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
LLVM does perform this fold for shifts <= 31, and for lsl it is able to find a different way of doing the comparison in one instruction using tst. It also seems to already perform the fold if comparing against a variable instead of 0. I guess the fold fails when comparing against 0 because a comparison against zero can be represented either as cmp x0, #0 or cmp xzr, x0
The text was updated successfully, but these errors were encountered:
LLVM does perform this fold for shifts <= 31, and for lsl it is able to find a different way of doing the comparison in one instruction using tst. It also seems to already perform the fold if comparing against a variable instead of 0. I guess the fold fails when comparing against 0 because a comparison against zero can be represented either as cmp x0, #<!-- -->0 or cmp xzr, x0
https://godbolt.org/z/rMMbbfMdW
Instead of performing an
lsr
/asr
and then comparing the result against zero, the shift can be performed as part of acmp
againstxzr
:LLVM does perform this fold for shifts <= 31, and for lsl it is able to find a different way of doing the comparison in one instruction using
tst
. It also seems to already perform the fold if comparing against a variable instead of0
. I guess the fold fails when comparing against0
because a comparison against zero can be represented either ascmp x0, #0
orcmp xzr, x0
The text was updated successfully, but these errors were encountered: