![](http://datasheet.mmic.net.cn/260000/PTM1300FBEA_datasheet_15959396/PTM1300FBEA_420.png)
TM1300 Data Book
Philips Semiconductors
A-134
PRODUCT SPECIFICATION
Logical shift right
SYNTAX
[ IF rguard ] lsr rsrc1 rsrc2
→
rdest
FUNCTION
if
rguard
then {
n
←
rsrc2<4:0>
rdest<31:32–n>
←
0
rdest<31–n:0>
←
rsrc1<31:n>
if rsrc2<31:5> != 0 {
rdest <- 0
}
}
ATTRIBUTES
Function unit
Operation code
Number of operands
Modifier
Modifier range
Latency
Issue slots
shifter
96
2
No
—
1
1, 2
DESCRIPTION
As shown below, the
lsr
operation takes two arguments, rsrc1and rsrc2 Rsrc2specifies an unsigned shift amount,
and rsrc1 is logically shifted right by this amount. If the rsrc2<31:5> value is not zero, then take this as a shift by 32 or
more bits. Zeros fill vacated bits from the left.
The
lsr
operation optionally takes a guard, specified in rguard If a guard is present, its LSB controls the
modification of the destination register. If the LSB of rguardis 1, rdestis written; otherwise, rdestis unchanged.
EXAMPLES
Initial Values
Operation
Result
r30 = 0x7008000f, r20 = 1
r30 = 0x7008000f, r42 = 2
r10 = 0, r30 = 0x7008000f, r44 = 4
r20 = 1, r30 = 0x7008000f, r44 = 4
r40 = 0x80030007, r44 = 4
r30 = 0x7008000f, r45 = 0x1f
r30 = 0x8008000f, r45 = 0x1f
r30 = 0x7008000f, r45 = 0x20
r30 = 0x8008000f, r45 = 0x80000000
r30 = 0x8008000f, r45 = 0x23
lsr r30 r20
→
r50
lsr r30 r42
→
r60
IF r10 lsr r30 r44
→
r70
IF r20 lsr r30 r44
→
r80
lsr r40 r44
→
r90
lsr r30 r45
→
r100
lsr r30 r45
→
r100
lsr r30 r45
→
r100
lsr r30 r45
→
r100
lsr r30 r45
→
r100
r50
←
0x38040007
r60
←
0x1c020003
no change, since guard is false
r80
←
0x07008000
r90
←
0x08003000
r100
←
0x00000000
r100
←
0x00000001
r100
←
0x00000000
r100
←
0x00000000
r100
←
0x00000000
0
31
rsrc1
0
31
rsrc2
0
0
0
Right shifter
32 bits from rsrc1
0
3
rdest
2
0
0
0
Intermediate result
(example: n= 3)
rsrc2
S
S
S
SEE ALSO
asl asli asr asri lsl lsli
lsri rol roli
lsr