HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VM_AVXFunc.h File Reference
#include "VM_API.h"
#include <SYS/SYS_Align.h>
#include <SYS/SYS_Types.h>
#include <immintrin.h>
+ Include dependency graph for VM_AVXFunc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CPU_HAS_AVX_INSTR   1
 
#define VM_AVX_STYLE   1
 
#define V8SF(A)   (v8sf)A
 
#define V8SI(A)   (v8si)A
 
#define _mm256_set_m128i(v0, v1)   _mm256_insertf128_si256(_mm256_castsi128_si256(v1), (v0), 1)
 
#define VM_SHUFFLE_MASK_AVX(a0, a1, b0, b1)   ((b1)<<6|(b0)<<4 | (a1)<<2|(a0))
 
#define SSE_WRAPPER_I(NAME, OP)
 
#define VM_EXTRACT_AVX   vm_extract_avx
 
#define VM_INSERT_AVX   vm_insert_avx
 
#define VM_SPLATS_AVX   vm_splats_avx
 
#define VM_LOAD_AVX   vm_load_avx
 
#define VM_STORE_AVX   vm_store_avx
 
#define VM_CMPLT_AVX(A, B)   V8SI(_mm256_cmp_ps(A,B,_CMP_LT_OQ))
 
#define VM_CMPLE_AVX(A, B)   V8SI(_mm256_cmp_ps(A,B,_CMP_LE_OQ))
 
#define VM_CMPGT_AVX(A, B)   V8SI(_mm256_cmp_ps(A,B,_CMP_GT_OQ))
 
#define VM_CMPGE_AVX(A, B)   V8SI(_mm256_cmp_ps(A,B,_CMP_GE_OQ))
 
#define VM_CMPEQ_AVX(A, B)   V8SI(_mm256_cmp_ps(A,B,_CMP_EQ_OQ))
 
#define VM_CMPNE_AVX(A, B)   V8SI(_mm256_cmp_ps(A,B,_CMP_NEQ_OQ))
 
#define VM_ICMPLT_AVX   vm_int_cmplt_avx
 
#define VM_ICMPGT_AVX   vm_int_cmpgt_avx
 
#define VM_ICMPEQ_AVX   vm_int_cmpeq_avx
 
#define VM_IADD_AVX   vm_int_add_avx
 
#define VM_ISUB_AVX   vm_int_sub_avx
 
#define VM_IMUL_AVX   vm_int_mul_avx
 
#define VM_ADD_AVX   _mm256_add_ps
 
#define VM_SUB_AVX   _mm256_sub_ps
 
#define VM_MUL_AVX   _mm256_mul_ps
 
#define VM_DIV_AVX   _mm256_div_ps
 
#define VM_SQRT_AVX   _mm256_sqrt_ps
 
#define VM_ISQRT_AVX   _mm256_rsqrt_ps
 
#define VM_INVERT_AVX   _mm256_rcp_ps
 
#define VM_ABS_AVX   vm_abs_avx
 
#define VM_FDIV_AVX   vm_fdiv_avx
 
#define VM_NEG_AVX   vm_negate_avx
 
#define VM_FSQRT_AVX   vm_fsqrt_avx
 
#define VM_MADD_AVX   vm_madd_avx
 
#define VM_MIN_AVX   _mm256_min_ps
 
#define VM_MAX_AVX   _mm256_max_ps
 
#define VM_AND_AVX   vm_int_and_avx
 
#define VM_ANDNOT_AVX   vm_int_andnot_avx
 
#define VM_OR_AVX   vm_int_or_avx
 
#define VM_XOR_AVX   vm_int_xor_avx
 
#define VM_ALLBITS_AVX   vm_allbits_avx
 
#define VM_SHUFFLE_AVX   vm_shuffle_avx
 
#define VM_SSE_ROUND_MASK_AVX   0x6000
 
#define VM_SSE_ROUND_ZERO_AVX   0x6000
 
#define VM_SSE_ROUND_UP_AVX   0x4000
 
#define VM_SSE_ROUND_DOWN_AVX   0x2000
 
#define VM_SSE_ROUND_NEAR_AVX   0x0000
 
#define GETROUND_AVX()   (_mm_getcsr()&VM_SSE_ROUND_MASK_AVX)
 
#define SETROUND_AVX(x)   (_mm_setcsr(x|(_mm_getcsr()&~VM_SSE_ROUND_MASK_AVX)))
 
#define VM_P_FLOOR_AVX()
 
#define VM_FLOOR_AVX   _mm256_cvtps_epi32
 
#define VM_INT_AVX   _mm256_cvttps_epi32
 
#define VM_E_FLOOR_AVX()   SETROUND_AVX(rounding);
 
#define VM_IFLOAT_AVX   _mm256_cvtepi32_ps
 
#define VM_SHIFTLEFT_AVX(A, C)   _mm256_sll_epi32(A,_mm_setr_epi32(C,0,0,0))
 
#define VM_SHIFTRIGHT_AVX(A, C)   _mm256_srl_epi32(A,_mm_setr_epi32(C,0,0,0))
 
#define _PI32AVX_CONST(Name, Val)
 
#define _PS256_CONST(Name, Val)
 
#define _PS256_CONST_TYPE(Name, Type, Val)
 
#define COPY_IMM_TO_XMM(imm_, xmm0_, xmm1_)
 
#define COPY_XMM_TO_IMM(xmm0_, xmm1_, imm_)
 
#define VM_SINCOS_AVX   vm_sincos_avx
 
#define VM_SIN_AVX   vm_sin_avx
 
#define VM_COS_AVX   vm_cos_avx
 
#define VM_TAN_AVX   vm_tan_avx
 

Typedefs

typedef __m256 v8sf
 
typedef __m256i v8si
 

Macro Definition Documentation

#define _mm256_set_m128i (   v0,
  v1 
)    _mm256_insertf128_si256(_mm256_castsi128_si256(v1), (v0), 1)

Definition at line 62 of file VM_AVXFunc.h.

#define _PI32AVX_CONST (   Name,
  Val 
)
Value:
static const SYS_ALIGN(32) int _pi32avx_##Name[4] = \
{ Val, Val, Val, Val }
#define SYS_ALIGN(b)
Definition: SYS_Align.h:101
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
#define _PS256_CONST (   Name,
  Val 
)
Value:
static const SYS_ALIGN(32) float _ps256_##Name[8] = \
{ Val, Val, Val, Val, Val, Val, Val, Val }
#define SYS_ALIGN(b)
Definition: SYS_Align.h:101
#define _PS256_CONST_TYPE (   Name,
  Type,
  Val 
)
Value:
static const SYS_ALIGN(32) Type _ps256_##Name[8] = \
{ Val, Val, Val, Val, Val, Val, Val, Val }
#define SYS_ALIGN(b)
Definition: SYS_Align.h:101
#define COPY_IMM_TO_XMM (   imm_,
  xmm0_,
  xmm1_ 
)
Value:
{ \
SYS_ALIGN(32) imm_xmm_union u; \
u.imm = imm_; \
xmm0_ = u.xmm[0]; \
xmm1_ = u.xmm[1]; \
}
#define SYS_ALIGN(b)
Definition: SYS_Align.h:101
#define COPY_XMM_TO_IMM (   xmm0_,
  xmm1_,
  imm_ 
)
Value:
{ \
SYS_ALIGN(32) imm_xmm_union u; \
u.xmm[0]=xmm0_; u.xmm[1]=xmm1_; imm_ = u.imm; \
}
#define SYS_ALIGN(b)
Definition: SYS_Align.h:101
#define CPU_HAS_AVX_INSTR   1

Definition at line 18 of file VM_AVXFunc.h.

#define GETROUND_AVX ( )    (_mm_getcsr()&VM_SSE_ROUND_MASK_AVX)

Definition at line 359 of file VM_AVXFunc.h.

#define SETROUND_AVX (   x)    (_mm_setcsr(x|(_mm_getcsr()&~VM_SSE_ROUND_MASK_AVX)))

Definition at line 360 of file VM_AVXFunc.h.

#define SSE_WRAPPER_I (   NAME,
  OP 
)
Value:
static SYS_FORCE_INLINE v8si \
NAME(v8si a, v8si b) \
{ \
__m128i la = _mm256_extractf128_si256(a, 0); \
__m128i ua = _mm256_extractf128_si256(a, 1); \
__m128i lb = _mm256_extractf128_si256(b, 0); \
__m128i ub = _mm256_extractf128_si256(b, 1); \
return _mm256_set_m128i(OP(ua, ub), \
OP(la, lb)); \
}
#define _mm256_set_m128i(v0, v1)
Definition: VM_AVXFunc.h:62
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLdouble GLdouble GLdouble b
Definition: glew.h:9122

Definition at line 274 of file VM_AVXFunc.h.

#define V8SF (   A)    (v8sf)A

Definition at line 58 of file VM_AVXFunc.h.

#define V8SI (   A)    (v8si)A

Definition at line 59 of file VM_AVXFunc.h.

#define VM_ABS_AVX   vm_abs_avx

Definition at line 333 of file VM_AVXFunc.h.

#define VM_ADD_AVX   _mm256_add_ps

Definition at line 326 of file VM_AVXFunc.h.

#define VM_ALLBITS_AVX   vm_allbits_avx

Definition at line 348 of file VM_AVXFunc.h.

#define VM_AND_AVX   vm_int_and_avx

Definition at line 343 of file VM_AVXFunc.h.

#define VM_ANDNOT_AVX   vm_int_andnot_avx

Definition at line 344 of file VM_AVXFunc.h.

#define VM_AVX_STYLE   1

Definition at line 19 of file VM_AVXFunc.h.

#define VM_CMPEQ_AVX (   A,
 
)    V8SI(_mm256_cmp_ps(A,B,_CMP_EQ_OQ))

Definition at line 315 of file VM_AVXFunc.h.

#define VM_CMPGE_AVX (   A,
 
)    V8SI(_mm256_cmp_ps(A,B,_CMP_GE_OQ))

Definition at line 314 of file VM_AVXFunc.h.

#define VM_CMPGT_AVX (   A,
 
)    V8SI(_mm256_cmp_ps(A,B,_CMP_GT_OQ))

Definition at line 313 of file VM_AVXFunc.h.

#define VM_CMPLE_AVX (   A,
 
)    V8SI(_mm256_cmp_ps(A,B,_CMP_LE_OQ))

Definition at line 312 of file VM_AVXFunc.h.

#define VM_CMPLT_AVX (   A,
 
)    V8SI(_mm256_cmp_ps(A,B,_CMP_LT_OQ))

Definition at line 311 of file VM_AVXFunc.h.

#define VM_CMPNE_AVX (   A,
 
)    V8SI(_mm256_cmp_ps(A,B,_CMP_NEQ_OQ))

Definition at line 316 of file VM_AVXFunc.h.

#define VM_COS_AVX   vm_cos_avx

Definition at line 615 of file VM_AVXFunc.h.

#define VM_DIV_AVX   _mm256_div_ps

Definition at line 329 of file VM_AVXFunc.h.

#define VM_E_FLOOR_AVX ( )    SETROUND_AVX(rounding);

Definition at line 369 of file VM_AVXFunc.h.

#define VM_EXTRACT_AVX   vm_extract_avx

Definition at line 305 of file VM_AVXFunc.h.

#define VM_FDIV_AVX   vm_fdiv_avx

Definition at line 335 of file VM_AVXFunc.h.

#define VM_FLOOR_AVX   _mm256_cvtps_epi32

Definition at line 367 of file VM_AVXFunc.h.

#define VM_FSQRT_AVX   vm_fsqrt_avx

Definition at line 337 of file VM_AVXFunc.h.

#define VM_IADD_AVX   vm_int_add_avx

Definition at line 322 of file VM_AVXFunc.h.

#define VM_ICMPEQ_AVX   vm_int_cmpeq_avx

Definition at line 320 of file VM_AVXFunc.h.

#define VM_ICMPGT_AVX   vm_int_cmpgt_avx

Definition at line 319 of file VM_AVXFunc.h.

#define VM_ICMPLT_AVX   vm_int_cmplt_avx

Definition at line 318 of file VM_AVXFunc.h.

#define VM_IFLOAT_AVX   _mm256_cvtepi32_ps

Definition at line 372 of file VM_AVXFunc.h.

#define VM_IMUL_AVX   vm_int_mul_avx

Definition at line 324 of file VM_AVXFunc.h.

#define VM_INSERT_AVX   vm_insert_avx

Definition at line 306 of file VM_AVXFunc.h.

#define VM_INT_AVX   _mm256_cvttps_epi32

Definition at line 368 of file VM_AVXFunc.h.

#define VM_INVERT_AVX   _mm256_rcp_ps

Definition at line 332 of file VM_AVXFunc.h.

#define VM_ISQRT_AVX   _mm256_rsqrt_ps

Definition at line 331 of file VM_AVXFunc.h.

#define VM_ISUB_AVX   vm_int_sub_avx

Definition at line 323 of file VM_AVXFunc.h.

#define VM_LOAD_AVX   vm_load_avx

Definition at line 308 of file VM_AVXFunc.h.

#define VM_MADD_AVX   vm_madd_avx

Definition at line 338 of file VM_AVXFunc.h.

#define VM_MAX_AVX   _mm256_max_ps

Definition at line 341 of file VM_AVXFunc.h.

#define VM_MIN_AVX   _mm256_min_ps

Definition at line 340 of file VM_AVXFunc.h.

#define VM_MUL_AVX   _mm256_mul_ps

Definition at line 328 of file VM_AVXFunc.h.

#define VM_NEG_AVX   vm_negate_avx

Definition at line 336 of file VM_AVXFunc.h.

#define VM_OR_AVX   vm_int_or_avx

Definition at line 345 of file VM_AVXFunc.h.

#define VM_P_FLOOR_AVX ( )
Value:
uint rounding = GETROUND_AVX(); \
#define GETROUND_AVX()
Definition: VM_AVXFunc.h:359
unsigned int uint
Definition: SYS_Types.h:44
#define VM_SSE_ROUND_DOWN_AVX
Definition: VM_AVXFunc.h:356
#define SETROUND_AVX(x)
Definition: VM_AVXFunc.h:360

Definition at line 365 of file VM_AVXFunc.h.

#define VM_SHIFTLEFT_AVX (   A,
 
)    _mm256_sll_epi32(A,_mm_setr_epi32(C,0,0,0))

Definition at line 375 of file VM_AVXFunc.h.

#define VM_SHIFTRIGHT_AVX (   A,
 
)    _mm256_srl_epi32(A,_mm_setr_epi32(C,0,0,0))

Definition at line 376 of file VM_AVXFunc.h.

#define VM_SHUFFLE_AVX   vm_shuffle_avx

Definition at line 350 of file VM_AVXFunc.h.

#define VM_SHUFFLE_MASK_AVX (   a0,
  a1,
  b0,
  b1 
)    ((b1)<<6|(b0)<<4 | (a1)<<2|(a0))

Definition at line 66 of file VM_AVXFunc.h.

#define VM_SIN_AVX   vm_sin_avx

Definition at line 614 of file VM_AVXFunc.h.

#define VM_SINCOS_AVX   vm_sincos_avx

Definition at line 613 of file VM_AVXFunc.h.

#define VM_SPLATS_AVX   vm_splats_avx

Definition at line 307 of file VM_AVXFunc.h.

#define VM_SQRT_AVX   _mm256_sqrt_ps

Definition at line 330 of file VM_AVXFunc.h.

#define VM_SSE_ROUND_DOWN_AVX   0x2000

Definition at line 356 of file VM_AVXFunc.h.

#define VM_SSE_ROUND_MASK_AVX   0x6000

Definition at line 353 of file VM_AVXFunc.h.

#define VM_SSE_ROUND_NEAR_AVX   0x0000

Definition at line 357 of file VM_AVXFunc.h.

#define VM_SSE_ROUND_UP_AVX   0x4000

Definition at line 355 of file VM_AVXFunc.h.

#define VM_SSE_ROUND_ZERO_AVX   0x6000

Definition at line 354 of file VM_AVXFunc.h.

#define VM_STORE_AVX   vm_store_avx

Definition at line 309 of file VM_AVXFunc.h.

#define VM_SUB_AVX   _mm256_sub_ps

Definition at line 327 of file VM_AVXFunc.h.

#define VM_TAN_AVX   vm_tan_avx

Definition at line 616 of file VM_AVXFunc.h.

#define VM_XOR_AVX   vm_int_xor_avx

Definition at line 346 of file VM_AVXFunc.h.

Typedef Documentation

typedef __m256 v8sf

Definition at line 22 of file VM_AVXFunc.h.

typedef __m256i v8si

Definition at line 23 of file VM_AVXFunc.h.