From: MITSUNARI Shigeo <[email protected]>

On 6/8/26 20:04, Richard Henderson wrote:
> "If the first and second operand are identical, it will contain the high half 
> of the
> multiplication result."
>
> Which suggests you don't need the scratch, just "%2,%0,%0".

Thanks for the tip.  I have simplified the pattern as you suggested:
both output operands now use the same register ("%0,%0,%2"), so no
scratch register or clobber is needed.

As a side effect, the peephole2 from [3/3] is no longer required
(the simplified pattern already handles the case where the value is
already in %rdx), so v4 is now a 2-patch series.

I have posted v4:
[PATCH v4 0/2] expmed/i386: optimize u32 constant division and improve BMI2 
codegen

Reply via email to