summaryrefslogtreecommitdiffstats
path: root/vec_pseudo.h
diff options
context:
space:
mode:
Diffstat (limited to 'vec_pseudo.h')
-rw-r--r--vec_pseudo.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/vec_pseudo.h b/vec_pseudo.h
index 95894fd..a319502 100644
--- a/vec_pseudo.h
+++ b/vec_pseudo.h
@@ -32,6 +32,7 @@ namespace vecmathlib {
static int const size = N;
typedef bool scalar_t;
typedef uint_t bvector_t[size];
+ static int const alignment = sizeof(bvector_t);
typedef boolpseudovec boolvec_t;
typedef intpseudovec<real_t, size> intvec_t;
@@ -49,7 +50,7 @@ namespace vecmathlib {
- bvector_t v __attribute__((__aligned__(sizeof(bvector_t))));
+ bvector_t v __attribute__((__aligned__(alignment)));
boolpseudovec() {}
// Can't have a non-trivial copy constructor; if so, objects won't
@@ -133,6 +134,7 @@ namespace vecmathlib {
static int const size = N;
typedef int_t scalar_t;
typedef int_t ivector_t[size];
+ static int const alignment = sizeof(ivector_t);
typedef boolpseudovec<real_t, size> boolvec_t;
typedef intpseudovec intvec_t;
@@ -150,7 +152,7 @@ namespace vecmathlib {
- ivector_t v __attribute__((__aligned__(sizeof(ivector_t))));
+ ivector_t v __attribute__((__aligned__(alignment)));
intpseudovec() {}
// Can't have a non-trivial copy constructor; if so, objects won't
@@ -403,6 +405,7 @@ namespace vecmathlib {
static int const size = N;
typedef real_t scalar_t;
typedef real_t vector_t[size];
+ static int const alignment = sizeof(vector_t);
static char const* name()
{
@@ -471,7 +474,7 @@ namespace vecmathlib {
- vector_t v __attribute__((__aligned__(sizeof(vector_t))));
+ vector_t v __attribute__((__aligned__(alignment)));
realpseudovec() {}
// Can't have a non-trivial copy constructor; if so, objects won't
OpenPOWER on IntegriCloud