Commit 99b8e7c8 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] Change TruncateFloat32ToInt64 to TryTruncateFloat32ToInt64.

Port 28261daa

Original commit message:
    This operator now provides a second output which indicates whether the
    conversion from float32 to int64 was successful or not. The second output
    returns 0 if the conversion fails, or something else if the conversion succeeds.

    The second output can be ignored, which means that the operator can be used the
    same as the original operator.

R=ahaas@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1530273002

Cr-Commit-Position: refs/heads/master@{#32914}
parent a4162898
......@@ -927,8 +927,20 @@ void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) {
#if V8_TARGET_ARCH_PPC64
void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) {
VisitRR(this, kPPC_DoubleToInt64, node);
void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) {
PPCOperandGenerator 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(kPPC_DoubleToInt64, output_count, outputs, 1, inputs);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment