From: Luke Kenneth Casson Leighton Date: Sun, 18 Sep 2022 16:33:32 +0000 (+0100) Subject: reverse decode_bo inv/eq/lt/le/etc. thing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=361df8c7c74f3e58ef71c0b436fcce7b7aeb1ee9;p=openpower-isa.git reverse decode_bo inv/eq/lt/le/etc. thing rather than piss about modifying the table itself, do an MSB0-LSB0 swap --- diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index 40fdc0ef..36bd3bfe 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -645,7 +645,9 @@ def decode_bo(encoding): } assert encoding in pmap, \ "encoding %s for BO Mode not recognised" % encoding - return pmap[encoding] + # barse-ackwards MSB0/LSB0. sigh + mapped = pmap[encoding] + return int(bin(mapped)[:1:-1], 2) # to 0bNNN, reverse-and-strip b0, base2 # partial-decode fail-first mode