[x86] x >
/>=
/<
/<=
0 produce very different assembly
#59668
Labels
>
/>=
/<
/<=
0 produce very different assembly
#59668
Compiling a bunch of
icmp
s against zeroGives two rather different kinds of checks https://llvm.godbolt.org/z/4sh47s1bn
My instinct is that
check_sge
should just betest
+setge
, more like howcheck_sgt
is, rather than needing a shift-by-immediate.But I'm also really not familiar with the nuances of codegen. I suppose it's also possible that flags are so bad that not using them is better. If that's the case, though, should the others be changed too? Maybe
check_sgt
could be done withneg
and shifting, for example.(Or perhaps how it is currently is is already best, and I should just go read more architecture manuals to learn what matters.)
Inspired by a conversation about the Rust's
Ordering::is_lt
& friends, and the different ways those could be written https://rust.godbolt.org/z/fq96Yezq7.The text was updated successfully, but these errors were encountered: