summaryrefslogtreecommitdiffstats
path: root/vecmathlib.h
blob: 3e04b1905c3b4960c777d3bdc6a09679fec768c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// -*-C++-*-

#ifndef VECMATHLIB_H
#define VECMATHLIB_H

#if defined VML_DEBUG || defined VML_NODEBUG
#  if defined VML_DEBUG && defined VML_NODEBUG
#    error "Only one of VML_DEBUG or VML_NODEBUG may be defined"
#  endif
#else
// default
#  define VML_DEBUG
#endif

#undef VML_HAVE_DENORMALS
#undef VML_HAVE_INF
#undef VML_HAVE_NAN
#define VML_HAVE_SIGNED_ZERO



// This workaround is needed for older libstdc++ versions such as the
// one in Debian 6.0 when compiled with clang++
// <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013207.html>.
// The version time stamp used below is the one in Debian 6.0.
#include <cstring>              // pull in __GLIBCXX__
#if defined __GLIBCXX__ && __GLIBCXX__ <= 20101114
namespace std { class type_info; }
#endif



#include <cassert>



#ifdef VML_DEBUG
#  define VML_ASSERT(x) assert(x)
#else
#  define VML_ASSERT(x) ((void)0)
#endif

// Scalarise all vector operations, and use libm's functions (mostly
// useful as fallback)
#include "vec_pseudo.h"

// Use compiler-provided vector types
// #include "vec_builtin.h"

// Scalarise all vector operations; don't use libm, use only
// Vecmathlib's functions (mostly useful for testing Vecmathlib)
#include "vec_test.h"

#if defined __ARM_PCS_VFP       // ARM NEON
// TODO: VFP
// TODO: vec_neon_float4
#  include "vec_neon_float2.h"
#endif

#if defined __SSE2__            // Intel SSE 2
#  include "vec_sse_float1.h"
#  include "vec_sse_float4.h"
#  include "vec_sse_double1.h"
#  include "vec_sse_double2.h"
#endif

#if defined __AVX__             // Intel AVX
#  include "vec_avx_fp8_32.h"
#  include "vec_avx_fp16_16.h"
#  include "vec_avx_float8.h"
#  include "vec_avx_double4.h"
#endif

// TODO: MIC

#if defined __ALTIVEC__         // IBM Altivec
#  include "vec_altivec_float4.h"
#endif
#if defined __VSX__             // IBM VSX
#  include "vec_vsx_double2.h"
#endif

// TODO: IBM Blue Gene/P DoubleHummer

#if defined __bgq__ && defined __VECTOR4DOUBLE__ // IBM Blue Gene/Q QPX
// TODO: vec_qpx_float4
#  include "vec_qpx_double4.h"
#endif

#endif // #ifndef VECMATHLIB_H
OpenPOWER on IntegriCloud