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