Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
comptime_int bitwise operators with negative values give incorrect results #1387
This is with the stage1 compiler.
@kristate Thanks for the help. More confused than I expected :-)
I'll try and convey what I currently understand by walking through what I understand to be the implementation of
So our bigint type stores the data for the digits (always positive), and a sign externally (as opposed to storing the twos complement form like llvm's APInt does). Thus, to do bitwise operations like
Assuming that's correct from a high level, then my confusion is just with the implementation of
Also, please don't hesitate to fix the issue yourself -- I don't want to artificially slow things down and can learn more about what's going on either way.