decoder/helpers: support XLCASTU
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Tue, 28 Sep 2021 20:17:42 +0000 (20:17 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Wed, 29 Sep 2021 11:42:26 +0000 (11:42 +0000)
src/openpower/decoder/helpers.py

index d51305b96ad396cbad760e8d69d14ac6393206a2..3b142e1a9a5e96b47259802a7afc4d04e7a95d48 100644 (file)
@@ -450,6 +450,10 @@ class ISACallerHelper:
     def XLEN(self):
         return self.__XLEN
 
+    def XLCASTU(self, value):
+        bits = min(value.bits, self.XLEN)
+        return SelectableInt(value.value & ((1 << bits) - 1), self.XLEN)
+
     def __getattr__(self, attr):
         return getattr(sys.modules[ISACallerHelper.__module__], attr)