-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[x86] x >
/>=
/<
/<=
0 produce very different assembly
#59668
Labels
Comments
@llvm/issue-subscribers-backend-x86 |
Interestingly this appears to only be an issue for i8 |
Hmm, for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: