SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
Saturation to Signed/Unsigned N-Bit Value with Sign/Zero Extend
SATN ucst3, src2, dst
Functional unit = L
32 bit
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 16 | 15 | 13 | 12 | 10 | 9 | 0 |
x | x | x | x | x | x | x | x | x | x | x | x | x | ucst3[2:0] | dst | src2 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
3 | 3 | 3 | opcode |
Saturation to signed/unsigned N-bit value and sign/zero extend to 32 bits. src2 is saturated based on ucst3:
src2 is considered a signed value that needs to be saturated to a signed or unsigned range. The result is undefined, if reserved values in ucst3 are used.
CSR[2]EQ = (dst == 0)
dst = (src2 <= -2(N-1)) ? -2(N-1) : ( (src2 >= 2(N-1) - 1) ? 2(N-1) - 1 : src2);