EMIT(CPOS(s,MIR_Move.create(IA32_MOV, result, falseValue))); EMIT(MIR_CondMove.mutate(s, IA32_CMOV, result.copy(), asReg(s, IA32_MOV, trueValue), COND(cond)));
if (trueValue.isRegister()) { EMIT(CPOS(s,MIR_Move.create(IA32_MOV, result, falseValue))); EMIT(MIR_CondMove.mutate(s, IA32_CMOV, result.copyRO(), trueValue, COND(cond))); } else {   int true_const  = ((OPT_IntConstantOperand)trueValue).value; int false_const = ((OPT_IntConstantOperand)falseValue).value;   EMIT(CPOS(s,MIR_Set.create(IA32_SET__B, result.copyRO(), COND(cond)))); if(((false_const - true_const) > 0) && ((false_const - true_const) <= 0xFF)) {    EMIT(CPOS(s,MIR_BinaryAcc.create(IA32_SUB, result.copyRO(), IC(1)))); EMIT(CPOS(s,MIR_BinaryAcc.create(IA32_AND, result.copyRO(), IC(false_const - true_const)))); EMIT(MIR_BinaryAcc.mutate(s, IA32_ADD, result, IC(true_const))); } else {    if(((true_const - false_const) > 0xFF) || ((true_const - false_const) < 0)) { EMIT(CPOS(s,MIR_Unary.create(IA32_MOVZX__B, result.copyRO(), result.copyRO()))); } EMIT(CPOS(s,MIR_UnaryAcc.create(IA32_NEG, result.copyRO()))); EMIT(CPOS(s,MIR_BinaryAcc.create(IA32_AND, result.copyRO(), IC(true_const - false_const)))); EMIT(MIR_BinaryAcc.mutate(s, IA32_ADD, result, IC(false_const))); } }
  protected final void CMOV_MOV(OPT_Instruction s,                                OPT_RegisterOperand result,                                OPT_ConditionOperand cond,                                OPT_Operand trueValue,                                OPT_Operand falseValue) {    if (result.similar(trueValue)) {      // in this case, only need a conditional move for the false branch.      EMIT(MIR_CondMove.mutate(s, IA32_CMOV, result,                                      asReg(s, IA32_MOV, falseValue),                                      COND(cond.flipCode())));    } else if (result.similar(falseValue)) {      // in this case, only need a conditional move for the true branch.      EMIT(MIR_CondMove.mutate(s, IA32_CMOV, result,                                       asReg(s, IA32_MOV, trueValue),                                      COND(cond)));    } else {      // need to handle both possible assignments. Unconditionally      // assign one value then conditionally assign the other.      if (falseValue.isRegister()) {        EMIT(CPOS(s,MIR_Move.create(IA32_MOV, result, trueValue)));        EMIT(MIR_CondMove.mutate(s, IA32_CMOV, result.copy(),                                         falseValue,                                        COND(cond.flipCode())));      } else {        EMIT(CPOS(s,MIR_Move.create(IA32_MOV, result, falseValue)));        EMIT(MIR_CondMove.mutate(s, IA32_CMOV, result.copy(),                                         asReg(s, IA32_MOV, trueValue),                                        COND(cond)));      }    }  }