
TM1100 Preliminary Data Book
Philips Semiconductors
A-134
PRELIMINARY INFORMATION
File: ops.fm5, modified 7/23/99
Logical shift right
SYNTAX
[ IF r
guard ] lsr rsrc1 rsrc2
→ rdest
FUNCTION
if r
guard then {
n
← rsrc2<4:0>
r
dest<31:32–n>
← 0
r
dest<31–n:0>
← rsrc1<31:n>
if rsrc2<31:5> != 0 {
rdest <- rsrc1<31>
}
}
ATTRIBUTES
Function unit
shifter
Operation code
96
Number of operands
2
Modier
No
Modier range
—
Latency
1
Issue slots
1, 2
DESCRIPTION
As shown below, the lsr operation takes two arguments, r
src1 and rsrc2. Rsrc2 species an unsigned shift
amount, and r
src1 is arithmetically 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 ll vacated bits from the left.
The lsr operation optionally takes a guard, specied in r
guard. If a guard is present, its LSB controls the
modication of the destination register. If the LSB of r
guard is 1, rdest is written; otherwise, rdest is unchanged.
EXAMPLES
Initial Values
Operation
Result
r30 = 0x7008000f, r20 = 1
lsr r30 r20
→ r50
r50
← 0x38040007
r30 = 0x7008000f, r42 = 2
lsr r30 r42
→ r60
r60
← 0x1c020003
r10 = 0, r30 = 0x7008000f, r44 = 4
IF r10 lsr r30 r44
→ r70
no change, since guard is false
r20 = 1, r30 = 0x7008000f, r44 = 4
IF r20 lsr r30 r44
→ r80
r80
← 0x07008000
r40 = 0x80030007, r44 = 4
lsr r40 r44
→ r90
r90
← 0x08003000
r30 = 0x7008000f, r45 = 0x1f
lsr r30 r45
→ r100
r100
← 0x00000000
r30 = 0x8008000f, r45 = 0x1f
lsr r30 r45
→ r100
r100
← 0x00000001
r30 = 0x7008000f, r45 = 0x20
lsr r30 r45
→ r100
r100
← 0x00000000
r30 = 0x8008000f, r45 = 0x80000000
lsr r30 r45
→ r100
r100
← 0x00000000
r30 = 0x8008000f, r45 = 0x23
lsr r30 r45
→ r100
r100
← 0x00000000
0
31
r
src1
0
31
r
src2
0
Right shifter
32 bits from r
src1
0
3
r
dest
2
0
Intermediate result
(example:
n = 3)
r
src2
S
SEE ALSO
lsr