Chromium Code Reviews| 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); |
|
Rodolph Perfetta (ARM)
2015/12/07 11:19:47
those are not needed anymore
ahaas
2015/12/07 11:54:50
Done, thanks for looking at the code so carefully.
|
| + 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); |
| } |