add EXTZ since it's in PowerISA v3.1B (see lbz for an example)
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 21 Apr 2023 03:13:57 +0000 (20:13 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 21 Apr 2023 03:13:57 +0000 (20:13 -0700)
src/openpower/decoder/helpers.py

index c009431d7e3125245a0b3c5b466fd6a80a5a61d8..76dad8a2efbf614d8b82e35be8ad083006fd5f48 100644 (file)
@@ -46,6 +46,14 @@ def EXTS(value):
     return SelectableInt(exts(value.value, value.bits) & ((1 << 256)-1), 256)
 
 
+def EXTZ(value):
+    """ zero extend to 256 bits
+    """
+    if isinstance(value, SelectableInt):
+        value = value.value
+    return SelectableInt(value & ((1 << 256) - 1), 256)
+
+
 def EXTS64(value):
     """ extends sign bit out from current MSB to 64 bits
     """