On 27/10/2020 10:35, Alex Coplan via Gcc-patches wrote: > On 26/10/2020 12:43, Segher Boessenkool wrote: > > I do not like handling both mult and ashift in one case like this, it > > complicates things for no good reason. Write it as two cases, and it > > should be good. > > OK, the attached patch rewrites (mult x 2^n) to (ashift x n) at the top > of make_extraction so that the existing ASHIFT block can do the work for > us. We remember if we did it and then convert it back if necessary. > > I'm not convinced that it's an improvement. What do you think? > > Bootstrap/regtest in progress on aarch64-none-linux-gnu. I'll test other > platforms (as well as testing on top of 1/2) and repost with a proper > commit message if you think it looks good.
This passes bootstrap and regtest on aarch64, FWIW. Alex > > gcc/ChangeLog: > > (make_extraction): Temporarily rewrite (mult x 2^n) so that we > can handle it as (ashift x n) and avoid emitting an extract where > extend+shift will suffice.