diff mbox

[aarch64] Fix cost calculation for MADD

Message ID 52CAD31A.8000900@arm.com
State New
Headers show

Commit Message

Richard Earnshaw Jan. 6, 2014, 4 p.m. UTC
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  <rearnsha@arm.com>

	* aarch64.c (aarch64_rtx_costs): Fix cost calculation for MADD.
diff mbox

Patch

--- 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)