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

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

Issue 1552483002: MIPS: [turbofan] Improve matching for And(Shr(x, imm), mask). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove wrong matching. Created 5 years 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/mips64/assembler-mips64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8bc7deb35b21ff944052ffbea976e6aee5a484f4..e2ecec8999da866edba8fb804e13c9dd71cbe37b 100644
--- a/src/compiler/mips64/code-generator-mips64.cc
+++ b/src/compiler/mips64/code-generator-mips64.cc
@@ -768,10 +768,22 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
i.InputInt8(2));
}
break;
- case kMips64Dext:
- __ Dext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
- i.InputInt8(2));
+ case kMips64Dext: {
+ int16_t pos = i.InputInt8(1);
+ int16_t size = i.InputInt8(2);
+ if (size > 0 && size <= 32 && pos >= 0 && pos < 32) {
+ __ Dext(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
+ i.InputInt8(2));
+ } else if (size > 32 && size <= 64 && pos > 0 && pos < 32) {
+ __ Dextm(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
+ i.InputInt8(2));
+ } else {
+ DCHECK(size > 0 && size <= 32 && pos >= 32 && pos < 64);
+ __ Dextu(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
+ i.InputInt8(2));
+ }
break;
+ }
case kMips64Dins:
if (instr->InputAt(1)->IsImmediate() && i.InputInt8(1) == 0) {
__ Dins(i.OutputRegister(), zero_reg, i.InputInt8(1), i.InputInt8(2));
« no previous file with comments | « no previous file | src/mips64/assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698