remove barse-ackwardsness, use SelectableInt() in decode_bo
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Sep 2022 19:20:39 +0000 (20:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Sep 2022 19:20:39 +0000 (20:20 +0100)
src/openpower/sv/trans/svp64.py

index 8a6d271a6ca8f1a13b69ebf8ea249e01158277c3..6037de94107525f72600de26257d9d4b5c5d0a16 100644 (file)
@@ -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