by freshbob · 6y ago · 0 comments
x / 2 resulting in the off-by-one error mentioned in the paper, if x is LLONG_MIN. LLONG_MIN / 2 = 0 in with their optimization.
Are you saying clang is leading to an off-by-one error? The code seems to behave correctly to me.
return x / 2
baz: # @baz mov rax, rdi shr rax, 63 add rax, rdi sar rax ret