2.10 __promise

__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).

Non-ConfidentialPDF file icon PDF versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.