| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |