Closed tkoenig1 closed 2 months ago
Possibly fixed by commit 3d9a2636b8d0.
Possibly fixed by commit 3d9a263.
Yes, the load/stores are gone, I now get
inv_sqrt: ; @inv_sqrt
; %bb.0: ; %entry
and r2,r1,#4294967294
srl r2,r2,#1,#0
add r2,#1595932665,-r2
fmulf r3,r2,#0x3F343637
fmulf r1,r1,-r2
fmacf r1,r1,r2,#0x4018E962
fmulf r1,r3,r1
ret
As you remarked, the combination of and and srl looks weird (and it could have been done with a single srl).
The and/srl appears to be a side effect of the type punning. I can't reproduce it in "normal" code.
For the code
I get
where the store/loads are apparently done for type punning.
There is probably something missing in the machine description that this conversion is, in fact, a no-op and needs no load/stores.