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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/arm64/instruction-selector-arm64.cc
diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc
index ce16050e1c3b210da19279aba93a6e80fb921753..545ebe9ea63ac42a911917b4a44982a2f1030764 100644
--- a/src/compiler/arm64/instruction-selector-arm64.cc
+++ b/src/compiler/arm64/instruction-selector-arm64.cc
@@ -1242,8 +1242,26 @@ void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) {
}
-void InstructionSelector::VisitTruncateFloat64ToInt64(Node* node) {
- VisitRR(this, kArm64Float64ToInt64, node);
+void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) {
+ Arm64OperandGenerator g(this);
+
+ Constant int64min(INT64_MIN);
+ Constant int64max(INT64_MAX);
+ InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0)),
+ sequence()->AddImmediate(int64min),
+ sequence()->AddImmediate(int64max)};
+ InstructionOperand outputs[2];
+ size_t output_count = 0;
+ size_t input_count = 1;
+ outputs[output_count++] = g.DefineAsRegister(node);
+
+ Node* success_output = NodeProperties::FindProjection(node, 1);
+ if (success_output) {
+ outputs[output_count++] = g.DefineAsRegister(success_output);
+ input_count = 3;
+ }
+
+ Emit(kArm64Float64ToInt64, output_count, outputs, input_count, inputs);
}

Powered by Google App Engine
This is Rietveld 408576698