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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Table 4-13 ETSI basic operations supported in RVCT (continued)<br />

Intrinsics<br />

extract_l L_macNs L_shr mult_r shr<br />

L_abs L_msu L_shr_r negate shr_r<br />

L_add L_msuNs L_sub norm_s sub<br />

The header file dspfns.h also exposes certain status flags as global variables for use in<br />

your C or C++ programs. The status flags exposed by dspfns.h are listed in Table 4-14.<br />

Table 4-14 ETSI status flags exposed in RVCT<br />

Status flag<br />

Overflow<br />

Carry<br />

Description<br />

Overflow status flag.<br />

Generally, saturating functions have a sticky effect on overflow.<br />

Carry status flag.<br />

Example<br />

#include <br />

#include <br />

#include <br />

// include ETSI basic operations<br />

int32_t C_L_add(int32_t a, int32_t b)<br />

{<br />

int32_t c = a + b;<br />

if (((a ^ b) & INT_MIN) == 0)<br />

{<br />

if ((c ^ a) & INT_MIN)<br />

{<br />

c = (a < 0) INT_MIN : INT_MAX;<br />

}<br />

}<br />

}<br />

return c;<br />

__asm int32_t asm_L_add(int32_t a, int32_t b)<br />

{<br />

qadd r0, r0, r1<br />

bx lr<br />

}<br />

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!