From: Luke Kenneth Casson Leighton Date: Wed, 23 Jun 2021 15:26:02 +0000 (+0100) Subject: add bitrev to pywriter autogenerator X-Git-Tag: xlen-bcd~411 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bcf55f5907f608429174eb206d471cb666f52c5;p=openpower-isa.git add bitrev to pywriter autogenerator --- diff --git a/src/openpower/decoder/helpers.py b/src/openpower/decoder/helpers.py index ed8679d6..4e0a1c16 100644 --- a/src/openpower/decoder/helpers.py +++ b/src/openpower/decoder/helpers.py @@ -369,12 +369,12 @@ def bitrev(val, VL): """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 diff --git a/src/openpower/decoder/pseudo/pywriter.py b/src/openpower/decoder/pseudo/pywriter.py index 766f7929..58b29052 100644 --- a/src/openpower/decoder/pseudo/pywriter.py +++ b/src/openpower/decoder/pseudo/pywriter.py @@ -25,9 +25,7 @@ from openpower.decoder.helpers import (EXTS, EXTS64, EXTZ64, ROTL64, ROTL32, 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