|
MSA 011110 |
011 |
df |
wt |
ws |
wd |
3R 010000 |
|
6 |
3 |
2 |
5 |
5 |
5 |
6 |
ADDS_U.df |
Vector Unsigned Saturated Add of Unsigned Values | |
ADDS_U.B wd,ws,wt |
MSA |
Vector Unsigned Saturated Add of Unsigned Values |
ADDS_U.H wd,ws,wt |
MSA |
Vector Unsigned Saturated Add of Unsigned Values |
ADDS_U.W wd,ws,wt |
MSA |
Vector Unsigned Saturated Add of Unsigned Values |
ADDS_U.D wd,ws,wt |
MSA |
Vector Unsigned Saturated Add of Unsigned Values |
Vector Unsigned Saturated Add of Unsigned Values
Vector addition to vector saturating the result as unsigned value.
wd[i] = saturate_unsigned(unsigned(ws[i]) + unsigned(wt[i]))
The elements in v ector wt are added to the elements in vector ws. Unsigned arithmetic is performed and overflows clamp to the largest representable unsigned value before writing the result to vector wd.
The operands and results are values in integer data format df.
No data-dependent exceptions are possible.
ADDS_U.B:
for i in 0 .. WRLEN/8-1
WR[wd]8i+7..8i = adds_u(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
endfor
ADDS_U.H:
for i in 0 .. WRLEN/16-1
WR[wd]16i+15..16i = adds_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
endfor
ADDS_U.W:
for i in 0 .. WRLEN/32-1
WR[wd]32i+31..32i = adds_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
endfor
ADDS_U.D:
for i in 0 .. WRLEN/64-1
WR[wd]64i+63..64i = adds_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
endfor
function sat_u(tt, n, b)
if ttn-1..b != 0n-b then
return 0n-b || 1b
else
return tt
endif
endfunction sat_u
function adds_u(ts, tt, n)
t = (0 || ts) + (0 || tt)
return sat_u(t, n+1, n)
endfunction adds_u
Reserved Instruction Exception, MSA Disabled Exception.