Encoding:

MSA

011110

001

df

wt

ws

wd

3R

010001

6

3

2

5

5

5

6

Format:

SUBS_U.df 

Vector Unsigned Saturated Subtract of Unsigned Values

SUBS_U.B wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Unsigned Values

SUBS_U.H wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Unsigned Values

SUBS_U.W wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Unsigned Values

SUBS_U.D wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Unsigned Values

Purpose:

Vector Unsigned Saturated Subtract of Unsigned Values

Vector subtraction from vector saturating the result as unsigned value.

Description:

wd[i] = saturate_unsigned(unsigned(ws[i]) - unsigned(wt[i]))

The elements in vector wt are subtracted from the elements in vector ws. Unsigned arithmetic is performed and underflows clamp to 0 before writing the result to vector wd.

The operands and results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SUBS_U.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = subs_u(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
SUBS_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = subs_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
SUBS_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = subs_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
SUBS_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = subs_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 subs_u(ts, tt, n)
   t = (0 || ts) - (0 || tt)
   if tn = 0
      return sat_u(t, n+1, n)
   else
      return 0
endfunction subs_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.