lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] jit_qdivr_u trashes JIT_R0 on x86_64


From: Paul Cercueil
Subject: Re: [Lightning] jit_qdivr_u trashes JIT_R0 on x86_64
Date: Wed, 28 Aug 2019 21:36:37 +0200



Le mer. 28 août 2019 à 18:15, Paulo =?iso-8859-1?b?Q+lzYXI=?= Pereira de Andrade <address@hidden> a écrit :
Em qui, 22 de ago de 2019 às 16:24, Paul Cercueil <address@hidden> escreveu:
[...]
 This is with the latest master. Good job on the RISC-V port btw :)
Thanks :)

[...]
 I call jit_qdiv(reg1, reg2, reg2, reg1)
 (and also jit_qdiv_u with the same arguments). reg1 and reg2 cannot
 represent the same register.

  Ok. I see it can fail on some ports, actually, probably only on x86.
I will add extra tests for these conditions, and fix any register clobbers
that should be being generated.
Note that by doing the way you described, it might cause lightning to generate code to get at least one extra temporary depending on registers
input. It might look clean in the lightning input, but may generate
significantly larger code due to moves to/from %rax and %rdx, as well as
spill reloads.

Since I have my own register allocator on top of Lightning, sometimes in a function all the registers offered by Lightning have been written to, and I guess there's no way for Lightning to know which registers are safe to use without spilling. A good improvement would be to have an API function to mark a register as freely usable.

Thanks,
-Paul





reply via email to

[Prev in Thread] Current Thread [Next in Thread]