From: Luke Kenneth Casson Leighton Date: Fri, 23 Sep 2022 19:20:39 +0000 (+0100) Subject: remove barse-ackwardsness, use SelectableInt() in decode_bo X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09ac856dba6eb9b96a13b84a8e175152ff7bcb8f;p=openpower-isa.git remove barse-ackwardsness, use SelectableInt() in decode_bo --- diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index 8a6d271a..6037de94 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -668,7 +668,10 @@ def decode_bo(encoding): "encoding %s for BO Mode not recognised" % encoding # barse-ackwards MSB0/LSB0. sigh mapped = pmap[encoding] - return int(bin(mapped)[:1:-1], 2) # to 0bNNN, reverse-and-strip b0, base2 + si = SelectableInt(0, 3) + si[0] = mapped>>2 + si[1:3] = mapped & 3 + return int(si) # partial-decode fail-first mode