MicroBlaze Processor Reference Guide
187
UG081 (v14.7)
Instructions
bsi
Barrel Shift Immediate
Description
Shifts the contents of register rA by the amount specified by IMM and puts the result in register rD.
The mnemonic bsll sets the S bit (Side bit). If the S bit is set, the barrel shift is done to the left. The
mnemonics bsrl and bsra clear the S bit and the shift is done to the right.
The mnemonic bsra will set the T bit (Type bit). If the T bit is set, the barrel shift performed is
Arithmetical. The mnemonics bsrl and bsll clear the T bit and the shift performed is Logical.
Pseudocode
if S = 1 then
(rD)
←
(rA)
<<
IMM
else
if T = 1 then
if IMM
≠
0 then
(rD)[0:IMM-1]
←
(rA)
[0
]
(rD)[IMM:31]
←
(rA)
>>
IMM
else
(rD)
←
(rA)
else
(rD)
←
(rA)
>>
IMM
Registers Altered
•
rD
Latency
•
1 cycle with
C_AREA_OPTIMIZED=0
•
2 cycles with
C_AREA_OPTIMIZED=1
Notes
These are not Type B Instructions. There is no effect from a preceding imm instruction.
These instructions are optional. To use them, MicroBlaze has to be configured to use barrel shift
instructions (
C_USE_BARREL=1
).
bsrli
rD, rA, IMM
Barrel Shift Right Logical Immediate
bsrai
rD, rA, IMM
Barrel Shift Right Arithmetical Immediate
bslli
rD, rA, IMM
Barrel Shift Left Logical Immediate
0 1 1 0 0 1
rD
rA
0 0 0 0 0 S T 0 0 0 0
IMM
0
6
1
1
1
6
2
1
2
7
3
1