![](http://datasheet.mmic.net.cn/260000/PTM1300FBEA_datasheet_15959396/PTM1300FBEA_320.png)
TM1300 Data Book
Philips Semiconductors
A-34
PRODUCT SPECIFICATION
dualasr
Dual-16 arithmetic shift right
SYNTAX
[ IF rguard ] dualasr rsrc1 rsrc2
→
rdest
FUNCTION
if
rguard
then {
n <- rsrc2<3:0>
rdest<31:31-n> <- rsrc1<31>
rdest<30-n:16> <- rsrc1<30:16+n>
rdest<15:15-n> <- rsrc1<15>
rdest<14-n:0> <- rsrc1<14:n>
if rsrc2<31:4> != 0 {
rdest<31:16> <- rsrc1<31>
rdest<15:0> <- rsrc1<15>
}
}
DESCRIPTION
The argument rsrc1 contains two 16-bit signed integers, rsrc1<31:16> and rsrc1<15:0>. Rsrc2 specifies an
unsigned shift amount, and the two 16-bit integers shifted right by this amount. The sign bits rsrc1<31> and rsrc1<15>
are replicated as needed within each 16-bit value from the left. If the rsrc2<31:4> value is not zero, then take this as a
shift by 16 or more, i.e. extend the sign bit into either result.
ATTRIBUTES
Function unit
Operation code
Number of operands
Modifier
Modifier range
Latency
Issue slots
shifter
102
2
No
-
1
1,2
The dualasr 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 rguard is 1, rdest is written; otherwise, rdest is not changed.
EXAMPLES
Initial Values
Operation
Result
r30 = 0x70087008, r40 = 0x1
r30 = 0x70087008, r40 = 0x2
r10 = 0, r30 = 0x70087008, r40 = 0x2
r10 = 1, r30 = 0x70084008, r40 = 0x4
r10 = 1, r30 = 0x800c800c, r40 = 0x4
r10 = 1, r30 = 0x700c700c, r40 = 0xf
r10 = 1, r30 = 0x700c800c, r40 = 0xf
r10 = 1, r30 = 0x800c700c, r40 = 0xf
r10 = 1, r30 = 0x800c700c, r40 = 0x10000000
IF r10 dualasr r30 r40 -> r50
r10 = 1, r30 = 0x800c700c, r40 = 0x10
dualasr r30 r40 -> r50
dualasr r30 r40 -> r50
IF r10 dualasr r30 r40 -> r50
IF r10 dualasr r30 r40 -> r50
IF r10 dualasr r30 r40 -> r50
IF r10 dualasr r30 r40 -> r50
IF r10 dualasr r30 r40 -> r50
IF r10 dualasr r30 r40 -> r50
r50 <- 0x38043804
r50 <- 0x1c021c02
no change, since guard is false
r50 <- 0x07000400
r50 <- 0xf800f800
r50 <- 0x00000000
r50 <- 0x0000ffff
r50 <- 0xffff0000
r50 <- 0xffff0000
r50 <- 0xffff0000
IF r10 dualasr r30 r40 -> r50
0
3
rsrc1
0
3
rsrc2
n
Right shifter
0
31
rdest
28
S
S
S
Four LSBs of rsrc2
S
S
S
15
Right shifter
Four LSBs of rsrc2
S
S
S
Lower 13 bits
Intermediate result
(example: n= 3)
S
S
S
S
Lower 13 bits
Intermediate result
(example: n= 3)
S
15
12
S
S
S
S
SEE ALSO
asl asli asri lsl lsli lsr
lsri rol roli