change XLEN-ification
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 20 Apr 2023 01:12:32 +0000 (18:12 -0700)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:17 +0000 (19:51 +0100)
See bug #1064

openpower/isa/fixedlogical.mdwn

index 8a2c15954e4e1e6e2a9c1f00e83968e1aa9285d2..d3b54bc9ac350d7a4f437451198082be37846891 100644 (file)
@@ -274,11 +274,11 @@ X-Form
 Pseudo-code:
 
     n <- 0
-    do while n < 32
-       if (RS)[63-n] = 0b1 then
+    do while n < XLEN/2
+       if (RS)[XLEN-1-n] = 0b1 then
             leave
        n  <- n + 1
-    RA <- EXTZ64(n)
+    RA <- EXTZXL(n)
 
 Special Registers Altered:
 
@@ -447,7 +447,7 @@ Pseudo-code:
        if (RS)[XLEN-1-n] = 0b1 then
             leave
        n  <- n + 1
-    RA <- EXTZ64(n)
+    RA <- EXTZXL(n)
 
 Special Registers Altered:
 
@@ -461,14 +461,14 @@ X-Form
 
 Pseudo-code:
 
-    perm <- [0] * 8
+    perm <- [0] * (XLEN/8)
     for i = 0 to ((XLEN/8)-1)
        index <- (RS)[8*i:8*i+7]
        if index <u XLEN then
             perm[i] <- (RB)[index]
        else
             perm[i] <- 0
-    RA <- [0]*(XLEN-8) || perm[0:7]
+    RA <- [0]*(XLEN*7/8) || perm
 
 Special Registers Altered: