"""Returns the integer whose value is the reverse of the lowest
'width' bits of the integer 'val'
"""
- result = 0
+ result = 0
width = VL.bit_length()
- for _ in range(width):
- result = (result << 1) | (val & 1)
- val >>= 1
- return result
+ for _ in range(width):
+ result = (result << 1) | (val & 1)
+ val >>= 1
+ return result
# For these tests I tried to find power instructions that would let me
ne, eq, gt, ge, lt, le, ltu, gtu, length,
trunc_divs, trunc_rems, MULS, DIVS, MODS,
EXTS128, undefined,
- DOUBLE, SINGLE,
- FPADD32, FPSUB32, FPMUL32, FPDIV32,
- FPADD64, FPSUB64, FPMUL64, FPDIV64,
+ bitrev,
)
from openpower.decoder.selectable_int import SelectableInt
from openpower.decoder.selectable_int import selectconcat as concat