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 <[email protected]>
* 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;
}