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
{{ message }}
Repository navigation
IRToASTVisitor: sign-extend from the source width #345
Reproduced with Rellic v0.2.3 (0cccc98a78d985bd0d1343f82b123dda03f71fcb), LLVM 15. The corresponding lowering remains in current master (370abaad86ae5adad82f85b81aff14557462b7f2); current-master behavior has only been source-inspected.
LLVM sext widens an unsigned C source directly to the signed destination, losing the source sign bit.
For extend32, the emitted widening is equivalent to (long long)source with an unsigned 32-bit source. 0xffffffff consequently becomes 4294967295, whereas LLVM requires -1.
For sext i1, true must become all-one bits (-1), rather than integer 1.
Interpret the source at its signed LLVM width before widening, including the special one-bit case. Casting only the destination to a signed type is insufficient.
Activity