__promise represents a promise you make to the compiler that a given expression always has a nonzero value. This enables the compiler to perform more aggressive optimization when vectorizing code.
Syntax
__promise(expr)
Where expr is an expression
that evaluates to nonzero.
Usage
You must #include <assert.h> to use __promise(expr).
If assertions are enabled (by not defining NDEBUG) and the macro __DO_NOT_LINK_PROMISE_WITH_ASSERT is not defined, then the promise is checked at runtime by evaluating expr as part of assert(expr).
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.