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

Unified Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 1504363002: [turbofan] Change TruncateFloat32ToInt64 to TryTruncateFloat32ToInt64. (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 7aa8254fac41952188c1b798a2fdad7510599885..1833ad5c96f8b552f2a85842c761d139441f0bfb 100644
--- a/src/compiler/arm64/instruction-selector-arm64.cc
+++ b/src/compiler/arm64/instruction-selector-arm64.cc
@@ -1237,8 +1237,20 @@ void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
}
-void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) {
- VisitRR(this, kArm64Float32ToInt64, node);
+void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
+ Arm64OperandGenerator g(this);
+
+ InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))};
+ InstructionOperand outputs[2];
+ size_t output_count = 0;
+ outputs[output_count++] = g.DefineAsRegister(node);
+
+ Node* success_output = NodeProperties::FindProjection(node, 1);
+ if (success_output) {
+ outputs[output_count++] = g.DefineAsRegister(success_output);
+ }
+
+ Emit(kArm64Float32ToInt64, output_count, outputs, 1, inputs);
}
@@ -1809,6 +1821,10 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
cont.OverwriteAndNegateIfEqual(kOverflow);
return VisitBinop<Int32BinopMatcher>(this, node, kArm64Sub32,
kArithmeticImm, &cont);
+ case IrOpcode::kTryTruncateFloat64ToInt64:
+ return VisitTryTruncateFloat64ToInt64(result);
+ case IrOpcode::kTryTruncateFloat32ToInt64:
+ return VisitTryTruncateFloat32ToInt64(result);
default:
break;
}

Powered by Google App Engine
This is Rietveld 408576698