## Rounding, clamp and saturate
-One of the issues with vector ops is that in integer DSP ops for example
-in Audio the operation must clamp or saturate rather than overflow or
-ignore the upper bits and become a modulo operation. This for Audio
-is extremely important, also to provide an indicator as to whether
-saturation occurred. see [[av_opcodes]].
+see [[av_opcodes]].
To help ensure that audio quality is not compromised by overflow,
"saturation" is provided, as well as a way to detect when saturation
-occurred (Rc=1). When Rc=1 there will be a *vector* of CRs, one CR per
+occurred if desired (Rc=1). When Rc=1 there will be a *vector* of CRs, one CR per
element in the result (Note: this is different from VSX which has a
single CR per block).
When N=0 the result is saturated to within the maximum range of an
unsigned value. For integer ops this will be 0 to 2^elwidth-1. Similar
logic applies to FP operations, with the result being saturated to
-maximum rather than returning INF.
+maximum rather than returning INF, and the minimum to +0.0
When N=1 the same occurs except that the result is saturated to the min
-or max of a signed result.
+or max of a signed result, and for FP to the min and max value rather than returning +/- INF.
When Rc=1, the CR "overflow" bit is set on the CR associated with the
element, to indicate whether saturation occurred. Note that due to
scalar result is placed in the first available unmasked element.
TODO: Rc=1 on Scalar Logical Operations? is this possible? was space
-reserved in Logical Ops?
+creserved in Logical Ops?
Pseudocode for the case where RA==RB: