MSA 011110 |
001 |
df |
wt |
ws |
wd |
3R 010000 |
6 |
3 |
2 |
5 |
5 |
5 |
6 |
ADDS_A.df |
Vector Saturated Add of Absolute Values | |
ADDS_A.B wd,ws,wt |
MSA |
Vector Saturated Add of Absolute Values |
ADDS_A.H wd,ws,wt |
MSA |
Vector Saturated Add of Absolute Values |
ADDS_A.W wd,ws,wt |
MSA |
Vector Saturated Add of Absolute Values |
ADDS_A.D wd,ws,wt |
MSA |
Vector Saturated Add of Absolute Values |
Vector Saturated Add of Absolute Values
Vector saturated addition to vector of absolute values.
wd[i] = saturate_signed(absolute_value(ws[i]) + absolute_value(wt[i]))
The absolute values of the elements in v ector wt are added to the absolute values of the elements in v ector ws. The saturated signed result is written to vector wd.
The operands and results are values in integer data format df.
No data-dependent exceptions are possible.
ADDS_A.B: for i in 0 .. WRLEN/8-1 WR[wd]8i+7..8i = adds_a(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8) endfor ADDS_A.H: for i in 0 .. WRLEN/16-1 WR[wd]16i+15..16i = adds_a(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16) endfor ADDS_A.W: for i in 0 .. WRLEN/32-1 WR[wd]32i+31..32i = adds_a(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32) endfor ADDS_A.D: for i in 0 .. WRLEN/64-1 WR[wd]64i+63..64i = adds_a(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64) endfor function abs(tt, n) if ttn-1 = 1 then return -ttn-1...0 else return ttn-1..0 endif endfunction abs function sat_s(tt, n, b) if ttn-1 = 0 and ttn-1..b-1 != 0n-b+1 then return 0n-b+1 || 1b-1 endif if ttn-1 = 1 and ttn-1..b-1 != 1n-b+1 then return 1n-b+1 || 0b-1 else return tt endif endfunction sat_s function adds_a(ts, tt, n) t = (0 || abs(ts, n)) + (0 || abs(tt, n)) return sat_s(t, n+1, n) endfunction adds_a
Reserved Instruction Exception, MSA Disabled Exception.