> On Jul 28, 2015, at 3:25 AM, Kyrill Tkachov <kyrylo.tkac...@arm.com> wrote: > > Hi all, > > Currently we assign the wrong rtx cost to instructions of the form > add x0, x0, x1, sxtw > > that is, an arith operation plus a single extend (no shifting). > We correctly catch the cases where the extend is inside a shift, but > not the simple case. > > This patch fixes that oversight by catching the simple case in > aarch64_rtx_arith_op_extract_p and thus making sure that it gets > assigned the alu.extend_arith extra cost.
This patch reminds me, on thunderx the cost for add with sign extend is different from add with zero extend. The zero extend case is the same as a normal add while sign extend is one extra cycle. So soon we need to split extend to zextend and sextend. Thanks, Andrew > > Bootstrapped and tested on aarch64. > > Ok for trunk? > Thanks, > Kyrill > > > 2015-07-28 Kyrylo Tkachov <kyrylo.tkac...@arm.com> > > * config/aarch64/aarch64.c (aarch64_rtx_arith_op_extract_p): > Handle simple SIGN_EXTEND or ZERO_EXTEND. > (aarch64_rtx_costs): Properly strip extend or extract before > passing down to rtx costs again. > <aarch64-arith-extend-costs.patch>