[Libre-soc-bugs] [Bug 684] XLEN-16 fails when XLEN=8

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Sep 30 14:34:13 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=684

--- Comment #14 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
helpers.py:

+    def XLCASTU(self, value):
+        bits = min(value.bits, self.XLEN)
+        return SelectableInt(value.value & ((1 << bits) - 1), self.XLEN)
+

that can just be:

        return SelectableInt(value.value, self.XLEN)

with a comment explaining that SelectableInt performs the required
value truncation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list