overflow test MSBs not LSBs
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 11 Jul 2020 10:23:45 +0000 (11:23 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 11 Jul 2020 10:23:45 +0000 (11:23 +0100)
openpower/isa/fixedarith.mdwn

index 75bf9faa08d8049699c32e23edbd975de38df66e..1931c72ece17a9f750040f85cf6aa0b6760e39c7 100644 (file)
@@ -350,8 +350,8 @@ Pseudo-code:
 
     prod[0:63] <- MULS((RA)[32:63], (RB)[32:63])
     RT <- prod
-    overflow <- ((prod[32:63] != 0x0000_0000) &
-                 (prod[32:63] != 0xffff_ffff))
+    overflow <- ((prod[0:31] != 0x0000_0000) &
+                 (prod[0:31] != 0xffff_ffff))
 
 Special Registers Altered:
 
@@ -564,6 +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))
 
 Special Registers Altered: