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

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

Issue 1495213003: [turbofan] Changed TruncateFloat64ToInt64 to TryTruncateFloat64ToInt64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { 1235 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
1236 VisitRR(this, kArm64Float64ToUint32, node); 1236 VisitRR(this, kArm64Float64ToUint32, node);
1237 } 1237 }
1238 1238
1239 1239
1240 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) { 1240 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) {
1241 VisitRR(this, kArm64Float32ToInt64, node); 1241 VisitRR(this, kArm64Float32ToInt64, node);
1242 } 1242 }
1243 1243
1244 1244
1245 void InstructionSelector::VisitTruncateFloat64ToInt64(Node* node) { 1245 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
1246 VisitRR(this, kArm64Float64ToInt64, node); 1246 Arm64OperandGenerator g(this);
1247
1248 Constant int64min(INT64_MIN);
1249 Constant int64max(INT64_MAX);
1250 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0)),
1251 sequence()->AddImmediate(int64min),
1252 sequence()->AddImmediate(int64max)};
1253 InstructionOperand outputs[2];
1254 size_t output_count = 0;
1255 size_t input_count = 1;
1256 outputs[output_count++] = g.DefineAsRegister(node);
1257
1258 Node* success_output = NodeProperties::FindProjection(node, 1);
1259 if (success_output) {
1260 outputs[output_count++] = g.DefineAsRegister(success_output);
1261 input_count = 3;
1262 }
1263
1264 Emit(kArm64Float64ToInt64, output_count, outputs, input_count, inputs);
1247 } 1265 }
1248 1266
1249 1267
1250 void InstructionSelector::VisitTruncateFloat32ToUint64(Node* node) { 1268 void InstructionSelector::VisitTruncateFloat32ToUint64(Node* node) {
1251 VisitRR(this, kArm64Float32ToUint64, node); 1269 VisitRR(this, kArm64Float32ToUint64, node);
1252 } 1270 }
1253 1271
1254 1272
1255 void InstructionSelector::VisitTruncateFloat64ToUint64(Node* node) { 1273 void InstructionSelector::VisitTruncateFloat64ToUint64(Node* node) {
1256 VisitRR(this, kArm64Float64ToUint64, node); 1274 VisitRR(this, kArm64Float64ToUint64, node);
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 MachineOperatorBuilder::kFloat32RoundTiesEven | 2128 MachineOperatorBuilder::kFloat32RoundTiesEven |
2111 MachineOperatorBuilder::kFloat64RoundTiesEven | 2129 MachineOperatorBuilder::kFloat64RoundTiesEven |
2112 MachineOperatorBuilder::kWord32ShiftIsSafe | 2130 MachineOperatorBuilder::kWord32ShiftIsSafe |
2113 MachineOperatorBuilder::kInt32DivIsSafe | 2131 MachineOperatorBuilder::kInt32DivIsSafe |
2114 MachineOperatorBuilder::kUint32DivIsSafe; 2132 MachineOperatorBuilder::kUint32DivIsSafe;
2115 } 2133 }
2116 2134
2117 } // namespace compiler 2135 } // namespace compiler
2118 } // namespace internal 2136 } // namespace internal
2119 } // namespace v8 2137 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698