working on fixing divwe. spec bugs
authorJacob Lifshay <programmerjake@gmail.com>
Sat, 3 Oct 2020 01:01:56 +0000 (18:01 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Sat, 3 Oct 2020 01:01:56 +0000 (18:01 -0700)
openpower/isa/fixedarith.mdwn

index 7a03aff4676c28c8d78e1aafa545cbeee4a783c9..f8511652c73f9cc1f1f4f7d3cf92c869a65c86c5 100644 (file)
@@ -439,12 +439,13 @@ XO-Form
 Pseudo-code:
 
     dividend[0:63] <- (RA)[32:63] || [0]*32
-    divisor[0:63] <- [0]*32 || (RB)[32:63]
+    divisor[0:63] <- EXTS64((RB)[32:63])
     if (divisor = 0x0000_0000_0000_0000) then
         overflow <- 1
     else
         result <- DIVS(dividend, divisor)
-        if (result[0:31] = 0) then
+        result32[0:63] <- EXTS64(result[32:63])
+        if (result32 = result) then
             RT[32:63] <- result[32:63]
             RT[0:31] <- undefined[0:31]
             overflow <- 0