SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
Assembly syntax: | VRND src1, src2, dst |
Operation: | Round src1 by number of bits expressed in src2 |
Classification: | 2-input 1-output |
Bit width: | 40-bit src1/dst, 5-bit src2, allowing rounding by 0 ~ 31 bits |
Delay slot: | one |
C statement: | rnd_add = (src2 > 0) ? (1 << (src2 – 1)) : 0; dst = (src1 + rnd_add) >> src2; |
A half-unit is added before the right-shift. For example, if src2 = 8, dst = (src1 + 128) >> 8.
Only src2[4:0] are read, so for example src2 = 40 causes a rounding by 8 bits, since src2[4:0] = 0x08.