Hi all,
ACLE section 9.4.2 defines the __qdbl intrinsic:
int32_t qdbl(int32_t);
Doubles a signed 32-bit number, with saturation. qdbl(x) is equal to __qadd(x,x) except that the argument x is evaluated only once.
Sets the Q flag if the addition saturates.
Since we already have an arm_acle.h header file with qadd implemented, it's trivial to implement this. I've also added a test that should make sure the argument is only evaluated once - this would catch e.g. if someone decided to do #define qdbl(X) __qadd(X,X) instead, which evaluates X twice. Does this look reasonable?
Cheers
Moritz