// "size" bits are shifted circularly in place by "count" positions;
// the shift is leftward if count is nonnegative, rightward otherwise.
// Higher-order bits are unchanged.
- constexpr FixedPoint ISHFTC(int count, int size) const {
+ constexpr FixedPoint ISHFTC(int count, int size = bits) const {
if (count == 0 || size <= 0) {
return *this;
}
if ((count %= size) == 0) {
return *this;
}
- int middleBits, leastBits;
- if (count > 0) {
- middleBits = size - count;
- leastBits = count;
- } else {
+ int middleBits{size - count}, leastBits{count};
+ if (count < 0) {
middleBits = -count;
leastBits = size + count;
}
}
}
MATCH(trailcheck, a.TRAILZ())("%s, x=0x%llx", desc, x);
- // TODO test BTEST, DIM, MODULO, ISHFTC, DSHIFTL/R
+ for (int j{0}; j < BITS; ++j) {
+ MATCH((x >> j) & 1, a.BTEST(j))
+ ("%s, x=0x%llx, bit %d", desc, x, j);
+ }
+ // TODO test DIM, MODULO, ISHFTC, DSHIFTL/R
// TODO test IBCLR, IBSET, IBITS, MAX, MIN, MERGE_BITS, RANGE, SIGN
Ordering ord{Ordering::Equal};