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.

Using NEON Support<br />

E.3 Intrinsics<br />

The intrinsics described in this section map closely to NEON instructions. Each section<br />

begins with a list of function prototypes, with a comment specifying an equivalent<br />

assembler instruction. The compiler selects an instruction that has the required<br />

semantics, but there is no guarantee that the compiler produces the listed instruction.<br />

The intrinsics use a naming scheme that is similar to the NEON unified assembler<br />

syntax. That is, each intrinsic has the form:<br />

_<br />

An additional q flag is provided to specify that the intrinsic operates on 128-bit vectors.<br />

For example:<br />

• vmul_s16, multiplies two vectors of signed 16-bit values.<br />

This compiles to VMUL.I16 d2, d0, d1.<br />

• vaddl_u8, is a long add of two 64-bit vectors containing unsigned 8-bit values,<br />

resulting in a 128-bit vector of unsigned 16-bit values.<br />

This compiles to VADDL.U8 q1, d0, d1.<br />

Note<br />

The intrinsic function prototypes in this section use the following type annotations:<br />

__const(n) the argument n must be a compile-time constant<br />

__constrange(min, max)<br />

the argument must be a compile-time constant in the range min to max<br />

__transfersize(n)<br />

the intrinsic loads n bytes from this pointer.<br />

E.3.1<br />

Addition<br />

These intrinsics add vectors. Each lane in the result is the consequence of performing<br />

the addition on the corresponding lanes in each operand vector. The operations<br />

performed are as follows:<br />

• Vector add: vadd -> Vr[i]:=Va[i]+Vb[i] on page E-5<br />

• Vector long add: vadd -> Vr[i]:=Va[i]+Vb[i] on page E-5<br />

• Vector wide add: vadd -> Vr[i]:=Va[i]+Vb[i] on page E-5<br />

• Vector halving add: vhadd -> Vr[i]:=(Va[i]+Vb[i])>>1 on page E-6<br />

• Vector rounding halving add: vrhadd -> Vr[i]:=(Va[i]+Vb[i]+1)>>1 on<br />

page E-6<br />

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