| 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 c24cecf4605dc68b091358c0d217e5720604936a..7a5b84275acd05008f13de95121235ee1b8f8f15 100644
|
| --- a/src/compiler/arm64/instruction-selector-arm64.cc
|
| +++ b/src/compiler/arm64/instruction-selector-arm64.cc
|
| @@ -1671,7 +1671,7 @@ void VisitWord64Test(InstructionSelector* selector, Node* node,
|
| }
|
|
|
|
|
| -// Shared routine for multiple float64 compare operations.
|
| +// Shared routine for multiple float32 compare operations.
|
| void VisitFloat32Compare(InstructionSelector* selector, Node* node,
|
| FlagsContinuation* cont) {
|
| Arm64OperandGenerator g(selector);
|
| @@ -1679,6 +1679,10 @@ void VisitFloat32Compare(InstructionSelector* selector, Node* node,
|
| if (m.right().Is(0.0f)) {
|
| VisitCompare(selector, kArm64Float32Cmp, g.UseRegister(m.left().node()),
|
| g.UseImmediate(m.right().node()), cont);
|
| + } else if (m.left().Is(0.0f)) {
|
| + cont->Commute();
|
| + VisitCompare(selector, kArm64Float32Cmp, g.UseRegister(m.right().node()),
|
| + g.UseImmediate(m.left().node()), cont);
|
| } else {
|
| VisitCompare(selector, kArm64Float32Cmp, g.UseRegister(m.left().node()),
|
| g.UseRegister(m.right().node()), cont);
|
| @@ -1694,6 +1698,10 @@ void VisitFloat64Compare(InstructionSelector* selector, Node* node,
|
| if (m.right().Is(0.0)) {
|
| VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.left().node()),
|
| g.UseImmediate(m.right().node()), cont);
|
| + } else if (m.left().Is(0.0)) {
|
| + cont->Commute();
|
| + VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.right().node()),
|
| + g.UseImmediate(m.left().node()), cont);
|
| } else {
|
| VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.left().node()),
|
| g.UseRegister(m.right().node()), cont);
|
| @@ -1765,19 +1773,19 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
|
| cont.OverwriteAndNegateIfEqual(kEqual);
|
| return VisitFloat32Compare(this, value, &cont);
|
| case IrOpcode::kFloat32LessThan:
|
| - cont.OverwriteAndNegateIfEqual(kUnsignedLessThan);
|
| + cont.OverwriteAndNegateIfEqual(kFloatLessThan);
|
| return VisitFloat32Compare(this, value, &cont);
|
| case IrOpcode::kFloat32LessThanOrEqual:
|
| - cont.OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
|
| + cont.OverwriteAndNegateIfEqual(kFloatLessThanOrEqual);
|
| return VisitFloat32Compare(this, value, &cont);
|
| case IrOpcode::kFloat64Equal:
|
| cont.OverwriteAndNegateIfEqual(kEqual);
|
| return VisitFloat64Compare(this, value, &cont);
|
| case IrOpcode::kFloat64LessThan:
|
| - cont.OverwriteAndNegateIfEqual(kUnsignedLessThan);
|
| + cont.OverwriteAndNegateIfEqual(kFloatLessThan);
|
| return VisitFloat64Compare(this, value, &cont);
|
| case IrOpcode::kFloat64LessThanOrEqual:
|
| - cont.OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual);
|
| + cont.OverwriteAndNegateIfEqual(kFloatLessThanOrEqual);
|
| return VisitFloat64Compare(this, value, &cont);
|
| case IrOpcode::kProjection:
|
| // Check if this is the overflow output projection of an
|
| @@ -2018,13 +2026,13 @@ void InstructionSelector::VisitFloat32Equal(Node* node) {
|
|
|
|
|
| void InstructionSelector::VisitFloat32LessThan(Node* node) {
|
| - FlagsContinuation cont(kUnsignedLessThan, node);
|
| + FlagsContinuation cont(kFloatLessThan, node);
|
| VisitFloat32Compare(this, node, &cont);
|
| }
|
|
|
|
|
| void InstructionSelector::VisitFloat32LessThanOrEqual(Node* node) {
|
| - FlagsContinuation cont(kUnsignedLessThanOrEqual, node);
|
| + FlagsContinuation cont(kFloatLessThanOrEqual, node);
|
| VisitFloat32Compare(this, node, &cont);
|
| }
|
|
|
| @@ -2036,13 +2044,13 @@ void InstructionSelector::VisitFloat64Equal(Node* node) {
|
|
|
|
|
| void InstructionSelector::VisitFloat64LessThan(Node* node) {
|
| - FlagsContinuation cont(kUnsignedLessThan, node);
|
| + FlagsContinuation cont(kFloatLessThan, node);
|
| VisitFloat64Compare(this, node, &cont);
|
| }
|
|
|
|
|
| void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
|
| - FlagsContinuation cont(kUnsignedLessThanOrEqual, node);
|
| + FlagsContinuation cont(kFloatLessThanOrEqual, node);
|
| VisitFloat64Compare(this, node, &cont);
|
| }
|
|
|
|
|