__promise intrinsic

This intrinsic 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.

Show/hideSyntax

void __promise(expr)

Where expr is an expression that evaluates to nonzero.

Show/hideUsage

__promise(expr) is similar but complementary to assert(expr). Unlike assert(expr), __promise(expr) is effective when NDEBUG is defined.

If assertions are enabled (by including assert.h and not defining NDEBUG) then the promise is checked at runtime by evaluating expr as part of assert(expr).

Show/hideSee also

Copyright © 2010-2012 ARM. All rights reserved.ARM DUI 0491H
Non-ConfidentialID070912