Commit 7d6c5666 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [turbofan] Implemented the optional Float32RoundUp operator.

  port 4f494789 (r32262)

  original commit message:
  The Float32RoundUp operator rounds float32 numbers towards infinity.
  The operator is currently implemented on x64, ia32, arm, and arm64.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#32515}
parent fc6ff534
...@@ -856,7 +856,11 @@ void InstructionSelector::VisitFloat64RoundDown(Node* node) { ...@@ -856,7 +856,11 @@ void InstructionSelector::VisitFloat64RoundDown(Node* node) {
} }
void InstructionSelector::VisitFloat32RoundUp(Node* node) { UNREACHABLE(); } void InstructionSelector::VisitFloat32RoundUp(Node* node) {
X87OperandGenerator g(this);
Emit(kX87Float32Round | MiscField::encode(kRoundUp), g.UseFixed(node, stX_0),
g.Use(node->InputAt(0)));
}
void InstructionSelector::VisitFloat64RoundUp(Node* node) { void InstructionSelector::VisitFloat64RoundUp(Node* node) {
...@@ -1311,11 +1315,12 @@ InstructionSelector::SupportedMachineOperatorFlags() { ...@@ -1311,11 +1315,12 @@ InstructionSelector::SupportedMachineOperatorFlags() {
flags |= MachineOperatorBuilder::kWord32Popcnt; flags |= MachineOperatorBuilder::kWord32Popcnt;
} }
flags |= MachineOperatorBuilder::kFloat64RoundDown | flags |= MachineOperatorBuilder::kFloat32RoundDown |
MachineOperatorBuilder::kFloat64RoundDown |
MachineOperatorBuilder::kFloat32RoundUp |
MachineOperatorBuilder::kFloat64RoundUp | MachineOperatorBuilder::kFloat64RoundUp |
MachineOperatorBuilder::kFloat64RoundTruncate | MachineOperatorBuilder::kFloat64RoundTruncate |
MachineOperatorBuilder::kFloat64RoundTiesEven | MachineOperatorBuilder::kFloat64RoundTiesEven;
MachineOperatorBuilder::kFloat32RoundDown;
return flags; return flags;
} }
......
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