Encoding:

MSA

011110

001

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

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

Purpose:

Vector Saturated Add of Absolute Values

Vector saturated addition to vector of absolute values.

Description:

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.

Restrictions:

No data-dependent exceptions are possible.

Operation:

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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

ADDS_S.df 

Vector Signed Saturated Add of Signed Values

ADDS_S.B wd,ws,wt

MSA

Vector Signed Saturated Add of Signed Values

ADDS_S.H wd,ws,wt

MSA

Vector Signed Saturated Add of Signed Values

ADDS_S.W wd,ws,wt

MSA

Vector Signed Saturated Add of Signed Values

ADDS_S.D wd,ws,wt

MSA

Vector Signed Saturated Add of Signed Values

Purpose:

Vector Signed Saturated Add of Signed Values

Vector addition to vector saturating the result as signed value.

Description:

wd[i] = saturate_signed(signed(ws[i]) + signed(wt[i]))

The elements in v ector wt are added to the ele ments in vector ws. Signed arithmetic is performed and overflows clamp to the largest and/or smallest representable signed values 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:

ADDS_S.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = adds_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
ADDS_S.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = adds_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
ADDS_S.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = adds_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
ADDS_S.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = adds_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 adds_s(ts, tt, n)
   t = (tsn-1 || ts) + (ttn-1 || tt)
   return sat_s(t, n+1, n)
endfunction adds_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

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

Purpose:

Vector Unsigned Saturated Add of Unsigned Values

Vector addition to vector saturating the result as unsigned value.

Description:

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.

Restrictions:

No data-dependent exceptions are possible.

Operation:

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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

ADDV.df 

Vector Add

ADDV.B wd,ws,wt

MSA

Vector Add

ADDV.H wd,ws,wt

MSA

Vector Add

ADDV.W wd,ws,wt

MSA

Vector Add

ADDV.D wd,ws,wt

MSA

Vector Add

Purpose:

Vector Add

Vector addition to vector.

Description:

wd[i] = ws[i] + wt[i]

The elements in vector wt are added to the elements in vector ws. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ADDV.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i + WR[wt]8i+7..8i
   endfor
ADDV.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i + WR[wt]16i+15..16i
   endfor
ADDV.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i + WR[wt]32i+31..32i
   endfor
ADDV.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i + WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

u5

ws

wd

I5

000110

6

3

2

5

5

5

6

Format:

ADDVI.df 

Immediate Add

ADDVI.B wd,ws,u5

MSA

Immediate Add

ADDVI.H wd,ws,u5

MSA

Immediate Add

ADDVI.W wd,ws,u5

MSA

Immediate Add

ADDVI.D wd,ws,u5

MSA

Immediate Add

Purpose:

Immediate Add

Immediate addition to vector.

Description:

wd[i] = ws[i] + u5

The 5-bit immediate unsigned value u5 is added to the elements in vector ws. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ADDVI.B:
   t = 03 || u54..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i + t
   endfor
ADDVI.H:
   t = 011 || u54..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i + t
   endfor
ADDVI.W:
   t = 027 || u54..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i + t
   endfor
ADDVI.D:
   t = 059 || u54..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i + t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

ADD_A.df 

Vector Add Absolute Values

ADD_A.B wd,ws,wt

MSA

Vector Add Absolute Values

ADD_A.H wd,ws,wt

MSA

Vector Add Absolute Values

ADD_A.W wd,ws,wt

MSA

Vector Add Absolute Values

ADD_A.D wd,ws,wt

MSA

Vector Add Absolute Values

Purpose:

Vector Add Absolute Values

Vector addition to vector using the absolute values.

Description:

wd[i] = 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 result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ADD_A.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = abs(WR[ws]8i+7..8i, 8) + abs(WR[wt]8i+7..8i, 8)
   endfor
ADD_A.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = abs(WR[ws]16i+15..16i, 16) + abs(WR[wt]16i+15..16i, 16)
   endfor
ADD_A.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = abs(WR[ws]32i+31..32i, 32) + abs(WR[wt]32i+31..32i, 32)
   endfor
ADD_A.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = abs(WR[ws]64i+63..64i, 64) + abs(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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00000

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

AND.V 

Vector Logical And

AND.V wd,ws,wt

MSA

Vector Logical And

Purpose:

Vector Logical And

Vector by vector logical and.

Description:

wd = ws AND wt

Each bit of vector ws is combined with the corresponding bit of vector wt in a bitwise logical AND operation. The result is written to vector wd.

The operands and results are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = WR[ws] and WR[wt]

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00

i8

ws

wd

I8

000000

6

2

8

5

5

6

Format:

ANDI.B 

Immediate Logical And

ANDI.B wd,ws,i8

MSA

Immediate Logical And

Purpose:

Immediate Logical And

Immediate by vector logical and.

Description:

wd[i] = ws[i] AND i8

Each byte element of vector ws is combined with the 8-bit immediate i8 in a bitwise logical AND operation. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

 for i in 0 .. WRLEN/8-1
   WR[wd]8i+7..8i = WR[ws]8i+7..8i and i87..0
endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

010001

6

3

2

5

5

5

6

Format:

ASUB_S.df 

Vector Absolute Values of Signed Subtract

ASUB_S.B wd,ws,wt

MSA

Vector Absolute Values of Signed Subtract

ASUB_S.H wd,ws,wt

MSA

Vector Absolute Values of Signed Subtract

ASUB_S.W wd,ws,wt

MSA

Vector Absolute Values of Signed Subtract

ASUB_S.D wd,ws,wt

MSA

Vector Absolute Values of Signed Subtract

Purpose:

Vector Absolute Values of Signed Subtract

Vector subtraction from vector of signed values taking the absolute value of the results.

Description:

wd[i] = absolute_value(signed(ws[i]) - signed(wt[i]))

The signed elements in v ector wt are subtracted from the signed elements in v ector ws. The absolute value of the signed result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ASUB_S.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = asub_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
ASUB_S.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = asub_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
ASUB_S.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = asub_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
ASUB_S.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = asub_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function asub_s(ts, tt, n)
   t = (tsn-1 || ts) - (ttn-1 || tt)
   if tn = 0 then
      return tn-1..0
   else
      return (-t)n-1..0
endfunction asub_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

010001

6

3

2

5

5

5

6

Format:

ASUB_U.df 

Vector Absolute Values of Unsigned Subtract

ASUB_U.B wd,ws,wt

MSA

Vector Absolute Values of Unsigned Subtract

ASUB_U.H wd,ws,wt

MSA

Vector Absolute Values of Unsigned Subtract

ASUB_U.W wd,ws,wt

MSA

Vector Absolute Values of Unsigned Subtract

ASUB_U.D wd,ws,wt

MSA

Vector Absolute Values of Unsigned Subtract

Purpose:

Vector Absolute Values of Unsigned Subtract

Vector subtraction from vector of unsigned values taking the absolute value of the results.

Description:

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

The unsigned elements in vector wt are subtracted from the unsigned elements in vector ws. The absolute value of the signed result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ASUB_U.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = asub_u(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
ASUB_U.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = asub_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
ASUB_U.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = asub_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
ASUB_U.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = asub_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function asub_u(ts, tt, n)
   t = (0 || ts) - (0 || tt)
   if tn = 0 then
      return tn-1..0
   else
      return (-t)n-1..0
endfunction asub_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

AVER_S.df 

Vector Signed Average Rounded

AVER_S.B wd,ws,wt

MSA

Vector Signed Average Rounded

AVER_S.H wd,ws,wt

MSA

Vector Signed Average Rounded

AVER_S.W wd,ws,wt

MSA

Vector Signed Average Rounded

AVER_S.D wd,ws,wt

MSA

Vector Signed Average Rounded

Purpose:

Vector Signed Average Rounded

Vector average rounded using the signed values.

Description:

wd[i] = (ws[i] + wt[i] + 1) / 2

The elements in vector wt are added to the elements in vector ws. The addition of the elements plus 1 (for rounding) is done signed with full precision, i.e. the result has one extra bit. Signed division by 2 (or arithmetic shift right by one bit) is performed 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:

AVER_S.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = aver_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
AVER_S.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = aver_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
AVER_S.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = aver_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
AVER_S.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = aver_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function ave_s(ts, tt, n)
   t = (tsn-1 || ts) + (ttn-1 || tt) + 1
   return tn..1
endfunction aver_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

AVER_U.df 

Vector Unsigned Average Rounded

AVER_U.B wd,ws,wt

MSA

Vector Unsigned Average Rounded

AVER_U.H wd,ws,wt

MSA

Vector Unsigned Average Rounded

AVER_U.W wd,ws,wt

MSA

Vector Unsigned Average Rounded

AVER_U.D wd,ws,wt

MSA

Vector Unsigned Average Rounded

Purpose:

Vector Unsigned Average Rounded

Vector average rounded using the unsigned values.

Description:

wd[i] = (ws[i] + wt[i] + 1) / 2

The elements in vector wt are added to the elements in vector ws. The addition of the elements plus 1 (for rounding) is done unsigned with full precision, i.e. the result has one extra bit. Unsigned division by 2 (or logical shift right by one bit) is performed 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:

AVER_U.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = aver_u(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
AVER_U.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = aver_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
AVER_U.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = aver_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
AVER_U.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = aver_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function ave_u(ts, tt, n)
   t = (0 || ts) + (0 || tt) + 1
   return tn..1
endfunction aver_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

AVE_S.df 

Vector Signed Average

AVE_S.B wd,ws,wt

MSA

Vector Signed Average

AVE_S.H wd,ws,wt

MSA

Vector Signed Average

AVE_S.W wd,ws,wt

MSA

Vector Signed Average

AVE_S.D wd,ws,wt

MSA

Vector Signed Average

Purpose:

Vector Signed Average

Vector average using the signed values.

Description:

wd[i] = (ws[i] + wt[i]) / 2

The elements in vector wt are added to the elements in vector ws. The addition is done signed with full precision, i.e. the result has one extra bit. Signed division by 2 (or arithmetic shift right by one bit) is performed 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:

AVE_S.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = ave_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
AVE_S.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = ave_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
AVE_S.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = ave_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
AVE_S.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = ave_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function ave_s(ts, tt, n)
   t = (tsn-1 || ts) + (ttn-1 || tt)
   return tn..1
endfunction ave_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

010000

6

3

2

5

5

5

6

Format:

AVE_U.df 

Vector Unsigned Average

AVE_U.B wd,ws,wt

MSA

Vector Unsigned Average

AVE_U.H wd,ws,wt

MSA

Vector Unsigned Average

AVE_U.W wd,ws,wt

MSA

Vector Unsigned Average

AVE_U.D wd,ws,wt

MSA

Vector Unsigned Average

Purpose:

Vector Unsigned Average

Vector average using the unsigned values.

Description:

wd[i] = (ws[i] + wt[i]) / 2

The elements in vector wt are added to the elements in vector ws. The addition is done unsigned with full precision, i.e. the result has one extra bit. Unsigned division by 2 (or logical shift right by one bit) is performed 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:

AVE_U.B:
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = ave_u(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
AVE_U.H:
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = ave_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
AVE_U.W:
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = ave_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
AVE_U.D:
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = ave_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function ave_u(ts, tt, n)
   t = (0 || ts) + (0 || tt)
   return tn..1
endfunction ave_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

BCLR.df 

Vector Bit Clear

BCLR.B wd,ws,wt

MSA

Vector Bit Clear

BCLR.H wd,ws,wt

MSA

Vector Bit Clear

BCLR.W wd,ws,wt

MSA

Vector Bit Clear

BCLR.D wd,ws,wt

MSA

Vector Bit Clear

Purpose:

Vector Bit Clear

Vector selected bit position clear in each element.

Description:

wd[i] = bit_clear(ws[i], wt[i])

Clear (set to 0) one bit in each element of vector ws. The bit position is given by the elements in wt modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BCLR.B:
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = WR[ws]8i+7..8i and (17-t || 0 || 1t)
   endfor
BCLR.:
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = WR[ws]16i+15..16i and (115-t || 0 || 1t)
   endfor
BCLR.W:
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = WR[ws]32i+31..32i and (131-t || 0 || 1t)
   endfor
BCLR.D:
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = WR[ws]64i+63..64i and (163-t || 0 || 1t)
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

BCLRI.df 

Immediate Bit Clear

BCLRI.B wd,ws,m

MSA

Immediate Bit Clear

BCLRI.H wd,ws,m

MSA

Immediate Bit Clear

BCLRI.W wd,ws,m

MSA

Immediate Bit Clear

BCLRI.D wd,ws,m

MSA

Immediate Bit Clear

Purpose:

Immediate Bit Clear

Immediate selected bit position clear in each element.

Description:

wd[i] = bit_clear(ws[i], m)

Clear (set to 0) one bit in each element of vector ws. The bit position is given by the immediate m modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BCLRI.B:
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i and (17-t || 0 || 1t)
   endfor
BCLRI.H:
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i and (115-t || 0 || 1t)
   endfor
BCLRI.W:
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i and (131-t || 0 || 1t)
   endfor
BCLRI.D:
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i and (163-t || 0 || 1t)
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

BINSL.df 

Vector Bit Insert Left

BINSL.B wd,ws,wt

MSA

Vector Bit Insert Left

BINSL.H wd,ws,wt

MSA

Vector Bit Insert Left

BINSL.W wd,ws,wt

MSA

Vector Bit Insert Left

BINSL.D wd,ws,wt

MSA

Vector Bit Insert Left

Purpose:

Vector Bit Insert Left

Vector selected left most bits copy while preserving destination right bits.

Description:

wd[i] = bit_insert_left(wd[i], ws[i], wt[i])

Copy most significant (left) bits in each element of vector ws to elements in vector wd while preserving the least significant (right) bits. The number of bits to copy is given by the elements in vector wt modulo the size of the element in bits plus 1.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BINSL.B:
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = WR[ws]8i+7..8i+7-t || WR[wd]8i+7-t-1..8i
   endfor
BINSL.H:
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = WR[ws]16i+15..16i+15-t || WR[wd]16i+15-t-1..16i
   endfor
BINSL.W:
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = WR[ws]32i+31..32i+31-t || WR[wd]32i+31-t-1..32i
   endfor
BINSL.D:
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = WR[ws]64i+63..64i+63-t || WR[wd]64i+63-t-1..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

BINSLI.df 

Immediate Bit Insert Left

BINSLI.B wd,ws,m

MSA

Immediate Bit Insert Left

BINSLI.H wd,ws,m

MSA

Immediate Bit Insert Left

BINSLI.W wd,ws,m

MSA

Immediate Bit Insert Left

BINSLI.D wd,ws,m

MSA

Immediate Bit Insert Left

Purpose:

Immediate Bit Insert Left

Immediate selected left most bits copy while preserving destination right bits.

Description:

wd[i] = bit_insert_left(wd[i], ws[i], m)

Copy most significant (left) bits in each element of vector ws to elements in vector wd while preserving the least significant (right) bits. The number of bits to copy is given by the immediate m modulo the size of the element in bits plus 1.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BINSLI.B:
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i+7-t || WR[wd]8i+7-t-1..8i
   endfor
BINSLI.H:
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i+15-t || WR[wd]16i+15-t-1..16i
   endfor
BINSLI.W:
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i+31-t || WR[wd]32i+31-t-1..32i
   endfor
BINSLI.D:
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i+63-t || WR[wd]64i+63-t-1..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

BINSR.df 

Vector Bit Insert Right

BINSR.B wd,ws,wt

MSA

Vector Bit Insert Right

BINSR.H wd,ws,wt

MSA

Vector Bit Insert Right

BINSR.W wd,ws,wt

MSA

Vector Bit Insert Right

BINSR.D wd,ws,wt

MSA

Vector Bit Insert Right

Purpose:

Vector Bit Insert Right

Vector selected right most bits copy while preserving destination left bits.

Description:

wd[i] = bit_insert_right(wd[i], ws[i], wt[i])

Copy least significant (right) bits in each element of vector ws to elements in vector wd while preserving the most significant (left) bits. The number of bits to copy is given by the elements in vector wt modulo the size of the element in bits plus 1.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BINSR.B:
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = WR[wd]8i+7..8i+t+1 || WR[ws]8i+t..8i
   endfor
BINSR.H:
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = WR[wd]16i+15..16i+t+1 || WR[ws]16i+t..16i
   endfor
BINSR.W:
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = WR[wd]32i+31..32i+t+1 || WR[ws]32i+t..32i
   endfor
BINSR.D:
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = WR[wd]64i+63..64i+t+1 || WR[ws]64i+t..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

BINSRI.df 

Immediate Bit Insert Right

BINSRI.B wd,ws,m

MSA

Immediate Bit Insert Right

BINSRI.H wd,ws,m

MSA

Immediate Bit Insert Right

BINSRI.W wd,ws,m

MSA

Immediate Bit Insert Right

BINSRI.D wd,ws,m

MSA

Immediate Bit Insert Right

Purpose:

Immediate Bit Insert Right

Immediate selected right most bits copy while preserving destination left bits.

Description:

wd[i] = bit_insert_right(wd[i], ws[i], m)

Copy least significant (right) bits in each element of vector ws to elements in vector wd while preserving the most significant (left) bits. The number of bits to copy is given by the immediate m modulo the size of the element in bits plus

1.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BINSRI.B:
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[wd]8i+7..8i+7+t+1 || WR[ws]8i+t..8i
   endfor
BINSRI.H:
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[wd]16i+15..16i+t+1 || WR[ws]16i+t..16i
   endfor
BINSRI.W:
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[wd]32i+31..32i+t+1 || WR[ws]32i+t..32i
   endfor
BINSRI.D:
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[wd]64i+63..64i+t+1 || WR[ws]64i+t..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00100

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

BMNZ.V 

Vector Bit Move If Not Zero

BMNZ.V wd,ws,wt

MSA

Vector Bit Move If Not Zero

Purpose:

Vector Bit Move If Not Zero

Vector mask-based copy bits on the condition mask being set.

Description:

wd = (ws AND wt) OR (wd AND NOT wt)

Copy to destination vector wd all bits from source v ector ws for which the corresponding bits from target vector wt are 1 and leaves unchanged all destination bits for which the corresponding target bits are 0.

The operands and results are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = (WR[ws] and WR[wt]) or (WR[wd] and not WR[wt])

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00

i8

ws

wd

I8

000001

6

2

8

5

5

6

Format:

BMNZI.B 

Immediate Bit Move If Not Zero

BMNZI.B wd,ws,i8

MSA

Immediate Bit Move If Not Zero

Purpose:

Immediate Bit Move If Not Zero

Immediate mask-based copy bits on the condition mask being set.

Description:

wd[i] = (ws[i] AND i8) OR (wd[i] AND NOT i8)

Copy to destination vector wd all bits from source vector ws for which the corresponding bits from immediate i8 are 1 and leaves unchanged all destination bits for which the corresponding immediate bits are 0.

The operands and results are vector values in integer byte data format.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = (WR[ws]8i+7..8i and i87..0) or (WR[wd]8i+7..8i and not i87..0)

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00101

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

BMZ.V 

Vector Bit Move If Zero

BMZ.V wd,ws,wt

MSA

Vector Bit Move If Zero

Purpose:

Vector Bit Move If Zero

Vector mask-based copy bits on the condition mask being clear.

Description:

wd = (ws AND NOT wt) OR (wd AND wt)

Copy to destination vector wd all bits from source v ector ws for which the corresponding bits from target vector wt are 0 and leaves unchanged all destination bits for which the corresponding target bits are 1.

The operands and results are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = (WR[ws] and not WR[wt]) or (WR[wd] and WR[wt])

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

01

i8

ws

wd

I8

000001

6

2

8

5

5

6

Format:

BMZI.B 

Immediate Bit Move If Zero

BMZI.B wd,ws,i8

MSA

Immediate Bit Move If Zero

Purpose:

Immediate Bit Move If Zero

Immediate mask-based copy bits on the condition mask being clear.

Description:

wd[i] = (ws[i] AND NOT i8) OR (wd[i] AND i8)

Copy to destination vector wd all bits from source vector ws for which the corresponding bits from immediate i8 are 0 and leaves unchanged all destination bits for which the corresponding immediate bits are 1.

The operands and results are vector values in integer byte data format.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = (WR[ws] and not i87..0) or (WR[wd] and i87..0)

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

BNEG.df 

Vector Bit Negate

BNEG.B wd,ws,wt

MSA

Vector Bit Negate

BNEG.H wd,ws,wt

MSA

Vector Bit Negate

BNEG.W wd,ws,wt

MSA

Vector Bit Negate

BNEG.D wd,ws,wt

MSA

Vector Bit Negate

Purpose:

Vector Bit Negate

Vector selected bit position negate in each element.

Description:

wd[i] = bit_negate(ws[i], wt[i])

Negate (complement) one bit in each element of vector ws. The bit position is given by the elements in wt modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BNEG.B:
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = WR[ws]8i+7..8i xor (07-t || 1 || 0t)
   endfor
BNEG.H:
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = WR[ws]16i+15..16i xor (015-t || 1 || 0t)
   endfor
BNEG.W:
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = WR[ws]32i+31..32i xor (031-t || 1 || 0t)
   endfor
BNEG.D:
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = WR[ws]64i+63..64i xor (063-t || 1 || 0t)
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

BNEGI.df 

Immediate Bit Negate

BNEGI.B wd,ws,m

MSA

Immediate Bit Negate

BNEGI.H wd,ws,m

MSA

Immediate Bit Negate

BNEGI.W wd,ws,m

MSA

Immediate Bit Negate

BNEGI.D wd,ws,m

MSA

Immediate Bit Negate

Purpose:

Immediate Bit Negate

Immediate selected bit position negate in each element.

Description:

wd[i] = bit_negate(ws[i], m)

Negate (complement) one bit in each element of vector ws. The bit position is given by the immediate m modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BNEGI.B:
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i xor (07-t || 1 || 0t)
   endfor
BNEGI.H:
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i xor (015-t || 1 || 0t)
   endfor
BNEGI.W:
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i xor (031-t || 1 || 0t)
   endfor
BNEGI.D:
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i xor (063-t || 1 || 0t)
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

COP1

010001

111

df

wt

s16

6

3

2

5

16

Format:

BNZ.df 

Immediate Branch If All Elements Are Not Zero

BNZ.B wt,s16

MSA

Immediate Branch If All Elements Are Not Zero

BNZ.H wt,s16

MSA

Immediate Branch If All Elements Are Not Zero

BNZ.W wt,s16

MSA

Immediate Branch If All Elements Are Not Zero

BNZ.D wt,s16

MSA

Immediate Branch If All Elements Are Not Zero

Purpose:

Immediate Branch If All Elements Are Not Zero

Immediate PC offset branch if all destination elements are not zero.

Description:

if wt[i] != 0 for all i then branch PC-relative s16

PC-relative branch if all elements in wt are not zero. The branch instruction has a delay slot. s16 is a PC word offset, i.e. signed count of 32-bit instructions, from the PC of the delay slot.

Restrictions:

Processor operation is UNPREDICTABLE if a branch is placed in the delay slot of a branch or jump.

Operation:

BNZ.B:
   branch(WR[wt]8i+7..8i != 0 for all i, s16)
BNZ.H:
   branch(WR[wt]16i+15..16i != 0 for all i, s16)
BNZ.W:
   branch(WR[wt]32i+31..32i != 0 for all i, s16)
BNZ.D:
   branch(WR[wt]64i+63..64i != 0 for all i, s16)
function branch(cond, offset)
   if cond then
      I:   target_offset = (offset9)GPRLEN-12 || offset9..0 || 0^^2
      I+1: PC = PC + target_offset
   endif
endfunction branch

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

COP1

010001

01111

wt

s16

6

5

5

16

Format:

BNZ.V 

Immediate Branch If Not Zero (At Least One Element of Any Format Is Not Zero)

BNZ.V wt,s16

MSA

Immediate Branch If Not Zero (At Least One Element of Any Format Is Not Zero)

Purpose:

Immediate Branch If Not Zero (At Least One Element of Any Format Is Not Zero)

Immediate PC offset branch if destination vector is not zero.

Description:

if wt != 0 then branch PC-relative s16

PC-relative branch if at least one bit in wt is not zero, i.e at least one element is not zero regardless of the data format. The branch instruction has a delay slot. s16 is a PC word offset, i.e. signed count of 32-bit instructions, from the PC of the delay slot.

Restrictions:

Processor operation is UNPREDICTABLE if a branch is placed in the delay slot of a branch or jump.

Operation:

   branch(WR[wt] != 0, s16)
function branch(cond, offset)
   if cond then
      I:   target_offset = (offset9)GPRLEN-12 || offset9..0 || 0^^2
      I+1: PC = PC + target_offset
   endif
endfunction branch

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00110

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

BSEL.V 

Vector Bit Select

BSEL.V wd,ws,wt

MSA

Vector Bit Select

Purpose:

Vector Bit Select

Vector mask-based copy bits from two source vectors selected by the bit mask value

Description:

wd = (ws AND NOT wd) OR (wt AND wd)

Selectively copy bits from the source v ectors ws and wt into destination vector wd based on the corresponding bit in wd: if 0 copies the bit from ws, if 1 copies the bit from wt.

Restrictions:

The operands and results are bit vector values.

Operation:

 WR[wd] = (WR[ws] and not WR[wd]) or (WR[wt] and WR[wd])

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

10

i8

ws

wd

I8

000001

6

2

8

5

5

6

Format:

BSELI.B 

Immediate Bit Select

BSELI.B wd,ws,i8

MSA

Immediate Bit Select

Purpose:

Immediate Bit Select

Immediate mask-based copy bits from two source vectors selected by the bit mask value

Description:

wd = (ws AND NOT wd) OR (i8 AND wd)

Selectively copy bits from the the 8-bit immediate i8 and source v ector ws into destination vector wd based on the corresponding bit in wd: if 0 copies the bit from ws, if 1 copies the bit from i8.

Restrictions:

The operands and results are bit vector values.

Operation:

 for i in 0 .. WRLEN/8-1
   WR[wd]8i+7..8i =
      (WR[ws]8i+7..8i and not WR[wd]8i+7..8i) or (i87..0 and WR[wd]8i+7..8i)
endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

BSET.df 

Vector Bit Set

BSET.B wd,ws,wt

MSA

Vector Bit Set

BSET.H wd,ws,wt

MSA

Vector Bit Set

BSET.W wd,ws,wt

MSA

Vector Bit Set

BSET.D wd,ws,wt

MSA

Vector Bit Set

Purpose:

Vector Bit Set

Vector selected bit position set in each element.

Description:

wd[i] = bit_set(ws[i], wt[i])

Set to 1 one bit in each element of v ector ws. The bit position is given by the elements in wt modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BSET_S.B:
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = WR[ws]8i+7..8i or (07-t || 1 || 0t)
   endfor
BSET_S.H:
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = WR[ws]16i+15..16i or (015-t || 1 || 0t)
   endfor
BSET_S.W:
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = WR[ws]32i+31..32i or (031-t || 1 || 0t)
   endfor
BSET_S.D:
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = WR[ws]64i+63..64i or (063-t || 1 || 0t)
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

BSETI.df 

Immediate Bit Set

BSETI.B wd,ws,m

MSA

Immediate Bit Set

BSETI.H wd,ws,m

MSA

Immediate Bit Set

BSETI.W wd,ws,m

MSA

Immediate Bit Set

BSETI.D wd,ws,m

MSA

Immediate Bit Set

Purpose:

Immediate Bit Set

Immediate selected bit position set in each element.

Description:

wd[i] = bit_set(ws[i], m)

Set to 1 one bit in each element of vector ws. The bit position is given by the immediate m. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

BSETI_S.B:
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i or (07-t || 1 || 0t)
   endfor
BSETI_S.H:
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i or (015-t || 1 || 0t)
   endfor
BSETI_S.W:
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i or (031-t || 1 || 0t)
   endfor
BSETI_S.D:
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i or (063-t || 1 || 0t)
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

COP1

010001

110

df

wt

s16

6

3

2

5

16

Format:

BZ.df 

Immediate Branch If At Least One Element Is Zero

BZ.B wt,s16

MSA

Immediate Branch If At Least One Element Is Zero

BZ.H wt,s16

MSA

Immediate Branch If At Least One Element Is Zero

BZ.W wt,s16

MSA

Immediate Branch If At Least One Element Is Zero

BZ.D wt,s16

MSA

Immediate Branch If At Least One Element Is Zero

Purpose:

Immediate Branch If At Least One Element Is Zero

Immediate PC offset branch if at least one destination element is zero.

Description:

if wt[i] = 0 for some i then branch PC-relative s16

PC-relative branch if at least one element in wt is zero. The branch instruction has a delay slot. s16 is a PC word offset, i.e. signed count of 32-bit instructions, from the PC of the delay slot.

Restrictions:

Processor operation is UNPREDICTABLE if a branch is placed in the delay slot of a branch or jump.

Operation:

BZ.B:
   for i in 0 .. WRLEN/8-1
      branch(WR[wt]8i+7..8i = 0, s16)
   endfor
BZ.H:
   for i in 0 .. WRLEN/16-1
      branch(WR[wt]16i+15..16i = 0, s16)
   endfor
BZ.W:
   for i in 0 .. WRLEN/32-1
      branch(WR[wt]32i+31..32i = 0, s16)
   endfor
BZ.D:
   for i in 0 .. WRLEN/64-1
      branch(WR[wt]64i+63..64i = 0, s16)
   endfor
function branch(cond, offset)
   if cond then
      I:   target_offset = (offset9)GPRLEN-12 || offset9..0 || 0^^2
      I+1: PC = PC + target_offset
   endif
endfunction branch

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

COP1

010001

01011

wt

s16

6

5

5

16

Format:

BZ.V 

Immediate Branch If Zero (All Elements of Any Format Are Zero)

BZ.V wt,s16

MSA

Immediate Branch If Zero (All Elements of Any Format Are Zero)

Purpose:

Immediate Branch If Zero (All Elements of Any Format Are Zero)

Immediate PC offset branch if destination vector is zero.

Description:

if wt = 0 then branch PC-relative s16

PC-relative branch if all wt bits are zero, i.e. all elements are zero regardless of the data format. The branch instruction has a delay slot. s16 is a PC word offset, i.e. signed count of 32-bit instructions, from the PC of the delay slot.

Restrictions:

Processor operation is UNPREDICTABLE if a branch is placed in the delay slot of a branch or jump.

Operation:

   branch(WR[wt] = 0, s16)
function branch(cond, offset)
   if cond then
      I:   target_offset = (offset9)GPRLEN-12 || offset9..0 || 0^^2
      I+1: PC = PC + target_offset
   endif
endfunction branch

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

001111

6

3

2

5

5

5

6

Format:

CEQ.df 

Vector Compare Equal

CEQ.B wd,ws,wt

MSA

Vector Compare Equal

CEQ.H wd,ws,wt

MSA

Vector Compare Equal

CEQ.W wd,ws,wt

MSA

Vector Compare Equal

CEQ.D wd,ws,wt

MSA

Vector Compare Equal

Purpose:

Vector Compare Equal

Vector to vector compare for equality; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] = wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt elements are equal, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CEQ.B:
   for i in 0 .. WRLEN/8-1
      c = WR[ws]8i+7..8i = WR[wt]8i+7..8i
      WR[wd]8i+7..8i = c8
   endfor
CEQ.H:
   for i in 0 .. WRLEN/16-1
      c = WR[ws]16i+15..16i = WR[wt]16i+15..16i
      WR[wd]16i+15..16i = c16
   endfor
CEQ.W:
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i = WR[wt]32i+31..32i
      WR[wd]32i+31..32i = c32
   endfor
CEQ.D:
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i = WR[wt]64i+63..64i
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

s5

ws

wd

I5

000111

6

3

2

5

5

5

6

Format:

CEQI.df 

Immediate Compare Equal

CEQI.B wd,ws,s5

MSA

Immediate Compare Equal

CEQI.H wd,ws,s5

MSA

Immediate Compare Equal

CEQI.W wd,ws,s5

MSA

Immediate Compare Equal

CEQI.D wd,ws,s5

MSA

Immediate Compare Equal

Purpose:

Immediate Compare Equal

Immediate to vector compare for equality; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] = s5)

Set all bits to 1 in wd elements if the corresponding ws element and the 5-bit signed immediate s5 are equal, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CEQI.B:
   t = (s54)3 || s54..0
   for i in 0 .. WRLEN/8-1
      c = WR[ws]8i+7..8i = t
      WR[wd]8i+7..8i = c8
   endfor
CEQI.H:
   t = (s54)11 || s54..0
   for i in 0 .. WRLEN/16-1
      c = WR[ws]16i+15..16i = t
      WR[wd]16i+15..16i = c16
   endfor
CEQI.W:
   t = (s54)27 || s54..0
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i = t
      WR[wd]32i+31..32i = c32
   endfor
CEQI.D:
   t = (s54)59 || s54..0
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i = t
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0001111110

cs

rd

ELM

011001

6

10

5

5

6

Format:

CFCMSA 

GPR Copy from MSA Control Register

CFCMSA rd,cs

MSA

GPR Copy from MSA Control Register

Purpose:

GPR Copy from MSA Control Register

GPR value copied from MSA control register.

Description:

rd = signed(cs)

The sign extended content of MSA control register cs is copied to GPR rd.

Restrictions:

The read operation returns ZERO if cs specifies a reserved register or a register that does not exist.

Operation:

if cs = 0 then
   GPR[rd] = sign_extend(MSAIR, 64)
elseif cs = 1 then
   GPR[rd] = sign_extend(MSACSR, 64)
elseif MSAIRWRP = 1 then
   if cs = 2 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAAccess, 64)
   elseif cs = 3 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSASave, 64)
   elseif cs = 4 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAModify, 64)
   elseif cs = 5 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSARequest, 64)
   elseif cs = 6 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAMap, 64)
   elseif cs = 7 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      GPR[rd] = sign_extend(MSAUnmap, 64)
   else
      GPR[rd] = 0
   endif
else
   GPR[rd] = 0
endif

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception. Coprocessor 0 Unusable Exception.

Encoding:

MSA

011110

100

df

s5

ws

wd

I5

000111

6

3

2

5

5

5

6

Format:

CLEI_S.df 

Immediate Compare Signed Less Than or Equal

CLEI_S.B wd,ws,s5

MSA

Immediate Compare Signed Less Than or Equal

CLEI_S.H wd,ws,s5

MSA

Immediate Compare Signed Less Than or Equal

CLEI_S.W wd,ws,s5

MSA

Immediate Compare Signed Less Than or Equal

CLEI_S.D wd,ws,s5

MSA

Immediate Compare Signed Less Than or Equal

Purpose:

Immediate Compare Signed Less Than or Equal

Immediate to vector compare for signed less or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <= s5)

Set all bits to 1 in wd elements if the corresponding ws element is less than or equal to the 5-bit signed immediate s5, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLEI_S.B
   t = (s54)3 || s54..0
   for i in 0 .. WRLEN/8-1
      c = WR[ws]8i+7..8i <= t
      WR[wd]8i+7..8i = c8
   endfor
CLEI_S.H
   t = (s54)11 || s54..0
   for i in 0 .. WRLEN/16-1
      c = WR[ws]16i+15..16i <= t
      WR[wd]16i+15..16i = c16
   endfor
CLEI_S.W
   t = (s54)27 || s54..0
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i <= t
      WR[wd]32i+31..32i = c32
   endfor
CLEI_S.D
   t = (s54)59 || s5__4.. 0__
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i <= t
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

u5

ws

wd

I5

000111

6

3

2

5

5

5

6

Format:

CLEI_U.df 

Immediate Compare Unsigned Less Than or Equal

CLEI_U.B wd,ws,u5

MSA

Immediate Compare Unsigned Less Than or Equal

CLEI_U.H wd,ws,u5

MSA

Immediate Compare Unsigned Less Than or Equal

CLEI_U.W wd,ws,u5

MSA

Immediate Compare Unsigned Less Than or Equal

CLEI_U.D wd,ws,u5

MSA

Immediate Compare Unsigned Less Than or Equal

Purpose:

Immediate Compare Unsigned Less Than or Equal

Immediate to vector compare for unsigned less or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <= u5)

Set all bits to 1 in wd elements if the corresponding ws element is unsigned less than or equal to the 5-bit unsigned immediate u5, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLEI_U.B
   t = 03 || u54..0
   for i in 0 .. WRLEN/8-1
      c = (0 || WR[ws]8i+7..8i) <= (0 || t)
      WR[wd]8i+7..8i = c8
   endfor
CLEI_U.H
   t = 011 || u54..0
   for i in 0 .. WRLEN/16-1
      c = (0 || WR[ws]16i+15..16i) <= (0 || t)
      WR[wd]16i+15..16i = c16
   endfor
CLEI_U.W
   t = 027 || u54..0
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i <= (0 || t)
      WR[wd]32i+31..32i = c32
   endfor
CLEI_U.D
   t = 059 || u54..0
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i <= (0 || t)
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

001111

6

3

2

5

5

5

6

Format:

CLE_S.df 

Vector Compare Signed Less Than or Equal

CLE_S.B wd,ws,wt

MSA

Vector Compare Signed Less Than or Equal

CLE_S.H wd,ws,wt

MSA

Vector Compare Signed Less Than or Equal

CLE_S.W wd,ws,wt

MSA

Vector Compare Signed Less Than or Equal

CLE_S.D wd,ws,wt

MSA

Vector Compare Signed Less Than or Equal

Purpose:

Vector Compare Signed Less Than or Equal

Vector to vector compare for signed less or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <= wt[i])

Set all bits to 1 in wd elements if the corresponding ws elements are signed less than or equal to wt elements, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLE_S.B:
   for i in 0 .. WRLEN/8-1
      c = WR[ws]8i+7..8i <= WR[wt]8i+7..8i
      WR[wd]8i+7..8i = c8
   endfor
CLE_S.H:
   for i in 0 .. WRLEN/16-1
      c = WR[ws]16i+15..16i <= WR[wt]16i+15..16i
      WR[wd]16i+15..16i = c16
   endfor
CLE_S.W:
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i <= WR[wt]32i+31..32i
      WR[wd]32i+31..32i = c32
   endfor
CLE_S.D:
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i <= WR[wt]64i+63..64i
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

001111

6

3

2

5

5

5

6

Format:

CLE_U.df 

Vector Compare Unsigned Less Than or Equal

CLE_U.B wd,ws,wt

MSA

Vector Compare Unsigned Less Than or Equal

CLE_U.H wd,ws,wt

MSA

Vector Compare Unsigned Less Than or Equal

CLE_U.W wd,ws,wt

MSA

Vector Compare Unsigned Less Than or Equal

CLE_U.D wd,ws,wt

MSA

Vector Compare Unsigned Less Than or Equal

Purpose:

Vector Compare Unsigned Less Than or Equal

Vector to vector compare for unsigned less or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <= wt[i])

Set all bits to 1 in wd elements if the corresponding ws elements are unsigned less than or equal to wt elements, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLE_U.B
   for i in 0 .. WRLEN/8-1
      c = (0 || WR[ws]8i+7..8i) <= (0 || WR[wt]8i+7..8i)
      WR[wd]8i+7..8i = c8
   endfor
CLE_U.H
   for i in 0 .. WRLEN/16-1
      c = (0 || WR[ws]16i+15..16i) <= (0 || WR[wt]16i+15..16i)
      WR[wd]16i+15..16i = c16
   endfor
CLE_U.W
   for i in 0 .. WRLEN/32-1
      c = (0 || WR[ws]__32i+31..32i_)_ <= (0 || WR[wt]32i+31..32i)
      WR[wd]32i+31..32i = c32
   endfor
CLE_U.D
   for i in 0 .. WRLEN/64-1
      c = (0 || WR[ws]64i+63..64i) <= (0 || WR[wt]64i+63..64i)
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

s5

ws

wd

I5

000111

6

3

2

5

5

5

6

Format:

CLTI_S.df 

Immediate Compare Signed Less Than

CLTI_S.B wd,ws,s5

MSA

Immediate Compare Signed Less Than

CLTI_S.H wd,ws,s5

MSA

Immediate Compare Signed Less Than

CLTI_S.W wd,ws,s5

MSA

Immediate Compare Signed Less Than

CLTI_S.D wd,ws,s5

MSA

Immediate Compare Signed Less Than

Purpose:

Immediate Compare Signed Less Than

Immediate to vector compare for signed less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] < s5)

Set all bits to 1 in wd elements if the corresponding ws element is less than the 5-bit signed immediate s5, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLTI_S.B
   t = (s54)3 || s54..0
   for i in 0 .. WRLEN/8-1
      c = WR[ws]8i+7..8i < t
      WR[wd]8i+7..8i = c8
   endfor
CLTI_S.H
   t = (s54)11 || s54..0
   for i in 0 .. WRLEN/16-1
      c = WR[ws]16i+15..16i < t
      WR[wd]16i+15..16i = c16
   endfor
CLTI_S.W
   t = (s54)27 || s54..0
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i < t
      WR[wd]32i+31..32i = c32
   endfor
CLTI_S.D
   t = (s54)59 || s5__4.. 0__
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i < t
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

u5

ws

wd

I5

000111

6

3

2

5

5

5

6

Format:

CLTI_U.df 

Immediate Compare Unsigned Less Than

CLTI_U.B wd,ws,u5

MSA

Immediate Compare Unsigned Less Than

CLTI_U.H wd,ws,u5

MSA

Immediate Compare Unsigned Less Than

CLTI_U.W wd,ws,u5

MSA

Immediate Compare Unsigned Less Than

CLTI_U.D wd,ws,u5

MSA

Immediate Compare Unsigned Less Than

Purpose:

Immediate Compare Unsigned Less Than

Immediate to vector compare for unsigned less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] < u5)

Set all bits to 1 in wd elements if the corresponding ws element is unsigned less than the 5-bit unsigned immediate u5, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLTI_U.B
   t = 03 || u54..0
   for i in 0 .. WRLEN/8-1
      c = (0 || WR[ws]8i+7..8i) < (0 || t)
      WR[wd]8i+7..8i = c8
   endfor
CLTI_U.H
   t = 011 || u54..0
   for i in 0 .. WRLEN/16-1
      c = (0 || WR[ws]16i+15..16i) < (0 || t)
      WR[wd]16i+15..16i = c16
   endfor
CLTI_U.W
   t = 027 || u54..0
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i < (0 || t)
      WR[wd]32i+31..32i = c32
   endfor
CLTI_U.D
   t = 059 || u54..0
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i < (0 || t)
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

001111

6

3

2

5

5

5

6

Format:

CLT_S.df 

Vector Compare Signed Less Than

CLT_S.B wd,ws,wt

MSA

Vector Compare Signed Less Than

CLT_S.H wd,ws,wt

MSA

Vector Compare Signed Less Than

CLT_S.W wd,ws,wt

MSA

Vector Compare Signed Less Than

CLT_S.D wd,ws,wt

MSA

Vector Compare Signed Less Than

Purpose:

Vector Compare Signed Less Than

Vector to vector compare for signed less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] < wt[i])

Set all bits to 1 i n wd elements if the corresponding ws elements are signed less than wt elements, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLT_S.B
   for i in 0 .. WRLEN/8-1
      c = WR[ws]8i+7..8i < WR[wt]8i+7..8i
      WR[wd]8i+7..8i = c8
   endfor
CLT_S.H
   for i in 0 .. WRLEN/16-1
      c = WR[ws]16i+15..16i < WR[wt]16i+15..16i
      WR[wd]16i+15..16i = c16
   endfor
CLT_S.W
   for i in 0 .. WRLEN/32-1
      c = WR[ws]32i+31..32i < WR[wt]32i+31..32i
      WR[wd]32i+31..32i = c32
   endfor
CLT_S.D
   for i in 0 .. WRLEN/64-1
      c = WR[ws]64i+63..64i < WR[wt]64i+63..64i
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

001111

6

3

2

5

5

5

6

Format:

CLT_U.df 

Vector Compare Unsigned Less Than

CLT_U.B wd,ws,wt

MSA

Vector Compare Unsigned Less Than

CLT_U.H wd,ws,wt

MSA

Vector Compare Unsigned Less Than

CLT_U.W wd,ws,wt

MSA

Vector Compare Unsigned Less Than

CLT_U.D wd,ws,wt

MSA

Vector Compare Unsigned Less Than

Purpose:

Vector Compare Unsigned Less Than

Vector to vector compare for unsigned less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] < wt[i])

Set all bits to 1 in wd elements if the corresponding ws elements are unsigned less than wt elements, otherwise set all bits to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

CLT_U.B
   for i in 0 .. WRLEN/8-1
      c = (0 || WR[ws]8i+7..8i) < (0 || WR[wt]8i+7..8i)
      WR[wd]8i+7..8i = c8
   endfor
CLT_U.H
   for i in 0 .. WRLEN/16-1
      c = (0 || WR[ws]16i+15..16i) < (0 || WR[wt]16i+15..16i)
      WR[wd]16i+15..16i = c16
   endfor
CLT_U.W
   for i in 0 .. WRLEN/32-1
      c = (0 || WR[ws]__32i+31..32i_)_ < (0 || WR[wt]32i+31..32i)
      WR[wd]32i+31..32i = c32
   endfor
CLT_U.D
   for i in 0 .. WRLEN/64-1
      c = (0 || WR[ws]64i+63..64i) < (0 || WR[wt]64i+63..64i)
      WR[wd]64i+63..64i = c64
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0010

df/n

ws

rd

ELM

011001

6

4

6

5

5

6

Format:

COPY_S.df 

Element Copy to GPR Signed

COPY_S.B rd,ws[n]

MSA

Element Copy to GPR Signed

COPY_S.H rd,ws[n]

MSA

Element Copy to GPR Signed

COPY_S.W rd,ws[n]

MSA

Element Copy to GPR Signed

COPY_S.D rd,ws[n]

MIPS64, MSA

Element Copy to GPR Signed

Purpose:

Element Copy to GPR Signed

Element value sign extended and copied to GPR.

Description:

rd = signed(ws[n])

Sign-extend element n of vector ws and copy the result to GPR rd.

Restrictions:

No data-dependent exceptions are possible.

Operation:

COPY_S.B
   GPR[rd] = sign_extend(WR[ws]8n+7..8n, 64)
COPY_S.H
   GPR[rd] = sign_extend(WR[ws]16n+15..16n, 64)
COPY_S.W
   GPR[rd] = sign_extend(WR[ws]32n+31..32n, 64)
COPY_S.D
   GPR[rd] = WR[ws]64n+63..64n
function sign_extend(tt, n)
   return (ttn-1)GPRLEN-n || ttn-1..0
endfunction sign_extend

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0011

df/n

ws

rd

ELM

011001

6

4

6

5

5

6

Format:

COPY_U.df 

Element Copy to GPR Unsigned

COPY_U.B rd,ws[n]

MSA

Element Copy to GPR Unsigned

COPY_U.H rd,ws[n]

MSA

Element Copy to GPR Unsigned

COPY_U.W rd,ws[n]

MIPS64, MSA

Element Copy to GPR Unsigned

Purpose:

Element Copy to GPR Unsigned

Element value zero extended and copied to GPR.

Description:

rd = unsigned(ws[n])

Zero-extend element n of vector ws and copy the result to GPR rd.

Restrictions:

No data-dependent exceptions are possible.

Operation:

COPY_U.B
   GPR[rd] = zero_extend(WR[ws]8n+7..8n, 64))
COPY_U.H
   GPR[rd] = zero_extend(WR[ws]16n+15..16n, 64))
COPY_U.W
   GPR[rd] = zero_extend(WR[ws]32n+31..32n, 64)
function zero_extend(tt, n)
   return 0GPRLEN-n || ttn-1..0
endfunction zero_extend

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0000111110

rs

cd

ELM

011001

6

10

5

5

6

Format:

CTCMSA 

GPR Copy to MSA Control Register

CTCMSA cd,rs

MSA

GPR Copy to MSA Control Register

Purpose:

GPR Copy to MSA Control Register

GPR value copied to MSA control register.

Description:

cd = rs

The content of the least significant 31 bits of GPR rs is copied to MSA control register cd.

Writing to the MSA Control and Status Register MSACSR causes the appropriate e xception if any Cause bit and its corresponding Enable bit are both set. The register is written before the exception occurs and the EPC register contains the address of the CTCMSA instruction.

Restrictions:

The write attempt is IGNORED if cd specifies a reserved register or a register that does not exist or is not writable.

Operation:

if cd = 1 then
   MSACSR = GPR[rs]31..0
   if MSACSRCause and (1 || MSACSREnables) != 0 then
      SignalException(MSAFloatingPointException)
   endif
elseif MSAIRWRP = 1 then
   if cd = 3 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      MSASave = GPR[rs]31..0
   elseif cd = 4 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      MSAModify = GPR[rs]31..0
   elseif cd = 6 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      MSAMap = GPR[rs]31..0
   elseif cd = 7 then
      if not IsCoprocessorEnabled(0) then
         SignalException(CoprocessorUnusableException, 0)
      endif
      MSAUnmap = GPR[rs]31..0
   endif
endif

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception. Coprocessor 0 Unusable

Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

DIV_S.df 

Vector Signed Divide

DIV_S.B wd,ws,wt

MSA

Vector Signed Divide

DIV_S.H wd,ws,wt

MSA

Vector Signed Divide

DIV_S.W wd,ws,wt

MSA

Vector Signed Divide

DIV_S.D wd,ws,wt

MSA

Vector Signed Divide

Purpose:

Vector Signed Divide

Vector signed divide.

Description:

wd[i] = ws[i] div wt[i]

The signed integer elements in vector ws are divided by signed integer elements in vector wt. The result is written to vector wd. If a divisor element vector wt is zero, the result value is UNPREDICTABLE.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

DIV_S.B
   for i in 0 .. WRLEN/8-1
         WR[wd]8i+7..8i = WR[ws]8i+7..8i div WR[wt]8i+7..8i
   endfor
DIV_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i div WR[wt]16i+15..16i
   endfor
DIV_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i div WR[wt]32i+31..32i
   endfor
DIV_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i div WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

DIV_U.df 

Vector Unsigned Divide

DIV_U.B wd,ws,wt

MSA

Vector Unsigned Divide

DIV_U.H wd,ws,wt

MSA

Vector Unsigned Divide

DIV_U.W wd,ws,wt

MSA

Vector Unsigned Divide

DIV_U.D wd,ws,wt

MSA

Vector Unsigned Divide

Purpose:

Vector Unsigned Divide

Vector unsigned divide.

Description:

wd[i] = ws[i] udiv wt[i]

The unsigned integer elements in vector ws are divided by unsigned integer elements in vector wt. The result is written to vector wd. If a divisor element vector wt is zero, the result value is UNPREDICTABLE.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

DIV_U.B
   for i in 0 .. WRLEN/8-1
         WR[wd]8i+7..8i = WR[ws]8i+7..8i udiv WR[wt]8i+7..8i
   endfor
DIV_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i udiv WR[wt]16i+15..16i
   endfor
DIV_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i udiv WR[wt]32i+31..32i
   endfor
DIV_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i udiv WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

SPECIAL

000000

rs

rt

rd

000

sa

DLSA

010101

6

5

5

5

3

2

6

Format:

DLSA 

Doubleword Left Shift Add

DLSA rd,rs,rt,sa

MSA

Doubleword Left Shift Add

Purpose:

Doubleword Left Shift Add

To left-shift a doubleword by a fixed number of bits and add the result to another doubleword.

Description:

GPR[rd] = (GPR[rs] << (sa + 1)) + GPR[rt]

The 64-bit doubleword value in GPR rs is shifted left, inserting zeros into the emptied bits; the 64-bit doubleword result is added to the 64-bit value in GPR rt and the 64-bit arithmetic result is placed into GPR rd.

No Integer Overflow exception occurs under any circumstances.

Restrictions:

A Reserved Instruction Exception is signaled if access to 64-bit operations is not enabled or MSA implementation is not present.

Operation:

if Are64bitOperationsEnabled() and Config3MSAP = 1 then
   s = sa + 1
   temp = (GPR[rs](63-s)..0 || 0s) + GPR[rt]
   GPR[rd] = temp63..0
else
   SignalException(ReservedInstruction)
endif

Exceptions:

Reserved Instruction Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

010011

6

3

2

5

5

5

6

Format:

DOTP_S.df 

Vector Signed Dot Product

DOTP_S.H wd,ws,wt

MSA

Vector Signed Dot Product

DOTP_S.W wd,ws,wt

MSA

Vector Signed Dot Product

DOTP_S.D wd,ws,wt

MSA

Vector Signed Dot Product

Purpose:

Vector Signed Dot Product

Vector signed dot product (multiply and then pairwise add the adjacent multiplication results) to double width elements.

Description:

(wd[2i+1], wd[2i]) = signed(ws[2i+1]) * signed(wt[2i+1]) + signed(ws[2i]) * 
signed(wt[2i])

The signed integer elements in vector wt are multiplied by signed integer elements in vector ws producing a result twice the size of the input operands. The multiplication results of adjacent odd/even elements are added and stored to the destination.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

DOTP_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = dotp_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
DOTP_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = dotp_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
DOTP_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = dotp_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function dotp_s(ts, tt, n)
   p1 = mulx_s(ts2n-1..n, tt2n-1..n, n)
   p0 = mulx_s(tsn-1..0, ttn-1..0, n)
   p = p1 + p0
   return p2n-1..0
endfunction dotp_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df

wt

ws

wd

3R

010011

6

3

2

5

5

5

6

Format:

DOTP_U.df 

Vector Unsigned Dot Product

DOTP_U.H wd,ws,wt

MSA

Vector Unsigned Dot Product

DOTP_U.W wd,ws,wt

MSA

Vector Unsigned Dot Product

DOTP_U.D wd,ws,wt

MSA

Vector Unsigned Dot Product

Purpose:

Vector Unsigned Dot Product

Vector unsigned dot product (multiply and then pairwise add the adjacent multiplication results) to double width elements.

Description:

(wd[2i+1], wd[2i]) = unsigned(ws[2i+1]) * unsigned(wt[2i+1]) + 
unsigned(ws[2i]) * unsigned(wt[2i])

The unsigned integer elements in v ector wt are multiplied by unsigned integer elements in vector ws producing a result twice the size of the input operands. The multiplication results of adj acent odd/even elements are added and stored to the destination.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

DOTP_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = dotp_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
DOTP_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = dotp_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
DOTP_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = dotp_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function mulx_u(ts, tt, n)
   s = 0n || tsn-1..0 
   t = 0n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function dotp_u(ts, tt, n)
   p1 = mulx_u(ts2n-1..n, tt2n-1..n, n)
   p0 = mulx_u(tsn-1..0, ttn-1..0, n)
   p = p1 + p0
   return p2n-1..0
endfunction dotp_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

010011

6

3

2

5

5

5

6

Format:

DPADD_S.df 

Vector Signed Dot Product and Add

DPADD_S.H wd,ws,wt

MSA

Vector Signed Dot Product and Add

DPADD_S.W wd,ws,wt

MSA

Vector Signed Dot Product and Add

DPADD_S.D wd,ws,wt

MSA

Vector Signed Dot Product and Add

Purpose:

Vector Signed Dot Product and Add

Vector signed dot p roduct (multiply and then pairwise ad d the adjacent mu ltiplication results) and add to double width elements.

Description:

(wd[2i+1], wd[2i]) = (wd[2i+1], wd[2i]) + signed(ws[2i+1]) * 
signed(wt[2i+1]) + signed(ws[2i]) * signed(wt[2i])

The signed integer elements in vector wt are multiplied by signed integer elements in vector ws producing a result twice the size of the input operands. The multiplication results of adjacent odd/even elements are added to the integer elements in vector wd.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

DPADD_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             WR[wd]16i+15..16i + dotp_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
DPADD_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             WR[wd]32i+31..32i + dotp_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
DPADD_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             WR[wd]64i+63..64i + dotp_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function dotp_s(ts, tt, n)
   p1 = mulx_s(ts2n-1..n, tt2n-1..n, n)
   p0 = mulx_s(tsn-1..0, ttn-1..0, n)
   p = p1 + p0
   return p2n-1..0
endfunction dotp_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

010011

6

3

2

5

5

5

6

Format:

DPADD_U.df 

Vector Unsigned Dot Product and Add

DPADD_U.H wd,ws,wt

MSA

Vector Unsigned Dot Product and Add

DPADD_U.W wd,ws,wt

MSA

Vector Unsigned Dot Product and Add

DPADD_U.D wd,ws,wt

MSA

Vector Unsigned Dot Product and Add

Purpose:

Vector Unsigned Dot Product and Add

Vector unsigned dot product (multiply and then pairwise add the adjacent multiplication results) and add to double width results.

Description:

(wd[2i+1], wd[2i]) = (wd[2i+1], wd[2i]) + unsigned(ws[2i+1]) * 
unsigned(wt[2i+1]) + unsigned(ws[2i]) * unsigned(wt[2i])

The unsigned integer elements in v ector wt are multiplied by unsigned integer elements in vector ws producing a result twice the size of the input operands. The multiplication results of adjacent odd/even elements are added to the integer elements in vector wd.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

DPADD_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             WR[wd]16i+15..16i + dotp_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
DPADD_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             WR[wd]32i+31..32i + dotp_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
DPADD_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             WR[wd]64i+63..64i + dotp_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function mulx_u(ts, tt, n)
   s = 0n || tsn-1..0 
   t = 0n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function dotp_u(ts, tt, n)
   p1 = mulx_u(ts2n-1..n, tt2n-1..n, n)
   p0 = mulx_u(tsn-1..0, ttn-1..0, n)
   p = p1 + p0
   return p2n-1..0
endfunction dotp_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

010011

6

3

2

5

5

5

6

Format:

DPSUB_S.df 

Vector Signed Dot Product and Subtract

DPSUB_S.H wd,ws,wt

MSA

Vector Signed Dot Product and Subtract

DPSUB_S.W wd,ws,wt

MSA

Vector Signed Dot Product and Subtract

DPSUB_S.D wd,ws,wt

MSA

Vector Signed Dot Product and Subtract

Purpose:

Vector Signed Dot Product and Subtract

Vector signed dot product (multiply and then pairwise add the adjacent multiplication results) and subtract from double width elements.

Description:

(wd[2i+1], wd[2i]) = (wd[2i+1], wd[2i]) - (signed(ws[2i+1]) * 
signed(wt[2i+1]) + signed(ws[2i]) * signed(wt[2i]))

The signed integer elements in vector wt are multiplied by signed integer elements in vector ws producing a signed result twice the size of the input ope rands. The sum of multiplication results of adjacent odd/even elements is subtracted from the integer elements in vector wd to a signed result.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

DPSUB_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i =
             WR[wd]16i+15..16i - dotp_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
DPSUB_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             WR[wd]32i+31..32i - dotp_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
DPSUB_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             WR[wd]64i+63..64i - dotp_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function dotp_s(ts, tt, n)
   p1 = mulx_s(ts2n-1..n, tt2n-1..n, n)
   p0 = mulx_s(tsn-1..0, ttn-1..0, n)
   p = p1 + p0
   return p2n-1..0
endfunction dotp_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

010011

6

3

2

5

5

5

6

Format:

DPSUB_U.df 

Vector Unsigned Dot Product and Subtract

DPSUB_U.H wd,ws,wt

MSA

Vector Unsigned Dot Product and Subtract

DPSUB_U.W wd,ws,wt

MSA

Vector Unsigned Dot Product and Subtract

DPSUB_U.D wd,ws,wt

MSA

Vector Unsigned Dot Product and Subtract

Purpose:

Vector Unsigned Dot Product and Subtract

Vector unsigned dot product (multiply and then pairwise add the adjacent multiplication results) and subtract from double width elements.

Description:

(wd[2i+1], wd[2i]) = (wd[2i+1], wd[2i]) - (unsigned(ws[2i+1]) * 
unsigned(wt[2i+1]) + unsigned(ws[2i]) * unsigned(wt[2i]))

The unsigned integer elements in vector wt are multiplied by unsigned integer elements in vector ws producing a positive, unsigned result twice the size of the input operands. The sum of multiplication results of adjacent odd/even elements is subtracted from the integer elements in vector wd to a signed result.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

DPSUB_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             WR[wd]16i+15..16i - dotp_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
DPSUB_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             WR[wd]32i+31..32i - dotp_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
DPSUB_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             WR[wd]64i+63..64i - dotp_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function mulx_u(ts, tt, n)
   s = 0n || tsn-1..0 
   t = 0n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function dotp_u(ts, tt, n)
   p1 = mulx_u(ts2n-1..n, tt2n-1..n, n)
   p0 = mulx_u(tsn-1..0, ttn-1..0, n)
   p = p1 + p0
   return p2n-1..0
endfunction dotp_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0000

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FADD.df 

Vector Floating-Point Addition

FADD.W wd,ws,wt

MSA

Vector Floating-Point Addition

FADD.D wd,ws,wt

MSA

Vector Floating-Point Addition

Purpose:

Vector Floating-Point Addition

Vector floating-point addition.

Description:

wd[i] = ws[i] + wt[i]

The floating-point elements in vector wt are added to the floating-point elements in vector ws. The result is written to vector wd.

The add operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FADD.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = AddFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FADD.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = AddFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function AddFP(tt, ts, n)
   /* Implementation defined add operation. */
endfunction AddFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0000

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCAF.df 

Vector Floating-Point Quiet Compare Always False

FCAF.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Always False

FCAF.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Always False

Purpose:

Vector Floating-Point Quiet Compare Always False

Vector to vector floating-point quiet compare always false; all destination bits are clear.

Description:

wd[i] = quietFalse(ws[i], wt[i])

Set all bits to 0 in wd elements. Signaling NaN elements in ws or wt signal Invalid Operation exception.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCAF.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = QuietFALSE(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FCAF.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = QuietFALSE(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function QuietFALSE(tt, ts, n)
   /* Implementation defined signaling NaN test */
   return 0
endfunction QuietFALSE

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0010

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCEQ.df 

Vector Floating-Point Quiet Compare Equal

FCEQ.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Equal

FCEQ.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Equal

Purpose:

Vector Floating-Point Quiet Compare Equal

Vector to vector floating-point quiet compare for equality; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] =(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are ordered and equal, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCEQ.W
   for i in 0 .. WRLEN/32-1
      c = EqualFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FCEQ.D
   for i in 0 .. WRLEN/64-1
      c = EqualFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function EqualFP(tt, ts, n)
   /* Implementation defined quiet equal compare operation. */
endfunction EqualFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010000

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FCLASS.df 

Vector Floating-Point Class Mask

FCLASS.W wd,ws

MSA

Vector Floating-Point Class Mask

FCLASS.D wd,ws

MSA

Vector Floating-Point Class Mask

Purpose:

Vector Floating-Point Class Mask

Vector floating-point class shown as a bit mask for Zero, Negative, Infinite, Subnormal, Quiet NaN, or Signaling

NaN.

Description:

wd[i] = class(ws[i])

Store in each element of v ector wd a bit mask reflecting the floating-point class of the correspo nding element of vector ws.

The mask has 10 bits as follows. Bits 0 and 1 indicate NaN values: signaling NaN (bit 0) and quiet NaN (bit 1). Bits

2, 3, 4, 5 classify negative values: infinity (bit 2), normal (bit 3), subnormal (bit 4), and zer o (bit 5). Bits 6, 7, 8, 9 classify positive values:infinity (bit 6), normal (bit 7), subnormal (bit 8), and zero (bit 9).

The input values and generated bit masks are not affected by the flush-to-zero bit FS in MSA Control and Status

Register MSACSR.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

FCLASS.W
   for i in 0 .. WRLEN/32-1
      c = ClassFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = 022 || c9..0
   endfor
FCLASS.D
   for i in 0 .. WRLEN/64-1
      c = ClassFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = 054 || c9..0
   endfor
function ClassFP(tt, n)
   /* Implementation defined class operation. */
endfunction ClassFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0110

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCLE.df 

Vector Floating-Point Quiet Compare Less or Equal

FCLE.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Less or Equal

FCLE.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Less or Equal

Purpose:

Vector Floating-Point Quiet Compare Less or Equal

Vector to vector floating-point quiet compare for less than or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <=(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are ordered and either less than or equal to wt floating-point elements, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCLE.W
   for i in 0 .. WRLEN/32-1
      c = LessFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = EqualFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FCLE.D
   for i in 0 .. WRLEN/64-1
      c = LessFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = EqualFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function LessThanFP(tt, ts, n)
   /* Implementation defined quiet less than compare operation. */
endfunction LessThanFP
function EqualFP(tt, ts, n)
   /* Implementation defined quiet equal compare operation. */
endfunction EqualFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0100

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCLT.df 

Vector Floating-Point Quiet Compare Less Than

FCLT.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Less Than

FCLT.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Less Than

Purpose:

Vector Floating-Point Quiet Compare Less Than

Vector to vector floating-point quiet compare for less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are ordered and less than wt floatingpoint elements, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCLT.W
   for i in 0 .. WRLEN/32-1
      c = LessFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FCLT.D
   for i in 0 .. WRLEN/64-1
      c = LessFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function LessThanFP(tt, ts, n)
   /* Implementation defined quiet less than compare operation. */
endfunction LessThanFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0011

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

FCNE.df 

Vector Floating-Point Quiet Compare Not Equal

FCNE.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Not Equal

FCNE.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Not Equal

Purpose:

Vector Floating-Point Quiet Compare Not Equal

Vector to vector floating-point quiet compare for not equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] !=(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are ordered and not equal, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCNE.W
   for i in 0 .. WRLEN/32-1
      c = NotEqualFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FCNE.D
   for i in 0 .. WRLEN/64-1
      c = NotEqualFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function NotEqualFP(tt, ts, n)
   /* Implementation defined quiet not equal compare operation. */
endfunction NotEqualFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0001

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

FCOR.df 

Vector Floating-Point Quiet Compare Ordered

FCOR.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Ordered

FCOR.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Ordered

Purpose:

Vector Floating-Point Quiet Compare Ordered

Vector to vector floating-point quiet compare ordered; if true all destination bits are set, otherwise clear.

Description:

wd[i] = ws[i] !?(quiet) wt[i]

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are ordered, i.e. both elements are not NaN values, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCOR.W
   for i in 0 .. WRLEN/32-1
      c =OrderedFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FCOR.D
   for i in 0 .. WRLEN/64-1
      c = OrderedFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function OrderedFP(tt, ts, n)
   /* Implementation defined quiet ordered compare operation. */
endfunction OrderedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0011

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCUEQ.df 

Vector Floating-Point Quiet Compare Unordered or Equal

FCUEQ.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Equal

FCUEQ.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Equal

Purpose:

Vector Floating-Point Quiet Compare Unordered or Equal

Vector to vector floating-point quiet compare for unordered or equality; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] =?(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are unordered or equal, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FCUEQ.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = EqualFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FCUEQ.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = EqualFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function UnorderedFP(tt, ts, n)
   /* Implementation defined quiet unordered compare operation. */
endfunction UnorderedFP
function EqualFP(tt, ts, n)
   /* Implementation defined quiet equal compare operation. */
endfunction EqualFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0111

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCULE.df 

Vector Floating-Point Quiet Compare Unordered or Less or Equal

FCULE.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Less or Equal

FCULE.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Less or Equal

Purpose:

Vector Floating-Point Quiet Compare Unordered or Less or Equal

Vector to vector floating-point quiet compare for unordered or less than or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <=?(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are unordered or less than or equal to wt floating-point elements, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FCULE.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = LessFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      e = EqualFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d | e)32
   endfor
FCULE.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = LessFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      e = EqualFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d | e)64
   endfor
function UnorderedFP(tt, ts, n)
   /* Implementation defined quiet unordered compare operation. */
endfunction UnorderedFP
function LessThanFP(tt, ts, n)
   /* Implementation defined quiet less than compare operation. */
endfunction LessThanFP
function EqualFP(tt, ts, n)
   /* Implementation defined quiet equal compare operation. */
endfunction EqualFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0101

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCULT.df 

Vector Floating-Point Quiet Compare Unordered or Less Than

FCULT.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Less Than

FCULT.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Less Than

Purpose:

Vector Floating-Point Quiet Compare Unordered or Less Than

Vector to vector floating-point quiet compare for unordered or less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <?(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are unordered or less than wt floatingpoint elements, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FCULT.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = LessFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FCULT.D
   for i in 0 .. WRLEN/64-1
      c = LessFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = UnorderedFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function UnorderedFP(tt, ts, n)
   /* Implementation defined quiet unordered compare operation. */
endfunction UnorderedFP
function LessThanFP(tt, ts, n)
   /* Implementation defined quiet less than compare operation. */
endfunction LessThanFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0001

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FCUN.df 

Vector Floating-Point Quiet Compare Unordered

FCUN.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered

FCUN.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered

Purpose:

Vector Floating-Point Quiet Compare Unordered

Vector to vector floating-point quiet compare unordered; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] ?(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are unordered, i.e. at least one element is a NaN value, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FCUN.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FCUN.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function UnorderedFP(tt, ts, n)
   /* Implementation defined quiet unordered compare operation. */
endfunction UnorderedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0010

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

FCUNE.df 

Vector Floating-Point Quiet Compare Unordered or Not Equal

FCUNE.W wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Not Equal

FCUNE.D wd,ws,wt

MSA

Vector Floating-Point Quiet Compare Unordered or Not Equal

Purpose:

Vector Floating-Point Quiet Compare Unordered or Not Equal

Vector to vector floating-point quiet compare for unordered or not equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] !=?(quiet) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are unordered or not equal, otherwise set all bits to 0.

The quiet compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FCUNE.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = NotEqualFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FCUNE.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = NotEqualFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function UnorderedFP(tt, ts, n)
   /* Implementation defined quiet unordered compare operation. */
endfunction UnorderedFP
function NotEqualFP(tt, ts, n)
   /* Implementation defined quiet not equal compare operation. */
endfunction NotEqualFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0011

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FDIV.df 

Vector Floating-Point Division

FDIV.W wd,ws,wt

MSA

Vector Floating-Point Division

FDIV.D wd,ws,wt

MSA

Vector Floating-Point Division

Purpose:

Vector Floating-Point Division

Vector floating-point division.

Description:

wd[i] = ws[i] / wt[i]

The floating-point elements in vector ws are divided by the floating-point elements in vector wt. The result is written to vector wd.

The divide operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FDIV.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = DivideFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FDIV.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = DivideFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function DivideFP(tt, ts, n)
   /* Implementation defined divide operation. */
endfunction DivideFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1000

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FEXDO.df 

Vector Floating-Point Down-Convert Interchange Format

FEXDO.H wd,ws,wt

MSA

Vector Floating-Point Down-Convert Interchange Format

FEXDO.W wd,ws,wt

MSA

Vector Floating-Point Down-Convert Interchange Format

Purpose:

Vector Floating-Point Down-Convert Interchange Format

Vector conversion to smaller interchange format.

Description:

left_half(wd)[i] = down_convert(ws[i]); right_half(wd)[i] = 
down_convert(wt[i])

The floating-point elements in vectors ws and wt are down-converted to a smaller interchange format, i.e. from 64-bit to 32-bit, or from 32-bit to 16-bit.

The format down-conversion operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

16-bit floating-point results are not affected by the flush-to-zero bit FS in MSA Control and Status Register MSACSR.

The operands are values in floating-point data format d ouble the size of df. The results are floating-point values in data format of df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FEXDO.H
   for i in 0 .. WRLEN/32-1
      f = DownConvertFP(WR[ws]32i+31..32i, 32)
      g = DownConvertFP(WR[wt]32i+31..32i, 32)
      WR[wd]16i+15+WRLEN/2..16i+WRLEN/2 = f
      WR[wd]16i+15..16i = g
   endfor
FEXDO.W
   for i in 0 .. WRLEN/64-1
      f = DownConvertFP(WR[ws]64i+63..64i, 64)
      g = DownConvertFP(WR[wt]64i+63..64i, 64)
      WR[wd]32i+31+WRLEN/2..32i+WRLEN/2 = f
      WR[wd]32i+31..32i = g
   endfor
function DownConvertFP(tt, n)
   /* Implementation defined format down-conversion. */
endfunction DownConvertFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0111

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FEXP2.df 

Vector Floating-Point Base 2 Exponentiation

FEXP2.W wd,ws,wt

MSA

Vector Floating-Point Base 2 Exponentiation

FEXP2.D wd,ws,wt

MSA

Vector Floating-Point Base 2 Exponentiation

Purpose:

Vector Floating-Point Base 2 Exponentiation

Vector floating-point base 2 exponentiation.

Description:

wd[i] = ws[i] * 2

wt[i]

The floating-point elements in vector ws are scaled, i.e. multiplied, by 2 to the power of integer elements in vector wt.

The result is written to vector wd.

The operation is the homogeneous scaleB() as defined by the IEEE Standard for Floating-Point Arithmetic 754TM2008.

The ws operands and wd results are values in floating-point data format df. The wt operands are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FEXP2.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = Exp2FP(WR[ws]32i+31..32i, WR[wt]32i+31..32i)
   endfor
FEXP2.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = Exp2FP(WR[ws]64i+63..64i, WR[wt]64i+63..64i)
   endfor
function Exp2FP(tt, ts, n)
   /* Implementation defined tt * 2ts operation. */
endfunction Exp2FP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011000

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FEXUPL.df 

Vector Floating-Point Up-Convert Interchange Format Left

FEXUPL.W wd,ws

MSA

Vector Floating-Point Up-Convert Interchange Format Left

FEXUPL.D wd,ws

MSA

Vector Floating-Point Up-Convert Interchange Format Left

Purpose:

Vector Floating-Point Up-Convert Interchange Format Left

Vector left elements conversion to wider interchange format.

Description:

wd[i] = up_convert(left_half(ws)[i])

The left half floating-point elements in vector ws are up-converted to a larger interchange format, i.e. from 16-bit to

32-bit, or from 32-bit to 64-bit. The result is written to vector wd.

The format up-conversion operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

16-bit floating-point inputs are not affected by the flush-to-zero bit FS in MSA Control and Status Register MSACSR.

The operands are values in floating-point data format half the size of df. The results are floating-point values in data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FEXUPL.W
   for i in 0 .. WRLEN/32-1
      f = UpConvertFP(WR[ws]16i+15+WRLEN/2..16i+WRLEN/2, 16)
      WR[wd]32i+31..32i = f
   endfor
FEXUPL.D
   for i in 0 .. WRLEN/64-1
      f = UpConvertFP(WR[ws]32i+31+WRLEN/2..32i+WRLEN/2, 32)
      WR[wd]64i+63..64i = f
   endfor
function UpConvertFP(tt, n)
   /* Implementation defined format up-conversion. */
endfunction UpConvertFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011001

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FEXUPR.df 

Vector Floating-Point Up-Convert Interchange Format Right

FEXUPR.W wd,ws

MSA

Vector Floating-Point Up-Convert Interchange Format Right

FEXUPR.D wd,ws

MSA

Vector Floating-Point Up-Convert Interchange Format Right

Purpose:

Vector Floating-Point Up-Convert Interchange Format Right

Vector right elements conversion to wider interchange format.

Description:

wd[i] = up_convert(right_half(ws)[i])

The right half floating-point elements in vector ws are up-converted to a larger interchange format, i.e. from 16-bit to

32-bit, or from 32-bit to 64-bit. The result is written to vector wd.

The format up-conversion operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

16-bit floating-point inputs are not affected by the flush-to-zero bit FS in MSA Control and Status Register MSACSR.

The operands are values in floating-point data format half the size of df. The results are floating-point values in data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FEXUPR.W
   for i in 0 .. WRLEN/32-1
      f = UpConvertFP(WR[ws]16i+15..16i, 16)
      WR[wd]32i+31..32i = f
   endfor
FEXUPR.D
   for i in 0 .. WRLEN/64-1
      f = UpConvertFP(WR[ws]32i+31..32i, 32)
      WR[wd]64i+63..64i = f
   endfor
function UpConvertFP(tt, n)
   /* Implementation defined format up-conversion. */
endfunction UpConvertFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011110

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FFINT_S.df 

Vector Floating-Point Round and Convert from Signed Integer

FFINT_S.W wd,ws

MSA

Vector Floating-Point Round and Convert from Signed Integer

FFINT_S.D wd,ws

MSA

Vector Floating-Point Round and Convert from Signed Integer

Purpose:

Vector Floating-Point Round and Convert from Signed Integer

Vector floating-point round and convert from signed integer.

Description:

wd[i] = from_int_s(ws[i])

The signed integer elements in ws are converted to floating-point values. The result is written to vector wd.

The integer to floating-point conversion operation is defined by the IEEE Standard for Floating-Point Arithmetic

754TM-2008.

The operands are values in integer data format df. The results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FFINT_S.W
   for i in 0 .. WRLEN/32-1
      f = FromIntSignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FFINT_S.D
   for i in 0 .. WRLEN/64-1
      f = FromIntSignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function FromFixPointFP(tt, n)
   /* Implementation defined signed integer to floating-point
         conversion. */
endfunction FromFixPointFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011111

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FFINT_U.df 

Vector Floating-Point Convert from Unsigned Integer

FFINT_U.W wd,ws

MSA

Vector Floating-Point Convert from Unsigned Integer

FFINT_U.D wd,ws

MSA

Vector Floating-Point Convert from Unsigned Integer

Purpose:

Vector Floating-Point Convert from Unsigned Integer

Vector floating-point convert from unsigned integer.

Description:

wd[i] = from_int_u(ws[i])

The unsigned integer elements in ws are converted to floating-point values. The result is written to vector wd.

The integer to floating-point conversion operation is defined by the IEEE Standard for Floating-Point Arithmetic

754TM-2008.

The operands are values in integer data format df. The results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FFINT_U.W
   for i in 0 .. WRLEN/32-1
      f = FromIntUnsignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FFINT_U.D
   for i in 0 .. WRLEN/64-1
      f = FromIntUnsignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function FromIntUnsignedFP(tt, n)
   /* Implementation defined unsigned integer to floating-point
         conversion. */
endfunction FromIntUnsignedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011010

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FFQL.df 

Vector Floating-Point Convert from Fixed-Point Left

FFQL.W wd,ws

MSA

Vector Floating-Point Convert from Fixed-Point Left

FFQL.D wd,ws

MSA

Vector Floating-Point Convert from Fixed-Point Left

Purpose:

Vector Floating-Point Convert from Fixed-Point Left

Vector left fix-point elements format conversion to floating-point doubling the element width.

Description:

wd[i] = from_q(left_half(ws)[i])

The left half fixed-point elements in vector ws are up-converted to floating-point data format, i.e. from 16-bit Q15 to

32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point. The result is written to vector wd.

The fixed-point Q15 or Q31 value is first converted to floating-point as a 16-bit or 32-bit integer (as though it was scaled up by 215 or 231) and then the resulting floating-point value is scaled down (divided by 215 or 231).

The scaling and integer to floating-point conversion operations are defined by the IEEE Standard for Floating-Point

Arithmetic 754TM-2008. No floating-point exceptions are possible because the input data is half the size of the output.

The operands are values in fixed-point data format half the size of df. The results are floating-point values in data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

FFQL.W
   for i in 0 .. WRLEN/32-1
      f = FromFixPointFP(WR[ws]16i+15+WRLEN/2..16i+WRLEN/2, 16)
      WR[wd]32i+31..32i = f
   endfor
FFQL.D
   for i in 0 .. WRLEN/64-1
      f = FromFixPointFP(WR[ws]32i+31+WRLEN/2..32i+WRLEN/2, 32)
      WR[wd]64i+63..64i = f
   endfor
function FromFixPointFP(tt, n)
   /* Implementation defined fixed-point to floating-point conversion. */
endfunction FromFixPointFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110011011

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FFQR.df 

Vector Floating-Point Convert from Fixed-Point Right

FFQR.W wd,ws

MSA

Vector Floating-Point Convert from Fixed-Point Right

FFQR.D wd,ws

MSA

Vector Floating-Point Convert from Fixed-Point Right

Purpose:

Vector Floating-Point Convert from Fixed-Point Right

Vector right fix-point elements format conversion to floating-point doubling the element width.

Description:

wd[i] = from_q(right_half(ws)[i]);

The right half fixed-point elements in vector ws are up-converted to floating-point data format, i.e. from 16-bit Q15 to

32-bit floating-point, or from 32-bit Q31 to 64-bit floating-point. The result is written to vector wd.

The fixed-point Q15 or Q31 value is first converted to floating-point as a 16-bit or 32-bit integer (as though it was scaled up by 215 or 231) and then the resulting floating-point value is scaled down (divided by 215 or 231).

The scaling and integer to floating-point conversion operations are defined by the IEEE Standard for Floating-Point

Arithmetic 754TM-2008. No floating-point exceptions are possible because the input data is half the size of the output.

The operands are values in fixed-point data format half the size of df. The results are floating-point values in data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

FFQR.W
   for i in 0 .. WRLEN/32-1
      f = FromFixPointFP(WR[ws]16i+15..16i, 16)
      WR[wd]32i+31..32i = f
   endfor
FFQR.D
   for i in 0 .. WRLEN/64-1
      f = FromFixPointFP(WR[wt]32i+31..32i, 32)
      WR[ws]64i+63..64i = f
   endfor
function FromFixPointFP(tt, n)
   /* Implementation defined fixed-point to floating-point conversion. */
endfunction FromFixPointFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

11000000

df

rs

wd

2R

011110

6

8

2

5

5

6

Format:

FILL.df 

Vector Fill from GPR

FILL.B wd,rs

MSA

Vector Fill from GPR

FILL.H wd,rs

MSA

Vector Fill from GPR

FILL.W wd,rs

MSA

Vector Fill from GPR

FILL.D wd,rs

MIPS64, MSA

Vector Fill from GPR

Purpose:

Vector Fill from GPR

Vector elements replicated from GPR.

Description:

wd[i] = rs

Replicate GPR rs value to all elements in vector wd. If the source GPR is wider than the destination data format, the destination's elements will be set to the least significant bits of the GPR.

Restrictions:

No data-dependent exceptions are possible.

Operation:

FILL.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = GPR[rs]7..0
   endfor
FILL.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = GPR[rs]15..0
   endfor
FILL.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = GPR[rs]31..0
   endfor
FILL.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = GPR[rs]63..0
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110010111

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FLOG2.df 

Vector Floating-Point Base 2 Logarithm

FLOG2.W wd,ws

MSA

Vector Floating-Point Base 2 Logarithm

FLOG2.D wd,ws

MSA

Vector Floating-Point Base 2 Logarithm

Purpose:

Vector Floating-Point Base 2 Logarithm

Vector floating-point base 2 logarithm.

Description:

wd[i] = log2(ws[i])

The signed integral base 2 e xponents of floating-point elements in vector ws are written as floating-point values to vector elements wd.

This operation is the homogeneous base 2 logB() as defined by the IEEE Standard for Floating-Point Arithmetic

754TM-2008.

The ws operands and wd results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FLOG2.W
   for i in 0 .. WRLEN/32-1
      l = Log2FP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = l
   endfor
FLOG2.D
   for i in 0 .. WRLEN/64-1
      f = Log2FP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function Log2FP(tt, n)
   /* Implementation defined logarithm base 2 operation. */
endfunction Log2FP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0100

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMADD.df 

Vector Floating-Point Multiply-Add

FMADD.W wd,ws,wt

MSA

Vector Floating-Point Multiply-Add

FMADD.D wd,ws,wt

MSA

Vector Floating-Point Multiply-Add

Purpose:

Vector Floating-Point Multiply-Add

Vector floating-point multiply-add

Description:

wd[i] = wd[i] + ws[i] * wt[i]

The floating-point elements in vector wt multiplied by floating-point elements in vector ws are added to the floatingpoint elements in vector wd. The operation is fused, i.e. computed as if with unbounded range and precision, rounding only once to the destination format.

The multiply add operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008. The multiplication between an infinity and a zero si gnals Invalid Operation exception. If the Invalid Operation exception is disabled, the result is the default quiet NaN.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMADD.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             MultiplyAddFP(WR[wd]32i+31..32i, WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMADD.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             MultiplyAddFP(WR[wd]64i+63..64i, WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      endfor
function MultiplyAddFP(td, tt, ts, n)
   /* Implementation defined multiply add operation. */
endfunction MultiplyAddFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1110

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMAX.df 

Vector Floating-Point Maximum

FMAX.W wd,ws,wt

MSA

Vector Floating-Point Maximum

FMAX.D wd,ws,wt

MSA

Vector Floating-Point Maximum

Purpose:

Vector Floating-Point Maximum

Vector floating-point maximum.

Description:

wd[i] = max(ws[i], wt[i])

The largest values between corresponding floating-point elements in vector ws and vector wt are written to vector wd.

The largest value is defined by the maxNum operation in the IEEE Standard for Floating-Point Arithmetic 754TM2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMAX.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = MaxFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMAX.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = MaxFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function MaxFP(tt, ts, n)
   /* Implementation defined, returns the largest argument. */
endfunction MaxFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1111

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMAX_A.df 

Vector Floating-Point Maximum Based on Absolute Values

FMAX_A.W wd,ws,wt

MSA

Vector Floating-Point Maximum Based on Absolute Values

FMAX_A.D wd,ws,wt

MSA

Vector Floating-Point Maximum Based on Absolute Values

Purpose:

Vector Floating-Point Maximum Based on Absolute Values

Vector floating-point maximum based on the magnitude, i.e. 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 floating-point elements in vector ws and vector wt are written to vector wd.

The largest absolute value is defined by the maxNumMag operation in the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMAX_A.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = MaxAbsoluteFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMAX_A.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = MaxAbsoluteFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function MaxAbsoluteFP(tt, ts, n)
   /* Implementation defined, returns the argument with largest
         absolute value. For equal absolute values, returns the largest
         argument.*/
endfunction MaxAbsoluteFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1100

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMIN.df 

Vector Floating-Point Minimum

FMIN.W wd,ws,wt

MSA

Vector Floating-Point Minimum

FMIN.D wd,ws,wt

MSA

Vector Floating-Point Minimum

Purpose:

Vector Floating-Point Minimum

Vector floating-point minimum.

Description:

wd[i] = min(ws[i], wt[i])

in v ector ws and v ector wt are written

The smallest value between corresponding floating-point elements to vector wd.

The smallest value is defined by the minNum operation in the IEEE Standard for Floating-Point Arithmetic 754TM2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMIN.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = MinFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMIN.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = MinFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function MinFP(tt, ts, n)
   /* Implementation defined, returns the smallest argument. */
endfunction MinFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1101

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMIN_A.df 

Vector Floating-Point Minimum Based on Absolute Values

FMIN_A.W wd,ws,wt

MSA

Vector Floating-Point Minimum Based on Absolute Values

FMIN_A.D wd,ws,wt

MSA

Vector Floating-Point Minimum Based on Absolute Values

Purpose:

Vector Floating-Point Minimum Based on Absolute Values

Vector floating-point minimum based on the magnitude, i.e. absolute values.

Description:

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

The value with the smallest magnitude, i.e. absol ute value, between corres ponding floating-point elements in vector ws and vector wt are written to vector wd.

The smallest absolute value is defined by the minNumMag operation in the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMIN_A.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = MinAbsoluteFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMIN_A.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = MinAbsoluteFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function MinAbsoluteFP(tt, ts, n)
   /* Implementation defined, returns the argument with smallest
         absolute value. For equal absolute values, returns the smallest
         argument.*/
endfunction MinAbsoluteFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0101

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMSUB.df 

Vector Floating-Point Multiply-Sub

FMSUB.W wd,ws,wt

MSA

Vector Floating-Point Multiply-Sub

FMSUB.D wd,ws,wt

MSA

Vector Floating-Point Multiply-Sub

Purpose:

Vector Floating-Point Multiply-Sub

Vector floating-point multiply-sub

Description:

wd[i] = wd[i] - ws[i] * wt[i]

The floating-point elements in vector wt multiplied by floating-point elements in vector ws are subtracted from the floating-point elements in vector wd. The operation is fused, i.e. computed as if with unbounded range and precision, rounding only once to the destination format.

The multiply subtract operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008. The multiplication between an infinity and a zero signals Invalid Operation exception. If the Invalid Operation exception is disabled, the result is the default quiet NaN.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMSUB.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             MultiplySubFP(WR[wd]32i+31..32i, WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMSUB.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             MultiplySubFP(WR[wd]64i+63..64i, WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function MultiplySubFP(td, tt, ts, n)
   /* Implementation defined multiply subtract operation. */
endfunction MultiplySubFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0010

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FMUL.df 

Vector Floating-Point Multiplication

FMUL.W wd,ws,wt

MSA

Vector Floating-Point Multiplication

FMUL.D wd,ws,wt

MSA

Vector Floating-Point Multiplication

Purpose:

Vector Floating-Point Multiplication

Vector floating-point multiplication.

Description:

wd[i] = ws[i] * wt[i]

The floating-point elements in vector wt are multiplied by the floating-point elements in vector ws. The result is written to vector wd.

The multiplication operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FMUL.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = MultiplyFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FMUL.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = MultiplyFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function MultiplyFP(tt, ts, n)
   /* Implementation defined multiplication operation. */
endfunction MultiplyFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010101

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FRCP.df 

Vector Approximate Floating-Point Reciprocal

FRCP.W wd,ws

MSA

Vector Approximate Floating-Point Reciprocal

FRCP.D wd,ws

MSA

Vector Approximate Floating-Point Reciprocal

Purpose:

Vector Approximate Floating-Point Reciprocal

Vector floating-point reciprocal.

Description:

wd[i] = 1.0 / ws[i]

The reciprocals of fl oating-point elements in vector ws are calculated as specif ied below. The result is w ritten to vector wd.

The compliant reciprocal operation is defined as 1.0 divided by element value, where the IEEE Standard for FloatingPoint Arithmetic 754TM-2008 defined divide operation is affected by the rounding mode bits RM and flush-to-zero bit FS in MSA Control and Status Register MSACSR. The compliant reciprocals signal all the exceptions specified by the IEEE Standard for Floating-Point Arithmetic 754TM-2008 for the divide operation.

The reciprocal operation is allowed to be approximate. The approximation differs from the compliant reciprocal representation by no more than one unit in the least significant place. Approximate reciprocal operations signal the Inexact exception if the compliant reciprocal is Inexact or if there is a chance the approximated result may differ from the compliant reciprocal. Approximate reciprocal operations are allowed to not signal the Overflow or Underflow exceptions. The Invalid and divide by Zero exceptions are signaled based on the IEEE Standard for Floating-Point Arithmetic 754TM-2008 defined divide operation.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FRCP.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = ReciprocalFP(WR[ws]32i+31..32i, 32)
   endfor
FRCP.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = ReciprocalFP(WR[ws]64i+63..64i, 64)
   endfor
function ReciprocalFP(tt, ts, n)
   /* Implementation defined Reciprocal operation. */
endfunction ReciprocalFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010110

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FRINT.df 

Vector Floating-Point Round to Integer

FRINT.W wd,ws

MSA

Vector Floating-Point Round to Integer

FRINT.D wd,ws

MSA

Vector Floating-Point Round to Integer

Purpose:

Vector Floating-Point Round to Integer

Vector floating-point round to integer.

Description:

wd[i] = round_int(ws[i])

The floating-point elements in vector ws are rounded to an integral valued floating-point number in the same format based on the rounding mode bits RM in MSA Control and Status Register MSACSR. The result is written to vector wd.

The round to integer operation is exact as defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FRINT.W
   for i in 0 .. WRLEN/32-1
      f = RoundIntFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FRINT.D
   for i in 0 .. WRLEN/64-1
      f = RoundIntFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function RoundIntFP(tt, n)
   /* Implementation defined round to integer operation. */
endfunction RoundIntFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010100

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FRSQRT.df 

Vector Approximate Floating-Point Reciprocal of Square Root

FRSQRT.W wd,ws

MSA

Vector Approximate Floating-Point Reciprocal of Square Root

FRSQRT.D wd,ws

MSA

Vector Approximate Floating-Point Reciprocal of Square Root

Purpose:

Vector Approximate Floating-Point Reciprocal of Square Root

Vector floating-point reciprocal of square root.

Description:

wd[i] = 1.0 / sqrt(ws[i])

roots of floating-point elements in vector ws are calculated as specif ied below. The

The reciprocals of the square result is written to vector wd.

The compliant reciprocal of the square root operation is defined as 1.0 di vided by the square root of the element value, where the IEEE Standard for Floating-Point Arithmetic 754TM-2008 defined divide and square root operations are affected by the rounding mode bits RM and flush-to-zero bit FS in MSA Control and Status Register MSACSR.

The compliant reciprocals of the square roots signal all the exceptions specified by the IEEE Standard for FloatingPoint Arithmetic 754TM-2008 for the divide and square roots operations.

The reciprocal of the square root operation is allowed to be approximate. The approximation differs from the compliant reciprocal of the square root representation by no more than two units in the least significant place. Approximate reciprocal of the square root operations signal the Inexact exception if the compliant reciprocal of the square root is

Inexact or if there is a chance the appr oximated result may differ from the compliant reciprocal of the square root.

The Invalid and divide by Zero exceptions are signaled based on the IEEE Stand ard for Floating-Point Arithmetic

754TM-2008 defined divide operation.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FRSQRT.W
   for i in 0 .. WRLEN/32-1
      f = SquareRootReciprocalFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FRSQRT.D
   for i in 0 .. WRLEN/64-1
      f = SquareRootReciprocalFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function SquareRootReciprocalFP(tt, ts, n)
   /* Implementation defined square root reciprocal operation. */
endfunction SquareRootReciprocalFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1000

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSAF.df 

Vector Floating-Point Signaling Compare Always False

FSAF.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Always False

FSAF.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Always False

Purpose:

Vector Floating-Point Signaling Compare Always False

Vector to vector floating-point signaling compare always false; all destination bits are clear.

Description:

wd[i] = signalingFalse(ws[i], wt[i])

Set all bits to 0 in wd elements. Signaling and quiet NaN elements in ws or wt signal Invalid Operation exception.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSAF.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = SignalingFALSE(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FSAF.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = SignalingFALSE(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function SignalingFALSE(tt, ts, n)
   /* Implementation defined signaling and quiet NaN test */
   return 0
endfunction SignalingFALSE

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1010

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSEQ.df 

Vector Floating-Point Signaling Compare Equal

FSEQ.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Equal

FSEQ.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Equal

Purpose:

Vector Floating-Point Signaling Compare Equal

Vector to vector floating-point signaling compare for equality; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] =(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are equal, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSEQ.W
   for i in 0 .. WRLEN/32-1
      c = EqualSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FSEQ.D
   for i in 0 .. WRLEN/64-1
      c = EqualSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function EqualSigFP(tt, ts, n)
   /* Implementation defined signaling equal compare operation. */
endfunction EqualSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1110

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSLE.df 

Vector Floating-Point Signaling Compare Less or Equal

FSLE.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Less or Equal

FSLE.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Less or Equal

Purpose:

Vector Floating-Point Signaling Compare Less or Equal

Vector to vector floating-point signaling compare for less than or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <=(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are less than or equal to wt floatingpoint elements, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FSLE.W
   for i in 0 .. WRLEN/32-1
      c = LessSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = EqualSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FSLE.D
   for i in 0 .. WRLEN/64-1
      c = LessSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = EqualSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function LessThanSigFP(tt, ts, n)
   /* Implementation defined signaling less than compare operation. */
endfunction LessThanSigFP
function EqualSigFP(tt, ts, n)
   /* Implementation defined signaling equal compare operation. */
endfunction EqualSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1100

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSLT.df 

Vector Floating-Point Signaling Compare Less Than

FSLT.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Less Than

FSLT.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Less Than

Purpose:

Vector Floating-Point Signaling Compare Less Than

Vector to vector floating-point signaling compare for less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are less than wt floating-point elements, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSLT.W
   for i in 0 .. WRLEN/32-1
      c = LessSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FSLT.D
   for i in 0 .. WRLEN/64-1
      c = LessSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function LessThanSigFP(tt, ts, n)
   /* Implementation defined signaling less than compare operation. */
endfunction LessThanSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1011

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

FSNE.df 

Vector Floating-Point Signaling Compare Not Equal

FSNE.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Not Equal

FSNE.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Not Equal

Purpose:

Vector Floating-Point Signaling Compare Not Equal

Vector to vector floating-point signaling compare for not equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] !=(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are not equal, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSNE.W
   for i in 0 .. WRLEN/32-1
      c = NotEqualSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FSNE.D
   for i in 0 .. WRLEN/64-1
      c = NotEqualSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function NotEqualSigFP(tt, ts, n)
   /* Implementation defined signaling not equal compare operation. */
endfunction NotEqualSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1001

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

FSOR.df 

Vector Floating-Point Signaling Compare Ordered

FSOR.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Ordered

FSOR.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Ordered

Purpose:

Vector Floating-Point Signaling Compare Ordered

Vector to vector floating-point signaling compare ordered; if true all destination bits are set, otherwise clear.

Description:

wd[i] = ws[i] !?(signaling) wt[i]

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are ordered, i.e. both elements are not NaN values, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

0.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSOR.W
   for i in 0 .. WRLEN/32-1
      c = OrderedSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FSOR.D
   for i in 0 .. WRLEN/64-1
      c = OrderedSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function OrderedSigFP(tt, ts, n)
   /* Implementation defined signaling ordered compare operation. */
endfunction OrderedSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010011

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FSQRT.df 

Vector Floating-Point Square Root

FSQRT.W wd,ws

MSA

Vector Floating-Point Square Root

FSQRT.D wd,ws

MSA

Vector Floating-Point Square Root

Purpose:

Vector Floating-Point Square Root

Vector floating-point square root.

Description:

wd[i] = sqrt(ws[i])

The square roots of floating-point elements in vector ws are written to vector wd.

The square root operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSQRT.W
   for i in 0 .. WRLEN/32-1
      f = SquareRootFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FSQRT.D
   for i in 0 .. WRLEN/64-1
      f = SquareRootFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function SquareRootFP(tt, ts, n)
   /* Implementation defined square root operation. */
endfunction SquareRootFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

0001

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FSUB.df 

Vector Floating-Point Subtraction

FSUB.W wd,ws,wt

MSA

Vector Floating-Point Subtraction

FSUB.D wd,ws,wt

MSA

Vector Floating-Point Subtraction

Purpose:

Vector Floating-Point Subtraction

Vector floating-point subtraction.

Description:

wd[i] = ws[i] - wt[i]

The floating-point elements in vector wt are subtracted from the floa ting-point elements in vector ws. The result is written to vector wd.

The subtract operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The operands and results are values in floating-point data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSUB.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = SubtractFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
FSUB.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = SubtractFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function SubtractFP(tt, ts, n)
   /* Implementation defined subtract operation. */
endfunction SubtractFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1011

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSUEQ.df 

Vector Floating-Point Signaling Compare Unordered or Equal

FSUEQ.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Equal

FSUEQ.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Equal

Purpose:

Vector Floating-Point Signaling Compare Unordered or Equal

Vector to vector floating-point signaling compare for unordered or equality; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] =?(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are unordered or equal, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FSUEQ.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = EqualSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FSUEQ.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = EqualSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function UnorderedSigFP(tt, ts, n)
   /* Implementation defined signaling unordered compare operation. */
endfunction UnorderedSigFP
function EqualSigFP(tt, ts, n)
   /* Implementation defined signaling equal compare operation. */
endfunction EqualSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1111

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSULE.df 

Vector Floating-Point Signaling Compare Unordered or Less or Equal

FSULE.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Less or Equal

FSULE.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Less or Equal

Purpose:

Vector Floating-Point Signaling Compare Unordered or Less or Equal

Vector to vector floating-point signaling compare for unordered or less than or equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <=?(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are unordered or less than or equal to wt floating-point elements, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FSULE.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = LessSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      e = EqualSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d | e)32
   endfor
FSULE.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = LessSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      e = EqualSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d | e)64
   endfor
function UnorderedSigFP(tt, ts, n)
   /* Implementation defined signaling unordered compare operation. */
endfunction UnorderedSigFP
function LessThanSigFP(tt, ts, n)
   /* Implementation defined signaling less than compare operation. */
endfunction LessThanSigFP
function EqualSigFP(tt, ts, n)
   /* Implementation defined signaling equal compare operation. */
endfunction EqualSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1101

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSULT.df 

Vector Floating-Point Signaling Compare Unordered or Less Than

FSULT.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Less Than

FSULT.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Less Than

Purpose:

Vector Floating-Point Signaling Compare Unordered or Less Than

Vector to vector floating-point signaling compare for unordered or less than; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] <?(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws floating-point elements are unordered or less than wt floatingpoint elements, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FSULT.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = LessSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FSULT.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      d = LessSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function UnorderedSigFP(tt, ts, n)
   /* Implementation defined signaling unordered compare operation. */
endfunction UnorderedSigFP
function LessThanSigFP(tt, ts, n)
   /* Implementation defined signaling less than compare operation. */
endfunction LessThanSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1001

df

wt

ws

wd

3RF

011010

6

4

1

5

5

5

6

Format:

FSUN.df 

Vector Floating-Point Signaling Compare Unordered

FSUN.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered

FSUN.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered

Purpose:

Vector Floating-Point Signaling Compare Unordered

Vector to vector floating-point signaling compare unordered; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] ?(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are unordered, i.e. at least one element is a NaN value, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM2008.

Operation:

FSUN.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = c32
   endfor
FSUN.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = c64
   endfor
function UnorderedSigFP(tt, ts, n)
   /* Implementation defined signaling unordered compare operation. */
endfunction UnorderedSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1010

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

FSUNE.df 

Vector Floating-Point Signaling Compare Unordered or Not Equal

FSUNE.W wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Not Equal

FSUNE.D wd,ws,wt

MSA

Vector Floating-Point Signaling Compare Unordered or Not Equal

Purpose:

Vector Floating-Point Signaling Compare Unordered or Not Equal

Vector to vector floating-point signaling compare for unordered or not equal; if true all destination bits are set, otherwise clear.

Description:

wd[i] = (ws[i] !=?(signaling) wt[i])

Set all bits to 1 in wd elements if the corresponding ws and wt floating-point elements are unordered or not equal, otherwise set all bits to 0.

The signaling compare operation is defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008.

The Inexact Exception is not signaled when subnormal input operands are flushed based on the flush-to-zero bit FS in

MSA Control and Status Register MSACSR. In case of a floating-point exception, the default result has all bits set to

1.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are poss ible as s pecified by the I EEE Standard for Floating-Point Arithmetic 754TM

2008.

Operation:

FSUNE.W
   for i in 0 .. WRLEN/32-1
      c = UnorderedSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      d = NotEqualSigFP(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
      WR[wd]32i+31..32i = (c | d)32
   endfor
FSUNE.D
   for i in 0 .. WRLEN/64-1
      c = UnorderedSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      c = NotEqualSigFP(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
      WR[wd]64i+63..64i = (c | d)64
   endfor
function UnorderedSigFP(tt, ts, n)
   /* Implementation defined signaling unordered compare operation. */
endfunction UnorderedSigFP
function NotEqualSigFP(tt, ts, n)
   /* Implementation defined signaling not equal compare operation. */
endfunction NotEqualSigFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011100

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FTINT_S.df 

Vector Floating-Point Convert to Signed Integer

FTINT_S.W wd,ws

MSA

Vector Floating-Point Convert to Signed Integer

FTINT_S.D wd,ws

MSA

Vector Floating-Point Convert to Signed Integer

Purpose:

Vector Floating-Point Convert to Signed Integer

Vector floating-point convert to signed integer.

Description:

wd[i] = to_int_s(ws[i])

The floating-point elements in ws are rounded and converted to signed integer values based on the rounding mode bits

RM in MSA Control and Status Register MSACSR. The result is written to vector wd.

The floating-point to integer conversion operation is exact as defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand. In this case, the default result is the rounded result.

NaN values and numeric operands converting to an integer outside the range of the destination format signal the

Invalid Operation exception. For positive numeric operands outside the range, the default result is the largest signed integer value. The default result for negative numeric operands outside the range is the smallest signed integer value.

The default result for NaN operands is zero.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are possible.

Operation:

FTINT_S.W
   for i in 0 .. WRLEN/32-1
      f = ToIntSignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FTINT_S.D
   for i in 0 .. WRLEN/64-1
      f = ToIntSignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function ToIntSignedFP(tt, n)
   /* Implementation defined floating-point rounding and signed
         integer conversion. */
endfunction ToIntSignedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110011101

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FTINT_U.df 

Vector Floating-Point Round and Convert to Unsigned Integer

FTINT_U.W wd,ws

MSA

Vector Floating-Point Round and Convert to Unsigned Integer

FTINT_U.D wd,ws

MSA

Vector Floating-Point Round and Convert to Unsigned Integer

Purpose:

Vector Floating-Point Round and Convert to Unsigned Integer

Vector floating-point round and convert to unsigned integer.

Description:

wd[i] = to_int_u(ws[i])

The floating-point elements in ws are rounded and converted to unsigned integer values based on the rounding mode bits RM in MSA Control and Status Register MSACSR. The result is written to vector wd.

The floating-point to integer conversion operation is exact as defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand. In this case, the default result is the rounded result.

NaN values and numeric operands converting to an integer outside the range of the destination format signal the

Invalid Operation exception. For positive numeric operands outside the range, the default result is the largest unsigned integer value. The default result for negative numeric operands is zero. The default result for NaN operands is zero.

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

Restrictions:

Data-dependent exceptions are possible.

Operation:

FTINT_U.W
   for i in 0 .. WRLEN/32-1
      f = ToIntUnsignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FTINT_U.D
   for i in 0 .. WRLEN/64-1
      f = ToIntUnsignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function ToIntUnsignedFP(tt, n)
   /* Implementation defined floating-point rounding and unsigned
         integer conversion. */
endfunction ToIntUnsignedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

1010

df

wt

ws

wd

3RF

011011

6

4

1

5

5

5

6

Format:

FTQ.df 

Vector Floating-Point Convert to Fixed-Point

FTQ.H wd,ws,wt

MSA

Vector Floating-Point Convert to Fixed-Point

FTQ.W wd,ws,wt

MSA

Vector Floating-Point Convert to Fixed-Point

Purpose:

Vector Floating-Point Convert to Fixed-Point

Vector fix-point format conversion from floating-point.

Description:

left_half(wd)[i] = to_q(ws[i]); right_half(wd)[i] = to_q(wt[i])

The floating-point elements in vectors ws and wt are down-converted to a fixed-point representation, i.e. from 64-bit floating-point to 32-bit Q31 fixed-point representation, or from 32-bit floating-point to 16-bit Q15 fixed-point representation.

The floating-point data inside the fixed-point range is first scaled up (multiplied by 215 or 231) and then rounded and converted to a 16-bit or 32 -bit integer based on the ro unding mode bits RM in MSA Control and St atus

Register MSACSR. The resulting value is the Q15 or Q31 representation.

The scaling and floating-point to integer conversion operations are defined by the IEEE Standard for Floating-Point

Arithmetic 754TM-2008. The integer conversion operation is exact, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand. In this case, the default result is the rounded result.

NaN values signal the Invalid Operation exception. Numeric operands converting to fixed-point values outside the range of the destination format signal the Overflow and the Inexact exceptions. For positive numeric operands outside

the range, the default result is the largest fixed-point value. The default result for negative numeric operands outside the range is the smallest fixed-point value. The default result for NaN operands is zero.

The operands are values in floating-point data format df. The results are fixed-point values in data format half the size of df.

Restrictions:

Data-dependent exceptions are possible.

Operation:

FTQ.H
   for i in 0 .. WRLEN/32-1
      q = ToFixPointFP((WR[ws]32i+31..32i, 32)
      r = ToFixPointFP((WR[wt]32i+31..32i, 32)
      WR[wd]16i+15+WRLEN/2..16i+WRLEN/2 = q
      WR[wd]16i+15..16i = r
   endfor
FTQ.W
   for i in 0 .. WRLEN/64-1
      q = ToFixPointFP((WR[ws]64i+63..64i, 64)
      r = ToFixPointFP((WR[wt]64i+63..64i, 64)
      WR[wd]32i+31+WRLEN/2..32i+WRLEN/2 = q
      WR[wd]32i+31..32i = r
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010001

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FTRUNC_S.df 

Vector Floating-Point Truncate and Convert to Signed Integer

FTRUNC_S.W wd,ws

MSA

Vector Floating-Point Truncate and Convert to Signed Integer

FTRUNC_S.D wd,ws

MSA

Vector Floating-Point Truncate and Convert to Signed Integer

Purpose:

Vector Floating-Point Truncate and Convert to Signed Integer

Vector floating-point truncate and convert to signed integer.

Description:

wd[i] = truncate_to_int_s(ws[i])

The floating-point elements in ws are truncated, i.e. rounded toward zero, to signed integer values. The rounding mode bits RM in MSA Control and Status Register MSACSR are not used. The result is written to vector wd.

The floating-point to integer conversion operation is exact as defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand. In this case, the default result is the rounded result.

NaN values and numeric operands converting to an integer outside the range of the destination format signal the

Invalid Operation exception. For positive numeric operands outside the range, the default result is the largest signed integer value. The default result for negative numeric operands outside the range is the smallest signed integer value.

The default result for NaN operands is zero.

The operands are values in floating-point data format df. The results are values in integer data format df.

Restrictions:

Data-dependent exceptions are possible.

Operation:

FTRUNC_S.W
   for i in 0 .. WRLEN/32-1
      f = TruncToIntSignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FTRUNC_S.D
   for i in 0 .. WRLEN/64-1
      f = TruncToIntSignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function TruncToIntSignedFP(tt, n)
   /* Implementation defined floating-point truncation and signed
         integer conversion. */
endfunction TruncToIntSignedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

110010010

df

ws

wd

2RF

011110

6

9

1

5

5

6

Format:

FTRUNC_U.df 

Vector Floating-Point Truncate and Convert to Unsigned Integer

FTRUNC_U.W wd,ws

MSA

Vector Floating-Point Truncate and Convert to Unsigned Integer

FTRUNC_U.D wd,ws

MSA

Vector Floating-Point Truncate and Convert to Unsigned Integer

Purpose:

Vector Floating-Point Truncate and Convert to Unsigned Integer

Vector floating-point truncate and convert to unsigned integer.

Description:

wd[i] = truncate_to_int_u(ws[i])

The floating-point elements in ws are truncated, i.e. rounded toward zero, to unsigned integer values. The rounding mode bits RM in MSA Control and Status Register MSACSR are not used. The result is written to vector wd.

The floating-point to integer conversion operation is exact as defined by the IEEE Standard for Floating-Point Arithmetic 754TM-2008, i.e. the Inexact exception is signaled if the result does not have the same numerical value as the input operand. In this case, the default result is the rounded result.

NaN values and numeric operands converting to an integer outside the range of the destination format signal the

Invalid Operation exception. For positive numeric operands outside the range, the default result is the largest unsigned integer value. The default value for negative numeric operands is zero. The default result for NaN operands is zero.

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

Restrictions:

Data-dependent exceptions are possible.

Operation:

FTRUNC_U.W
   for i in 0 .. WRLEN/32-1
      f = TruncToIntUnsignedFP(WR[ws]32i+31..32i, 32)
      WR[wd]32i+31..32i = f
   endfor
FTRUNC_U.D
   for i in 0 .. WRLEN/64-1
      f = TruncToIntUnsignedFP(WR[ws]64i+63..64i, 64)
      WR[wd]64i+63..64i = f
   endfor
function TruncToIntUnsignedFP(tt, n)
   /* Implementation defined floating-point truncation and unsigned
         integer conversion. */
endfunction TruncToIntUnsignedFP

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception, MSA Floating Point Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

HADD_S.df 

Vector Signed Horizontal Add

HADD_S.H wd,ws,wt

MSA

Vector Signed Horizontal Add

HADD_S.W wd,ws,wt

MSA

Vector Signed Horizontal Add

HADD_S.D wd,ws,wt

MSA

Vector Signed Horizontal Add

Purpose:

Vector Signed Horizontal Add

Vector sign extend and pairwise add the odd elements with the even elements to double width elements

Description:

(wd[2i+1], wd[2i]) = signed(ws[2i+1]) + signed(wt[2i])

The sign-extended odd elements in vector ws are added to the sign-extended even elements in vector wt producing a result twice the size of the input operands. The result is written to vector wd.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

HADD_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = hadd_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
HADD_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = hadd_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
HADD_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = hadd_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function hadd_s(ts, tt, n)
   t = ((ts2n-1)n || ts2n-1..n) + ((ttn-1)n || ttn-1..0)
   return t
endfunction hadd_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

HADD_U.df 

Vector Unsigned Horizontal Add

HADD_U.H wd,ws,wt

MSA

Vector Unsigned Horizontal Add

HADD_U.W wd,ws,wt

MSA

Vector Unsigned Horizontal Add

HADD_U.D wd,ws,wt

MSA

Vector Unsigned Horizontal Add

Purpose:

Vector Unsigned Horizontal Add

Vector zero extend and pairwise add the odd elements with the even elements to double width elements

Description:

(wd[2i+1], wd[2i]) = unsigned(ws[2i+1]) + unsigned(wt[2i])

The zero-extended odd elements in vector ws are added to the zero-extended even elements in vector wt producing a result twice the size of the input operands. The result is written to vector wd.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

HADD_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = hadd_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
HADD_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = hadd_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
HADD_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = hadd_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function hadd_u(ts, tt, n)
   t = (0n || ts2n-1..n) + (0n || ttn-1..0)
   return t
endfunction hadd_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

HSUB_S.df 

Vector Signed Horizontal Subtract

HSUB_S.H wd,ws,wt

MSA

Vector Signed Horizontal Subtract

HSUB_S.W wd,ws,wt

MSA

Vector Signed Horizontal Subtract

HSUB_S.D wd,ws,wt

MSA

Vector Signed Horizontal Subtract

Purpose:

Vector Signed Horizontal Subtract

Vector sign extend and pairwise subtract the even elements from the odd elements to double width elements

Description:

(wd[2i+1], wd[2i]) = signed(ws[2i+1]) - signed(wt[2i])

The sign-extended odd elements in vector wt are subtracted from the sign-extended even elements in vector wt producing a signed result twice the size of the input operands. The result is written to vector wd.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

HSUB_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = hsub_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
HSUB_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = hsub_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
HSUB_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = hsub_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function hsub_s(ts, tt, n)
   t = ((ts2n-1)n || ts2n-1..n) - ((ttn-1)n || ttn-1..0)
   return t
endfunction hsub_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

HSUB_U.df 

Vector Unsigned Horizontal Subtract

HSUB_U.H wd,ws,wt

MSA

Vector Unsigned Horizontal Subtract

HSUB_U.W wd,ws,wt

MSA

Vector Unsigned Horizontal Subtract

HSUB_U.D wd,ws,wt

MSA

Vector Unsigned Horizontal Subtract

Purpose:

Vector Unsigned Horizontal Subtract

Vector zero extend and pairwise subtract the even elements from the odd elements to double width elements

Description:

(wd[2i+1], wd[2i]) = unsigned(ws[2i+1]) - unsigned(wt[2i])

The zero-extended odd elements in vector wt are subtracted from the zero-extended even elements in vector ws producing a signed result twice the size of the input operands. The result is written to vector wd.

The operands are values in integer data format half the size of df. The results are values in integer data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

HSUB_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = hsub_u(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 8)
   endfor
HSUB_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = hsub_u(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 16)
   endfor
HSUB_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = hsub_u(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 32)
   endfor
function hsub_u(ts, tt, n)
   t = (0n || ts2n-1..n) - (0n || ttn-1..0)
   return t
endfunction hsub_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110

df

wt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

ILVEV.df 

Vector Interleave Even

ILVEV.B wd,ws,wt

MSA

Vector Interleave Even

ILVEV.H wd,ws,wt

MSA

Vector Interleave Even

ILVEV.W wd,ws,wt

MSA

Vector Interleave Even

ILVEV.D wd,ws,wt

MSA

Vector Interleave Even

Purpose:

Vector Interleave Even

Vector even elements interleave.

Description:

wd[2i] = wt[2i]; wd[2i+1] = ws[2i]

Even elements in v ectors ws and wt are copied to vector wd alternating one element from ws with one element from wt.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ILVEV.B
   for i in 0 .. WRLEN/16-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]8j+7..8j = WR[wt]8j+7..8j
      WR[wd]8k+7..8k = WR[ws]8j+7..8j
   endfor
ILVEV.H
   for i in 0 .. WRLEN/32-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]16j+15..16j = WR[wt]16j+15..16j
      WR[wd]16k+15..16k = WR[ws]16j+15..16j
   endfor
ILVEV.W
   for i in 0 .. WRLEN/64-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]32j+31..32j = WR[wt]32j+31..32j
      WR[wd]32k+31..32k = WR[ws]32j+31..32j
   endfor
ILVEV.D
   for i in 0 .. WRLEN/128-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]64j+63..64j = WR[wt]64j+63..64j
      WR[wd]64k+63..64k = WR[ws]64j+63..64j
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

ILVL.df 

Vector Interleave Left

ILVL.B wd,ws,wt

MSA

Vector Interleave Left

ILVL.H wd,ws,wt

MSA

Vector Interleave Left

ILVL.W wd,ws,wt

MSA

Vector Interleave Left

ILVL.D wd,ws,wt

MSA

Vector Interleave Left

Purpose:

Vector Interleave Left

Vector left elements interleave.

Description:

wd[2i] = left_half(wt)[i]; wd[2i+1] = left_half(ws)[i]

The left half elements in vectors ws and wt are copied to vector wd alternating one element from ws with one element from wt.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ILVL.B
   for i in 0 .. WRLEN/16-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]8j+7..8j = WR[wt]8i+7+WRLEN/2..8i+WRLEN/2
      WR[wd]8k+7..8k = WR[ws]8i+7+WRLEN/2..8i+WRLEN/2
   endfor
ILVL.H
   for i in 0 .. WRLEN/32-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]16j+15..16j = WR[wt]16i+15+WRLEN/2..16i+WRLEN/2
      WR[wd]16k+15..16k = WR[ws]16i+15+WRLEN/2..16i+WRLEN/2
   endfor
ILVL.W
   for i in 0 .. WRLEN/64-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]32j+31..32j = WR[wt]32i+31+WRLEN/2..32i+WRLEN/2
      WR[wd]32k+31..32k = WR[ws]32i+31+WRLEN/2..32i+WRLEN/2
   endfor
ILVL.D
   for i in 0 .. WRLEN/128-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]64j+63..64j = WR[wt]64i+63+WRLEN/2..64i+WRLEN/2
      WR[wd]64k+63..64k = WR[ws]64i+63+WRLEN/2..64i+WRLEN/2
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df

wt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

ILVOD.df 

Vector Interleave Odd

ILVOD.B wd,ws,wt

MSA

Vector Interleave Odd

ILVOD.H wd,ws,wt

MSA

Vector Interleave Odd

ILVOD.W wd,ws,wt

MSA

Vector Interleave Odd

ILVOD.D wd,ws,wt

MSA

Vector Interleave Odd

Purpose:

Vector Interleave Odd

Vector odd elements interleave.

Description:

wd[2i] = wt[2i+1]; wd[2i+1] = ws[2i+1]

Odd elements in v ectors ws and wt are copied to vector wd alternating one element from ws with one element from wt.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ILVOD.B
   for i in 0 .. WRLEN/16-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]8j+7..8j = WR[wt]8k+7..8k
      WR[wd]8k+7..8k = WR[ws]8k+7..8k
   endfor
ILVOD.H
   for i in 0 .. WRLEN/32-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]16j+15..16j = WR[wt]16k+15..16k
      WR[wd]16k+15..16k = WR[ws]16k+15..16k
   endfor
ILVOD.W
   for i in 0 .. WRLEN/64-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]32j+31..32j = WR[wt]32k+31..32k
      WR[wd]32k+31..32k = WR[ws]32k+31..32k
   endfor
ILVOD.D
   for i in 0 .. WRLEN/128-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]64j+63..64j = WR[wt]64k+63..64k
      WR[wd]64k+63..64k = WR[ws]64k+63..64k
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

ILVR.df 

Vector Interleave Right

ILVR.B wd,ws,wt

MSA

Vector Interleave Right

ILVR.H wd,ws,wt

MSA

Vector Interleave Right

ILVR.W wd,ws,wt

MSA

Vector Interleave Right

ILVR.D wd,ws,wt

MSA

Vector Interleave Right

Purpose:

Vector Interleave Right

Vector right elements interleave.

Description:

wd[2i] = right_half(wt)[i]; wd[2i+1] = right_half(ws)[i]

The right half elements in vectors ws and wt are copied to vector wd alternating one element from ws with one element from wt.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

ILVR.B
   for i in 0 .. WRLEN/16-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]8j+7..8j = WR[wt]8i+7..8i
      WR[wd]8k+7..8k = WR[ws]8i+7..8i
   endfor
ILVR.H
   for i in 0 .. WRLEN/32-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]16j+15..16j = WR[wt]16i+15..16i
      WR[wd]16k+15..16k = WR[ws]16i+15..16i
   endfor
ILVR.W
   for i in 0 .. WRLEN/64-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]32j+31..32j = WR[wt]32i+31..32i
      WR[wd]32k+31..32k = WR[ws]32i+31..32i
   endfor
ILVR.D
   for i in 0 .. WRLEN/128-1
      j = 2 * i
      k = 2 * i + 1
      WR[wd]64j+63..64j = WR[wt]64i+63..64i
      WR[wd]64k+63..64k = WR[ws]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0100

df/n

rs

wd

ELM

011001

6

4

6

5

5

6

Format:

INSERT.df 

GPR Insert Element

INSERT.B wd[n],rs

MSA

GPR Insert Element

INSERT.H wd[n],rs

MSA

GPR Insert Element

INSERT.W wd[n],rs

MSA

GPR Insert Element

INSERT.D wd[n],rs

MIPS64, MSA

GPR Insert Element

Purpose:

GPR Insert Element

GPR value copied to vector element.

Description:

wd[n] = rs

Set element n in vector wd to GPR rs value. All other elements in vector wd are unchanged. If the source GPR is wider than the destination data format, the destination's elements will be set to the least significant bits of the GPR.

The operands and results are values in data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

INSERT.B
   WR[wd]8n+7..8n = GPR[rs]7..0
INSERT.H
   WR[wd]16n+15..16n = GPR[rs]15..0
INSERT.W
   WR[wd]32n+31..32n = GPR[rs]31..0
INSERT.D
   WR[wd]64n+63..64n = GPR[rs]63..0

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0101

df/n

ws

wd

ELM

011001

6

4

6

5

5

6

Format:

INSVE.df 

Element Insert Element

INSVE.B wd[n],ws[0]

MSA

Element Insert Element

INSVE.H wd[n],ws[0]

MSA

Element Insert Element

INSVE.W wd[n],ws[0]

MSA

Element Insert Element

INSVE.D wd[n],ws[0]

MSA

Element Insert Element

Purpose:

Element Insert Element

Element value copied to vector element.

Description:

wd[n] = ws[0]

Set element n in vector wd to element 0 in vector ws value. All other elements in vector wd are unchanged.

The operands and results are values in data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

INSVE.B
   WR[wd]8n+7..8n = WR[ws]7..0
INSVE.H
   WR[wd]16n+15..16n = WR[ws]15..0
INSVE.W
   WR[wd]32n+31..32n = WR[ws]31..0
INSVE.D
   WR[wd]64n+63..64n = WR[ws]63..0

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

s10

rs

wd

MI10

1000

df

6

10

5

5

4

2

Format:

LD.df 

Vector Load

LD.B wd,s10(rs)

MSA

Vector Load

LD.H wd,s10(rs)

MSA

Vector Load

LD.W wd,s10(rs)

MSA

Vector Load

LD.D wd,s10(rs)

MSA

Vector Load

Purpose:

Vector Load

Vector load element-by-element from base register plus offset memory address,

Description:

wd[i] = memory[rs + (s10 + i) * sizeof(wd[i])]

The WRLEN / 8 bytes at the ef fective memory location addressed by the basers and the 10-bit signed immediate offset s10 are fetched and placed in wd as elements of data format df.

The s10 offset in data format df units is added to the base rs to form the effective memory location address. rs and the effective memory location address have no alignment restrictions.

If the effective memory location address is element aligned, the vector load instruction is atomic at the element level with no guaranteed ordering among elemen ts, i.e. each element load is an ato mic operation issued in no particular order with respect to the element's vector position.

By convention, in the assembly language syntax all offsets are in bytes and have to be multiple of the size of the data format df. The assembler determines the s10 bitfield value dividing the byte offset by the size of the data format df.

Restrictions:

Address-dependent exceptions are possible.

Operation:

LD.B
   a = rs + s10
   LoadByteVector(WR[wd]WRLEN-1..0, a, WRLEN/8)
LD.H
   a = rs + s10 * 2
   LoadHalfwordVector(WR[wd]WRLEN-1..0, a, WRLEN/16)
LD.W
   a = rs + s10 * 4
   LoadWordVector(WR[wd]WRLEN-1..0, a, WRLEN/32)
LD.D
   a = rs + s10 * 8
   LoadDoublewordVector(WR[wd]WRLEN-1..0, a, WRLEN/64)
function LoadByteVector(ts, a, n)
   /* Implementation defined load ts vector of n bytes from virtual
         address a. */
endfunction LoadByteVector
function LoadHalfwordVector(ts, a, n)
   /* Implementation defined load ts vector of n halfwords from
          virtual address a. */
endfunction LoadHalfwordVector
function LoadWordVector(ts, a, n)
   /* Implementation defined load ts vector of n words from virtual
         address a. */
endfunction LoadWordVector
function LoadDoublewordVector(ts, a, n)
   /* Implementation defined load ts vector of n doublewords from
         virtual address a. */
endfunction LoadDoublewordVector

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception. Data access TLB and Address Error Exceptions.

Encoding:

MSA

011110

110

df

s10

wd

I10

000111

6

3

2

10

5

6

Format:

LDI.df 

Immediate Load

LDI.B wd,s10

MSA

Immediate Load

LDI.H wd,s10

MSA

Immediate Load

LDI.W wd,s10

MSA

Immediate Load

LDI.D wd,s10

MSA

Immediate Load

Purpose:

Immediate Load

Immediate value replicated across all destination elements.

Description:

wd[i] = s10

The signed immediate s10 is replicated in all wd elements. For byte elements, only the least significant 8 bits of s10 will be used.

Restrictions:

No data-dependent exceptions are possible.

Operation:

LDI.B
   t = s107..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = t
   endfor
LDI.H
   t = (s109)6 || s109..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = t
   endfor
LDI.W
   t = (s109)22 || s109..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = t
   endfor
LDI.D
   t = (s109)54 || s109..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

SPECIAL

000000

rs

rt

rd

000

sa

LSA

000101

6

5

5

5

3

2

6

Format:

LSA 

Left Shift Add

LSA rd,rs,rt,sa

MSA

Left Shift Add

Purpose:

Left Shift Add

To left-shift a word by a fixed number of bits and add the result to another word.

Description:

GPR[rd] = (GPR[rs] << (sa + 1)) + GPR[rt]

The 32-bit word value in GPR rs is shifted left, inserting zeros into the emptied bits; the 32-bit word result is added to the 32-bit value in GPR rt and the 32-bit arithmetic result is sign-extended and placed into GPR rd.

No Integer Overflow exception occurs under any circumstances.

Restrictions:

A Reserved Instruction Exception is signaled if MSA implementation is not present.

If GPR rt does not contain sign-extended 32-bit values (bits 63..31 equal), then the result of the operation is UNPREDICTABLE.

Operation:

if NotWordValue(GPR[rt]) then
   UNPREDICTABLE
endif
if Config3MSAP = 1 then
   s = sa + 1
   temp = (GPR[rs](31-s)..0 || 0s) + GPR[rt]
   GPR[rd] = sign_extend(temp31..0)
else
   SignalException(ReservedInstruction)
endif

Exceptions:

Reserved Instruction Exception.

Programming Notes:

Unlike nearly all other word operations, the LSA input operand GPR rs does not have to be a properly sign-extended word value to produce a valid sign-extended 32-bit result. The result word is always sign-extended into a 64-bit destination register.

Encoding:

MSA

011110

1101

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

MADDR_Q.df 

Vector Fixed-Point Multiply and Add Rounded

MADDR_Q.H wd,ws,wt

MSA

Vector Fixed-Point Multiply and Add Rounded

MADDR_Q.W wd,ws,wt

MSA

Vector Fixed-Point Multiply and Add Rounded

Purpose:

Vector Fixed-Point Multiply and Add Rounded

Vector fixed-point multiply and add rounded.

Description:

wd[i] = saturate(round(wd[i] + ws[i] * wt[i]))

The products of fixed-point elements in vector wt by fixed-point elements in vector ws are added to the fixed-point elements in vector wd. The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.

The rounded and saturated fixed-point results are stored back to wd.

Internally, the multiplication, addition, and rounding operate on data double the size of df. Truncation to fixed-point data format df is performed at the very last stage, after saturation.

The rounding is done by adding 1 to the most significant bit that is going to be discarded at truncation.

The operands and results are values in fixed-point data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

MADDR_Q.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             q_maddr(WR[wd]16i+15..16i, WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MADDR_Q.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = 
             q_maddr(WR[wd]32i+31..32i, WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
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 q_maddr(td, ts, tt, n)
   p = mulx_s(ts, tt, n)
   d = (tdn-1 || tdn-1..0 || 0n-1) + p2n-1..0
   d = d + (1 || 0n-2)
   d = sat_s(d2n-1..n-1, n+1, n)
   return dn-1..0
endfunction q_maddr

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

MADDV.df 

Vector Multiply and Add

MADDV.B wd,ws,wt

MSA

Vector Multiply and Add

MADDV.H wd,ws,wt

MSA

Vector Multiply and Add

MADDV.W wd,ws,wt

MSA

Vector Multiply and Add

MADDV.D wd,ws,wt

MSA

Vector Multiply and Add

Purpose:

Vector Multiply and Add

Vector multiply and add.

Description:

wd[i] = wd[i] + ws[i] * wt[i]

The integer elements in vector wt are multiplied by integer elements in vector ws and added to the integer elements in vector wd. The most significant half of the multiplication result is discarded.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MADDV.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = 
             WR[wd]8i+7..8i + WR[ws]8i+7..8i * WR[wt]8i+7..8i
   endfor
MADDV.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i =
             WR[wd]16i+15..16i + WR[ws]16i+15..16i * WR[wt]16i+15..16i
   endfor
MADDV.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             WR[wd]32i+31..32i + WR[ws]32i+31..32i * WR[wt]32i+31..32i
   endfor
MADDV.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             WR[wd]64i+63..64i + WR[ws]64i+63..64i * WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0101

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

MADD_Q.df 

Vector Fixed-Point Multiply and Add

MADD_Q.H wd,ws,wt

MSA

Vector Fixed-Point Multiply and Add

MADD_Q.W wd,ws,wt

MSA

Vector Fixed-Point Multiply and Add

Purpose:

Vector Fixed-Point Multiply and Add

Vector fixed-point multiply and add.

Description:

wd[i] = saturate(wd[i] + ws[i] * wt[i])

The products of fixed-point elements in vector wt by fixed-point elements in vector ws are added to the fixed-point elements in vector wd. The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is added to the destination.

The saturated fixed-point results are stored back to wd.

Internally, the multiplication and addition operate on data double the size of df. Truncation to fixed-point data format df is performed at the very last stage, after saturation.

The operands and results are values in fixed-point data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

MADD_Q.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             q_madd(WR[wd]16i+15..16i, WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MADD_Q.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = 
             q_madd(WR[wd]32i+31..32i, WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
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 q_madd(td, ts, tt, n)
   p = mulx_s(ts, tt, n)
   d = (tdn-1 || tdn-1..0 || 0n-1) + p2n-1..0
   d = sat_s(d2n-1..n-1, n+1, n)
   return dn-1..0
endfunction q_madd

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

s5

ws

wd

I5

000110

6

3

2

5

5

5

6

Format:

MAXI_S.df 

Immediate Signed Maximum

MAXI_S.B wd,ws,s5

MSA

Immediate Signed Maximum

MAXI_S.H wd,ws,s5

MSA

Immediate Signed Maximum

MAXI_S.W wd,ws,s5

MSA

Immediate Signed Maximum

MAXI_S.D wd,ws,s5

MSA

Immediate Signed Maximum

Purpose:

Immediate Signed Maximum

Immediate and vector signed maximum.

Description:

wd[i] = max(ws[i], s5)

Maximum values between signed elements in vector ws and the 5-bit signed immediate s5 are written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MAXI_S.B
   t = (s54)3 || s54..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = max_s(WR[ws]8i+7..8i, t, 8)
   endfor
MAXI_S.H
   t = (s54)11 || s54..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = max_s(WR[ws]16i+15..16i, t, 16)
   endfor
MAXI_S.W
   t = (s54)27 || s54..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = max_s(WR[ws]32i+31..32i, t, 32)
   endfor
MAXI_S.D
   t = (s54)59 || s54..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = max_s(WR[ws]64i+63..64i, t, 64)
   endfor
function max_s(ts, tt, n)
   t = ttn-1 || tt
   s = tsn-1 || ts
   if t < s then
      return ts
   else
      return tt
   endif
endfunction max_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

u5

ws

wd

I5

000110

6

3

2

5

5

5

6

Format:

MAXI_U.df 

Immediate Unsigned Maximum

MAXI_U.B wd,ws,u5

MSA

Immediate Unsigned Maximum

MAXI_U.H wd,ws,u5

MSA

Immediate Unsigned Maximum

MAXI_U.W wd,ws,u5

MSA

Immediate Unsigned Maximum

MAXI_U.D wd,ws,u5

MSA

Immediate Unsigned Maximum

Purpose:

Immediate Unsigned Maximum

Immediate and vector unsigned maximum.

Description:

wd[i] = max(ws[i], u5)

Maximum values between unsigned elements in v ector ws and the 5-bit unsigned immediate u5 are written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MAXI_U.B
   t = 03 || u54..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = max_u(WR[ws]8i+7..8i, t, 8)
   endfor
MAXI_U.H
   t = 011 || u54..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = max_u(WR[ws]16i+15..16i, t, 16)
   endfor
MAXI_U.W
   t = 027 || u54..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = max_u(WR[ws]32i+31..32i, t, 32)
   endfor
MAXI_U.D
   t = 059 || u54..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = max_u(WR[ws]64i+63..64i, t, 64)
   endfor
function max_u(ts, tt, n)
   t = 0 || tt
   s = 0 || ts
   if t < s then
      return ts
   else
      return tt
   endif
endfunction max_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

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.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

MAX_S.df 

Vector Signed Maximum

MAX_S.B wd,ws,wt

MSA

Vector Signed Maximum

MAX_S.H wd,ws,wt

MSA

Vector Signed Maximum

MAX_S.W wd,ws,wt

MSA

Vector Signed Maximum

MAX_S.D wd,ws,wt

MSA

Vector Signed Maximum

Purpose:

Vector Signed Maximum

Vector and vector signed maximum.

Description:

wd[i] = max(ws[i], wt[i])

Maximum values between signed elements in vector wt and signed elements in vector ws are written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MAX_S.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = max_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
MAX_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = max_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MAX_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = max_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
MAX_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = max_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function max_s(ts, tt, n)
   t = ttn-1 || tt
   s = tsn-1 || ts
   if t < s then
      return ts
   else
      return tt
   endif
endfunction max_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

MAX_U.df 

Vector Unsigned Maximum

MAX_U.B wd,ws,wt

MSA

Vector Unsigned Maximum

MAX_U.H wd,ws,wt

MSA

Vector Unsigned Maximum

MAX_U.W wd,ws,wt

MSA

Vector Unsigned Maximum

MAX_U.D wd,ws,wt

MSA

Vector Unsigned Maximum

Purpose:

Vector Unsigned Maximum

Vector and vector unsigned maximum.

Description:

wd[i] = max(ws[i], wt[i])

ector wt and uns igned elements in vector ws are written to

Maximum values between unsigned elements in v vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

s5

ws

wd

I5

000110

6

3

2

5

5

5

6

Format:

MINI_S.df 

Immediate Signed Minimum

MINI_S.B wd,ws,s5

MSA

Immediate Signed Minimum

MINI_S.H wd,ws,s5

MSA

Immediate Signed Minimum

MINI_S.W wd,ws,s5

MSA

Immediate Signed Minimum

MINI_S.D wd,ws,s5

MSA

Immediate Signed Minimum

Purpose:

Immediate Signed Minimum

Immediate and vector signed minimum.

Description:

wd[i] = min(ws[i], s5)

Minimum values between signed elements in vector ws and the 5-bit signed immediate s5 are written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MINI_S.B
   t = (s54)3 || s54..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = min_s(WR[ws]8i+7..8i, t, 8)
   endfor
MINI_S.H
   t = (s54)11 || s54..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = min_s(WR[ws]16i+15..16i, t, 16)
   endfor
MINI_S.W
   t = (s54)27 || s54..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = min_s(WR[ws]32i+31..32i, t, 32)
   endfor
MINI_S.D
   t = (s54)59 || s54..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = min_s(WR[ws]64i+63..64i, t, 64)
   endfor
function min_s(ts, tt, n)
   t = ttn-1 || tt
   s = tsn-1 || ts
   if t > s then
      return ts
   else
      return tt
   endif
endfunction min_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

u5

ws

wd

I5

000110

6

3

2

5

5

5

6

Format:

MINI_U.df 

Immediate Unsigned Minimum

MINI_U.B wd,ws,u5

MSA

Immediate Unsigned Minimum

MINI_U.H wd,ws,u5

MSA

Immediate Unsigned Minimum

MINI_U.W wd,ws,u5

MSA

Immediate Unsigned Minimum

MINI_U.D wd,ws,u5

MSA

Immediate Unsigned Minimum

Purpose:

Immediate Unsigned Minimum

Immediate and vector unsigned minimum.

Description:

wd[i] = min(ws[i], u5)

Minimum values between unsigned elements in vector ws and the 5-bit unsigned immediate u5 are written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MINI_U.B
   t = 03 || u54..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = min_u(WR[ws]8i+7..8i, t, 8)
   endfor
MINI_U.H
   t = 011 || u54..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = min_u(WR[ws]16i+15..16i, t, 16)
   endfor
MINI_U.W
   t = 027 || u54..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = min_u(WR[ws]32i+31..32i, t, 32)
   endfor
MINI_U.D
   t = 059 || u54..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = min_u(WR[ws]64i+63..64i, t, 64)
   endfor
function min_u(ts, tt, n)
   t = 0 || tt
   s = 0 || ts
   if t > s then
      return ts
   else
      return tt
   endif
endfunction min_u

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

MIN_A.df 

Vector Minimum Based on Absolute Value

MIN_A.B wd,ws,wt

MSA

Vector Minimum Based on Absolute Value

MIN_A.H wd,ws,wt

MSA

Vector Minimum Based on Absolute Value

MIN_A.W wd,ws,wt

MSA

Vector Minimum Based on Absolute Value

MIN_A.D wd,ws,wt

MSA

Vector Minimum Based on Absolute Value

Purpose:

Vector Minimum Based on Absolute Value

Vector and vector minimum based on the absolute values.

Description:

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

The value with the smallest 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:

MIN_A.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = min_a(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
MIN_A.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = min_a(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MIN_A.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = min_a(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
MIN_A.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = min_a(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function min_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 min_a

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

100

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

MIN_S.df 

Vector Signed Minimum

MIN_S.B wd,ws,wt

MSA

Vector Signed Minimum

MIN_S.H wd,ws,wt

MSA

Vector Signed Minimum

MIN_S.W wd,ws,wt

MSA

Vector Signed Minimum

MIN_S.D wd,ws,wt

MSA

Vector Signed Minimum

Purpose:

Vector Signed Minimum

Vector and vector signed minimum.

Description:

wd[i] = min(ws[i], wt[i])

Minimum values between signed elements in vector wt and signed elements in vector ws are written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MIN_S.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = min_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
MIN_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = min_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MIN_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = min_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
MIN_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = min_s(WR[ws]64i+63..64i, WR[wt]64i+63..64i, 64)
   endfor
function min_s(ts, tt, n)
   t = ttn-1 || tt
   s = tsn-1 || ts
   if t > s then
      return ts
   else
      return tt
   endif
endfunction min_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

101

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

MIN_U.df 

Vector Unsigned Minimum

MIN_U.B wd,ws,wt

MSA

Vector Unsigned Minimum

MIN_U.H wd,ws,wt

MSA

Vector Unsigned Minimum

MIN_U.W wd,ws,wt

MSA

Vector Unsigned Minimum

MIN_U.D wd,ws,wt

MSA

Vector Unsigned Minimum

Purpose:

Vector Unsigned Minimum

Vector and vector unsigned minimum.

Description:

wd[i] = min(ws[i], wt[i])

in vector wt and unsigne d elements in vector ws are w ritten

Minimum values between unsigned elements to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

110

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

MOD_S.df 

Vector Signed Modulo

MOD_S.B wd,ws,wt

MSA

Vector Signed Modulo

MOD_S.H wd,ws,wt

MSA

Vector Signed Modulo

MOD_S.W wd,ws,wt

MSA

Vector Signed Modulo

MOD_S.D wd,ws,wt

MSA

Vector Signed Modulo

Purpose:

Vector Signed Modulo

Vector signed remainder (modulo).

Description:

wd[i] = ws[i] mod wt[i]

The signed integer elements in vector ws are divided by signed integer elements in vector wt. The remainder of the same sign as the dividend is written to vector wd. If a divisor element vector wt is zero, the result value is UNPREDICTABLE.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MOD_S.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i mod WR[wt]8i+7..8i
   endfor
MOD_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i mod WR[wt]16i+15..16i
   endfor
MOD_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i mod WR[wt]32i+31..32i
   endfor
MOD_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i mod WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

111

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

MOD_U.df 

Vector Unsigned Modulo

MOD_U.B wd,ws,wt

MSA

Vector Unsigned Modulo

MOD_U.H wd,ws,wt

MSA

Vector Unsigned Modulo

MOD_U.W wd,ws,wt

MSA

Vector Unsigned Modulo

MOD_U.D wd,ws,wt

MSA

Vector Unsigned Modulo

Purpose:

Vector Unsigned Modulo

Vector unsigned remainder (modulo).

Description:

wd[i] = ws[i] umod wt[i]

The unsigned integer elements in vector ws are divided by unsigned integer elements in vector wt. The remainder is written to vector wd. If a divisor element vector wt is zero, the result value is UNPREDICTABLE.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MOD_U.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i umod WR[wt]8i+7..8i
   endfor
MOD_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i umod WR[wt]16i+15..16i
   endfor
MOD_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i umod WR[wt]32i+31..32i
   endfor
MOD_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i umod WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0010111110

ws

wd

ELM

011001

6

10

5

5

6

Format:

MOVE.V 

Vector Move

MOVE.V wd,ws

MSA

Vector Move

Purpose:

Vector Move

Vector to vector move.

Description:

wd = ws

Copy all WRLEN bits in vector ws to vector wd.

The operand and result are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

   WR[wd] = WR[ws]

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

1110

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

MSUBR_Q.df 

Vector Fixed-Point Multiply and Subtract Rounded

MSUBR_Q.H wd,ws,wt

MSA

Vector Fixed-Point Multiply and Subtract Rounded

MSUBR_Q.W wd,ws,wt

MSA

Vector Fixed-Point Multiply and Subtract Rounded

Purpose:

Vector Fixed-Point Multiply and Subtract Rounded

Vector fixed-point multiply and subtract rounded.

Description:

wd[i] = saturate(round(wd[i] - ws[i] * wt[i]))

The products of fixed-point elements in vector wt by fixed-point elements in vector ws are subtracted from the fixedpoint elements in vector wd. The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is subtracted from the destination. The rounded and saturated fixed-point results are stored back to wd.

Internally, the multiplication, subtraction, and rounding operate on data double the size of df. Truncation to fixedpoint data format df is performed at the very last stage, after saturation.

The rounding is done by adding 1 to the most significant bit that is going to be discarded at truncation.

The operands and results are values in fixed-point data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

MSUBR_Q.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             q_msubr(WR[wd]16i+15..16i, WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MSUBR_Q.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = 
             q_msubr(WR[wd]32i+31..32i, WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
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 q_msubr(td, ts, tt, n)
   p = mulx_s(ts, tt, n)
   d = (tdn-1 || tdn-1..0 || 0n-1) - p2n-1..0
   d = d + (1 || 0n-2)
   d = sat_s(d2n-1..n-1, n+1, n)
   return dn-1..0
endfunction q_msubr

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

MSUBV.df 

Vector Multiply and Subtract

MSUBV.B wd,ws,wt

MSA

Vector Multiply and Subtract

MSUBV.H wd,ws,wt

MSA

Vector Multiply and Subtract

MSUBV.W wd,ws,wt

MSA

Vector Multiply and Subtract

MSUBV.D wd,ws,wt

MSA

Vector Multiply and Subtract

Purpose:

Vector Multiply and Subtract

Vector multiply and subtract.

Description:

wd[i] = wd[i] - ws[i] * wt[i]

The integer elements in vector wt are multiplied by integer elements in vector ws and subtracted from the integer elements in vector wd. The most significant half of the multiplication result is discarded.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MSUBV.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = 
             WR[wd]8i+7..8i - WR[ws]8i+7..8i * WR[wt]8i+7..8i
   endfor
MSUBV.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i =
             WR[wd]16i+15..16i - WR[ws]16i+15..16i * WR[wt]16i+15..16i
   endfor
MSUBV.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i =
             WR[wd]32i+31..32i - WR[ws]32i+31..32i * WR[wt]32i+31..32i
   endfor
MSUBV.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i =
             WR[wd]64i+63..64i - WR[ws]64i+63..64i * WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0110

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

MSUB_Q.df 

Vector Fixed-Point Multiply and Subtract

MSUB_Q.H wd,ws,wt

MSA

Vector Fixed-Point Multiply and Subtract

MSUB_Q.W wd,ws,wt

MSA

Vector Fixed-Point Multiply and Subtract

Purpose:

Vector Fixed-Point Multiply and Subtract

Vector fixed-point multiply and subtract.

Description:

wd[i] = saturate(wd[i] - ws[i] * wt[i])

The product of fixed-point elements in vector wt by fixed-point elements in vector ws are subtracted from the fixedpoint elements in vector wd. The multiplication result is not saturated, i.e. exact (-1) * (-1) = 1 is subtracted from the destination. The saturated fixed-point results are stored back to wd.

Internally, the multiplication and subtraction operate on data double the size of df. Truncation to fixed-point data format df is performed at the very last stage, after saturation.

The operands and results are values in fixed-point data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

MSUB_Q.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 
             q_msub(WR[wd]16i+15..16i, WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MSUB_Q.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = 
             q_msub(WR[wd]32i+31..32i, WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
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 q_msub(td, ts, tt, n)
   p = mulx_s(ts, tt, n)
   d = (tdn-1 || tdn-1..0 || 0n-1) - p2n-1..0
   d = sat_s(d2n-1..n-1, n+1, n)
   return dn-1..0
endfunction q_msub

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

1100

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

MULR_Q.df 

Vector Fixed-Point Multiply Rounded

MULR_Q.H wd,ws,wt

MSA

Vector Fixed-Point Multiply Rounded

MULR_Q.W wd,ws,wt

MSA

Vector Fixed-Point Multiply Rounded

Purpose:

Vector Fixed-Point Multiply Rounded

Vector fixed-point multiply rounded.

Description:

wd[i] = round(ws[i] * wt[i])

The fixed-point elements in vector wt multiplied by fixed-point elements in vector ws. The rounded result is written to vector wd.

Fixed-point multiplication for 16-bit Q15 and 32-bit Q31 is a regular signed multiplication followed by one bit shift left with saturation. Only the most significant half of the result is preserved.

The rounding is done by adding 1 to the most significant bit that is going to be discarded prior to shifting left the full multiplication result.

The operands and results are values in fixed-point data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

MULR_Q.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = q_mulr(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MULR_Q.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = q_mulr(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function q_mulr(ts, tt, n)
   if ts = 1 || 0n-1 and tt = 1 || 0n-1 then
      return 0 || 1n-1
   else
      p = mulx_s(ts, tt, n)
      p = p + (1 || 0n-2)
      return p2n-2..n-1
endfunction q_mulr

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

010010

6

3

2

5

5

5

6

Format:

MULV.df 

Vector Multiply

MULV.B wd,ws,wt

MSA

Vector Multiply

MULV.H wd,ws,wt

MSA

Vector Multiply

MULV.W wd,ws,wt

MSA

Vector Multiply

MULV.D wd,ws,wt

MSA

Vector Multiply

Purpose:

Vector Multiply

Vector multiply.

Description:

wd[i] = ws[i] * wt[i]

The integer elements in vector wt are multiplied by integer elements in vector ws. The result is written to vector wd.

The most significant half of the multiplication result is discarded.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

MULV.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i * WR[wt]8i+7..8i
   endfor
MULV.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i * WR[wt]16i+15..16i
   endfor
MULV.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i * WR[wt]32i+31..32i
   endfor
MULV.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i * WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0100

df

wt

ws

wd

3RF

011100

6

4

1

5

5

5

6

Format:

MUL_Q.df 

Vector Fixed-Point Multiply

MUL_Q.H wd,ws,wt

MSA

Vector Fixed-Point Multiply

MUL_Q.W wd,ws,wt

MSA

Vector Fixed-Point Multiply

Purpose:

Vector Fixed-Point Multiply

Vector fixed-point multiplication.

Description:

wd[i] = ws[i] * wt[i]

The fixed-point elements in vector wt multiplied by f ixed-point elements in vector ws. The result is written to vector wd.

Fixed-point multiplication for 16-bit Q15 and 32-bit Q31 is a regular signed multiplication followed by one bit shift left with saturation. Only the most significant half of the result is preserved.

The operands and results are values in fixed-point data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

MUL_Q.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = q_mul(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
MUL_Q.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = q_mul(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
function mulx_s(ts, tt, n)
   s = (tsn-1)n || tsn-1..0 
   t = (ttn-1)n || ttn-1..0
   p = s * t 
   return p2n-1..0
endfunction mulx_s
function q_mul(ts, tt, n)
   if ts = 1 || 0n-1 and tt = 1 || 0n-1 then
      return 0 || 1n-1
   else
      p = mulx_s(ts, tt, n)
      return p2n-2..n-1
   endif
endfunction q_mul

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

11000010

df

ws

wd

2R

011110

6

8

2

5

5

6

Format:

NLOC.df 

Vector Leading Ones Count

NLOC.B wd,ws

MSA

Vector Leading Ones Count

NLOC.H wd,ws

MSA

Vector Leading Ones Count

NLOC.W wd,ws

MSA

Vector Leading Ones Count

NLOC.D wd,ws

MSA

Vector Leading Ones Count

Purpose:

Vector Leading Ones Count

Vector element count of leading bits set to 1.

Description:

wd[i] = leading_one_count(ws[i])

The number of leading ones for elements in vector ws is stored to the elements in vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

NLOC.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = leading_one_count(WR[ws]8i+7..8i, 8)
   endfor
NLOC.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = leading_one_count(WR[ws]16i+15..16i, 16)
   endfor
NLOC.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = leading_one_count(WR[ws]32i+31..32i, 32)
   endfor
NLOC.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = leading_one_count(WR[ws]64i+63..64i, 64)
   endfor
function leading_one_count(tt, n)
   z = 0
   for i in n-1..0
      if tti = 0 then
          return z
      else
          z = z + 1
      endif
endfunction leading_one_count

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

11000011

df

ws

wd

2R

011110

6

8

2

5

5

6

Format:

NLZC.df 

Vector Leading Zeros Count

NLZC.B wd,ws

MSA

Vector Leading Zeros Count

NLZC.H wd,ws

MSA

Vector Leading Zeros Count

NLZC.W wd,ws

MSA

Vector Leading Zeros Count

NLZC.D wd,ws

MSA

Vector Leading Zeros Count

Purpose:

Vector Leading Zeros Count

Vector element count of leading bits set to 0.

Description:

wd[i] = leading_zero_count(ws[i])

The number of leading zeroes for elements in vector ws is stored to the elements in vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

NLZC.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = leading_zero_count(WR[ws]8i+7..8i, 8)
   endfor
NLZC.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = leading_zero_count(WR[ws]16i+15..16i, 16)
   endfor
NLZC.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = leading_zero_count(WR[ws]32i+31..32i, 32)
   endfor
NLZC.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = leading_zero_count(WR[ws]64i+63..64i, 64)
   endfor
function leading_zero_count(tt, n)
   z = 0
   for i in n-1..0
      if tti = 1 then
          return z
      else
          z = z + 1
      endif
endfunction leading_zero_count

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00010

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

NOR.V 

Vector Logical Negated Or

NOR.V wd,ws,wt

MSA

Vector Logical Negated Or

Purpose:

Vector Logical Negated Or

Vector by vector logical negated or.

Description:

wd = ws NOR wt

Each bit of vector ws is combined with the corresponding bit of vector wt in a bi twise logical NOR operation. The result is written to vector wd.

The operands and results are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = WR[ws] nor WR[wt]

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

10

i8

ws

wd

I8

000000

6

2

8

5

5

6

Format:

NORI.B 

Immediate Logical Negated Or

NORI.B wd,ws,i8

MSA

Immediate Logical Negated Or

Purpose:

Immediate Logical Negated Or

Immediate by vector logical negated or.

Description:

wd[i] = ws[i] NOR i8

Each byte element of vector ws is combined with the 8-bit immediate i8 in a bitwis e logical NOR operation. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

 for i in 0 .. WRLEN/8-1
   WR[wd]8i+7..8i = WR[ws]8i+7..8i nor i87..0
endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00001

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

OR.V 

Vector Logical Or

OR.V wd,ws,wt

MSA

Vector Logical Or

Purpose:

Vector Logical Or

Vector by vector logical or.

Description:

wd = ws OR wt

Each bit of vector ws is combined with the corresponding bit of vector wt in a bit wise logical OR operation. The result is written to vector wd.

The operands and results are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = WR[ws] or WR[wt]

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

01

i8

ws

wd

I8

000000

6

2

8

5

5

6

Format:

ORI.B 

Immediate Logical Or

ORI.B wd,ws,i8

MSA

Immediate Logical Or

Purpose:

Immediate Logical Or

Immediate by vector logical or.

Description:

wd[i] = ws[i] OR i8

Each byte element of vector ws is combined with the 8-bit immediate i8 in a bitwise logical OR operation. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

 for i in 0 .. WRLEN/8-1
   WR[wd]8i+7..8i = WR[ws]8i+7..8i or i87..0
endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

PCKEV.df 

Vector Pack Even

PCKEV.B wd,ws,wt

MSA

Vector Pack Even

PCKEV.H wd,ws,wt

MSA

Vector Pack Even

PCKEV.W wd,ws,wt

MSA

Vector Pack Even

PCKEV.D wd,ws,wt

MSA

Vector Pack Even

Purpose:

Vector Pack Even

Vector even elements copy.

Description:

left_half(wd)[i] = ws[2i]; right_half(wd)[i] = wt[2i]

Even elements in vector ws are copied to the left half of vector wd and even elements in vector wt are copied to the right half of vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

PCKEV.B
   for i in 0 .. WRLEN/16-1
      j = 2 * i
      WR[wd]8i+7+WRLEN/2..8i+WRLEN/2 = WR[ws]8j+7..8j
      WR[wd]8i+7..8i = WR[wt]8j+7..8j
   endfor
PCKEV.H
   for i in 0 .. WRLEN/32-1
      j = 2 * i
      WR[wd]16i+15+WRLEN/2..16j+WRLEN/2 = WR[ws]16j+15..16j
      WR[wd]16i+15..16i = WR[wt]16j+15..16j
   endfor
PCKEV.W
   for i in 0 .. WRLEN/64-1
      j = 2 * i
      WR[wd]32i+31+WRLEN/2..32j+WRLEN/2 = WR[ws]32j+31..32j
      WR[wd]32i+31..32i = WR[wt]32j+31..32j
   endfor
PCKEV.D
   for i in 0 .. WRLEN/128-1
      j = 2 * i
      WR[wd]64i+63+WRLEN/2..64j+WRLEN/2 = WR[ws]64j+63..64j
      WR[wd]64i+63..64i = WR[wt]64j+63..64j
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

PCKOD.df 

Vector Pack Odd

PCKOD.B wd,ws,wt

MSA

Vector Pack Odd

PCKOD.H wd,ws,wt

MSA

Vector Pack Odd

PCKOD.W wd,ws,wt

MSA

Vector Pack Odd

PCKOD.D wd,ws,wt

MSA

Vector Pack Odd

Purpose:

Vector Pack Odd

Vector odd elements copy.

Description:

left_half(wd)[i] = ws[2i+1]; right_half(wd)[i] = wt[2i+1]

Odd elements in vector ws are copied to the left half of vector wd and odd elements in vector wt are copied to the right half of vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

PCKOD.B
   for i in 0 .. WRLEN/16-1
      k = 2 * i + 1
      WR[wd]8i+7+WRLEN/2..8i+WRLEN/2 = WR[ws]8k+7..8k
      WR[wd]8i+7..8i = WR[wt]8k+7..8k
   endfor
PCKOD.H
   for i in 0 .. WRLEN/32-1
      k = 2 * i + 1
      WR[wd]16i+15+WRLEN/2..16i+WRLEN/2 = WR[ws]16k+15..16k
      WR[wd]16i+15..16i = WR[wt]16k+15..16k
   endfor
PCKOD.W
   for i in 0 .. WRLEN/64-1
      k = 2 * i + 1
      WR[wd]32i+31+WRLEN/2..32i+WRLEN/2 = WR[ws]32k+31..32k
      WR[wd]32i+31..32i = WR[wt]32k+31..32k
   endfor
PCKOD.D
   for i in 0 .. WRLEN/128-1
      k = 2 * i + 1
      WR[wd]64i+63+WRLEN/2..64i+WRLEN/2 = WR[ws]64k+63..64k
      WR[wd]64i+63..64i = WR[wt]64k+63..64k
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

11000001

df

ws

wd

2R

011110

6

8

2

5

5

6

Format:

PCNT.df 

Vector Population Count

PCNT.B wd,ws

MSA

Vector Population Count

PCNT.H wd,ws

MSA

Vector Population Count

PCNT.W wd,ws

MSA

Vector Population Count

PCNT.D wd,ws

MSA

Vector Population Count

Purpose:

Vector Population Count

Vector element count of all bits set to 1.

Description:

wd[i] = population_count(ws[i])

The number of bits set to 1 for elements in vector ws is stored to the elements in vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

PCNT.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = population_count(WR[ws]8i+7..8i, 8)
   endfor
PCNT.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = population_count(WR[ws]16i+15..16i, 16)
   endfor
PCNT.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = population_count(WR[ws]32i+31..32i, 32)
   endfor
PCNT.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = population_count(WR[ws]64i+63..64i, 64)
   endfor
function population_count(tt, n)
   z = 0
   for i in n-1..0
      if tti = 1 then
          z = z + 1
      endif
endfunction population_count

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df/m

ws

wd

BIT

001010

6

3

7

5

5

6

Format:

SAT_S.df 

Immediate Signed Saturate

SAT_S.B wd,ws,m

MSA

Immediate Signed Saturate

SAT_S.H wd,ws,m

MSA

Immediate Signed Saturate

SAT_S.W wd,ws,m

MSA

Immediate Signed Saturate

SAT_S.D wd,ws,m

MSA

Immediate Signed Saturate

Purpose:

Immediate Signed Saturate

Immediate selected bit width saturation of signed values.

Description:

wd[i] = saturate_signed(ws[i], m+1)

Signed elements in vector ws are saturated to signed values of m+1 bits without changing the data width. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SAT_S.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = sat_s(WR[ws]8i+7..8i, 8, m+1)
   endfor
SAT_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = sat_s(WR[ws]16i+15..16i, 16, m+1)
   endfor
SAT_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = sat_s(WR[ws]32i+31..32i, 32, m+1)
   endfor
SAT_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = sat_s(WR[ws]64i+63..64i, 64, m+1)
   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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df/m

ws

wd

BIT

001010

6

3

7

5

5

6

Format:

SAT_U.df 

Immediate Unsigned Saturate

SAT_U.B wd,ws,m

MSA

Immediate Unsigned Saturate

SAT_U.H wd,ws,m

MSA

Immediate Unsigned Saturate

SAT_U.W wd,ws,m

MSA

Immediate Unsigned Saturate

SAT_U.D wd,ws,m

MSA

Immediate Unsigned Saturate

Purpose:

Immediate Unsigned Saturate

Immediate selected bit width saturation of unsigned values.

Description:

wd[i] = saturate_unsigned(ws[i], m+1)

Unsigned elements in vector ws are saturated to unsigned values of m+1 bits without changing the data width. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SAT_U.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = sat_u(WR[ws]8i+7..8i, 8, m+1)
   endfor
SAT_U.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = sat_u(WR[ws]16i+15..16i, 16, m+1)
   endfor
SAT_U.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = sat_u(WR[ws]32i+31..32i, 32, m+1)
   endfor
SAT_U.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = sat_u(WR[ws]64i+63..64i, 64, m+1)
   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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

df

i8

ws

wd

I8

000010

6

2

8

5

5

6

Format:

SHF.df 

Immediate Set Shuffle Elements

SHF.B wd,ws,i8

MSA

Immediate Set Shuffle Elements

SHF.H wd,ws,i8

MSA

Immediate Set Shuffle Elements

SHF.W wd,ws,i8

MSA

Immediate Set Shuffle Elements

Purpose:

Immediate Set Shuffle Elements

Immediate control value-based 4 element set copy

Description:

wd[i] = shuffle_set(ws, i, i8)

The set shuffle instruction works on 4-element sets in df data format. All sets are shuf fled in the same w ay: the element i82i+1..2i in ws is copied over the element i in wd, where i is 0, 1, 2, 3.

The operands and results are values in byte data format.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SHF.B
   for i in 0 .. WRLEN/8-1
      j = i % 4
      k = i - j + i82j+1..2j
      WR[wd]8i+7..8i = WR[ws]8k+7..8k
   endfor
SHF.H
   for i in 0 .. WRLEN/16-1
      j = i % 4
      k = i - j + i82j+1..2j
      WR[wd]16i+15..16i = WR[ws]16k+15..16k
   endfor
SHF.W
   for i in 0 .. WRLEN/32-1
      j = i % 4
      k = i - j + i82j+1..2j
      WR[wd]32i+31..32i = WR[ws]32k+31..32k
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

rt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

SLD.df 

GPR Columns Slide

SLD.B wd,ws[rt]

MSA

GPR Columns Slide

SLD.H wd,ws[rt]

MSA

GPR Columns Slide

SLD.W wd,ws[rt]

MSA

GPR Columns Slide

SLD.D wd,ws[rt]

MSA

GPR Columns Slide

Purpose:

GPR Columns Slide

GPR number of columns to slide left source array.

Description:

wd[i] = slide(wd, ws, rt)

Vector registers wd and ws contain 2-dimensional byte arrays (rectangles) stored row-wise, with as many rows as bytes in integer data format df.

The slide instructions manipulate the content of vector registers wd and ws as byte elements, with data format df indicating the 2-dimensional byte array layout.

The two source rectangles wd and ws are concatenated horizontally in the order they appear in the syntax, i.e. first wd and then ws. Place a new destination rectangle over ws and then slide it to the left over the concatenation of wd and ws by the number of columns given in GPR rt. The result is written to vector wd.

GPR rt value is interpreted modulo the number of columns in destination rectangle, or equivalently, the number of data format df elements in the destination vector.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SLD.B
   n = GPR[rt] % (WRLEN/8)
   v = WR[wd] || WR[ws]
   for i in 0 .. WRLEN/8-1
      j = i + n
      WR[wd]8i+7..8i = v8j+7..8j
   endfor
SLD.H
   n = GPR[rt] % (WRLEN/16)
   s = WRLEN/2
   for k in 0, 1
      t = s * k
      v = (WR[wd]t+s-1..t || WR[ws]t+s-1..t)
      for i in 0 .. s/8-1
          j = i + n
          WR[wd]t+8i+7..t+8i = v8j+7..8j
      endfor
   endfor
SLD.W
   n = GPR[rt] % (WRLEN/32)
   s = WRLEN/4
   for k in 0, .., 3
      t = s * k
      v = (WR[wd]t+s-1..t || WR[ws]t+s-1..t)
      for i in 0 .. s/8-1
          j = i + n
          WR[wd]t+8i+7..t+8i = v8j+7..8j
      endfor
   endfor
SLD.D
   n = GPR[rt] % (WRLEN/64)
   s = WRLEN/8
   for k in 0, .., 7
      t = s * k
      v = (WR[wd]t+s-1..t || WR[ws]t+s-1..t)
      for i in 0 .. s/8-1
          j = i + n
          WR[wd]t+8i+7..t+8i = v8j+7..8j
      endfor
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0000

df/n

ws

wd

ELM

011001

6

4

6

5

5

6

Format:

SLDI.df 

Immediate Columns Slide

SLDI.B wd,ws[n]

MSA

Immediate Columns Slide

SLDI.H wd,ws[n]

MSA

Immediate Columns Slide

SLDI.W wd,ws[n]

MSA

Immediate Columns Slide

SLDI.D wd,ws[n]

MSA

Immediate Columns Slide

Purpose:

Immediate Columns Slide

Immediate number of columns to slide left source array.

Description:

wd[i] = slide(wd, ws, n)

Vector registers wd and ws contain 2-dimensional byte arrays (rectangles) stored row-wise, with as many rows as bytes in integer data format df.

The slide instructions manipulate the content of vector registers wd and ws as byte elements, with data format df indicating the 2-dimensional byte array layout.

The two source rectangles wd and ws are concatenated horizontally in the order they appear in the syntax, i.e. first wd and then ws. Place a new destination rectangle over ws and then slide it to the left over the concatenation of wd and ws by n columns. The result is written to vector wd.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SLDI.B
   v = WR[wd] || WR[ws]
   for i in 0 .. WRLEN/8-1
      j = i + n
      WR[wd]8i+7..8i = v8j+7..8j
   endfor
SLDI.H
   s = WRLEN/2
   for k in 0, 1
      t = s * k
      v = (WR[wd]t+s-1..t || WR[ws]t+s-1..t)
      for i in 0 .. s/8-1
          j = i + n
          WR[wd]t+8i+7..t+8i = v8j+7..8j
      endfor
   endfor
SLDI.W
   s = WRLEN/4
   for k in 0, .., 3
      t = s * k
      v = (WR[wd]t+s-1..t || WR[ws]t+s-1..t)
      for i in 0 .. s/8-1
          j = i + n
          WR[wd]t+8i+7..t+8i = v8j+7..8j
      endfor
   endfor
SLDI.D
   s = WRLEN/8
   for k in 0, .., 7
      t = s * k
      v = (WR[wd]t+s-1..t || WR[ws]t+s-1..t)
      for i in 0 .. s/8-1
          j = i + n
          WR[wd]t+8i+7..t+8i = v8j+7..8j
      endfor
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

SLL.df 

Vector Shift Left

SLL.B wd,ws,wt

MSA

Vector Shift Left

SLL.H wd,ws,wt

MSA

Vector Shift Left

SLL.W wd,ws,wt

MSA

Vector Shift Left

SLL.D wd,ws,wt

MSA

Vector Shift Left

Purpose:

Vector Shift Left

Vector bit count shift left.

Description:

wd[i] = ws[i] << wt[i]

The elements in vector ws are shifted left by the number of bits the elements in vector wt specify modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SLL.B
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = WR[ws]8i+8-t-1..8i || 0t
   endfor
SLL.H
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = WR[ws]16i+16-t-1..16i || 0t
   endfor
SLL.W
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = WR[ws]32i+32-t-1..32i || 0t
   endfor
SLL.D
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = WR[ws]64i+64-t-1..64i || 0t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

SLLI.df 

Immediate Shift Left

SLLI.B wd,ws,m

MSA

Immediate Shift Left

SLLI.H wd,ws,m

MSA

Immediate Shift Left

SLLI.W wd,ws,m

MSA

Immediate Shift Left

SLLI.D wd,ws,m

MSA

Immediate Shift Left

Purpose:

Immediate Shift Left

Immediate bit count shift left.

Description:

wd[i] = ws[i] << m

The elements in vector ws are shifted left by m bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SLLI.B
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+8-t-1..8i || 0t
   endfor
SLLI.H
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+16-t-1..16i || 0t
   endfor
SLLI.W
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+32-t-1..32i || 0t
   endfor
SLLI.D
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+64-t-1..64i || 0t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df

rt

ws

wd

3R

010100

6

3

2

5

5

5

6

Format:

SPLAT.df 

GPR Element Splat

SPLAT.B wd,ws[rt]

MSA

GPR Element Splat

SPLAT.H wd,ws[rt]

MSA

GPR Element Splat

SPLAT.W wd,ws[rt]

MSA

GPR Element Splat

SPLAT.D wd,ws[rt]

MSA

GPR Element Splat

Purpose:

GPR Element Splat

GPR selected element replicated in all destination elements.

Description:

wd[i] = ws[rt]

Replicate vector ws element with index given by GPR rt to all elements in vector wd.

GPR rt value is interpreted modulo the number of data format df elements in the destination vector.

The operands and results are values in data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SPLAT.B
   n = GPR[rt] % (WRLEN/8)
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8n+7..8n
   endfor
SPLAT.H
   n = GPR[rt] % (WRLEN/16)
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16n+15..16n
   endfor
SPLAT.W
   n = GPR[rt] % (WRLEN/32)
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32n+31..32n
   endfor
SPLAT.D
   n = GPR[rt] % (WRLEN/64)
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64n+63..64n
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

0001

df/n

ws

wd

ELM

011001

6

4

6

5

5

6

Format:

SPLATI.df 

Immediate Element Splat

SPLATI.B wd,ws[n]

MSA

Immediate Element Splat

SPLATI.H wd,ws[n]

MSA

Immediate Element Splat

SPLATI.W wd,ws[n]

MSA

Immediate Element Splat

SPLATI.D wd,ws[n]

MSA

Immediate Element Splat

Purpose:

Immediate Element Splat

Immediate selected element replicated in all destination elements.

Description:

wd[i] = ws[n]

Replicate element n in vector ws to all elements in vector wd.

The operands and results are values in data format df.

Restrictions:

No data-dependent exceptions are possible.

Operation:

SPLATI.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8n+7..8n
   endfor
SPLATI.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16n+15..16n
   endfor
SPLATI.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32n+31..32n
   endfor
SPLATI.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64n+63..64n
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

SRA.df 

Vector Shift Right Arithmetic

SRA.B wd,ws,wt

MSA

Vector Shift Right Arithmetic

SRA.H wd,ws,wt

MSA

Vector Shift Right Arithmetic

SRA.W wd,ws,wt

MSA

Vector Shift Right Arithmetic

SRA.D wd,ws,wt

MSA

Vector Shift Right Arithmetic

Purpose:

Vector Shift Right Arithmetic

Vector bit count shift right arithmetic.

Description:

wd[i] = ws[i] >> wt[i]

The elements in vector ws are shifted right arithmetic by the number of bits the elements in vector wt specify modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRA.B
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = (WR[ws]8i+7)t || WR[ws]8i+7..8i+t
   endfor
SRA.H
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = (WR[ws]16i+15)t || WR[ws]16i+15..16i+t
   endfor
SRA.W
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = (WR[ws]32i+31)t || WR[ws]32i+31..32i+t
   endfor
SRA.D
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = (WR[ws]64i+63)t || WR[ws]64i+63..64i+t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

SRAI.df 

Immediate Shift Right Arithmetic

SRAI.B wd,ws,m

MSA

Immediate Shift Right Arithmetic

SRAI.H wd,ws,m

MSA

Immediate Shift Right Arithmetic

SRAI.W wd,ws,m

MSA

Immediate Shift Right Arithmetic

SRAI.D wd,ws,m

MSA

Immediate Shift Right Arithmetic

Purpose:

Immediate Shift Right Arithmetic

Immediate bit count shift right arithmetic.

Description:

wd[i] = ws[i] >> m

The elements in vector ws are shifted right arithmetic by m bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRAI.B
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = (WR[ws]8i+7)t || WR[ws]8i+7..8i+t
   endfor
SRAI.H
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = (WR[ws]16i+15)t || WR[ws]16i+15..16i+t
   endfor
SRAI.W
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = (WR[ws]32i+31)t || WR[ws]32i+31..32i+t
   endfor
SRAI.D
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = (WR[ws]64i+63)t || WR[ws]64i+63..64i+t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

SRAR.df 

Vector Shift Right Arithmetic Rounded

SRAR.B wd,ws,wt

MSA

Vector Shift Right Arithmetic Rounded

SRAR.H wd,ws,wt

MSA

Vector Shift Right Arithmetic Rounded

SRAR.W wd,ws,wt

MSA

Vector Shift Right Arithmetic Rounded

SRAR.D wd,ws,wt

MSA

Vector Shift Right Arithmetic Rounded

Purpose:

Vector Shift Right Arithmetic Rounded

Vector bit count shift right arithmetic with rounding

Description:

wd[i] = ws[i] >>(rounded) wt[i]

The elements in vector ws are shifted right arithmetic by the number of bits the elements in vector wt specify modulo the size of the element in bits. The most significant discarded bit is added to the shifted value (for rounding) and the result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRAR.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = srar(WR[ws]8i+7..8i,  WR[wt]8i+2..8i, 8)
   endfor
SRAR.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = srar(WR[ws]16i+15..16i, WR[wt]16i+3..16i, 16)
   endfor
SRAR.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = srar(WR[ws]32i+31..32i, WR[wt]32i+4..32i, 32)
   endfor
SRAR.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = srar(WR[ws]64i+63..64i, WR[wt]64i+5..64i, 64)
   endfor
function srar(ts, n, b)
   if n = 0 then
      return ts
   else
      return ((tsb-1)n || tsb-1..n) + tsn-1
   endif
endfunction srar

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df/m

ws

wd

BIT

001010

6

3

7

5

5

6

Format:

SRARI.df 

Immediate Shift Right Arithmetic Rounded

SRARI.B wd,ws,m

MSA

Immediate Shift Right Arithmetic Rounded

SRARI.H wd,ws,m

MSA

Immediate Shift Right Arithmetic Rounded

SRARI.W wd,ws,m

MSA

Immediate Shift Right Arithmetic Rounded

SRARI.D wd,ws,m

MSA

Immediate Shift Right Arithmetic Rounded

Purpose:

Immediate Shift Right Arithmetic Rounded

Immediate bit count shift right arithmetic with rounding

Description:

wd[i] = ws[i] >>(rounded) m

The elements in v ector ws are shifted right arithmetic by m bits. The most significant discarded bit is added to the shifted value (for rounding) and the result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRARI.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = srar(WR[ws]8i+7..8i,  m, 8)
   endfor
SRARI.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = srar(WR[ws]16i+15..16i, m, 16)
   endfor
SRARI.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = srar(WR[ws]32i+31..32i, m, 32)
   endfor
SRARI.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = srar(WR[ws]64i+63..64i, m, 64)
   endfor
function srar(ts, n, b)
   if n = 0 then
      return ts
   else
      return ((tsb-1)n || tsb-1..n) + tsn-1
   endif
endfunction srar

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

001101

6

3

2

5

5

5

6

Format:

SRL.df 

Vector Shift Right Logical

SRL.B wd,ws,wt

MSA

Vector Shift Right Logical

SRL.H wd,ws,wt

MSA

Vector Shift Right Logical

SRL.W wd,ws,wt

MSA

Vector Shift Right Logical

SRL.D wd,ws,wt

MSA

Vector Shift Right Logical

Purpose:

Vector Shift Right Logical

Vector bit count shift right logical.

Description:

wd[i] = ws[i] >> wt[i]

The elements in vector ws are shifted right logical by the number of bits the elements in vector wt specify modulo the size of the element in bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRL.B
   for i in 0 .. WRLEN/8-1
      t = WR[wt]8i+2..8i
      WR[wd]8i+7..8i = 0t || WR[ws]8i+7..8i+t
   endfor
SRL.H
   for i in 0 .. WRLEN/16-1
      t = WR[wt]16i+3..16i
      WR[wd]16i+15..16i = 0t || WR[ws]16i+15..16i+t
   endfor
SRL.W
   for i in 0 .. WRLEN/32-1
      t = WR[wt]32i+4..32i
      WR[wd]32i+31..32i = 0t || WR[ws]32i+31..32i+t
   endfor
SRL.D
   for i in 0 .. WRLEN/64-1
      t = WR[wt]64i+5..64i
      WR[wd]64i+63..64i = (WR[ws]64i+63)t || WR[ws]64i+63..64i+t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df/m

ws

wd

BIT

001001

6

3

7

5

5

6

Format:

SRLI.df 

Immediate Shift Right Logical

SRLI.B wd,ws,m

MSA

Immediate Shift Right Logical

SRLI.H wd,ws,m

MSA

Immediate Shift Right Logical

SRLI.W wd,ws,m

MSA

Immediate Shift Right Logical

SRLI.D wd,ws,m

MSA

Immediate Shift Right Logical

Purpose:

Immediate Shift Right Logical

Immediate bit count shift right logical.

Description:

wd[i] = ws[i] >> m

The elements in vector ws are shifted right logical by m bits. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRLI.B
   t = m
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = 0t || WR[ws]8i+7..8i+t
   endfor
SRLI.H
   t = m
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = 0t || WR[ws]16i+15..16i+t
   endfor
SRLI.W
   t = m
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = 0t || WR[ws]32i+31..32i+t
   endfor
SRLI.D
   t = m
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = 0t || WR[ws]64i+63..64i+t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

SRLR.df 

Vector Shift Right Logical Rounded

SRLR.B wd,ws,wt

MSA

Vector Shift Right Logical Rounded

SRLR.H wd,ws,wt

MSA

Vector Shift Right Logical Rounded

SRLR.W wd,ws,wt

MSA

Vector Shift Right Logical Rounded

SRLR.D wd,ws,wt

MSA

Vector Shift Right Logical Rounded

Purpose:

Vector Shift Right Logical Rounded

Vector bit count shift right logical with rounding

Description:

wd[i] = ws[i] >>(rounded) wt[i]

The elements in vector ws are shifted right logical by the number of bits the elements in vector wt specify modulo the size of the element in bits. The most significant discarded bit is added to the shifted value (for rounding) and the result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRLR.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = srlr(WR[ws]8i+7..8i, WR[wt]8i+2..8i, 8)
   endfor
SRLR.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = srlr(WR[ws]16i+15..16i, WR[wt]16i+3..16i, 16)
   endfor
SRLR.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = srlr(WR[ws]32i+31..32i, WR[wt]32i+4..32i, 32)
   endfor
SRLR.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = srlr(WR[ws]64i+63..64i, WR[wt]64i+5..64i, 64)
   endfor
function srlr(ts, n, b)
   if n = 0 then
      return ts
   else
      return (0n || tsb-1..n) + tsn-1
   endif
endfunction srlr

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df/m

ws

wd

BIT

001010

6

3

7

5

5

6

Format:

SRLRI.df 

Immediate Shift Right Logical Rounded

SRLRI.B wd,ws,m

MSA

Immediate Shift Right Logical Rounded

SRLRI.H wd,ws,m

MSA

Immediate Shift Right Logical Rounded

SRLRI.W wd,ws,m

MSA

Immediate Shift Right Logical Rounded

SRLRI.D wd,ws,m

MSA

Immediate Shift Right Logical Rounded

Purpose:

Immediate Shift Right Logical Rounded

Immediate bit count shift right logical with rounding

Description:

wd[i] = ws[i] >>(rounded) m

The elements in vector ws are shifted right logical by m bits. The most significant discarded bit is added to the shifted value (for rounding) and the result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SRLRI.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = srlr(WR[ws]8i+7..8i, m, 8)
   endfor
SRLRI.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = srlr(WR[ws]16i+15..16i, m, 16)
   endfor
SRLRI.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = srlr(WR[ws]32i+31..32i, m, 32)
   endfor
SRLRI.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = srlr(WR[ws]64i+63..64i, m, 64)
   endfor
function srlr(ts, n, b)
   if n = 0 then
      return ts
   else
      return (0n || tsb-1..n) + tsn-1
   endif
endfunction srlr

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

s10

rs

wd

MI10

1001

df

6

10

5

5

4

2

Format:

ST.df 

Vector Store

ST.B wd,s10(rs)

MSA

Vector Store

ST.H wd,s10(rs)

MSA

Vector Store

ST.W wd,s10(rs)

MSA

Vector Store

ST.D wd,s10(rs)

MSA

Vector Store

Purpose:

Vector Store

Vector store element-by-element to base register plus offset memory address.

Description:

memory[rs + s10 + i * sizeof(wd[i])] = wd[i]

The WRLEN / 8 bytes in vector wd are stored as elements of data format df at the effective memory location addressed by the base rs and the 10-bit signed immediate offset s10.

The s10 offset in data format df units is added to the base rs to form the effective memory location address. rs and the effective memory location address have no alignment restrictions.

If the effective memory location address is element aligned, the vector store instruction is atomic at the element level with no guaranteed ordering among elemen ts, i.e. each element store is an atomic operation issued in no particular order with respect to the element's vector position.

By convention, in the assembly language syntax all offsets are in bytes and have to be multiple of the size of the data format df. The assembler determines the s10 bitfield value dividing the byte offset by the size of the data format df.

Restrictions:

Address-dependent exceptions are possible.

Operation:

ST.B
   a = rs + s10
   StoreByteVector(WR[wd]WRLEN-1..0, a, WRLEN/8)
ST.H
   a = rs + s10 * 2
   StoreHalfwordVector(WR[wd]WRLEN-1..0, a, WRLEN/16)
ST.W
   a = rs + s10 * 4
   StoreWordVector(WR[wd]WRLEN-1..0, a, WRLEN/32)
ST.D
   a = rs + s10 * 8
   StoreDoublewordVector(WR[wd]WRLEN-1..0, a, WRLEN/64)
function StoreByteVector(tt, a, n)
   /* Implementation defined store n byte vector tt to virtual
         address a. */
endfunction StoreByteVector
function StoreHalfwordVector(tt, a, n)
   /* Implementation defined store n halfword vector tt to virtual
          address a. */
endfunction StoreHalfwordVector
function StoreWordVector(tt, a, n)
   /* Implementation defined store n word vector tt to virtual
         address a. */
endfunction StoreWordVector
function StoreDoublewordVector(tt, a, n)
   /* Implementation defined store n doubleword vector tt to virtual
         address a. */
endfunction StoreDoublewordVector

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception. Data access TLB and Address Error Exceptions.

Encoding:

MSA

011110

010

df

wt

ws

wd

3R

010001

6

3

2

5

5

5

6

Format:

SUBSUS_U.df 

Vector Unsigned Saturated Subtract of Signed from Unsigned

SUBSUS_U.B wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Signed from Unsigned

SUBSUS_U.H wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Signed from Unsigned

SUBSUS_U.W wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Signed from Unsigned

SUBSUS_U.D wd,ws,wt

MSA

Vector Unsigned Saturated Subtract of Signed from Unsigned

Purpose:

Vector Unsigned Saturated Subtract of Signed from Unsigned

Vector subtraction of signed values from unsigned values saturating the results as unsigned values.

Description:

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

ector wt are subtracted from the unsigned elements in v ector ws. The signe d result is

The signed elements in v unsigned saturated and written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

011

df

wt

ws

wd

3R

010001

6

3

2

5

5

5

6

Format:

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

Purpose:

Vector Signed Saturated Subtract of Unsigned Values

Vector subtraction from vector of unsigned values saturating the results as signed values.

Description:

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.

Restrictions:

No data-dependent exceptions are possible.

Operation:

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

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

010001

6

3

2

5

5

5

6

Format:

SUBS_S.df 

Vector Signed Saturated Subtract of Signed Values

SUBS_S.B wd,ws,wt

MSA

Vector Signed Saturated Subtract of Signed Values

SUBS_S.H wd,ws,wt

MSA

Vector Signed Saturated Subtract of Signed Values

SUBS_S.W wd,ws,wt

MSA

Vector Signed Saturated Subtract of Signed Values

SUBS_S.D wd,ws,wt

MSA

Vector Signed Saturated Subtract of Signed Values

Purpose:

Vector Signed Saturated Subtract of Signed Values

Vector subtraction from vector saturating the result as signed value.

Description:

wd[i] = saturate_signed(signed(ws[i]) - signed(wt[i]))

The elements in vector wt are subtracted from the eleme nts in vector ws. Signed arithmetic is performed and o verflows clamp to the largest and/or smallest representable signed values 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_S.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = subs_s(WR[ws]8i+7..8i, WR[wt]8i+7..8i, 8)
   endfor
SUBS_S.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = subs_s(WR[ws]16i+15..16i, WR[wt]16i+15..16i, 16)
   endfor
SUBS_S.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = subs_s(WR[ws]32i+31..32i, WR[wt]32i+31..32i, 32)
   endfor
SUBS_S.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = subs_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 subs_s(ts, tt, n)
   t = (tsn-1 || ts) - (ttn-1 || tt)
   return sat_s(t, n+1, n)
endfunction subs_s

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

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.

Encoding:

MSA

011110

001

df

wt

ws

wd

3R

001110

6

3

2

5

5

5

6

Format:

SUBV.df 

Vector Subtract

SUBV.B wd,ws,wt

MSA

Vector Subtract

SUBV.H wd,ws,wt

MSA

Vector Subtract

SUBV.W wd,ws,wt

MSA

Vector Subtract

SUBV.D wd,ws,wt

MSA

Vector Subtract

Purpose:

Vector Subtract

Vector subtraction from vector.

Description:

wd[i] = ws[i] - wt[i]

The elements in vector wt are subtracted from the elements in vector ws. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SUBV.B
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i - WR[wt]8i+7..8i
   endfor
SUBV.H
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i - WR[wt]16i+15..16i
   endfor
SUBV.W
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i - WR[wt]32i+31..32i
   endfor
SUBV.D
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i - WR[wt]64i+63..64i
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

001

df

u5

ws

wd

I5

000110

6

3

2

5

5

5

6

Format:

SUBVI.df 

Immediate Subtract

SUBVI.B wd,ws,u5

MSA

Immediate Subtract

SUBVI.H wd,ws,u5

MSA

Immediate Subtract

SUBVI.W wd,ws,u5

MSA

Immediate Subtract

SUBVI.D wd,ws,u5

MSA

Immediate Subtract

Purpose:

Immediate Subtract

Immediate subtraction from vector.

Description:

wd[i] = ws[i] - u5

The 5-bit immediate unsigned value u5 is subtracted from the elements in v ector ws. The r esult is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

SUBVI.B
   t = 03 || u54..0
   for i in 0 .. WRLEN/8-1
      WR[wd]8i+7..8i = WR[ws]8i+7..8i - t
   endfor
SUBVI.H
   t = 011 || u54..0
   for i in 0 .. WRLEN/16-1
      WR[wd]16i+15..16i = WR[ws]16i+15..16i - t
   endfor
SUBVI.W
   t = 027 || u54..0
   for i in 0 .. WRLEN/32-1
      WR[wd]32i+31..32i = WR[ws]32i+31..32i - t
   endfor
SUBVI.D
   t = 059 || u54..0
   for i in 0 .. WRLEN/64-1
      WR[wd]64i+63..64i = WR[ws]64i+63..64i - t
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

000

df

wt

ws

wd

3R

010101

6

3

2

5

5

5

6

Format:

VSHF.df 

Vector Data Preserving Shuffle

VSHF.B wd,ws,wt

MSA

Vector Data Preserving Shuffle

VSHF.H wd,ws,wt

MSA

Vector Data Preserving Shuffle

VSHF.W wd,ws,wt

MSA

Vector Data Preserving Shuffle

VSHF.D wd,ws,wt

MSA

Vector Data Preserving Shuffle

Purpose:

Vector Data Preserving Shuffle

Vector elements selective copy based on the control vector preserving the input data vectors.

Description:

wd = vector_shuffle(control(wd), ws, wt)

concatenation of vectors ws and wt into

The vector shuffle instructions selectively copy data elements from the vector wd based on the corresponding control element in wd.

The least significant 6 bits in wd control elements modulo the number of elements in the concatenated vectors ws, wt specify the index of the source element. If bit 6 or bit 7 is 1, there will be no copy, but rather the destination element is set to 0.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

VSHF.B
   v = WR[ws] || WR[wt]
   for i in 0 .. WRLEN/8-1
      k = WR[wd]8i+5..8i mod (WRLEN/4)
      if WR[wd]8i+7..8i+6 != 0 then
         WR[wd]8i+7..8i = 0
      else
         WR[wd]8i+7..8i = v8k+7..8k
      endif
   endfor
VSHF.H
   v = WR[ws] || WR[wt]
   for i in 0 .. WRLEN/16-1
      k = WR[wd]16i+5..16i mod (WRLEN/8)
      if WR[wd]16i+7..16i+6 !=0 then
         WR[wd]16i+15..16i = 0
      else
         WR[wd]16i+15..16i = v16k+15..16k
      endif
   endfor
VSHF.W
   v = WR[ws] || WR[wt]
   for i in 0 .. WRLEN/32-1
      k = WR[wd]32i+5..32i mod (WRLEN/16)
      if WR[wd]32i+7..32i+6 != 0 then
         WR[wd]32i+31..32i = 0
      else
         WR[wd]32i+31..32i = v32k+31..32k
      endif
   endfor
VSHF.D
   v = WR[ws] || WR[wt]
   for i in 0 .. WRLEN/64-1
      k = WR[wd]64i+5..64i mod (WRLEN/32)
      if WR[wd]64i+7..64i+6 != 0 then
         WR[wd]64i+63..64i = 0
      else
         WR[wd]64i+63..64i = v64k+63..64k
      endif
   endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

00011

wt

ws

wd

VEC

011110

6

5

5

5

5

6

Format:

XOR.V 

Vector Logical Exclusive Or

XOR.V wd,ws,wt

MSA

Vector Logical Exclusive Or

Purpose:

Vector Logical Exclusive Or

Vector by vector logical exclusive or.

Description:

wd = ws XOR wt

Each bit of vector ws is combined with the corresponding bit of vector wt in a bi twise logical XOR operation. The result is written to vector wd.

The operands and results are bit vector values.

Restrictions:

No data-dependent exceptions are possible.

Operation:

 WR[wd] = WR[ws] xor WR[wt]

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.

Encoding:

MSA

011110

11

i8

ws

wd

I8

000000

6

2

8

5

5

6

Format:

XORI.B 

Immediate Logical Exclusive Or

XORI.B wd,ws,i8

MSA

Immediate Logical Exclusive Or

Purpose:

Immediate Logical Exclusive Or

Immediate by vector logical exclusive or.

Description:

wd[i] = ws[i] XOR i8

Each byte element of vector ws is combined with the 8-bit immediate i8 in a bitwis e logical XOR operation. The result is written to vector wd.

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

Restrictions:

No data-dependent exceptions are possible.

Operation:

 for i in 0 .. WRLEN/8-1
   WR[wd]8i+7..8i = WR[ws]8i+7..8i xor i87..0
endfor

Exceptions:

Reserved Instruction Exception, MSA Disabled Exception.