From: Dmitry Selyutin Date: Sat, 2 Oct 2021 09:12:13 +0000 (+0000) Subject: decoder/helpers: simplify XLCASTU X-Git-Tag: sv_maxu_works-initial~782 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45e739e1bdb44b6975c1826cbd0606667e4f73b7;p=openpower-isa.git decoder/helpers: simplify XLCASTU --- diff --git a/src/openpower/decoder/helpers.py b/src/openpower/decoder/helpers.py index a11081bc..be6ab496 100644 --- a/src/openpower/decoder/helpers.py +++ b/src/openpower/decoder/helpers.py @@ -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: