ABS Absolute Value With Saturation
3-38 Instruction Set SPRU733
Absolute Value With SaturationABS
Syntax ABS (.unit) src2, dst
.unit = .L1 or .L2
Compatibility C62x, C64x, C67x, and C67x+ CPU
Opcode
31 29 28 27 23 22 18 17 13 12 11 5 4 3 2 1 0
creg z dst src2 00000x op 1 1 0 s p
3 1 5 5 1 7 1 1
Opcode map field used... For operand type... Unit Opfield
src2
dst
xsint
sint
.L1, .L2 0011010
src2
dst
slong
slong
.L1, L2 0111000
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 0, then src2 dst
2) If src2 0 and src2 231, then src2 dst
3) If src2 = 231, then 231 1 dst
The absolute value of src2 when src2 is an slong is determined as follows:
1) If src2 0, then src2 dst
2) If src2 0 and src2 239, then src2 dst
3) If src2 = 239, then 239 1 dst
Pipeline
Stage E1
Read src2
Written dst
Unit in use .L
Pipeline