From: Jacob Lifshay Date: Mon, 7 Aug 2023 23:04:00 +0000 (-0700) Subject: split out instructions from openpower/isa/fixedlogical.mdwn X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3996230909cabd6fa2a56adf095c6943e73019a;p=openpower-isa.git split out instructions from openpower/isa/fixedlogical.mdwn --- diff --git a/openpower/isa/fixedlogical.mdwn b/openpower/isa/fixedlogical.mdwn index 01eeffb1..6b578f17 100644 --- a/openpower/isa/fixedlogical.mdwn +++ b/openpower/isa/fixedlogical.mdwn @@ -10,574 +10,68 @@ -# AND Immediate +[[!inline pagenames="openpower/isa/fixedlogical/andi." raw="yes"]] -D-Form +[[!inline pagenames="openpower/isa/fixedlogical/ori" raw="yes"]] -* andi. RA,RS,UI +[[!inline pagenames="openpower/isa/fixedlogical/andis." raw="yes"]] -Pseudo-code: +[[!inline pagenames="openpower/isa/fixedlogical/oris" raw="yes"]] - RA <- (RS) & EXTZ(UI) +[[!inline pagenames="openpower/isa/fixedlogical/xoris" raw="yes"]] -Special Registers Altered: +[[!inline pagenames="openpower/isa/fixedlogical/xori" raw="yes"]] - CR0 +[[!inline pagenames="openpower/isa/fixedlogical/and" raw="yes"]] -# OR Immediate +[[!inline pagenames="openpower/isa/fixedlogical/or" raw="yes"]] -D-Form +[[!inline pagenames="openpower/isa/fixedlogical/xor" raw="yes"]] -* ori RA,RS,UI +[[!inline pagenames="openpower/isa/fixedlogical/nand" raw="yes"]] -Pseudo-code: +[[!inline pagenames="openpower/isa/fixedlogical/nor" raw="yes"]] - RA <- (RS) | EXTZ(UI) +[[!inline pagenames="openpower/isa/fixedlogical/eqv" raw="yes"]] -Special Registers Altered: +[[!inline pagenames="openpower/isa/fixedlogical/andc" raw="yes"]] - None +[[!inline pagenames="openpower/isa/fixedlogical/orc" raw="yes"]] -# AND Immediate Shifted +[[!inline pagenames="openpower/isa/fixedlogical/extsb" raw="yes"]] -D-Form +[[!inline pagenames="openpower/isa/fixedlogical/extsh" raw="yes"]] -* andis. RA,RS,UI +[[!inline pagenames="openpower/isa/fixedlogical/cntlzw" raw="yes"]] -Pseudo-code: +[[!inline pagenames="openpower/isa/fixedlogical/cnttzw" raw="yes"]] - RA <- (RS) & EXTZ(UI || [0]*16) +[[!inline pagenames="openpower/isa/fixedlogical/cmpb" raw="yes"]] -Special Registers Altered: +[[!inline pagenames="openpower/isa/fixedlogical/popcntb" raw="yes"]] - CR0 +[[!inline pagenames="openpower/isa/fixedlogical/popcntw" raw="yes"]] -# OR Immediate Shifted +[[!inline pagenames="openpower/isa/fixedlogical/prtyd" raw="yes"]] -D-Form +[[!inline pagenames="openpower/isa/fixedlogical/prtyw" raw="yes"]] -* oris RA,RS,UI +[[!inline pagenames="openpower/isa/fixedlogical/extsw" raw="yes"]] -Pseudo-code: +[[!inline pagenames="openpower/isa/fixedlogical/popcntd" raw="yes"]] - RA <- (RS) | EXTZ(UI || [0]*16) +[[!inline pagenames="openpower/isa/fixedlogical/cntlzd" raw="yes"]] -Special Registers Altered: +[[!inline pagenames="openpower/isa/fixedlogical/cnttzd" raw="yes"]] - None +[[!inline pagenames="openpower/isa/fixedlogical/cntlzdm" raw="yes"]] -# XOR Immediate Shifted +[[!inline pagenames="openpower/isa/fixedlogical/cnttzdm" raw="yes"]] -D-Form +[[!inline pagenames="openpower/isa/fixedlogical/bpermd" raw="yes"]] -* xoris RA,RS,UI +[[!inline pagenames="openpower/isa/fixedlogical/cfuged" raw="yes"]] -Pseudo-code: +[[!inline pagenames="openpower/isa/fixedlogical/pextd" raw="yes"]] - RA <- (RS) ^ EXTZ(UI || [0]*16) - -Special Registers Altered: - - None - -# XOR Immediate - -D-Form - -* xori RA,RS,UI - -Pseudo-code: - - RA <- (RS) ^ EXTZ(UI) - -Special Registers Altered: - - None - -# AND - -X-Form - -* and RA,RS,RB (Rc=0) -* and. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- (RS) & (RB) - -Special Registers Altered: - - CR0 (if Rc=1) - -# OR - -X-Form - -* or RA,RS,RB (Rc=0) -* or. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- (RS) | (RB) - -Special Registers Altered: - - CR0 (if Rc=1) - -# XOR - -X-Form - -* xor RA,RS,RB (Rc=0) -* xor. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- (RS) ^ (RB) - -Special Registers Altered: - - CR0 (if Rc=1) - -# NAND - -X-Form - -* nand RA,RS,RB (Rc=0) -* nand. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- ¬((RS) & (RB)) - -Special Registers Altered: - - CR0 (if Rc=1) - -# NOR - -X-Form - -* nor RA,RS,RB (Rc=0) -* nor. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- ¬((RS) | (RB)) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Equivalent - -X-Form - -* eqv RA,RS,RB (Rc=0) -* eqv. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- ¬((RS) ^ (RB)) - -Special Registers Altered: - - CR0 (if Rc=1) - -# AND with Complement - -X-Form - -* andc RA,RS,RB (Rc=0) -* andc. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- (RS) & ¬(RB) - -Special Registers Altered: - - CR0 (if Rc=1) - -# OR with Complement - -X-Form - -* orc RA,RS,RB (Rc=0) -* orc. RA,RS,RB (Rc=1) - -Pseudo-code: - - RA <- (RS) | ¬(RB) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Extend Sign Byte - -X-Form - -* extsb RA,RS (Rc=0) -* extsb. RA,RS (Rc=1) - -Pseudo-code: - - RA <- EXTSXL(RS, XLEN/8) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Extend Sign Halfword - -X-Form - -* extsh RA,RS (Rc=0) -* extsh. RA,RS (Rc=1) - -Pseudo-code: - - RA <- EXTSXL(RS, XLEN/4) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Count Leading Zeros Word - -X-Form - -* cntlzw RA,RS (Rc=0) -* cntlzw. RA,RS (Rc=1) - -Pseudo-code: - - n <- (XLEN/2) - do while n < XLEN - if (RS)[n] = 1 then - leave - n <- n + 1 - RA <- n - (XLEN/2) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Count Trailing Zeros Word - -X-Form - -* cnttzw RA,RS (Rc=0) -* cnttzw. RA,RS (Rc=1) - -Pseudo-code: - - n <- 0 - do while n < XLEN/2 - if (RS)[XLEN-1-n] = 0b1 then - leave - n <- n + 1 - RA <- EXTZ(n) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Compare Bytes - -X-Form - -* cmpb RA,RS,RB - -Pseudo-code: - - do n = 0 to ((XLEN/8)-1) - if RS[8*n:8* n+7] = (RB)[8*n:8*n+7] then - RA[8*n:8* n+7] <- [1]*8 - else - RA[8*n:8* n+7] <- [0]*8 - -Special Registers Altered: - - None - -# Population Count Bytes - -X-Form - -* popcntb RA,RS - -Pseudo-code: - - do i = 0 to ((XLEN/8)-1) - n <- 0 - do j = 0 to 7 - if (RS)[(i*8)+j] = 1 then - n <- n+1 - RA[(i*8):(i*8)+7] <- n - -Special Registers Altered: - - None - -# Population Count Words - -X-Form - -* popcntw RA,RS - -Pseudo-code: - - e <- (XLEN/2)-1 - do i = 0 to 1 - s <- i*XLEN/2 - n <- 0 - do j = 0 to e - if (RS)[s+j] = 1 then - n <- n+1 - RA[s:s+e] <- n - -Special Registers Altered: - - None - -# Parity Doubleword - -X-Form - -* prtyd RA,RS - -Pseudo-code: - - s <- 0 - do i = 0 to ((XLEN/8)-1) - s <- s ^ (RS)[i*8+7] - RA <- [0] * (XLEN-1) || s - -Special Registers Altered: - - None - -# Parity Word - -X-Form - -* prtyw RA,RS - -Pseudo-code: - - s <- 0 - t <- 0 - do i = 0 to ((XLEN/8/2)-1) - s <- s ^ (RS)[i*8+7] - do i = 4 to ((XLEN/8)-1) - t <- t ^ (RS)[i*8+7] - RA[0:(XLEN/2)-1] <- [0]*((XLEN/2)-1) || s - RA[XLEN/2:XLEN-1] <- [0]*((XLEN/2)-1) || t - -Special Registers Altered: - - None - -# Extend Sign Word - -X-Form - -* extsw RA,RS (Rc=0) -* extsw. RA,RS (Rc=1) - -Pseudo-code: - - RA <- EXTSXL(RS, XLEN/2) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Population Count Doubleword - -X-Form - -* popcntd RA,RS - -Pseudo-code: - - n <- 0 - do i = 0 to (XLEN-1) - if (RS)[i] = 1 then - n <- n+1 - RA <- n - -Special Registers Altered: - - None - -# Count Leading Zeros Doubleword - -X-Form - -* cntlzd RA,RS (Rc=0) -* cntlzd. RA,RS (Rc=1) - -Pseudo-code: - - n <- 0 - do while n < XLEN - if (RS)[n] = 1 then - leave - n <- n + 1 - RA <- n - -Special Registers Altered: - - CR0 (if Rc=1) - -# Count Trailing Zeros Doubleword - -X-Form - -* cnttzd RA,RS (Rc=0) -* cnttzd. RA,RS (Rc=1) - -Pseudo-code: - - n <- 0 - do while n < XLEN - if (RS)[XLEN-1-n] = 0b1 then - leave - n <- n + 1 - RA <- EXTZ(n) - -Special Registers Altered: - - CR0 (if Rc=1) - -# Count Leading Zeros Doubleword under bit Mask - -X-Form - -* cntlzdm RA,RS,RB - -Pseudo-code: - - count <- 0 - do i = 0 to 63 - if (RB)[i] = 1 then - if (RS)[i] = 1 then leave - count <- count + 1 - RA <- EXTZ64(count) - -Special Registers Altered: - - None - -# Count Trailing Zeros Doubleword under bit Mask - -X-Form - -* cnttzdm RA,RS,RB - -Pseudo-code: - - count <- 0 - do i = 0 to 63 - if (RB)[63-i] = 1 then - if (RS)[63-i] = 1 then leave - count <- count + 1 - RA <- EXTZ64(count) - -Special Registers Altered: - - None - -# Bit Permute Doubleword - -X-Form - -* bpermd RA,RS,RB - -Pseudo-code: - - perm <- [0] * (XLEN/8) - for i = 0 to ((XLEN/8)-1) - index <- (RS)[8*i:8*i+7] - if index