diff --git a/simgear/math/simd.hxx b/simgear/math/simd.hxx index 0ec604e8..7cef6fb2 100644 --- a/simgear/math/simd.hxx +++ b/simgear/math/simd.hxx @@ -1085,7 +1085,7 @@ inline simd4_t max(simd4_t v1, const simd4_t& v2) { # endif # ifdef __ARM_NEON__ -# include "simd_neon.hxx" +# include # endif #endif /* __SIMD_H__ */ diff --git a/simgear/math/simd_neon.hxx b/simgear/math/simd_neon.hxx index 11a2614b..608cd219 100644 --- a/simgear/math/simd_neon.hxx +++ b/simgear/math/simd_neon.hxx @@ -48,20 +48,15 @@ private: public: simd4_t(void) {} - simd4_t(float f) { - simd4 = vdupq_n_f32(f); - for (int i=N; i<4; ++i) _v4[i] = 0.0f; - } + simd4_t(float f) {} simd4_t(float x, float y) : simd4_t(x,y,0,0) {} simd4_t(float x, float y, float z) : simd4_t(x,y,z,0) {} simd4_t(float x, float y, float z, float w) { _v4[0] = x; _v4[1] = y; _v4[2] = z; _v4[3] = w; } - simd4_t(const __vec4f_t v) { - simd4 = vld1q_f32(v); - for (int i=N; i<4; ++i) _v4[i] = 0.0f; - } - simd4_t(const simd4_t& v) { + simd4_t(const __vec4f_t v) {} + template + simd4_t(const simd4_t& v) { simd4 = v.v4(); } simd4_t(const float32x4_t& v) { @@ -89,25 +84,6 @@ public: return vec; } - inline simd4_t& operator=(float f) { - simd4 = vdupq_n_f32(f); - for (int i=N; i<4; ++i) _v4[i] = 0.0f; - return *this; - } - inline simd4_t& operator=(const __vec4f_t v) { - simd4 = vld1q_f32(v); - for (int i=N; i<4; ++i) _v4[i] = 0.0f; - return *this; - } - inline simd4_t& operator=(const simd4_t& v) { - simd4 = v.v4(); - return *this; - } - inline simd4_t& operator=(const float32x4_t& v) { - simd4 = v; - return *this; - } - inline simd4_t& operator+=(float f) { return operator+=(simd4_t(f)); } @@ -149,6 +125,9 @@ public: } }; +simd4 = vdupq_n_f32(f); +simd4 = vld1q_f32(v); + namespace simd4 { // http://stackoverflow.com/questions/6931217/sum-all-elements-in-a-quadword-vector-in-arm-assembly-with-neon