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

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

Issue 704703002: [x64] 64-bit shift left by 32 or more covers sign/zero extend. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/unittests/compiler/x64/instruction-selector-x64-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 313
314 } // namespace 314 } // namespace
315 315
316 316
317 void InstructionSelector::VisitWord32Shl(Node* node) { 317 void InstructionSelector::VisitWord32Shl(Node* node) {
318 VisitWord32Shift(this, node, kX64Shl32); 318 VisitWord32Shift(this, node, kX64Shl32);
319 } 319 }
320 320
321 321
322 void InstructionSelector::VisitWord64Shl(Node* node) { 322 void InstructionSelector::VisitWord64Shl(Node* node) {
323 X64OperandGenerator g(this);
324 Int64BinopMatcher m(node);
325 if ((m.left().IsChangeInt32ToInt64() || m.left().IsChangeUint32ToUint64()) &&
326 m.right().IsInRange(32, 63)) {
327 // There's no need to sign/zero-extend to 64-bit if we shift out the upper
328 // 32 bits anyway.
329 Emit(kX64Shl, g.DefineSameAsFirst(node),
330 g.UseRegister(m.left().node()->InputAt(0)),
331 g.UseImmediate(m.right().node()));
332 return;
333 }
323 VisitWord64Shift(this, node, kX64Shl); 334 VisitWord64Shift(this, node, kX64Shl);
324 } 335 }
325 336
326 337
327 void InstructionSelector::VisitWord32Shr(Node* node) { 338 void InstructionSelector::VisitWord32Shr(Node* node) {
328 VisitWord32Shift(this, node, kX64Shr32); 339 VisitWord32Shift(this, node, kX64Shr32);
329 } 340 }
330 341
331 342
332 void InstructionSelector::VisitWord64Shr(Node* node) { 343 void InstructionSelector::VisitWord64Shr(Node* node) {
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 if (CpuFeatures::IsSupported(SSE4_1)) { 1083 if (CpuFeatures::IsSupported(SSE4_1)) {
1073 return MachineOperatorBuilder::kFloat64Floor | 1084 return MachineOperatorBuilder::kFloat64Floor |
1074 MachineOperatorBuilder::kFloat64Ceil | 1085 MachineOperatorBuilder::kFloat64Ceil |
1075 MachineOperatorBuilder::kFloat64RoundTruncate; 1086 MachineOperatorBuilder::kFloat64RoundTruncate;
1076 } 1087 }
1077 return MachineOperatorBuilder::kNoFlags; 1088 return MachineOperatorBuilder::kNoFlags;
1078 } 1089 }
1079 } // namespace compiler 1090 } // namespace compiler
1080 } // namespace internal 1091 } // namespace internal
1081 } // namespace v8 1092 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/unittests/compiler/x64/instruction-selector-x64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698