asm.emitLAddr(T0, gprsOffset, T1);
asm.emitLAddrOffset(T0, T1, gprsOffset);
  private static VM_CodeArray generateThreadSwitchInstructions() {    VM_Assembler asm = new VM_Assembler(0);    int   ipOffset = VM_Entrypoints.registersIPField.getOffsetAsInt();    int fprsOffset = VM_Entrypoints.registersFPRsField.getOffsetAsInt();    int gprsOffset = VM_Entrypoints.registersGPRsField.getOffsetAsInt();    int regsOffset = VM_Entrypoints.threadContextRegistersField.getOffsetAsInt();    // (1) Save nonvolatile hardware state of current thread.    asm.emitMFLR (T3);                         // T3 gets return address    asm.emitLAddr (T2, regsOffset, T0);         // T2 = T0.contextRegisters    asm.emitSTAddr (T3, ipOffset, T2);           // T0.contextRegisters.ip = return address    // save non-volatile fprs    asm.emitLAddr(T3, fprsOffset, T2); // T3 := T0.contextRegisters.fprs[]    for (int i = FIRST_NONVOLATILE_FPR; i <= LAST_NONVOLATILE_FPR; ++i)      asm.emitSTFD(i, i<<LOG_BYTES_IN_DOUBLE, T3);    // save non-volatile gprs    asm.emitLAddr(T3, gprsOffset, T2); // T3 := registers.gprs[]    for (int i = FIRST_NONVOLATILE_GPR; i <= LAST_NONVOLATILE_GPR; ++i)      asm.emitSTAddr(i, i<<LOG_BYTES_IN_ADDRESS, T3);    // save fp    asm.emitSTAddr(FP, FP<<LOG_BYTES_IN_ADDRESS, T3);    // (2) Set currentThread.beingDispatched to false    asm.emitLVAL(0, 0);                                       // R0 := 0    asm.emitSTW(0, VM_Entrypoints.beingDispatchedField.getOffsetAsInt(), T0); // T0.beingDispatched := R0    // (3) Restore nonvolatile hardware state of new thread.    // restore non-volatile fprs    asm.emitLAddr(T0, fprsOffset, T1); // T0 := T1.fprs[]    for (int i = FIRST_NONVOLATILE_FPR; i <= LAST_NONVOLATILE_FPR; ++i)      asm.emitLFD(i, i<<LOG_BYTES_IN_DOUBLE, T0);    // restore non-volatile gprs    asm.emitLAddr(T0, gprsOffset, T1); // T0 := T1.gprs[]    for (int i = FIRST_NONVOLATILE_GPR; i <= LAST_NONVOLATILE_GPR; ++i)      asm.emitLAddr(i, i<<LOG_BYTES_IN_ADDRESS, T0);    // restore fp    asm.emitLAddr(FP, FP<<LOG_BYTES_IN_ADDRESS, T0);    // resume execution at saved ip (T1.ipOffset)    asm.emitLAddr(T0, ipOffset, T1);    asm.emitMTLR(T0);    asm.emitBCLR();    return asm.makeMachineCode().getInstructions();  }