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

index d6aca1187039ac99b275d75dfca8e415e2e6319c..9dd7f1f45ca215b8a91bea79b5f4f134dfe06d6c 100644 (file)
@@ -388,16 +388,16 @@ XO-Form
 
 Pseudo-code:
 
-    dividend[0:31] <- (RA)[32:63]
-    divisor[0:31] <- (RB) [32:63]
-    if (((dividend = 0x8000_0000) &
-         (divisor = [1]*32)) |
-         (divisor = [0]*32)) then
-        RT[0:63] <- undefined([0]*64)
+    dividend[0:(XLEN/2)-1] <- (RA)[XLEN/2:XLEN-1]
+    divisor[0:(XLEN/2)-1] <- (RB) [XLEN/2:XLEN-1]
+    if (((dividend = (0b1 || ([0b0] * ((XLEN/2)-1)))) &
+         (divisor = [1]*XLEN/2)) |
+         (divisor = [0]*XLEN/2)) then
+        RT[0:XLEN-1] <- undefined([0]*XLEN)
         overflow <- 1
     else
-        RT[32:63] <- DIVS(dividend, divisor)
-        RT[0:31] <- undefined([0]*32)
+        RT[XLEN/2:XLEN-1] <- DIVS(dividend, divisor)
+        RT[0:(XLEN/2)-1] <- undefined([0]*XLEN/2)
         overflow <- 0
 
 Special Registers Altered: