Built-In Functions

The following built-in functions are supported:

The __builtin_frame_address() function always returns zero unless the argument is a constant zero.

The __builtin_sqrt() and __builtin_sqrtf() functions are supported only when hardware floating point support is enabled. In addition, the __builtin_sqrt() function is not supported if --float_support is set to fpv4spd16.

When calling built-in functions that may be unavailable at run-time, use the Clang __has_builtin macro as shown in the following example to make sure the function is supported:

#if __has_builtin(__builtin_sqrt) double estimate = __builtin_sqrt(x); #else double estimate = fast_approximate_sqrt(x); #endif

If the built-in function is supported and the device has the appropriate hardware support, the built-in function will invoke the hardware support.

If the built-in function is supported but the device does not have the appropriate hardware enabled, the built-in function will usually become a call to an RTS library function. For example, __builtin_sqrt() will become a call to the library function sqrt().

The __builtin_return_address() function always returns zero.