sigh, bm not mode argument to bmask
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jun 2022 14:17:27 +0000 (15:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jun 2022 14:17:27 +0000 (15:17 +0100)
plus the offsets (sub-fields) of bm were completely wrong

openpower/isa/av.mdwn

index 6d13b90c1483ce68998dc5af5e7652bb3bf2d7c0..862c26ece4da5c9c36a67102ccdc6df304bc5843 100644 (file)
@@ -174,15 +174,15 @@ Special Registers Altered:
  
 BM2-Form
  
  
 BM2-Form
  
-* bmask  RT,RA,RB,mode
+* bmask  RT,RA,RB,bm
 
 Pseudo-code:
 
     if _RB = 0 then mask <- [1] * XLEN
 
 Pseudo-code:
 
     if _RB = 0 then mask <- [1] * XLEN
-    else mask = (RB)
+    else mask <- (RB)
     a1 <- (RA) & mask
     a1 <- (RA) & mask
-    if mode[1] then a1 <- ¬ra
-    mode2 <- mode[2:3]
+    if bm[0] then a1 <- ¬ra
+    mode2 <- bm[1:2]
     if mode2 = 0 then a2 <- (¬ra)+1
     if mode2 = 1 then a2 <- ra-1
     if mode2 = 2 then a2 <- ra+1
     if mode2 = 0 then a2 <- (¬ra)+1
     if mode2 = 1 then a2 <- ra-1
     if mode2 = 2 then a2 <- ra+1
@@ -190,7 +190,7 @@ Pseudo-code:
     a1 <- a1 & mask
     a2 <- a2 & mask
     # select operator
     a1 <- a1 & mask
     a2 <- a2 & mask
     # select operator
-    mode3 <- mode[3:4]
+    mode3 <- bm[3:4]
     if mode3 = 0 then result <- a1 | a2
     if mode3 = 1 then result <- a1 & a2
     if mode3 = 2 then result <- a1 ^ a2
     if mode3 = 0 then result <- a1 | a2
     if mode3 = 1 then result <- a1 & a2
     if mode3 = 2 then result <- a1 ^ a2