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

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

Issue 729853005: Generalize ScaledWithOffsetMatcher to support 64 bits (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix addressing mode 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 | « src/compiler/node-matchers.h ('k') | test/unittests/compiler/node-matchers-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/instruction-selector-x64.cc
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc
index e46357a7cfd5a9606e99c6c5d99207bb70a36479..fe668587099e1394f6cb8d99a2d4ebcf7400d9b5 100644
--- a/src/compiler/x64/instruction-selector-x64.cc
+++ b/src/compiler/x64/instruction-selector-x64.cc
@@ -388,9 +388,12 @@ AddressingMode GenerateMemoryOperandInputs(X64OperandGenerator* g, Node* scaled,
mode = kMRn_modes[scale_exponent];
}
} else {
- DCHECK(constant != NULL);
- inputs[(*input_count)++] = g->UseImmediate(constant);
- mode = kMode_MRI;
+ if (constant == NULL) {
+ mode = kMode_MR;
+ } else {
+ inputs[(*input_count)++] = g->UseImmediate(constant);
+ mode = kMode_MRI;
+ }
}
} else {
DCHECK(scaled != NULL);
@@ -415,7 +418,7 @@ AddressingMode GenerateMemoryOperandInputs(X64OperandGenerator* g, Node* scaled,
void InstructionSelector::VisitInt32Add(Node* node) {
// Try to match the Add to a leal pattern
- ScaledWithOffsetMatcher m(node);
+ ScaledWithOffset32Matcher m(node);
X64OperandGenerator g(this);
if (m.matches() && (m.constant() == NULL || g.CanBeImmediate(m.constant()))) {
InstructionOperand* inputs[4];
« no previous file with comments | « src/compiler/node-matchers.h ('k') | test/unittests/compiler/node-matchers-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698