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

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

Issue 1356913002: [turbofan] Add support for reinterpreting integers as floating point and vice versa. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename ReinterpretAs to BitcastTo Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.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/base/adapters.h" 5 #include "src/base/adapters.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 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 switch (TruncationModeOf(node->op())) { 680 switch (TruncationModeOf(node->op())) {
681 case TruncationMode::kJavaScript: 681 case TruncationMode::kJavaScript:
682 return VisitRR(this, node, kArchTruncateDoubleToI); 682 return VisitRR(this, node, kArchTruncateDoubleToI);
683 case TruncationMode::kRoundToZero: 683 case TruncationMode::kRoundToZero:
684 return VisitRO(this, node, kSSEFloat64ToInt32); 684 return VisitRO(this, node, kSSEFloat64ToInt32);
685 } 685 }
686 UNREACHABLE(); 686 UNREACHABLE();
687 } 687 }
688 688
689 689
690 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
691 IA32OperandGenerator g(this);
692 Emit(kIA32BitcastFI, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
693 }
694
695
696 void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
697 IA32OperandGenerator g(this);
698 Emit(kIA32BitcastIF, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
699 }
700
701
690 void InstructionSelector::VisitFloat32Add(Node* node) { 702 void InstructionSelector::VisitFloat32Add(Node* node) {
691 VisitRROFloat(this, node, kAVXFloat32Add, kSSEFloat32Add); 703 VisitRROFloat(this, node, kAVXFloat32Add, kSSEFloat32Add);
692 } 704 }
693 705
694 706
695 void InstructionSelector::VisitFloat64Add(Node* node) { 707 void InstructionSelector::VisitFloat64Add(Node* node) {
696 VisitRROFloat(this, node, kAVXFloat64Add, kSSEFloat64Add); 708 VisitRROFloat(this, node, kAVXFloat64Add, kSSEFloat64Add);
697 } 709 }
698 710
699 711
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 if (CpuFeatures::IsSupported(SSE4_1)) { 1361 if (CpuFeatures::IsSupported(SSE4_1)) {
1350 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1362 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1351 MachineOperatorBuilder::kFloat64RoundTruncate; 1363 MachineOperatorBuilder::kFloat64RoundTruncate;
1352 } 1364 }
1353 return flags; 1365 return flags;
1354 } 1366 }
1355 1367
1356 } // namespace compiler 1368 } // namespace compiler
1357 } // namespace internal 1369 } // namespace internal
1358 } // namespace v8 1370 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698