6 //9 SHIFT/ROTATE OPERATIONS
9 //Preg = ( Preg + Preg ) << 1 ; /* dest_reg = (dest_reg + src_reg) x 2 (a) */
17 //Preg = ( Preg + Preg ) << 2 ; /* dest_reg = (dest_reg + src_reg) x 4 (a) */
25 //Dreg = (Dreg + Dreg) << 1 ; /* dest_reg = (dest_reg + src_reg) x 2 (a) */
34 //Dreg = (Dreg + Dreg) << 2 ; /* dest_reg = (dest_reg + src_reg) x 4 (a) */
42 //Preg = Preg + ( Preg << 1 ) ; /* adder_pntr + (src_pntr x 2) (a) */
54 //Preg = Preg + ( Preg << 2 ) ; /* adder_pntr + (src_pntr x 4) (a) */
66 //Dreg >>>= uimm5 ; /* arithmetic right shift (a) */
74 //Dreg <<= uimm5 ; /* logical left shift (a) */
81 //Dreg_lo_hi = Dreg_lo_hi >>> uimm4 ; /* arithmetic right shift (b) */
109 //Dreg_lo_hi = Dreg_lo_hi << uimm4 (S) ; /* arithmetic left shift (b) */
111 R0.L = R0.L << 15(S);
113 R0.L = R0.H << 15(S);
115 R0.H = R0.L << 15(S);
117 R0.H = R0.H << 15(S);
120 R0.L = R1.L << 15(S);
122 R0.L = R1.H << 15(S);
124 R0.H = R1.L << 15(S);
126 R0.H = R1.H << 15(S);
129 R1.L = R6.L << 15(S);
131 R3.L = R4.H << 15(S);
133 R5.H = R2.L << 15(S);
135 R7.H = R0.H << 15(S);
136 //Dreg = Dreg >>> uimm5 ; /* arithmetic right shift (b) */
150 //Dreg = Dreg << uimm5 (S) ; /* arithmetic left shift (b) */
163 //A0 = A0 >>> uimm5 ; /* arithmetic right shift (b) */
168 //A0 = A0 << uimm5 ; /* logical left shift (b) */
173 //A1 = A1 >>> uimm5 ; /* arithmetic right shift (b) */
178 //A1 = A1 << uimm5 ; /* logical left shift (b) */
183 //Dreg >>>= Dreg ; /* arithmetic right shift (a) */
189 //Dreg <<= Dreg ; /* logical left shift (a) */
195 //Dreg_lo_hi = ASHIFT Dreg_lo_hi BY Dreg_lo (opt_sat) ; /* arithmetic right shift (b) */
196 r3.l = ashift r0.h by r7.l ; /* shift, half-word */
197 r3.h = ashift r0.l by r7.l ;
198 r3.h = ashift r0.h by r7.l ;
199 r3.l = ashift r0.l by r7.l ;
200 r3.l = ashift r0.h by r7.l(s) ; /* shift, half-word, saturated */
201 r3.h = ashift r0.l by r7.l(s) ; /* shift, half-word, saturated */
202 r3.h = ashift r0.h by r7.l(s) ;
203 r3.l = ashift r0.l by r7.l (s) ;
205 //Dreg = ASHIFT Dreg BY Dreg_lo (opt_sat) ; /* arithmetic right shift (b) */
206 r4 = ashift r2 by r7.l ; /* shift, word */
207 r4 = ashift r2 by r7.l (s) ; /* shift, word, saturated */
209 //A0 = ASHIFT A0 BY Dreg_lo ; /* arithmetic right shift (b)*/
210 A0 = ashift A0 by r7.l ; /* shift, Accumulator */
212 //A1 = ASHIFT A1 BY Dreg_lo ; /* arithmetic right shift (b)*/
213 A1 = ashift A1 by r7.l ; /* shift, Accumulator */
215 p3 = p2 >> 1 ; /* pointer right shift by 1 */
216 p3 = p3 >> 2 ; /* pointer right shift by 2 */
217 p4 = p5 << 1 ; /* pointer left shift by 1 */
218 p0 = p1 << 2 ; /* pointer left shift by 2 */
219 r3 >>= 17 ; /* data right shift */
220 r3 <<= 17 ; /* data left shift */
221 r3.l = r0.l >> 4 ; /* data right shift, half-word register */
222 r3.l = r0.h >> 4 ; /* same as above; half-word register combinations are arbitrary */
223 r3.h = r0.l << 12 ; /* data left shift, half-word register */
224 r3.h = r0.h << 14 ; /* same as above; half-word register combinations are arbitrary */
226 r3 = r6 >> 4 ; /* right shift, 32-bit word */
227 r3 = r6 << 4 ; /* left shift, 32-bit word */
229 a0 = a0 >> 7 ; /* Accumulator right shift */
230 a1 = a1 >> 25 ; /* Accumulator right shift */
231 a0 = a0 << 7 ; /* Accumulator left shift */
232 a1 = a1 << 14 ; /* Accumulator left shift */
234 r3 >>= r0 ; /* data right shift */
235 r3 <<= r1 ; /* data left shift */
237 r3.l = lshift r0.l by r2.l ; /* shift direction controlled by sign of R2.L */
238 r3.h = lshift r0.l by r2.l ;
240 a0 = lshift a0 by r7.l ;
241 a1 = lshift a1 by r7.l ;
243 r4 = rot r1 by 31 ; /* rotate left */
244 r4 = rot r1 by -32 ; /* rotate right */
245 r4 = rot r1 by 5 ; /* rotate right */
247 a0 = rot a0 by 22 ; /* rotate Accumulator left */
248 a0 = rot a0 by -32 ; /* rotate Accumulator left */
249 a0 = rot a0 by 31 ; /* rotate Accumulator left */
251 a1 = rot a1 by -32 ; /* rotate Accumulator right */
252 a1 = rot a1 by 31 ; /* rotate Accumulator right */
253 a1 = rot a1 by 22 ; /* rotate Accumulator right */
255 r4 = rot r1 by r2.l ;
256 a0 = rot a0 by r3.l ;
257 a1 = rot a1 by r7.l ;
283 r0.l = r1.h << 0 (S);
284 r0.l = r1.h << 1 (S);
285 r0.l = r1.h << 2 (S);
286 r0.l = r1.h << 4 (S);
287 r0.l = r1.h >>> 1 (S);
288 r0.l = r1.h >>> 2 (S);
289 r0.l = r1.h >>> 4 (S);