|
MSA 011110 |
000 |
df |
wt |
ws |
wd |
3R 010000 |
|
6 |
3 |
2 |
5 |
5 |
5 |
6 |
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 |
Vector Add Absolute Values
Vector addition to vector using the absolute values.
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.
No data-dependent exceptions are possible.
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
Reserved Instruction Exception, MSA Disabled Exception.