Index: src/compiler/mips/code-generator-mips.cc |
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc |
index 2a079404730de74a0a71050174d2564002894a8e..1c6688e953f9bc5df5ded75ce90f49c15045da12 100644 |
--- a/src/compiler/mips/code-generator-mips.cc |
+++ b/src/compiler/mips/code-generator-mips.cc |
@@ -240,11 +240,10 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
__ Ror(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); |
break; |
case kMipsTst: |
- // Psuedo-instruction used for tst/branch. |
- __ And(kCompareReg, i.InputRegister(0), i.InputOperand(1)); |
+ // Pseudo-instruction used for tst/branch. No opcode emitted here. |
break; |
case kMipsCmp: |
- // Psuedo-instruction used for cmp/branch. No opcode emitted here. |
+ // Pseudo-instruction used for cmp/branch. No opcode emitted here. |
break; |
case kMipsMov: |
// TODO(plind): Should we combine mov/li like this, or use separate instr? |
@@ -418,7 +417,6 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, |
// not separated by other instructions. |
if (instr->arch_opcode() == kMipsTst) { |
- // The kMipsTst psuedo-instruction emits And to 'kCompareReg' register. |
switch (condition) { |
case kNotEqual: |
cc = ne; |
@@ -430,7 +428,8 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, |
UNSUPPORTED_COND(kMipsTst, condition); |
break; |
} |
- __ Branch(tlabel, cc, kCompareReg, Operand(zero_reg)); |
+ __ And(at, i.InputRegister(0), i.InputOperand(1)); |
+ __ Branch(tlabel, cc, at, Operand(zero_reg)); |
} else if (instr->arch_opcode() == kMipsAddOvf || |
instr->arch_opcode() == kMipsSubOvf) { |
@@ -557,7 +556,6 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, |
// TODO(plind): Add CHECK() to ensure that test/cmp and this branch were |
// not separated by other instructions. |
if (instr->arch_opcode() == kMipsTst) { |
- // The kMipsTst psuedo-instruction emits And to 'kCompareReg' register. |
switch (condition) { |
case kNotEqual: |
cc = ne; |
@@ -569,7 +567,8 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, |
UNSUPPORTED_COND(kMipsTst, condition); |
break; |
} |
- __ Branch(USE_DELAY_SLOT, &done, cc, kCompareReg, Operand(zero_reg)); |
+ __ And(at, i.InputRegister(0), i.InputOperand(1)); |
+ __ Branch(USE_DELAY_SLOT, &done, cc, at, Operand(zero_reg)); |
__ li(result, Operand(1)); // In delay slot. |
} else if (instr->arch_opcode() == kMipsAddOvf || |