Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: src/compiler/mips/code-generator-mips.cc

Issue 700873002: MIPS: Improve compare and branch combining. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ||
« no previous file with comments | « no previous file | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698