From 05544d87afccac3305421532f95b3b427e03c99c Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 29 Jun 2009 01:35:11 +0100 Subject: [PATCH] Remove premature optimization that was breaking opt builds, -1 != 1 --- .../opt/lir2mir/ia32/BURS_Helpers.java | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/rvm/src/org/jikesrvm/compilers/opt/lir2mir/ia32/BURS_Helpers.java b/rvm/src/org/jikesrvm/compilers/opt/lir2mir/ia32/BURS_Helpers.java index bc4699f20..72e10c418 100644 --- a/rvm/src/org/jikesrvm/compilers/opt/lir2mir/ia32/BURS_Helpers.java +++ b/rvm/src/org/jikesrvm/compilers/opt/lir2mir/ia32/BURS_Helpers.java @@ -2834,21 +2834,10 @@ void EMIT_Compare(Instruction s, ConditionOperand cond, */ protected final void BOOLEAN_CMP_INT(Instruction s, RegisterOperand res, Operand val1, Operand val2, ConditionOperand cond) { - // Peephole optimize case where carry flag is tested to use SBB rather than SETcc - if (cond.isHIGHER() && !val2.isConstant()) { - cond.flipOperands(); - Operand temp = val1; - val1 = val2; - val2 = temp; - } EMIT(CPOS(s, MIR_Compare.create(IA32_CMP, val1, val2))); - if (!cond.isLOWER()) { - RegisterOperand temp = regpool.makeTemp(TypeReference.Boolean); - EMIT(CPOS(s, MIR_Set.create(IA32_SET__B, temp, COND(cond)))); - EMIT(MIR_Unary.mutate(s, IA32_MOVZX__B, res, temp.copyD2U())); - } else { - EMIT(MIR_BinaryAcc.mutate(s, IA32_SBB, res, res.copyRO())); - } + RegisterOperand temp = regpool.makeTemp(TypeReference.Boolean); + EMIT(CPOS(s, MIR_Set.create(IA32_SET__B, temp, COND(cond)))); + EMIT(MIR_Unary.mutate(s, IA32_MOVZX__B, res, temp.copyD2U())); } /** @@ -2860,14 +2849,9 @@ protected final void BOOLEAN_CMP_INT(Instruction s, RegisterOperand res, Operand * @param cond the condition operand */ protected final void BOOLEAN_CMP_INT(Instruction s, RegisterOperand res, ConditionOperand cond) { - // Peephole optimize case where carry flag is tested to use SBB rather than SETcc - if (!cond.isLOWER()) { - RegisterOperand temp = regpool.makeTemp(TypeReference.Boolean); - EMIT(CPOS(s, MIR_Set.create(IA32_SET__B, temp, COND(cond)))); - EMIT(MIR_Unary.mutate(s, IA32_MOVZX__B, res, temp.copyD2U())); - } else { - EMIT(MIR_BinaryAcc.mutate(s, IA32_SBB, res, res.copyRO())); - } + RegisterOperand temp = regpool.makeTemp(TypeReference.Boolean); + EMIT(CPOS(s, MIR_Set.create(IA32_SET__B, temp, COND(cond)))); + EMIT(MIR_Unary.mutate(s, IA32_MOVZX__B, res, temp.copyD2U())); } /**