diff mbox

[AArch64,costs] Fixup to costing of FNMUL

Message ID 1400228817-2316-1-git-send-email-james.greenhalgh@arm.com
State New
Headers show

Commit Message

James Greenhalgh May 16, 2014, 8:26 a.m. UTC
Hi,

While waiting for approval of the costs patches, I spotted this bug.
FNMUL should be costed like an FMUL, rather than being costed like
an FMA instruction.

Bootstrapped and tested in series with the costs patches with no issues.

I see Marcus has approved the patch series, so is this OK to go in as a fixup
to that?

Thanks,
James

---
gcc/

2014-05-15  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Fix FNMUL case.

Comments

Marcus Shawcroft May 16, 2014, 8:45 a.m. UTC | #1
On 16 May 2014 09:26, James Greenhalgh <james.greenhalgh@arm.com> wrote:

> 2014-05-15  James Greenhalgh  <james.greenhalgh@arm.com>
>
>         * config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Fix FNMUL case.

OK /Marcus
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 6eb2303..0a7f441 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4711,24 +4711,18 @@  aarch64_rtx_mult_cost (rtx x, int code, int outer, bool speed)
     {
       if (speed)
 	{
-	  /* Floating-point FMA can also support negations of the
+	  /* Floating-point FMA/FMUL can also support negations of the
 	     operands.  */
 	  if (GET_CODE (op0) == NEG)
-	    {
-	      maybe_fma = true;
-	      op0 = XEXP (op0, 0);
-	    }
+	    op0 = XEXP (op0, 0);
 	  if (GET_CODE (op1) == NEG)
-	    {
-	      maybe_fma = true;
-	      op1 = XEXP (op1, 0);
-	    }
+	    op1 = XEXP (op1, 0);
 
 	  if (maybe_fma)
 	    /* FMADD/FNMADD/FNMSUB/FMSUB.  */
 	    cost += extra_cost->fp[mode == DFmode].fma;
 	  else
-	    /* FMUL.  */
+	    /* FMUL/FNMUL.  */
 	    cost += extra_cost->fp[mode == DFmode].mult;
 	}