Skip to content
Commit 9cf8f81c authored by Aaron Ballman's avatar Aaron Ballman
Browse files

Fix _BitInt suffix width calculation

@mgehre-amd pointed out the following post-commit review feedback on
the changes in 8cba7217:

As an example, the paper says 3wb /* Yields an _BitInt(3); two value
bits, one sign bit */.
So I would expect that 0xFwb gives _BitInt(5); four value bits, one
sign bit, but with this implementation I get _BitInt(2).
This is because ResultVal as 4 bits, and getMinSignedBits() inteprets
it as negative and thus says that 1 bit is enough to represent -1.

This corrects the behavior for calculating the bit-width and adds some
test coverage.
parent 5856f30b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment