[Libre-soc-bugs] [Bug 448] MUL pipeline unit tests

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Aug 5 19:48:26 BST 2020


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

--- Comment #17 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Cole Poirier from comment #16)

> Thanks for the clarification. I'm still far too afraid of introducing things
> that break things, so when I get errors I cower ;-)

python unit test infrasttucture is specifically designed to be isolated.


> 
> Also, I committed the initial test where it failed due to madd* insns
> yesterday. So only a half failure there :)
> 
> Committed and pushed.

sorted.  git pull

diff --git a/src/soc/decoder/helpers.py b/src/soc/decoder/helpers.py
index 17534800..870ec4ab 100644
--- a/src/soc/decoder/helpers.py
+++ b/src/soc/decoder/helpers.py
@@ -4,6 +4,7 @@ from nmutil.divmod import trunc_divs, trunc_rems
 from operator import floordiv, mod
 from soc.decoder.selectable_int import selectltu as ltu
 from soc.decoder.selectable_int import selectgtu as gtu
+from soc.decoder.selectable_int import check_extsign

 trunc_div = floordiv
 trunc_rem = mod
@@ -37,6 +38,9 @@ def EXTS64(value):

 # signed version of MUL
 def MULS(a, b):
+    if isinstance(b, int):
+        b = SelectableInt(b, self.bits)
+    b = check_extsign(self, b)
     a_s = a.value & (1 << (a.bits-1)) != 0
     b_s = b.value & (1 << (b.bits-1)) != 0
     result = abs(a) * abs(b)

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


More information about the libre-soc-bugs mailing list