add initial ternlogi pseudo-code
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 9 Dec 2021 04:51:41 +0000 (20:51 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 9 Dec 2021 04:51:41 +0000 (20:51 -0800)
openpower/isa/bitmanip.mdwn [new file with mode: 0644]
src/openpower/decoder/isa/.gitignore

diff --git a/openpower/isa/bitmanip.mdwn b/openpower/isa/bitmanip.mdwn
new file mode 100644 (file)
index 0000000..daa6e67
--- /dev/null
@@ -0,0 +1,24 @@
+<!-- Draft Instructions here described in https://libre-soc.org/openpower/sv/bitmanip/ -->
+<!-- These instructions are *not yet official* -->
+
+# Ternary Bitwise Logic Immediate
+
+TLI-Form
+
+* ternlogi RT, RA, RB, TLI (Rc=0)
+* ternlogi. RT, RA, RB, TLI (Rc=1)
+
+Pseudo-code:
+
+    result <- [0] * XLEN
+    idx <- [0] * 3
+    do i = 0 to XLEN - 1
+      idx[0] <- (RT)[i]
+      idx[1] <- (RA)[i]
+      idx[2] <- (RB)[i]
+      result[i] <- (TLI & ROTL64(1, idx)) != 0
+    RT <- result
+
+Special Registers Altered:
+
+    CR0                    (if Rc=1)
index 5e256f8847eb3ac97d6ec3d64bd228f631fa1a2b..6a07a25f119185a2f84a4c7985984e2a4e23e96d 100644 (file)
@@ -1,5 +1,6 @@
 /all.py
 /bcd.py
+/bitmanip.py
 /branch.py
 /comparefixed.py
 /condition.py