This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/3][AArch64] Improve zero extend
On 20/07/16 14:40, Wilco Dijkstra wrote:
> Richard Earnshaw wrote:
>> Why does combine care what the cost is if the instruction isn't valid?
> No idea. Combine does lots of odd things that don't make sense to me.
> Unfortunately the costs we give for cases like this need to be accurate or
> they negatively affect code quality. The reason for this patch was to fix
> some unexpected slowdowns caused by the cost for zero_extend being
> too high.
Well if I take your testcase and plug it into a fairly recent gcc I get:
mov w1, 20
umull x0, w0, w1
If I change the constant to 33, I then get:
uxtw x0, w0
add x0, x0, x0, lsl 5
Both of which look reasonable to me.