From 45e739e1bdb44b6975c1826cbd0606667e4f73b7 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 2 Oct 2021 09:12:13 +0000 Subject: [PATCH] decoder/helpers: simplify XLCASTU --- src/openpower/decoder/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: -- 2.30.2