Xilinx MicroBlaze Reference Manual page 221

Hide thumbs Also See for MicroBlaze:
Table of Contents

Advertisement

bs
Barrel Shift
rD, rA, rB
bsrl
bsra
rD, rA, rB
rD, rA, rB
bsll
0 1 0 0 0 1
0
6
Description
Shifts the contents of register rA by the amount specified in register rB 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)
else
if T = 1 then
if ((rB)[27:31])
(rD)[0:(rB)[27:31]-1]
(rD)[(rB)[27:31]:31]
else
(rD)
else
(rD)
(rA)
Registers Altered
rD
Latency
1 cycle with
2 cycles with
Note
These instructions are optional. To use them, MicroBlaze has to be configured to use barrel shift
instructions (C_USE_BARREL=1).
MicroBlaze Processor Reference Guide
UG984 (v2018.2) June 21, 2018
Barrel Shift Right Logical
Barrel Shift Right Arithmetical
Barrel Shift Left Logical
rD
rA
11
< <
(rB)[27:31]
0 then
(rA)[0]
> >
(rA)
(rA)
> >
(rB)[27:31]
=0 or 2
C_AREA_OPTIMIZED
=1
C_AREA_OPTIMIZED
www.xilinx.com
Chapter 5: MicroBlaze Instruction Set Architecture
rB
S T 0 0 0 0 0 0 0 0 0
16
21
(rB)[27:31]
31
222
Send Feedback

Advertisement

Table of Contents
loading

Table of Contents