SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
Rotate Right
ROT src1, src2, dst
Functional unit = L
32 bit
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 16 | 15 | 13 | 12 | 10 | 9 | 7 | 6 | 0 |
| x | x | x | x | x | x | x | x | x | x | x | 1 | 0 | 1 | 0 | 1 | dst | src2 | src1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | ||||||
| 3 | 3 | 3 | opcode | ||||||||||||||||||||||||||||
src1[4:0] contains the number of bit positions that src2 is to be rotated right. The new MSB value is defined by the previous LSB value of src2. The result is stored in dst. A src1[4:0] = 0, results in the MV src1, dst instruction.
In the following example, src1[4:0] is 9.
CSR[2]EQ = (dst == 0)
dst = src2
for( i = 1; i < src1; i++) {
dst = { dst[0], dst[32-2: 1] };
}