This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AArch64 costs] Fixup to costing of FNMUL
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: marcus dot shawcroft at arm dot com
- Date: Fri, 16 May 2014 09:26:57 +0100
- Subject: [AArch64 costs] Fixup to costing of FNMUL
- Authentication-results: sourceware.org; auth=none
- References: <1395941622-22926-1-git-send-email-james dot greenhalgh at arm dot com>
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.
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;
}