summaryrefslogtreecommitdiffstats
path: root/vecmathlib.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-07-28 09:08:12 -0700
committerErik Schnetter <schnetter@gmail.com>2013-07-28 09:08:12 -0700
commit7e66f4a982ad1e7e9ae4a94ee5f91d6648948a40 (patch)
treedd494888912c9627b0a1b70dc6aa9cac22298b99 /vecmathlib.h
parent3a87fd635fa0336e4c28cde9f893c359ffd061f7 (diff)
downloadvecmathlib-7e66f4a982ad1e7e9ae4a94ee5f91d6648948a40.zip
vecmathlib-7e66f4a982ad1e7e9ae4a94ee5f91d6648948a40.tar.gz
Simplify example, add comments
Diffstat (limited to 'vecmathlib.h')
-rw-r--r--vecmathlib.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/vecmathlib.h b/vecmathlib.h
index 4bc7df3..cf46568 100644
--- a/vecmathlib.h
+++ b/vecmathlib.h
@@ -112,4 +112,44 @@ namespace std { class type_info; }
# include "vec_qpx_double4.h"
#endif
+
+
+// Define "best" vector types
+namespace vecmathlib {
+
+#if defined VECMATHLIB_HAVE_VEC_DOUBLE_8
+# define VECMATHLIB_MAX_DOUBLE_VECSIZE 8
+#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4
+# define VECMATHLIB_MAX_DOUBLE_VECSIZE 4
+#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_2
+# define VECMATHLIB_MAX_DOUBLE_VECSIZE 2
+#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_1
+# define VECMATHLIB_MAX_DOUBLE_VECSIZE 1
+#endif
+
+#if defined VECMATHLIB_HAVE_VEC_FLOAT_16
+# define VECMATHLIB_MAX_FLOAT_VECSIZE 16
+#elif defined VECMATHLIB_HAVE_VEC_FLOAT_8
+# define VECMATHLIB_MAX_FLOAT_VECSIZE 8
+#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4
+# define VECMATHLIB_MAX_FLOAT_VECSIZE 4
+#elif defined VECMATHLIB_HAVE_VEC_FLOAT_2
+# define VECMATHLIB_MAX_FLOAT_VECSIZE 2
+#elif defined VECMATHLIB_HAVE_VEC_FLOAT_1
+# define VECMATHLIB_MAX_FLOAT_VECSIZE 1
+#endif
+
+#ifdef VECMATHLIB_MAX_DOUBLE_VECSIZE
+ typedef realvec<double,VECMATHLIB_MAX_DOUBLE_VECSIZE> double_vec;
+ typedef intvec<double,VECMATHLIB_MAX_DOUBLE_VECSIZE> long_vec;
+ typedef boolvec<double,VECMATHLIB_MAX_DOUBLE_VECSIZE> bool_double_vec;
+#endif
+
+#ifdef VECMATHLIB_MAX_FLOAT_VECSIZE
+ typedef realvec<float,VECMATHLIB_MAX_FLOAT_VECSIZE> float_vec;
+ typedef intvec<float,VECMATHLIB_MAX_FLOAT_VECSIZE> int_vec;
+ typedef boolvec<float,VECMATHLIB_MAX_FLOAT_VECSIZE> bool_float_vec;
+#endif
+}
+
#endif // #ifndef VECMATHLIB_H
OpenPOWER on IntegriCloud