add bitrev to pywriter autogenerator
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 23 Jun 2021 15:26:02 +0000 (16:26 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 23 Jun 2021 15:26:02 +0000 (16:26 +0100)
src/openpower/decoder/helpers.py
src/openpower/decoder/pseudo/pywriter.py

index ed8679d688e46f31ec608252da458ed2bfc8c3db..4e0a1c16c487b3ec8208b13c615f5fcf57dc88f6 100644 (file)
@@ -369,12 +369,12 @@ def bitrev(val, VL):
     """Returns the integer whose value is the reverse of the lowest
     'width' bits of the integer 'val'
     """
-       result = 0
+    result = 0
     width = VL.bit_length()
-       for _ in range(width):
-               result = (result << 1) | (val & 1)
-               val >>= 1
-       return result
+    for _ in range(width):
+        result = (result << 1) | (val & 1)
+        val >>= 1
+    return result
 
 
 # For these tests I tried to find power instructions that would let me
index 766f7929d70f57507e0a7a61ad3ecd3646d917c9..58b290522dd61ec59553d7337d080a2c2bac4051 100644 (file)
@@ -25,9 +25,7 @@ from openpower.decoder.helpers import (EXTS, EXTS64, EXTZ64, ROTL64, ROTL32,
                                  ne, eq, gt, ge, lt, le, ltu, gtu, length,
                                  trunc_divs, trunc_rems, MULS, DIVS, MODS,
                                  EXTS128, undefined,
-                                 DOUBLE, SINGLE,
-                                 FPADD32, FPSUB32, FPMUL32, FPDIV32,
-                                 FPADD64, FPSUB64, FPMUL64, FPDIV64,
+                                 bitrev,
                                 )
 from openpower.decoder.selectable_int import SelectableInt
 from openpower.decoder.selectable_int import selectconcat as concat