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

Side by Side Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 732103002: [turbofan] remove redundant '& 0x1F' for shifts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments + ror fix 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/generic-node-inl.h" 5 #include "src/compiler/generic-node-inl.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 ArchOpcode opcode) { 268 ArchOpcode opcode) {
269 X64OperandGenerator g(selector); 269 X64OperandGenerator g(selector);
270 Int32BinopMatcher m(node); 270 Int32BinopMatcher m(node);
271 Node* left = m.left().node(); 271 Node* left = m.left().node();
272 Node* right = m.right().node(); 272 Node* right = m.right().node();
273 273
274 if (g.CanBeImmediate(right)) { 274 if (g.CanBeImmediate(right)) {
275 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), 275 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
276 g.UseImmediate(right)); 276 g.UseImmediate(right));
277 } else { 277 } else {
278 if (m.right().IsWord32And()) {
279 Int32BinopMatcher mright(right);
280 if (mright.right().Is(0x1F)) {
281 right = mright.left().node();
282 }
283 }
284 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), 278 selector->Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left),
285 g.UseFixed(right, rcx)); 279 g.UseFixed(right, rcx));
286 } 280 }
287 } 281 }
288 282
289 283
290 // Shared routine for multiple 64-bit shift operations. 284 // Shared routine for multiple 64-bit shift operations.
291 // TODO(bmeurer): Merge this with VisitWord32Shift using template magic? 285 // TODO(bmeurer): Merge this with VisitWord32Shift using template magic?
292 void VisitWord64Shift(InstructionSelector* selector, Node* node, 286 void VisitWord64Shift(InstructionSelector* selector, Node* node,
293 ArchOpcode opcode) { 287 ArchOpcode opcode) {
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 VisitFloat64Compare(this, node, &cont); 1157 VisitFloat64Compare(this, node, &cont);
1164 } 1158 }
1165 1159
1166 1160
1167 // static 1161 // static
1168 MachineOperatorBuilder::Flags 1162 MachineOperatorBuilder::Flags
1169 InstructionSelector::SupportedMachineOperatorFlags() { 1163 InstructionSelector::SupportedMachineOperatorFlags() {
1170 if (CpuFeatures::IsSupported(SSE4_1)) { 1164 if (CpuFeatures::IsSupported(SSE4_1)) {
1171 return MachineOperatorBuilder::kFloat64Floor | 1165 return MachineOperatorBuilder::kFloat64Floor |
1172 MachineOperatorBuilder::kFloat64Ceil | 1166 MachineOperatorBuilder::kFloat64Ceil |
1173 MachineOperatorBuilder::kFloat64RoundTruncate; 1167 MachineOperatorBuilder::kFloat64RoundTruncate |
1168 MachineOperatorBuilder::kWord32ShiftIsSafe;
1174 } 1169 }
1175 return MachineOperatorBuilder::kNoFlags; 1170 return MachineOperatorBuilder::kNoFlags;
1176 } 1171 }
1177 1172
1178 } // namespace compiler 1173 } // namespace compiler
1179 } // namespace internal 1174 } // namespace internal
1180 } // namespace v8 1175 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/machine-operator-reducer.cc ('k') | test/cctest/compiler/test-machine-operator-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698