asm.emitMTLR(S0);
asm.emitMTCTR(S0);
  private void genThreadSwitchTest (int whereFrom) {    if (isInterruptible) {      VM_ForwardReference fr;      // alternate ways of setting the thread switch bit      if (VM.BuildForDeterministicThreadSwitching) { // set THREAD_SWITCH_BIT every N method calls		// Decrement counter	asm.emitL  (T2, VM_Entrypoints.deterministicThreadSwitchCountField.getOffset(), PROCESSOR_REGISTER);	asm.emitCAL(T2, -1, T2);  // decrement it	asm.emitST (T2, VM_Entrypoints.deterministicThreadSwitchCountField.getOffset(), PROCESSOR_REGISTER);        	// If counter reaches zero, set threadswitch bit	asm.emitCMPI(T2, 0);	fr = asm.emitForwardBC(GT);	asm.emitCRORC(THREAD_SWITCH_BIT, 0, 0); // set thread switch bit      } else if (!VM.BuildForThreadSwitchUsingControlRegisterBit) {	asm.emitL(S0, VM_Entrypoints.threadSwitchRequestedField.getOffset(), PROCESSOR_REGISTER);	asm.emitCMPI(THREAD_SWITCH_REGISTER, S0, 0); // set THREAD_SWITCH_SWITCH_REGISTER, S0, 0); // set THREAD_SWITCH_BIT in CR	fr = asm.emitBNTS(); // skip, unless THREAD_SWITCH_BIT in CR is set      } else { // else rely on the timer interrupt to set the THREAD_SWITCH_BIT	fr = asm.emitBNTS(); // skip, unless THREAD_SWITCH_BIT in CR is set      }      if (whereFrom == VM_Thread.PROLOGUE) {	asm.emitL   (S0, VM_Entrypoints.threadSwitchFromPrologueMethod.getOffset(), JTOC);      } else if (whereFrom == VM_Thread.BACKEDGE) {	asm.emitL   (S0, VM_Entrypoints.threadSwitchFromBackedgeMethod.getOffset(), JTOC);      } else { // EPILOGUE	asm.emitL   (S0, VM_Entrypoints.threadSwitchFromEpilogueMethod.getOffset(), JTOC);      }      asm.emitMTLR(S0);      asm.emitCall(spSaveAreaOffset);      fr.resolve(asm);    }  }