whitespace
[libreriscv.git] / openpower / isa / fixedlogical.mdwn
index 85e3a71a819c291d263cb222fe0b9ad228488d83..7cf78ef3b52ea105173f5a0bbd74d7d1772ce82e 100644 (file)
 # AND Immediate
 
-andi.  RA,RS,UI 
+D-Form
+
+* andi.  RA,RS,UI
 
     RA <- (RS) & ([0]*48 || UI)
 
+Special Registers Altered:
+
+    CR0
+
 # OR Immediate
 
-ori RA,RS,UI
+D-Form
+
+* ori RA,RS,UI
 
     RA <- (RS) | ([0]*48 || UI)
 
-# AND Immediate Shifted 
+Special Registers Altered:
+
+    None
 
-andis.  RA,RS,UI
+# AND Immediate Shifted
+
+D-Form
+
+* andis.  RA,RS,UI
 
     RA <- (RS) & ([0]*32 || UI || [0]*16)
 
-# OR Immediate Shifted 
+Special Registers Altered:
+
+    CR0
+
+# OR Immediate Shifted
 
-oris      RA,RS,UI
+D-Form
+
+* oris      RA,RS,UI
 
     RA <- (RS) | ([0]*32 || UI || [0]*16)
 
-# XOR Immediate Shifted 
+Special Registers Altered:
+
+    None
+
+# XOR Immediate Shifted
 
-xoris RA,RS,UI
+D-Form
+
+* xoris RA,RS,UI
 
     RA <- (RS) ^ ([0]*32 || UI || [0]*16)
 
-# XOR Immediate  
+Special Registers Altered:
+
+    None
 
-xori RA,RS,UI 
+# XOR Immediate
+
+D-Form
+
+* xori RA,RS,UI
 
     RA <- (RS) XOR ([0]*48 || UI)
 
-# AND 
+Special Registers Altered:
+
+    None
+
+# AND
 
-and RA,RS,RB (Rc=0)
+X-Form
 
-and.  RA,RS,RB (Rc=1)
+* and RA,RS,RB (Rc=0)
+* and.  RA,RS,RB (Rc=1)
 
     RA <- (RS) & (RB)
 
-# OR 
+Special Registers Altered:
 
-or RA,RS,RB (Rc=0)
+    CR0                    (if Rc=1)
 
-or.  RA,RS,RB (Rc=1)
+# OR
+
+X-Form
+
+* or RA,RS,RB (Rc=0)
+* or.  RA,RS,RB (Rc=1)
 
     RA <- (RS) | (RB)
 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
 # XOR
 
-xor RA,RS,RB (Rc=0)
+X-Form
 
-xor.  RA,RS,RB (Rc=1)
+* xor RA,RS,RB (Rc=0)
+* xor.  RA,RS,RB (Rc=1)
 
     RA <- (RS) ^ (RB)
 
-# NAND 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
 
-nand RA,RS,RB (Rc=0)
+# NAND
 
-nand.  RA,RS,RB (Rc=1)
+X-Form
 
-RA <- ¬((RS) & (RB))
+* nand RA,RS,RB (Rc=0)
+* nand.  RA,RS,RB (Rc=1)
+
+    RA <- ¬((RS) & (RB))
+
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
 
 # NOR
 
-nor RA,RS,RB (Rc=0)
+X-Form
+
+* nor RA,RS,RB (Rc=0)
+* nor.  RA,RS,RB (Rc=1)
 
-nor.  RA,RS,RB (Rc=1)
+    RA <- ¬((RS) | (RB))
 
-   RA <- ¬((RS) | (RB))
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
 
 # Equivalent
 
-eqv RA,RS,RB (Rc=0)
+X-Form
 
-eqv.  RA,RS,RB (Rc=1)
+* eqv RA,RS,RB (Rc=0)
+* eqv.  RA,RS,RB (Rc=1)
 
     RA <- (RS) => (RB)
 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
 # AND with Complement
 
-andc RA,RS,RB (Rc=0)
+X-Form
 
-andc.  RA,RS,RB (Rc=1)
+* andc RA,RS,RB (Rc=0)
+* andc.  RA,RS,RB (Rc=1)
 
     RA <- (RS) &  ¬(RB)
 
-# OR with Complement 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
+# OR with Complement
 
-orc RA,RS,RB (Rc=0)
+X-Form
 
-orc.  RA,RS,RB (Rc=1)
+* orc RA,RS,RB (Rc=0)
+* orc.  RA,RS,RB (Rc=1)
 
     RA <- (RS) |  ¬(RB)
 
-# Extend Sign Byte 
+Special Registers Altered:
 
-extsb RA,RS (Rc=0)
+    CR0                    (if Rc=1)
 
-extsb.  RA,RS (Rc=1)
+# Extend Sign Byte
+
+X-Form
+
+* extsb RA,RS (Rc=0)
+* extsb.  RA,RS (Rc=1)
 
     s <- (RS)[56]
     RA[56:63] <- (RS)[56:63]
     RA[0:55] <- [s]*56
 
+Special Registers Altered:
 
-# Extend Sign Halfword  
+    CR0                    (if Rc=1)
 
-extsh RA,RS (Rc=0)
+# Extend Sign Halfword
 
-extsh.  RA,RS (Rc=1)
+X-Form
+
+* extsh RA,RS (Rc=0)
+* extsh.  RA,RS (Rc=1)
 
     s <- (RS)[48]
     RA[48:63] <-  (RS)[48:63]
     RA[0:47] <- [s]*48
 
-# Count Leading Zeros Word 
+Special Registers Altered:
 
-cntlzw RA,RS (Rc=0)
+    CR0                    (if Rc=1)
 
-cntlzw.  RA,RS (Rc=1)
+# Count Leading Zeros Word
 
-    n <- 32
+X-Form
 
+* cntlzw RA,RS (Rc=0)
+* cntlzw.  RA,RS (Rc=1)
+
+    n <- 32
     do while n < 64
-       if (RS)[n] = 1 then leave
+       if (RS)[n] = 1 then
+           leave
        n <- n + 1
-
     RA <- n - 32
 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
 # Count Trailing Zeros Word
 
-cnttzw RA,RS (Rc=0)
+X-Form
 
-cnttzw.  RA,RS (Rc=1)
+* cnttzw RA,RS (Rc=0)
+* cnttzw.  RA,RS (Rc=1)
 
     n <- 0
-
     do while n < 32
-       if (RS)[63-n=] = 0b1 then leave 
+       if (RS)[63-n=] = 0b1 then
+            leave
        n  <- n + 1
-
     RA <- EXTZ64(n)
 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
 # Compare Bytes
 
-cmpb RA,RS,RB 
+X-Form
 
-    do n = 0 to 7 
+* cmpb RA,RS,RB
+
+    do n = 0 to 7
         if RS[8*n:8* n+7] = (RB)[8*n:8*n+7] then
            RA[8*n:8* n+7] <- [1]*8
-        else 
+        else
            RA[8*n:8* n+7] <- [0]*8
 
+Special Registers Altered:
+
+    None
+
 # Population Count Bytes
 
-popcntb RA, RS
+X-Form
+
+* popcntb RA, RS
 
     do i = 0 to 7
        n <-  0
        do j = 0 to 7
           if (RS)[(i*8)+j] = 1 then
               n <- n+1
-       RA[(i*8):(i*8)+7] <-  n 
+       RA[(i*8):(i*8)+7] <-  n
+
+Special Registers Altered:
+
+    None
 
 # Population Count Words
 
-popcntw RA, RS
+X-Form
+
+* popcntw RA, RS
 
     do i = 0 to 1
        n <-  0
@@ -179,18 +286,30 @@ popcntw RA, RS
               n <- n+1
        RA[(i*32):(i*32)+31] <- n
 
+Special Registers Altered:
+
+    None
+
 # Parity Doubleword
 
-prtyd RA,RS
+X-Form
+
+* prtyd RA,RS
 
     s <- 0
     do i = 0 to 7
         s <- s / (RS)[i%8+7]
     RA <- [0] * 63 || s
 
-# Parity Word 
+Special Registers Altered:
+
+    None
+
+# Parity Word
 
-prtyw RA,RS
+X-Form
+
+* prtyw RA,RS
 
     s <- 0
     t <- 0
@@ -198,61 +317,96 @@ prtyw RA,RS
         s <-  s / (RS)i%8+7
     do i = 4 to 7
         t <-  t / (RS)i%8+7
-    RA[0:31] <- [0]*31 || s 
+    RA[0:31] <- [0]*31 || s
     RA[32:63] <- [0]*31 || t
 
+Special Registers Altered:
+
+    None
+
 # Extend Sign Word
 
-extsw RA,RS (Rc=0)
+X-Form
 
-extsw.  RA,RS (Rc=1)
+* extsw RA,RS (Rc=0)
+* extsw.  RA,RS (Rc=1)
 
     s <- (RS)[32]
     RA[32:63] <- (RS)[32:63]
     RA[0:31] <- [s]*32
 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
 # Population Count Doubleword
 
-popcntd RA, RS
+X-Form
+
+* popcntd RA, RS
 
     n <- 0
     do i = 0 to 63
        if (RS)[i] = 1 then
-       n <-  n+1
+           n <-  n+1
     RA <- n
 
-# Count Leading Zeros Doubleword 
+Special Registers Altered:
 
-cntlzd RA,RS (Rc=0)
+    None
 
-cntlzd.  RA,RS (Rc=1)
+# Count Leading Zeros Doubleword
+
+X-Form
+
+* cntlzd RA,RS (Rc=0)
+* cntlzd.  RA,RS (Rc=1)
 
     n <- 0
     do while n < 64
-      if (RS)[n]  = 1 then leave
+      if (RS)[n]  = 1 then
+         leave
       n <- n + 1
     RA <- n
 
-# Count Trailing Zeros Doubleword 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
 
-cnttzd RA,RS (Rc=0)
+# Count Trailing Zeros Doubleword
 
-cnttzd.  RA,RS (Rc=1)
+X-Form
+
+* cnttzd RA,RS (Rc=0)
+* cnttzd.  RA,RS (Rc=1)
 
     n  <- 0
     do while n < 64
-       if (RS)[63-n] = 0b1 then leave 
+       if (RS)[63-n] = 0b1 then
+            leave
        n  <- n + 1
     RA <- EXTZ64(n)
 
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
+
 # Bit Permute Doubleword
 
-bpermd RA,RS,RB]
+X-Form
+
+* bpermd RA,RS,RB]
 
-    For i = 0 to 7 
+    perm <- [0] * 8
+    For i = 0 to 7
        index <- (RS)[8*i:8*i+7]
-       If index < 64
-          then permi <- (RB)[index]
-          else permi <- 0
-    RA <- [0]*56|| perm[0:7]
+       if index < 64 then
+            perm[i] <- (RB)[index]
+       else
+            perm[i] <- 0
+    RA <- [0]*56 || perm[0:7]
+
+Special Registers Altered:
+
+    None