std1.0.0-beta-7 SafeC docs

std :: simd::cortex_m

Function std::dsp_qadd

#include <std/simd/cortex_m.h> source · definition

int dsp_qadd(int a, int b)

Each 'int'/'unsigned int' operand packs 2x16-bit or 4x8-bit lanes into one 32-bit word (lane 0 in the low bits); packing/unpacking individual lanes is the caller's job (shifts, or reading two adjacent short/char values as one int through a union or pointer cast). Requires an ARM target — using any of these while compiling for a non-ARM target is a compile error at the call site (enforced by the underlying _arm_dsp* builtin).

saturating 32-bit add