Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix issue #23943 #24011
The issue #23943 is due to literal
All the following expressions
have long long unsigned int type (see https://godbolt.org/z/Z443bf).
Consequently, C++ compiler uses lsr instruction instead of asr instruction for shifting 12 bits to the right.
This can be seen from the generated assembly for the expression computing
244978: 9274ce88 and x8, x20, #0xfffffffffffff000 24497c: 9274cec9 and x9, x22, #0xfffffffffffff000 244980: cb090108 sub x8, x8, x9 244984: d34cfd04 lsr x4, x8, #12
With this changes (introducing and using
244978: d34cfe88 lsr x8, x20, #12 24497c: cb563104 sub x4, x8, x22, lsr #12
Fixes issue #23943