reverse decode_bo inv/eq/lt/le/etc. thing
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 18 Sep 2022 16:33:32 +0000 (17:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 18 Sep 2022 16:33:32 +0000 (17:33 +0100)
rather than piss about modifying the table itself, do an MSB0-LSB0 swap

src/openpower/sv/trans/svp64.py

index 40fdc0effdd09b540f97d54e3372eff475a62bad..36bd3bfebded0597b3f6171653e5f6e7cc04c031 100644 (file)
@@ -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