1 <!-- Draft Instructions here described in -->
2 <!-- https://libre-soc.org/openpower/sv/bitmanip/ -->
3 <!-- These instructions are *not yet official* -->
20 Special Registers Altered:
24 # Ternary Bitwise Logic Immediate
28 * ternlogi RT,RA,RB,TLI (Rc=0)
29 * ternlogi. RT,RA,RB,TLI (Rc=1)
35 idx <- (RT)[i] || (RA)[i] || (RB)[i]
36 result[i] <- TLI[7-idx]
39 Special Registers Altered:
43 # GPR Dynamic Binary Logic
47 * binlog RT,RA,RB,RC,nh
51 if nh = 1 then lut <- (RC)[56:59]
52 else lut <- (RC)[60:63]
55 idx <- (RA)[i] || (RB)[i]
56 result[i] <- lut[3-idx]
61 If nh contains a 0, let lut be the four LSBs of RC
62 (bits 60 to 63). Otherwise let lut be the next
63 four LSBs of RC (bits 56 to 59).
65 Let j be the value of the concatenation of the
66 contents of bit i of RT with bit i of RB.
68 The value of bit j of lut is placed into bit i of RT.
70 Special registers altered:
74 # Condition Register Ternary Bitwise Logic Immediate
78 * crternlogi BF,BFA,BFB,TLI,msk
82 bf <- CR[4*BF+32:4*BF+35]
83 bfa <- CR[4*BFA+32:4*BFA+35]
84 bfb <- CR[4*BFB+32:4*BFB+35]
88 idx <- bf[i] || bfa[i] || bfb[i]
89 result[i] <- TLI[7-idx]
92 CR[4*BF+32+i] <- result[i]
94 Special Registers Altered:
98 # Condition Register Field Dynamic Binary Logic
102 * crbinlog BF,BFA,BFB,msk
106 a <- CR[4*BF+32:4*BFA+35]
107 b <- CR[4*BFA+32:4*BFA+35]
108 lut <- CR[4*BFB+32:4*BFB+35]
113 result[i] <- lut[3-idx]
116 CR[4*BF+32+i] <- result[i]
120 For each integer value i, 0 to 3, do the following.
122 Let j be the value of the concatenation of the
123 contents of bit i of CR Field BF with bit i of CR Field BFA.
125 If bit i of msk is set to 1 then the value of bit j of
126 CR Field BFB is placed into bit i of CR Field BF.
128 Otherwise, if bit i of msk is a zero then bit i of
129 CR Field BF is unchanged.
131 If `msk` is zero an Illegal Instruction trap is raised.
133 Special registers altered:
137 # Add With Shift By Immediate
141 * sadd RT,RA,RB,SH (Rc=0)
142 * sadd. RT,RA,RB,SH (Rc=1)
147 m <- ((0b0 || SH) + 1)
148 RT <- (n[m:XLEN-1] || [0]*m) + (RA)
150 Special Registers Altered:
154 # Add With Shift By Immediate Word
158 * saddw RT,RA,RB,SH (Rc=0)
159 * saddw. RT,RA,RB,SH (Rc=1)
163 n <- ([0]*(XLEN/2)) || (RB)[XLEN/2:XLEN-1]
164 if (RB)[XLEN/2] = 1 then
165 n[0:XLEN/2-1] <- [1]*(XLEN/2)
166 m <- ((0b0 || SH) + 1)
167 RT <- (n[m:XLEN-1] || [0]*m) + (RA)
169 Special Registers Altered:
173 # Add With Shift By Immediate Unsigned Word
177 * sadduw RT,RA,RB,SH (Rc=0)
178 * sadduw. RT,RA,RB,SH (Rc=1)
182 n <- ([0]*(XLEN/2)) || (RB)[XLEN/2:XLEN-1]
183 m <- ((0b0 || SH) + 1)
184 RT <- (n[m:XLEN-1] || [0]*m) + (RA)
186 Special Registers Altered: