Assembly syntax: | VMADD src1, src2, src3, dst, RND: rnd_param (dst same as src3) |
Operation: | Multiply-add |
Classification: | 3-input 1-output |
Bit width: | 17-bit src1/src2, 40-bit src3/dst |
Delay slot: | 2 delay from src1/src2, 1 delay from src3 |
C statement: | dst = src3 + round_or_shift(src1 * src2, rnd_param) |
The RND field specifies a parameter, in which additional fields are read to support built-in round/shift feature in the operation:
Figure 8-70 VMPY, VMADD and VMSUB Rounding Parameters | | | | Parameter Indexed by rnd_param | | | | |
Reserved | rnd_mode | rnd_shift |
Table 8-362 Parameter Indexed by rnd_param Field DescriptionsBits | Name | Description |
---|
15-7 | Reserved | |
6-5 | rnd_mode | Sets rounding mode: |
0 | No rounding |
1 | Round |
2 | Truncate |
3 | Left-shift |
4-0 | rnd_shift | Number of bits to round/shift, limited to: |
{8|15|16} | Round/truncate |
1 | Left-shift |
When rnd_mode = round or truncate, src1 * src2 is rounded down before the addition or subtraction. When rnd_mode = left-shift, src1 * src2 is shifted up before the addition or subtraction. Note the restriction on the number of bits to shift.