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

Side by Side Diff: src/compiler/arm/instruction-selector-arm.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 | « no previous file | src/compiler/arm64/code-generator-arm64.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/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 switch (TruncationModeOf(node->op())) { 918 switch (TruncationModeOf(node->op())) {
919 case TruncationMode::kJavaScript: 919 case TruncationMode::kJavaScript:
920 return VisitRR(this, kArchTruncateDoubleToI, node); 920 return VisitRR(this, kArchTruncateDoubleToI, node);
921 case TruncationMode::kRoundToZero: 921 case TruncationMode::kRoundToZero:
922 return VisitRR(this, kArmVcvtS32F64, node); 922 return VisitRR(this, kArmVcvtS32F64, node);
923 } 923 }
924 UNREACHABLE(); 924 UNREACHABLE();
925 } 925 }
926 926
927 927
928 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
929 VisitRR(this, kArmVmovLowU32F64, node);
930 }
931
932
933 void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
934 ArmOperandGenerator g(this);
935 Emit(kArmVmovLowF64U32, g.DefineAsRegister(node),
936 ImmediateOperand(ImmediateOperand::INLINE, 0),
937 g.UseRegister(node->InputAt(0)));
938 }
939
940
928 void InstructionSelector::VisitFloat32Add(Node* node) { 941 void InstructionSelector::VisitFloat32Add(Node* node) {
929 ArmOperandGenerator g(this); 942 ArmOperandGenerator g(this);
930 Float32BinopMatcher m(node); 943 Float32BinopMatcher m(node);
931 if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) { 944 if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) {
932 Float32BinopMatcher mleft(m.left().node()); 945 Float32BinopMatcher mleft(m.left().node());
933 Emit(kArmVmlaF32, g.DefineSameAsFirst(node), 946 Emit(kArmVmlaF32, g.DefineSameAsFirst(node),
934 g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()), 947 g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()),
935 g.UseRegister(mleft.right().node())); 948 g.UseRegister(mleft.right().node()));
936 return; 949 return;
937 } 950 }
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1646 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1634 MachineOperatorBuilder::kFloat64RoundTruncate | 1647 MachineOperatorBuilder::kFloat64RoundTruncate |
1635 MachineOperatorBuilder::kFloat64RoundTiesAway; 1648 MachineOperatorBuilder::kFloat64RoundTiesAway;
1636 } 1649 }
1637 return flags; 1650 return flags;
1638 } 1651 }
1639 1652
1640 } // namespace compiler 1653 } // namespace compiler
1641 } // namespace internal 1654 } // namespace internal
1642 } // namespace v8 1655 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698