On Tue, Oct 27, 2020 at 10:35:59AM +0000, Alex Coplan 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?

Restoring it like that is just yuck.  That can be okay if it is as the
start and end of a smallish function, importantly some self-contained
piece of code, but this is not.

Just write it as two blocks? One handling the shift, that is already
there; and add one block adding the mult case.  That should not
increase the complexity of this already way too complex code.


Segher

Reply via email to