You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that that canonicalization would undo what I was trying in the first place, which is this difference https://godbolt.org/z/to7D8q
example::spaceship1:
cmp edi, esi
seta al
sbb al, 0
ret
example::spaceship2:
xor ecx, ecx
cmp edi, esi
seta cl
mov eax, 255
cmovae eax, ecx
ret
It's not obvious to me which of those is better in general (is byte sbb or cmov worse?), but llvm-mca does say the former is better on the (old) core2 CPU I'm currently running.
Extended Description
I found this trying to make a better implementation of Rust's
Ord::cmp
for integers.C++ repro https://godbolt.org/z/tL0-oW
my_lt
there should be foldable down to justa < b
, but that doesn't happen(And running it through
opt
again doesn't help either, https://godbolt.org/z/-hl5H0)The text was updated successfully, but these errors were encountered: