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

index 273baa84da104174e79eb6647edc0c61c4f4f5fd..a23b402332afb600b34ee9fcd02150810bdb4975 100644 (file)
@@ -782,10 +782,10 @@ Pseudo-code:
 
     dividend <- (RA)
     divisor <- (RB)
-    if (((dividend = 0x8000_0000_0000_0000) &
-         (divisor = [1]*64)) |
-         (divisor = [0]*64)) then
-        RT[0:63] <- undefined([0]*64)
+    if (((dividend = (0b1 || ([0b0] * (XLEN-1)))) &
+         (divisor = [1]*XLEN)) |
+         (divisor = [0]*XLEN)) then
+        RT[0:63] <- undefined([0]*XLEN)
         overflow <- 1
     else
         RT <- MODS(dividend, divisor)