Version

menu_open

include/AK/SoundEngine/Platforms/Generic/AkSimd.h File Reference

Go to the source code of this file.

Classes

struct   AKSIMD_V4I32
struct   AKSIMD_V4UI32
struct   AKSIMD_V2F32
struct   AKSIMD_V4F32
struct   __attribute__
struct   __attribute__
struct   __attribute__
struct   __attribute__

Defines

#define  AKSIMD_GETELEMENT_V4F32(__vName, __num__)   (__vName).m_data[(__num__)]
#define  AKSIMD_GETELEMENT_V2F32(__vName, __num__)   (__vName).m_data[(__num__)]
#define  AKSIMD_GETELEMENT_V4I32(__vName, __num__)   (__vName).m_data[(__num__)]
#define  AkReal32Vector   AKSIMD_V4F32
#define  AKSIMD_LOAD1(__scalar__)   AKSIMD_LOAD1_V4F32( &__scalar__ )
#define  AKSIMD_LOADVEC(v)   AKSIMD_LOAD_V4F32((const AKSIMD_F32*)((v)))
#define  AKSIMD_MUL   AKSIMD_MUL_V4F32
#define  AKSIMD_STOREVEC   AKSIMD_STORE_V4F32
#define  AKSIMD_SPLAT_V4F32(var, idx)   AKSIMD_SHUFFLE_V4F32(var,var, AKSIMD_SHUFFLE(idx,idx,idx,idx))
Platform specific memory size alignment for allocation purposes

#define  AKSIMD_ALIGNSIZE(__Size__)   (((__Size__) + 15) & ~15)

Typedefs

AKSIMD types

typedef AkInt32  AKSIMD_I32
  32-bit signed integer
typedef AkReal32  AKSIMD_F32
  32-bit float
typedef AKSIMD_V4UI32  AKSIMD_V4COND
  Vector of 4 comparison results.

Functions

static AkForceInline void  AKSIMD_HORIZONTALADD (AKSIMD_V4F32 &vVec)
static AkForceInline AKSIMD_V4F32  AKSIMD_COMPLEXMUL (const AKSIMD_V4F32 vCIn1, const AKSIMD_V4F32 vCIn2)
  Cross-platform SIMD multiplication of 2 complex data elements with interleaved real and imaginary parts.
AKSIMD conversion

AkForceInline AKSIMD_V4F32  AKSIMD_CONVERT_V4I32_TO_V4F32 (const AKSIMD_V4I32 &in_from)
AkForceInline AKSIMD_V4I32  AKSIMD_CONVERT_V4F32_TO_V4I32 (const AKSIMD_V4F32 &in_from)
AKSIMD logical operations

AkForceInline AKSIMD_V4I32  AKSIMD_AND_V4I32 (const AKSIMD_V4I32 &in_vec1, const AKSIMD_V4I32 &in_vec2)
AkForceInline AKSIMD_V4I32  AKSIMD_CMPGT_V8I16 (const AKSIMD_V4I32 &in_vec1, const AKSIMD_V4I32 &in_vec2)
AkForceInline AKSIMD_V4UI32  AKSIMD_CMPLE_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
  Compares for less than or equal (see _mm_cmple_ps).
AkForceInline AKSIMD_V4I32  AKSIMD_SHIFTLEFT_V4I32 (AKSIMD_V4I32 in_vector, int in_shiftBy)
AkForceInline AKSIMD_V4I32  AKSIMD_SHIFTRIGHTARITH_V4I32 (AKSIMD_V4I32 in_vector, int in_shiftBy)
AKSIMD packing / unpacking

AkForceInline AKSIMD_V4I32  AKSIMD_UNPACKLO_VECTOR8I16 (const AKSIMD_V4I32 &in_vec1, const AKSIMD_V4I32 &in_vec2)
AkForceInline AKSIMD_V4I32  AKSIMD_UNPACKHI_VECTOR8I16 (const AKSIMD_V4I32 &in_vec1, const AKSIMD_V4I32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_UNPACKLO_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_UNPACKHI_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V4I32  AKSIMD_PACKS_V4I32 (const AKSIMD_V4I32 &in_vec1, const AKSIMD_V4I32 &in_vec2)

AKSIMD loading / setting



#define  AKSIMD_LOADU_V4I32(in_pData)   (*(in_pData))
#define  AKSIMD_LOADU_V4F32(in_pValue)   (*(AKSIMD_V4F32*)(in_pValue))
#define  AKSIMD_LOAD_V4F32(in_pValue)   (*(AKSIMD_V4F32*)(in_pValue))
AkForceInline AKSIMD_V4F32  AKSIMD_LOAD1_V4F32 (AKSIMD_F32 in_value)
AkForceInline AKSIMD_V4F32  AKSIMD_SET_V4F32 (AKSIMD_F32 in_value)
AkForceInline AKSIMD_V2F32  AKSIMD_SET_V2F32 (AKSIMD_F32 in_value)
AkForceInline AKSIMD_V4F32  AKSIMD_SETZERO_V4F32 ()
AkForceInline AKSIMD_V2F32  AKSIMD_SETZERO_V2F32 ()
AkForceInline AKSIMD_V4I32  AKSIMD_SETZERO_V4I32 ()
AkForceInline AKSIMD_V4F32  AKSIMD_LOAD_SS_V4F32 (const AKSIMD_F32 *in_pData)

AKSIMD storing



#define  AKSIMD_STOREU_V4F32(in_pTo, in_vec)   (*(AKSIMD_V4F32*)(in_pTo)) = (in_vec)
#define  AKSIMD_STORE_V4F32(__addr__, __vName__)   AKSIMD_STOREU_V4F32(__addr__, __vName__)
#define  AKSIMD_STOREU_V4I32(in_pTo, in_vec)   (*(AKSIMD_V4I32*)(in_pTo)) = (in_vec)
AkForceInline void  AKSIMD_STORE1_V4F32 (AKSIMD_F32 *in_pTo, const AKSIMD_V4F32 &in_vec)

AKSIMD arithmetic



#define  AKSIMD_MADD_V4F32(__a__, __b__, __c__)   AKSIMD_ADD_V4F32( AKSIMD_MUL_V4F32( (__a__), (__b__) ), (__c__) )
  Vector multiply-add operation.
#define  AKSIMD_MSUB_V4F32(__a__, __b__, __c__)   AKSIMD_SUB_V4F32( AKSIMD_MUL_V4F32( (__a__), (__b__) ), (__c__) )
#define  AKSIMD_MADD_SS_V4F32(__a__, __b__, __c__)   AKSIMD_ADD_SS_V4F32( AKSIMD_MUL_SS_V4F32( (__a__), (__b__) ), (__c__) )
  Vector multiply-add operation.
AkForceInline AKSIMD_V4F32  AKSIMD_SUB_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_SUB_SS_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_ADD_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V2F32  AKSIMD_ADD_V2F32 (const AKSIMD_V2F32 &in_vec1, const AKSIMD_V2F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_ADD_SS_V4F32 (const AKSIMD_V4F32 &a, const AKSIMD_V4F32 &b)
AkForceInline AKSIMD_V4F32  AKSIMD_MUL_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V2F32  AKSIMD_MUL_V2F32 (const AKSIMD_V2F32 &in_vec1, const AKSIMD_V2F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_MUL_SS_V4F32 (const AKSIMD_V4F32 &a, const AKSIMD_V4F32 &b)
AkForceInline AKSIMD_V4F32  AKSIMD_MIN_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V2F32  AKSIMD_MIN_V2F32 (const AKSIMD_V2F32 &in_vec1, const AKSIMD_V2F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_MAX_V4F32 (const AKSIMD_V4F32 &in_vec1, const AKSIMD_V4F32 &in_vec2)
AkForceInline AKSIMD_V2F32  AKSIMD_MAX_V2F32 (const AKSIMD_V2F32 &in_vec1, const AKSIMD_V2F32 &in_vec2)
AkForceInline AKSIMD_V4F32  AKSIMD_ABS_V4F32 (const AKSIMD_V4F32 &in_vec1)
AkForceInline AKSIMD_V4F32  AKSIMD_NEG_V4F32 (const AKSIMD_V4F32 &in_vec1)
AkForceInline AKSIMD_V4F32  AKSIMD_SQRT_V4F32 (const AKSIMD_V4F32 &in_vec)
AkForceInline AKSIMD_V2F32  AKSIMD_SQRT_V2F32 (const AKSIMD_V2F32 &in_vec)

AKSIMD shuffling



#define  AKSIMD_SHUFFLE(fp3, fp2, fp1, fp0)   (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0)))
#define  AKSIMD_MOVEHL_V4F32(a, b)   AKSIMD_SHUFFLE_V4F32( (b), (a), AKSIMD_SHUFFLE(3, 2, 3, 2) )
#define  AKSIMD_MOVELH_V4F32(a, b)   AKSIMD_SHUFFLE_V4F32( (a), (b), AKSIMD_SHUFFLE(1, 0, 1, 0) )
#define  AKSIMD_SHUFFLE_BADC(__a__)   AKSIMD_SHUFFLE_V4F32( (__a__), (__a__), AKSIMD_SHUFFLE(2,3,0,1));
  Swap the 2 lower floats together and the 2 higher floats together.
#define  AKSIMD_SHUFFLE_CDAB(__a__)   AKSIMD_SHUFFLE_V4F32( (__a__), (__a__), AKSIMD_SHUFFLE(1,0,3,2));
  Swap the 2 lower floats with the 2 higher floats.
#define  AKSIMD_DUP_ODD(__vv)   AKSIMD_SHUFFLE_V4F32(__vv, __vv, AKSIMD_SHUFFLE(3,3,1,1))
  Duplicates the odd items into the even items (d c b a -> d d b b ).
#define  AKSIMD_DUP_EVEN(__vv)   AKSIMD_SHUFFLE_V4F32(__vv, __vv, AKSIMD_SHUFFLE(2,2,0,0))
  Duplicates the even items into the odd items (d c b a -> c c a a ).
AkForceInline AKSIMD_V4F32  AKSIMD_SHUFFLE_V4F32 (const AKSIMD_V4F32 &xyzw, const AKSIMD_V4F32 &abcd, int mask)

Detailed Description

AKSIMD - Generic (no SIMD support) implementation

Definition in file AkSimd.h.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise