Am 29.05.26 um 17:12 schrieb Stefan Schulze Frielinghaus:
On Fri, May 29, 2026 at 03:47:48PM +0200, Georg-Johann Lay wrote:
With you patch applied, does it work since the insn uses constraint
modifier "%" ?
Or because the insn provides an alternative with swapped hard-reg
constraints?
I applied your patch to lra-lives.cc, and the code is optimal.
Moreover, it seems that both "%" and also the 2nd alternative with
swapped hard-reg constraints are required for RA to use swapped
operands.
So I applied my patch as is.
I took your patch as is without realizing that it contains the
constraint modifier and alternatives. While skimming over your patch I
realize you are also using hard register constraints for
clobber/match_scratch. That is still untested and you are entering new
terrain here and I expect that you are doing proper testing here. At
the moment I'm still focusing on asm. For input/output operands those
do not differ too much of an insn coming from MD. However,
match_scratch might behave differently and I haven't wrapped my head
around those.
Cheers,
Stefan
Hard-reg constraints for divmod is already upstream :-)
https://gcc.gnu.org/r17-891
It applied without new regressions, and the [u]divmodhi4 has at least
some testsuite coverage.
There is RTL code that can trigger a spill fail with HRC in a scratch
operand, though similar code with HRC in an ordinary operand also
triggers spill fail.
Cheers,
Johann