jameysharp commented on issue #1044:
Can we close this now that #5784 is merged, or do folks still want overflow-checking variants for shifts?
cfallin commented on issue #1044:
It might be useful to leave open until we do; @T0b1-iOS if you're interested in pushing this further, I'd be happy to review overflow-checking shifts as well! (Of course this is only if you want to: we can just as well leave this for someone else to pick up later!)
jameysharp commented on issue #1044:
After I wrote that question, I got thinking that it's not clear to me there's as much value in dedicated CLIF instructions for overflow-checked shifts. With addition and multiplication, there's often hardware support for detecting overflow as a side effect of the computation. But with shifts I don't think we can generate code that's any better than you'd get from explicitly writing something like
icmp uge shift_amt, 64
for the overflow output of an I64 shift, right?
cfallin commented on issue #1044:
Yeah, that's a good point actually. AFAIK the shift instructions at least on x86-64 and aarch64 have native wrapping behavior. So I agree there's no real reason to expect we could do any better. Given that I guess I'll close this but if new arguments for these ops arise, we can always reconsider!
cfallin closed issue #1044.
Last updated: Dec 23 2024 at 13:07 UTC