AArch64 gcc has supported a MADD instruction for a while now.
Unfortunately, it's generally failed to generate it because the costs
returned for it were too high. That's because we cost the operands to
the pattern more than once.
Fixed thusly:
2014-01-06 Richard Earnshaw <rearn...@arm.com>
* aarch64.c (aarch64_rtx_costs): Fix cost calculation for MADD.
--- aarch64.c (revision 206289)
+++ aarch64.c (local)
@@ -4643,12 +4643,15 @@ aarch64_rtx_costs (rtx x, int code, int
extra_cost->mult[GET_MODE (x) == DImode].extend_add;
return true;
}
+
*cost += (rtx_cost (XEXP (op0, 0), MULT, 0, speed)
+ rtx_cost (XEXP (op0, 1), MULT, 1, speed)
+ rtx_cost (op1, PLUS, 1, speed));
if (speed)
*cost += extra_cost->mult[GET_MODE (x) == DImode].add;
+
+ return true;
}
*cost += (rtx_cost (new_op0, PLUS, 0, speed)