From: yangguo Date: Fri, 27 Mar 2015 09:11:51 +0000 (-0700) Subject: Revert of [turbofan][arm64] Match fneg for -0.0 - x pattern. (patchset #1 id:1 of... X-Git-Tag: upstream/4.7.83~3545 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98580e4b8300abaa3891f8f4d48f94ff053b2924;p=platform%2Fupstream%2Fv8.git Revert of [turbofan][arm64] Match fneg for -0.0 - x pattern. (patchset #1 id:1 of https://codereview.chromium.org/1013743006/) Reason for revert: Revert due to crash. Original issue's description: > [turbofan][arm64] Match fneg for -0.0 - x pattern. > > Note that this patch add an extra bit to the ArchOpcodeField. > > R=bmeurer@chromium.org > > Committed: https://crrev.com/fe7441225100660d01e66ce3bcaefe368f62df81 > Cr-Commit-Position: refs/heads/master@{#27494} TBR=bmeurer@chromium.org,baptiste.afsa@arm.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1041633002 Cr-Commit-Position: refs/heads/master@{#27495} --- diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc index 56f1d9e52..34ec3821f 100644 --- a/src/compiler/arm64/code-generator-arm64.cc +++ b/src/compiler/arm64/code-generator-arm64.cc @@ -689,9 +689,6 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { 0, 2); break; } - case kArm64Float64Neg: - __ Fneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); - break; case kArm64Float64Sqrt: __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); break; diff --git a/src/compiler/arm64/instruction-codes-arm64.h b/src/compiler/arm64/instruction-codes-arm64.h index f9a91d768..ab19216e6 100644 --- a/src/compiler/arm64/instruction-codes-arm64.h +++ b/src/compiler/arm64/instruction-codes-arm64.h @@ -85,7 +85,6 @@ namespace compiler { V(Arm64Float64Mul) \ V(Arm64Float64Div) \ V(Arm64Float64Mod) \ - V(Arm64Float64Neg) \ V(Arm64Float64Sqrt) \ V(Arm64Float64RoundDown) \ V(Arm64Float64RoundTiesAway) \ diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc index 87ed89645..e81c5801b 100644 --- a/src/compiler/arm64/instruction-selector-arm64.cc +++ b/src/compiler/arm64/instruction-selector-arm64.cc @@ -1069,22 +1069,17 @@ void InstructionSelector::VisitFloat64Add(Node* node) { void InstructionSelector::VisitFloat64Sub(Node* node) { Arm64OperandGenerator g(this); Float64BinopMatcher m(node); - if (m.left().IsMinusZero()) { - if (m.right().IsFloat64RoundDown() && - CanCover(m.node(), m.right().node())) { - if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && - CanCover(m.right().node(), m.right().InputAt(0))) { - Float64BinopMatcher mright0(m.right().InputAt(0)); - if (mright0.left().IsMinusZero()) { - Emit(kArm64Float64RoundUp, g.DefineAsRegister(node), - g.UseRegister(mright0.right().node())); - return; - } + if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && + CanCover(m.node(), m.right().node())) { + if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && + CanCover(m.right().node(), m.right().InputAt(0))) { + Float64BinopMatcher mright0(m.right().InputAt(0)); + if (mright0.left().IsMinusZero()) { + Emit(kArm64Float64RoundUp, g.DefineAsRegister(node), + g.UseRegister(mright0.right().node())); + return; } } - Emit(kArm64Float64Neg, g.DefineAsRegister(node), - g.UseRegister(m.right().node())); - return; } VisitRRRFloat64(this, kArm64Float64Sub, node); } diff --git a/src/compiler/instruction-codes.h b/src/compiler/instruction-codes.h index d5c04ab12..50e04349e 100644 --- a/src/compiler/instruction-codes.h +++ b/src/compiler/instruction-codes.h @@ -127,11 +127,11 @@ typedef int32_t InstructionCode; // for code generation. We encode the instruction, addressing mode, and flags // continuation into a single InstructionCode which is stored as part of // the instruction. -typedef BitField ArchOpcodeField; -typedef BitField AddressingModeField; -typedef BitField FlagsModeField; -typedef BitField FlagsConditionField; -typedef BitField MiscField; +typedef BitField ArchOpcodeField; +typedef BitField AddressingModeField; +typedef BitField FlagsModeField; +typedef BitField FlagsConditionField; +typedef BitField MiscField; } // namespace compiler } // namespace internal diff --git a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc index 09ef9e8ec..02c8d2e06 100644 --- a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc +++ b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc @@ -2257,21 +2257,6 @@ TEST_F(InstructionSelectorTest, Word32Clz) { EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); } - -TEST_F(InstructionSelectorTest, Float64SubWithMinusZero) { - StreamBuilder m(this, kMachFloat64, kMachFloat64); - Node* const p0 = m.Parameter(0); - Node* const n = m.Float64Sub(m.Float64Constant(-0.0), p0); - m.Return(n); - Stream s = m.Build(); - ASSERT_EQ(1U, s.size()); - EXPECT_EQ(kArm64Float64Neg, s[0]->arch_opcode()); - ASSERT_EQ(1U, s[0]->InputCount()); - EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); - ASSERT_EQ(1U, s[0]->OutputCount()); - EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); -} - } // namespace compiler } // namespace internal } // namespace v8