Encoding:

MSA

011110

110

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

MAX_A.df 

Vector Maximum Based on Absolute Values

MAX_A.B wd,ws,wt

MSA

Vector Maximum Based on Absolute Values

MAX_A.H wd,ws,wt

MSA

Vector Maximum Based on Absolute Values

MAX_A.W wd,ws,wt

MSA

Vector Maximum Based on Absolute Values

MAX_A.D wd,ws,wt

MSA

Vector Maximum Based on Absolute Values

Purpose:

Vector Maximum Based on Absolute Values

Vector and vector maximum based on the absolute values.

Description:

wd[i] = absolute_value(ws[i]) > absolute_value(wt[i])? ws[i]: wt[i]

The value with the largest magnitude, i.e. absolute value, between corresponding signed elements in vector ws and vector wt are written to vector wd.

The minimum negative value representable has the largest absolute value.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MAX_A.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = max_a(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
MAX_A.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = max_a(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MAX_A.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = max_a(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
MAX_A.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = max_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 max_a(ts, tt, n)
   t = 0 || abs(tt, n)
   s = 0 || abs(ts, n)
   if t < s then
      return ts
   else
      return tt
   endif
endfunction max_a

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.