diff options
author | Craig Topper <craig.topper@sifive.com> | 2022-01-02 23:20:32 -0800 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2022-01-02 23:27:16 -0800 |
commit | db81324c8da56cd498b58d0081b49b08095ec534 (patch) | |
tree | 6f4d57012d098d3d825d7add4f1bf4f48bf456ec /llvm/unittests/Support/JSONTest.cpp | |
parent | 5527139302d9b0416b9fa7f1b84760d6acacda12 (diff) | |
download | llvm-db81324c8da56cd498b58d0081b49b08095ec534.zip llvm-db81324c8da56cd498b58d0081b49b08095ec534.tar.gz llvm-db81324c8da56cd498b58d0081b49b08095ec534.tar.bz2 |
[Support] Add KnownBits::countMaxSignedBits(). Make KnownBits::countMinSignBits() always return at least 1.
Even if we don't have any known bits, we can assume that there is
at least 1 sign bit. This is consistent with ComputeNumSignBits
which always returns at least 1.
Add KnownBits::countMaxSignedBits() which computes the number of
bits needed to represent all signed values with those known bits.
This is the signed equivalent of countMaxActiveBits().
Split from D116469.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D116500
Diffstat (limited to 'llvm/unittests/Support/JSONTest.cpp')
0 files changed, 0 insertions, 0 deletions