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

Unified Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 1400833002: MIPS: [turbofan] Improve test and equality compare with zero and constants. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo. Created 5 years, 2 months 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 | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips/instruction-selector-mips.cc
diff --git a/src/compiler/mips/instruction-selector-mips.cc b/src/compiler/mips/instruction-selector-mips.cc
index 3c4b378553e69a9e66060fcff69dfaafb2971062..7745717ecbd7316027bf070f51a2c6ab4fe6c512 100644
--- a/src/compiler/mips/instruction-selector-mips.cc
+++ b/src/compiler/mips/instruction-selector-mips.cc
@@ -44,11 +44,10 @@ class MipsOperandGenerator final : public OperandGenerator {
return is_uint16(value);
case kMipsLdc1:
case kMipsSdc1:
- case kCheckedLoadFloat32:
case kCheckedLoadFloat64:
paul.l... 2015/10/12 03:53:45 Why do you remove the kCheckedLoadFloat32/kChecked
dusan.milosavljevic 2015/10/12 14:41:52 Yes, the requirement for kCheckedLoadFloat32/kChec
- case kCheckedStoreFloat32:
case kCheckedStoreFloat64:
- return is_int16(value + kIntSize);
+ return std::numeric_limits<int16_t>::min() <= (value + kIntSize) &&
+ std::numeric_limits<int16_t>::max() >= (value + kIntSize);
paul.l... 2015/10/12 03:53:45 Can you explain why this is better than is_int16(v
dusan.milosavljevic 2015/10/12 14:41:52 Old check does not handle minimum offset edge cas
default:
return is_int16(value);
}
@@ -826,6 +825,16 @@ void VisitWordCompare(InstructionSelector* selector, Node* node,
// Match immediates on left or right side of comparison.
if (g.CanBeImmediate(right, opcode)) {
switch (cont->condition()) {
+ case kEqual:
+ case kNotEqual:
+ if (cont->IsSet()) {
+ VisitCompare(selector, opcode, g.UseRegister(left),
+ g.UseImmediate(right), cont);
+ } else {
+ VisitCompare(selector, opcode, g.UseRegister(left),
+ g.UseRegister(right), cont);
+ }
+ break;
case kSignedLessThan:
case kSignedGreaterThanOrEqual:
case kUnsignedLessThan:
@@ -840,6 +849,16 @@ void VisitWordCompare(InstructionSelector* selector, Node* node,
} else if (g.CanBeImmediate(left, opcode)) {
if (!commutative) cont->Commute();
switch (cont->condition()) {
+ case kEqual:
+ case kNotEqual:
+ if (cont->IsSet()) {
+ VisitCompare(selector, opcode, g.UseRegister(right),
+ g.UseImmediate(left), cont);
+ } else {
+ VisitCompare(selector, opcode, g.UseRegister(right),
+ g.UseRegister(left), cont);
+ }
+ break;
case kSignedLessThan:
case kSignedGreaterThanOrEqual:
case kUnsignedLessThan:
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698