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
My instinct is that check_sge should just be test+setge, more like how check_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 with neg 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.)
Hmm, for i16, it looks like slt 0 becomes shr 15, but the others are setCC (https://llvm.godbolt.org/z/ThfGbj39v). Maybe that's fine, though? (My μarchitecture knowledge is not nearly good enough to know for sure.)
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: