decoder/helpers: simplify XLCASTU
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sat, 2 Oct 2021 09:12:13 +0000 (09:12 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Wed, 13 Oct 2021 17:11:43 +0000 (17:11 +0000)
src/openpower/decoder/helpers.py

index a11081bc2478fefe8e38a4fddb303a3dc4bea608..be6ab4964621ea4098127404b67eb79d31994ed4 100644 (file)
@@ -454,8 +454,8 @@ class ISACallerHelper:
         return SelectableInt(exts(value.value, self.XLEN), self.XLEN)
 
     def XLCASTU(self, value):
-        bits = min(value.bits, self.XLEN)
-        return SelectableInt(value.value & ((1 << bits) - 1), self.XLEN)
+        # SelectableInt already takes care of masking out the bits
+        return SelectableInt(value.value, self.XLEN)
 
     def __getattr__(self, attr):
         try: