Internals: Make some accessors in V3Number public (#2756). No functional change.

This commit is contained in:
Yutetsu TAKATSUKASA 2021-01-16 23:47:04 +09:00 committed by GitHub
parent 22260c6b85
commit cea8b65f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,8 @@ private:
return ("01zx"[(((m_value[bit / 32] & (1UL << (bit & 31))) ? 1 : 0)
| ((m_valueX[bit / 32] & (1UL << (bit & 31))) ? 2 : 0))]);
}
public:
bool bitIs0(int bit) const {
if (bit < 0) return false;
if (bit >= m_width) return !bitIsXZ(m_width - 1);
@ -144,6 +146,8 @@ private:
return ((~m_value[bit / 32] & (1UL << (bit & 31)))
&& (m_valueX[bit / 32] & (1UL << (bit & 31))));
}
private:
uint32_t bitsValue(int lsb, int nbits) const {
uint32_t v = 0;
for (int bitn = 0; bitn < nbits; bitn++) { v |= (bitIs1(lsb + bitn) << bitn); }