From 361df8c7c74f3e58ef71c0b436fcce7b7aeb1ee9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 18 Sep 2022 17:33:32 +0100 Subject: [PATCH] reverse decode_bo inv/eq/lt/le/etc. thing rather than piss about modifying the table itself, do an MSB0-LSB0 swap --- src/openpower/sv/trans/svp64.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.30.2