This patch includes changes for the shift left operator involving saturated fixed point types.
For unsigned shifting, overflow occurs if the number of bits we shift exceeds the number of leading zeros in the number. This number is found using the intrinsic llvm function ctlz.
For signed shifting, if the number is positive, we cap at the max value for that type if the number of bits we shift exceeds the number of leading zeros. If the number is negative, we cap at the min value for that type if the number of bits we shift exceeds the number of leading ones. ctlz can be used in this case after flipping the bits in the number.
- Saturation tests were also added for saturated unsigned _Fract types.
- Added a fix to unsigned addition for saturated fixed point types where we would not be able to get the overflow if the number of data bits was equal to the underlying integer width. In this case, we need to use the intrinsic function uadd.with.overflow to detect overflow on this carry bit.