diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-06-12 21:50:35 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-06-12 21:50:35 -0400 |
commit | 79cc11f7acfcabbe4466782a2384d7acf6f4aeae (patch) | |
tree | 23baa9508e4c7f6cdd1b5f4b944d6c3f8924ce74 | |
parent | 0be74a2ad271fce92adf46e269aaa3aff87f344c (diff) | |
download | vecmathlib-79cc11f7acfcabbe4466782a2384d7acf6f4aeae.zip vecmathlib-79cc11f7acfcabbe4466782a2384d7acf6f4aeae.tar.gz |
Auto-detect support for unaligned memory access
-rw-r--r-- | vec_float_neon.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vec_float_neon.h b/vec_float_neon.h index 2b4d616..6ce894a 100644 --- a/vec_float_neon.h +++ b/vec_float_neon.h @@ -296,7 +296,11 @@ namespace vecmathlib { } static realvec_t loadu(real_t const* p) { +#if defined __ARM_FEATURE_UNALIGNED return vld1_f32(p); +#else +# error "unaligned NEON loads not implemented" +#endif } static realvec_t loadu(real_t const* p, std::ptrdiff_t ioff) { @@ -339,7 +343,11 @@ namespace vecmathlib { // be atomic // p[0] = (*this)[0]; // p[1] = (*this)[1]; +#if defined __ARM_FEATURE_UNALIGNED vst1_f32(p, v); +#else +# error "unaligned NEON stores not implemented" +#endif } void storeu(real_t* p, std::ptrdiff_t ioff) const { |