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

index 5832be51d4d0f79e2fa101d813605c12bfa3e908..b9501093a948d298675be97dae24900576b3271c 100644 (file)
@@ -668,12 +668,12 @@ XO-Form
 
 Pseudo-code:
 
-    dividend[0:63] <- (RA)
-    divisor[0:63] <- (RB)
-    if (((dividend = 0x8000_0000_0000_0000) &
-         (divisor = [1]*64)) |
-         (divisor = [0]*64)) then
-        RT[0:63] <- undefined([0]*64)
+    dividend[0:XLEN-1] <- (RA)
+    divisor[0:XLEN-1] <- (RB)
+    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
+         (divisor = [1]*XLEN)) |
+         (divisor = [0]*XLEN)) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
         overflow <- 1
     else
         RT <- DIVS(dividend, divisor)