From 2e4fe2751bf7b3be37c67454e273722766cd2f64 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 8 Dec 2021 20:51:41 -0800 Subject: [PATCH] add initial ternlogi pseudo-code --- openpower/isa/bitmanip.mdwn | 24 ++++++++++++++++++++++++ src/openpower/decoder/isa/.gitignore | 1 + 2 files changed, 25 insertions(+) create mode 100644 openpower/isa/bitmanip.mdwn diff --git a/openpower/isa/bitmanip.mdwn b/openpower/isa/bitmanip.mdwn new file mode 100644 index 00000000..daa6e670 --- /dev/null +++ b/openpower/isa/bitmanip.mdwn @@ -0,0 +1,24 @@ + + + +# 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) diff --git a/src/openpower/decoder/isa/.gitignore b/src/openpower/decoder/isa/.gitignore index 5e256f88..6a07a25f 100644 --- a/src/openpower/decoder/isa/.gitignore +++ b/src/openpower/decoder/isa/.gitignore @@ -1,5 +1,6 @@ /all.py /bcd.py +/bitmanip.py /branch.py /comparefixed.py /condition.py -- 2.30.2