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

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

Issue 2477453005: MIPS[64]: Optimize kMips[64]Tst in code-generator-mips[64].cc (Closed)
Patch Set: Created 4 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
Index: src/compiler/mips64/code-generator-mips64.cc
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc
index dc4d414c6089906e46c49334af092dbedd9dd926..7e0c289bcad3bfef36caf5cc1b1f173bd42a2ee2 100644
--- a/src/compiler/mips64/code-generator-mips64.cc
+++ b/src/compiler/mips64/code-generator-mips64.cc
@@ -2026,8 +2026,13 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
if (instr->arch_opcode() == kMips64Tst) {
cc = FlagsConditionToConditionTst(condition);
- __ And(kScratchReg, i.InputRegister(0), i.InputOperand(1));
- __ Sltu(result, zero_reg, kScratchReg);
+ if (instr->InputAt(1)->IsImmediate() &&
dusan.simicic 2016/11/09 12:40:49 Take a look at comment for mips32, the same could
+ i.InputOperand(1).immediate() == 1) {
+ __ Ext(result, i.InputRegister(0), 0, 1);
+ } else {
+ __ And(kScratchReg, i.InputRegister(0), i.InputOperand(1));
+ __ Sltu(result, zero_reg, kScratchReg);
+ }
if (cc == eq) {
// Sltu produces 0 for equality, invert the result.
__ xori(result, result, 1);
« src/compiler/mips/code-generator-mips.cc ('K') | « src/compiler/mips/code-generator-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698