[Libre-soc-bugs] [Bug 432] mulld pseudocode overflow calculation incorrect

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Jul 15 15:54:11 BST 2020


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

Luke Kenneth Casson Leighton <lkcl at lkcl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |IN_PROGRESS

--- Comment #3 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
look reasonable?

diff --git a/openpower/isa/fixedarith.mdwn b/openpower/isa/fixedarith.mdwn
index 1931c72..5f55660 100644
--- a/openpower/isa/fixedarith.mdwn
+++ b/openpower/isa/fixedarith.mdwn
@@ -350,8 +350,8 @@ Pseudo-code:

     prod[0:63] <- MULS((RA)[32:63], (RB)[32:63])
     RT <- prod
-    overflow <- ((prod[0:31] != 0x0000_0000) &
-                 (prod[0:31] != 0xffff_ffff))
+    overflow <- ((prod[0:32] != 0x0_0000_0000) &
+                 (prod[0:32] != 0x1_ffff_ffff))

 Special Registers Altered:

@@ -564,8 +564,8 @@ Pseudo-code:

     prod[0:127] <- MULS((RA), (RB))
     RT <- prod[64:127]
-    overflow <- ((prod[0:63] != 0x0000_0000_0000_0000) &
-                 (prod[0:63] != 0xffff_ffff_ffff_ffff))
+    overflow <- ((prod[0:64] != 0x0_0000_0000_0000_0000) &
+                 (prod[0:64] != 0x1_ffff_ffff_ffff_ffff))

 Special Registers Altered:

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


More information about the libre-soc-bugs mailing list