EMIT(MIR_Move.create(IA32_MOV, R(getEAX()), oldValue)); EMIT(MIR_CompareExchange.create(IA32_LOCK_CMPXCHG, R(getEAX()), mo, (OPT_RegisterOperand)temp.copy()));
EMIT(MIR_Move.create(IA32_MOV, new OPT_RegisterOperand(getEAX(), VM_TypeReference.Int), oldValue)); EMIT(MIR_CompareExchange.create(IA32_LOCK_CMPXCHG, new OPT_RegisterOperand(getEAX(), VM_TypeReference.Int), mo, temp.copyRO()));
  protected final void ATTEMPT(OPT_RegisterOperand result,                               OPT_MemoryOperand mo,                               OPT_Operand oldValue,                               OPT_Operand newValue) {    OPT_RegisterOperand temp = regpool.makeTempInt();    OPT_RegisterOperand temp2 = regpool.makeTemp(result);    EMIT(MIR_Move.create(IA32_MOV, temp, newValue));    EMIT(MIR_Move.create(IA32_MOV, R(getEAX()), oldValue));    EMIT(MIR_CompareExchange.create(IA32_LOCK_CMPXCHG, R(getEAX()),                                            mo, (OPT_RegisterOperand)temp.copy()));     EMIT(MIR_Set.create(IA32_SET__B, temp2, OPT_IA32ConditionOperand.EQ()));    // need to zero-extend the result of the set    EMIT(MIR_Unary.create(IA32_MOVZX__B, result, temp2.copy()));  }