R

Chapter 4: MicroBlaze Instruction Set Architecture

bsi

Barrel Shift Immediate

 

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

11

16

21

27

31

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

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).

98

www.xilinx.com

MicroBlaze Processor Reference Guide

 

1-800-255-7778

UG081 (v6.0) June 1, 2006

Page 98
Image 98
Xilinx EDK 8.2i manual Bsi, Barrel Shift Immediate Bsrli, Bsrai, Bslli