[Libre-soc-bugs] [Bug 324] create POWER9 DIV pipeline

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jun 19 15:24:53 BST 2020


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

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

> i have one more thing left to do (one more bad hack) - identify where
> "undefined" is used and copy only the bits required from it.

done.

this is a good sign:

    RT[32:64] = trunc_div(dividend, divisor)
  File "/home/lkcl/src/libresoc/soc/src/soc/decoder/helpers.py", line 20, in
trunc_div
    abs_n = abs(n)
TypeError: bad operand type for abs(): 'SelectableInt'

and appears to be sorted by this:

diff --git a/src/soc/decoder/selectable_int.py
b/src/soc/decoder/selectable_int.py
index 7264090..eebada6 100644
--- a/src/soc/decoder/selectable_int.py
+++ b/src/soc/decoder/selectable_int.py
@@ -181,6 +181,8 @@ class SelectableInt:
         return self._op(or_, b)
     def __xor__(self, b):
         return self._op(xor, b)
+    def __abs__(self):
+        return SelectableInt(0, self.bits) - self

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


More information about the libre-soc-bugs mailing list