SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
Rotate Right Through Carry Bit
ROTC 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 | 1 | 0 | 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 through the Carry bit (CSR[5]C). The new MSB value is defined by the current SAT bit in the control status register (CSR). The rotated LSB of src2 is moved to CSR[5]C. 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)
CSR[5]C: see the Pseudo Code
tmp = src2
for( i = 1; i < src1; i++) {
tmp = { CSR[C], tmp[32-2: 1] };
CSR[C] = tmp[0] ;
}
dst = tmp;