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

index 3b142e1a9a5e96b47259802a7afc4d04e7a95d48..84300ba0d92367d98b5ceb4a0a6f8e993056e2a8 100644 (file)
@@ -450,6 +450,9 @@ class ISACallerHelper:
     def XLEN(self):
         return self.__XLEN
 
+    def XLCASTS(self, value):
+        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)