ABS
Integer Absolute Value With Saturation
3-28
Syntax
ABS (.unit)
src2, dst
.unit = .L1, .L2
Opcode map field used...
For operand type...
Unit
Opfield
src2
dst
xsint
sint
.L1, .L2
0011010
src2
dst
slong
slong
.L1, L2
0111000
Opcode
31
29 28 27
23 22
18 17
creg
z
dst
13 12 11
5
4
3
2
1
0
x
op
1
1
0
s
p
3
5
5
5
7
src2
0 0 0 0 0
Description
The absolute value of
src2 is placed in dst.
Execution
if (cond)
abs(
src2)
→
dst
else
nop
The absolute value of
src2 when src2 is an sint is determined as follows:
1) If
src2
w
0, then
src2
→
dst
2) If
src2
t
0 and
src2
–2
31
, then –
src2
→
dst
3) If
src2 = –2
31
, then 2
31
– 1
→
dst
The absolute value of
src2 when src2 is an slong is determined as follows:
1) If
src2
w
0, then
src2
→
dst
2) If
src2
t
0 and
src2
–2
39
, then –
src2
→
dst
3) If
src2 = –2
39
, then 2
39
– 1
→
dst
Pipeline
Stage
E1
Read
src2
Written
dst
Unit in use
.L
Instruction Type
Single-cycle
Delay Slots
0
Pipeline