29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Compiler</strong>-specific Features<br />

4.7.3 __builtin_constant_p<br />

This builtin function determines if a value is known to be constant at compile-time.<br />

Note<br />

This builtin function is a GNU compiler extension that is supported by the <strong>ARM</strong><br />

compiler.<br />

Mode<br />

Supported in GNU mode only.<br />

Syntax<br />

int __builtin_constant_p(...)<br />

Where:<br />

... is the argument whose value is to be tested.<br />

Return value<br />

__builtin_constant_p returns the integer 1 if the argument is known to be a<br />

compile-time constant and 0 if it is not known to be a compile-time constant.<br />

Restrictions<br />

A return value of 0 does not indicate that the value is not a constant, but that the<br />

compiler cannot prove it is a constant with the specified value of the -O option.<br />

See also<br />

• -Onum on page 2-66.<br />

4.7.4 __builtin_expect<br />

This intrinsic provides the compiler with branch prediction information. Calling<br />

__builtin_expect(expr, c) informs the compiler that it is expected that expr == c.<br />

Note<br />

This builtin function is a GNU compiler extension that is supported by the <strong>ARM</strong><br />

compiler.<br />

<strong>ARM</strong> DUI 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 4-65<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!