The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Typedefs | Functions
neon.hpp File Reference

Helper class for ARM NEON support. More...

#include <boost/cstdint.hpp>
Include dependency graph for neon.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tvector< T, S >
 Emulates a vector. More...
 
struct  tmatrix< T, S, D >
 Emulates a matrix. More...
 

Typedefs

typedef tvector< uint8_t, 8 > uint8x8_t
 
typedef tvector< uint16_t, 8 > uint16x8_t
 
typedef tmatrix< uint8_t, 8, 4 > uint8x8x4_t
 

Functions

template<class Td , unsigned S>
tvector< Td, Svdup_n (Td imm)
 
uint16x8_t vdupq_n_u16 (uint16_t imm)
 
uint8x8_t vdup_n_u8 (uint8_t imm)
 
template<class Td , class Tm , unsigned S>
tvector< Td, Svshr (tvector< Tm, S > m, const unsigned imm)
 
uint8x8_t vshrn_n_u16 (uint16x8_t m, const unsigned imm)
 
template<class Td , class Tn , class Tm , unsigned S>
tvector< Td, Svadd (tvector< Tn, S > n, tvector< Tm, S > m)
 
uint16x8_t vaddq_u16 (uint16x8_t n, uint16x8_t m)
 
template<class Td , class Ts , unsigned S>
tvector< Td, Svmul (tvector< Ts, S > n, tvector< Ts, S > m)
 
uint16x8_t vmull_u8 (uint8x8_t n, uint8x8_t m)
 
template<class Td , unsigned S, unsigned D>
tmatrix< Td, S, D > vld (Td *base)
 
uint8x8x4_t vld4_u8 (uint8_t *base)
 
template<class Td , unsigned S, unsigned D>
void vst (Td *base, tmatrix< Td, S, D > list)
 
void vst4_u8 (uint8_t *base, uint8x8x4_t list)
 

Detailed Description

Helper class for ARM NEON support.

When using g++ on an ARM that support the NEON it uses the gcc intrinsics [1], for all other platforms an emulation is used. The emulation is based on the RealView Compilation Tool Assembler Guide (ARM DUI 0204J (ID101213)) [2]. The emulation follows the latter convensions instead of the former. The numbers in the sections refer to the section numers in [2].

Not everything is implemented, only functions used are implemented.

Common template parameters are:

[1] http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/ARM-NEON-Intrinsics.html [2] http://infocenter.arm.com/help/topic/com.arm.doc.dui0204i/DUI0204I_rvct_assembler_guide.pdf

Definition in file neon.hpp.

Typedef Documentation

typedef tvector<uint16_t, 8> uint16x8_t

Definition at line 82 of file neon.hpp.

typedef tvector<uint8_t, 8> uint8x8_t

Definition at line 81 of file neon.hpp.

typedef tmatrix<uint8_t, 8, 4> uint8x8x4_t

Definition at line 97 of file neon.hpp.

Function Documentation

template<class Td , class Tn , class Tm , unsigned S>
tvector<Td, S> vadd ( tvector< Tn, S n,
tvector< Tm, S m 
)
inline

Definition at line 149 of file neon.hpp.

References d, i, and S.

uint16x8_t vaddq_u16 ( uint16x8_t  n,
uint16x8_t  m 
)
inline

Definition at line 159 of file neon.hpp.

Referenced by blend_surface().

template<class Td , unsigned S>
tvector<Td, S> vdup_n ( Td  imm)
inline

Definition at line 105 of file neon.hpp.

References d, i, and S.

uint8x8_t vdup_n_u8 ( uint8_t  imm)
inline

Definition at line 121 of file neon.hpp.

Referenced by blend_surface().

uint16x8_t vdupq_n_u16 ( uint16_t  imm)
inline

Definition at line 115 of file neon.hpp.

Referenced by blend_surface().

template<class Td , unsigned S, unsigned D>
tmatrix<Td, S, D> vld ( Td *  base)
inline

Definition at line 188 of file neon.hpp.

References d, i, S, and tmatrix< T, S, D >::val.

uint8x8x4_t vld4_u8 ( uint8_t *  base)
inline

Definition at line 200 of file neon.hpp.

Referenced by blend_surface().

template<class Td , class Ts , unsigned S>
tvector<Td, S> vmul ( tvector< Ts, S n,
tvector< Ts, S m 
)
inline

Definition at line 168 of file neon.hpp.

References d, i, and S.

uint16x8_t vmull_u8 ( uint8x8_t  n,
uint8x8_t  m 
)
inline

Definition at line 179 of file neon.hpp.

Referenced by blend_surface().

template<class Td , class Tm , unsigned S>
tvector<Td, S> vshr ( tvector< Tm, S m,
const unsigned  imm 
)
inline

Definition at line 130 of file neon.hpp.

References d, i, and S.

uint8x8_t vshrn_n_u16 ( uint16x8_t  m,
const unsigned  imm 
)
inline

Definition at line 140 of file neon.hpp.

Referenced by blend_surface().

template<class Td , unsigned S, unsigned D>
void vst ( Td *  base,
tmatrix< Td, S, D >  list 
)
inline

Definition at line 207 of file neon.hpp.

References i, S, and tmatrix< T, S, D >::val.

void vst4_u8 ( uint8_t *  base,
uint8x8x4_t  list 
)
inline

Definition at line 217 of file neon.hpp.

Referenced by blend_surface().