Question
32 sum with saturation
Posted on January 08, 2016 at 18:25
hello forum
I am using a Cortex M0+ and I am looking for suggestions about handling saturation with 32 bit addition.I found this code in the webuint32_t sadd32(uint32_t a, uint32_t b)
{ return (a > (1<<32-1) - b) ? ((1<<32)-1) : a + b;}which can probably extended to int32_t (which puzzles me :) ). I am looking for possible suggestions about more efficient assembly implementationthanks