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 />

To make use of the TI C55x intrinsics in your own code, include the standard header file<br />

c55x.h. The intrinsics supplied in c55x.h are listed in Table 4-15.<br />

Table 4-15 TI C55x intrinsics supported in RVCT<br />

Intrinsics<br />

_abss _lshrs _rnd _smas<br />

_count _lsadd _norm _smpy<br />

_divs _lsmpy _round _sneg<br />

_labss _lsneg _roundn _sround<br />

_lmax _lsshl _sadd _sroundn<br />

_lmin _lssub _shl _sshl<br />

_lnorm _max _shrs _ssub<br />

_lshl _min _smac<br />

Example<br />

#include <br />

#include <br />

#include <br />

// include TI C55x intrinsics<br />

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

{<br />

qadd r0, r0, r1<br />

bx lr<br />

}<br />

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

{<br />

int32_t c, d, e;<br />

c = asm_lsadd(a, b); // assembly language saturating add<br />

d = __qadd(a, b); // <strong>ARM</strong> intrinsic saturating add<br />

e = _lsadd(a, b); // TI C55x saturating add<br />

}<br />

return c == d == e; // returns 1<br />

4-100 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!