mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
arm: fix glmm_vhadd on ARM32
This commit is contained in:
@@ -63,10 +63,14 @@ static inline float32x4_t glmm_max(float32x4_t a, float32x4_t b) { return vmaxq_
|
|||||||
static inline
|
static inline
|
||||||
float32x4_t
|
float32x4_t
|
||||||
glmm_vhadd(float32x4_t v) {
|
glmm_vhadd(float32x4_t v) {
|
||||||
|
#if CGLM_ARM64
|
||||||
float32x4_t p;
|
float32x4_t p;
|
||||||
p = vpaddq_f32(v, v); /* [a+b, c+d, a+b, c+d] */
|
p = vpaddq_f32(v, v); /* [a+b, c+d, a+b, c+d] */
|
||||||
return vpaddq_f32(p, p); /* [t, t, t, t] */;
|
return vpaddq_f32(p, p); /* [t, t, t, t] */;
|
||||||
|
#else
|
||||||
|
return vaddq_f32(vaddq_f32(glmm_splat_x(v), glmm_splat_y(v)),
|
||||||
|
vaddq_f32(glmm_splat_z(v), glmm_splat_w(v)));
|
||||||
|
#endif
|
||||||
/* TODO: measure speed of this compare to above */
|
/* TODO: measure speed of this compare to above */
|
||||||
/* return vdupq_n_f32(vaddvq_f32(v)); */
|
/* return vdupq_n_f32(vaddvq_f32(v)); */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user