From f3308413143e977215c386e3a51711380749f04f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 31 May 2011 16:25:15 +0000 Subject: [PATCH] i386.c (ix86_rtx_costs): Drop NEG from sub for FMA. * config/i386/i386.c (ix86_rtx_costs): Drop NEG from sub for FMA. * config/i386/sse.md: Add n to negated FMA pattern names. From-SVN: r174493 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 4 ++-- gcc/config/i386/sse.md | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fdebbd8f7f9..e4aa9074081 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-05-31 Alexandre Oliva + + * config/i386/i386.c (ix86_rtx_costs): Drop NEG from sub for FMA. + * config/i386/sse.md: Add n to negated FMA pattern names. + 2011-05-31 Alexandre Oliva * gcc.c (driver_handle_option): Fix disabling of -fcompare-debug. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 85d145a9428..c4f0b9dea0e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -29226,12 +29226,12 @@ ix86_rtx_costs (rtx x, int code, int outer_code_i, int *total, bool speed) /* Negate in op0 or op2 is free: FMS, FNMA, FNMS. */ sub = XEXP (x, 0); if (GET_CODE (sub) == NEG) - sub = XEXP (x, 0); + sub = XEXP (sub, 0); *total += rtx_cost (sub, FMA, speed); sub = XEXP (x, 2); if (GET_CODE (sub) == NEG) - sub = XEXP (x, 0); + sub = XEXP (sub, 0); *total += rtx_cost (sub, FMA, speed); return true; } diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 058f82bb26d..365fbfaa5d9 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1731,7 +1731,7 @@ [(set_attr "type" "ssemuladd") (set_attr "mode" "")]) -(define_insn "*fma_fmadd_" +(define_insn "*fma_fnmadd_" [(set (match_operand:FMAMODE 0 "register_operand" "=x,x,x") (fma:FMAMODE (neg:FMAMODE @@ -1746,7 +1746,7 @@ [(set_attr "type" "ssemuladd") (set_attr "mode" "")]) -(define_insn "*fma_fmsub_" +(define_insn "*fma_fnmsub_" [(set (match_operand:FMAMODE 0 "register_operand" "=x,x,x") (fma:FMAMODE (neg:FMAMODE -- 2.30.2