fixedarith: switch divdeX to XLEN
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 29 Aug 2021 19:44:52 +0000 (19:44 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 31 Aug 2021 11:42:24 +0000 (12:42 +0100)
openpower/isa/fixedarith.mdwn

index a23b402332afb600b34ee9fcd02150810bdb4975..5832be51d4d0f79e2fa101d813605c12bfa3e908 100644 (file)
@@ -720,22 +720,22 @@ XO-Form
 
 Pseudo-code:
 
-    dividend[0:127] <- (RA) || [0]*64
-    divisor[0:127] <- EXTS128((RB))
-    if (((dividend = 0x8000_0000_0000_0000_0000_0000_0000_0000) &
-         (divisor = [1]*128)) |
-         (divisor = [0]*128)) then
+    dividend[0:(XLEN*2)-1] <- (RA) || [0]*XLEN
+    divisor[0:(XLEN*2)-1] <- EXTS128((RB))
+    if (((dividend = (0b1 || ([0b0] * ((XLEN*2)-1)))) &
+         (divisor = [1]*(XLEN*2))) |
+         (divisor = [0]*(XLEN*2))) then
         overflow <- 1
     else
         result <- DIVS(dividend, divisor)
-        result64[0:127] <- EXTS128(result[64:127])
-        if (result64 = result) then
-            RT <- result[64:127]
+        result_half[0:(XLEN*2)-1] <- EXTS128(result[XLEN:(XLEN*2)-1])
+        if (result_half = result) then
+            RT <- result[XLEN:(XLEN*2)-1]
             overflow <- 0
         else
             overflow <- 1
     if overflow = 1 then
-        RT[0:63] <- undefined([0]*64)
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
 
 Special Registers Altered: