|
MSA 011110 |
011 |
df |
wt |
ws |
wd |
3R 010001 |
|
6 |
3 |
2 |
5 |
5 |
5 |
6 |
SUBSUU_S.df |
Vector Signed Saturated Subtract of Unsigned Values | |
SUBSUU_S.B wd,ws,wt |
MSA |
Vector Signed Saturated Subtract of Unsigned Values |
SUBSUU_S.H wd,ws,wt |
MSA |
Vector Signed Saturated Subtract of Unsigned Values |
SUBSUU_S.W wd,ws,wt |
MSA |
Vector Signed Saturated Subtract of Unsigned Values |
SUBSUU_S.D wd,ws,wt |
MSA |
Vector Signed Saturated Subtract of Unsigned Values |
Vector Signed Saturated Subtract of Unsigned Values
Vector subtraction from vector of unsigned values saturating the results as signed values.
wd[i] = saturate_signed(unsigned(ws[i]) - unsigned(wt[i]))
The unsigned elements in vector wt are subtracted from the unsigned elements in v ector ws. The si gned result is signed saturated and written to vector wd.
The operands and results are values in integer data format df.
No data-dependent exceptions are possible.
SUBSUU_S.B
for i in 0 .. WRLEN/8-1
WR[wd]8i+7..8i = subsuu_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
endfor
SUBSUU_S.H
for i in 0 .. WRLEN/16-1
WR[wd]16i+15..16i = subsuu_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
endfor
SUBSUU_S.W
for i in 0 .. WRLEN/32-1
WR[wd]32i+31..32i = subsuu_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
endfor
SUBSUU_S.D
for i in 0 .. WRLEN/64-1
WR[wd]64i+63..64i = subsuu_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
endfor
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 subsuu_s(ts, tt, n)
t = (0 || ts) - (0 || tt)
return sat_s(t, n+1, n)
endfunction subsuu_s
Reserved Instruction Exception, MSA Disabled Exception.