copy of halfrev2 algorithm updated
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 22 Jul 2021 14:24:36 +0000 (15:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 22 Jul 2021 14:24:36 +0000 (15:24 +0100)
src/openpower/decoder/isa/remap_dct_yield.py

index eaaeaf89c611820a62cc1c3767f9f75f114ea32d..44a4375346d217dad1f17326d40f8bd2d90c98e9 100644 (file)
@@ -36,8 +36,7 @@ def halfrev2(vec, pre_rev=True):
             ri = i
             bl = i.bit_length()
             for ji in range(1, bl):
-                if (1<<ji) & i:
-                    ri ^= ((1<<ji)-1)
+                ri ^= (i >> ji)
             res.append(vec[ri])
     return res