MSA 011110 |
0110 |
df |
wt |
ws |
wd |
3RF 011100 |
6 |
4 |
1 |
5 |
5 |
5 |
6 |
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 |
Vector Fixed-Point Multiply and Subtract
Vector fixed-point multiply and subtract.
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.
No data-dependent exceptions are possible.
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
Reserved Instruction Exception, MSA Disabled Exception.