neon/recps: Use vector ops instead of relying on autovec
Fixes
#if !defined(SIMDE_ARM_NEON_RECPS_H)
#define SIMDE_ARM_NEON_RECPS_H
+#include "dup_n.h"
+#include "mls.h"
#include "types.h"
HEDLEY_DIAGNOSTIC_PUSH
@@ -39,17 +41,7 @@ simde_vrecps_f32(simde_float32x2_t a, simde_float32x2_t b) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
return vrecps_f32(a, b);
#else
- simde_float32x2_private
- r_,
- a_ = simde_float32x2_to_private(a),
- b_ = simde_float32x2_to_private(b);
-
- SIMDE_VECTORIZE
- for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
- r_.values[i] = SIMDE_FLOAT32_C(2.0) - (a_.values[i] * b_.values[i]);
- }
-
- return simde_float32x2_from_private(r_);
+ return simde_vmls_f32(simde_vdup_n_f32(SIMDE_FLOAT32_C(2.0)), a, b);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
@@ -63,17 +55,7 @@ simde_vrecpsq_f32(simde_float32x4_t a, simde_float32x4_t b) {
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
return vrecpsq_f32(a, b);
#else
- simde_float32x4_private
- r_,
- a_ = simde_float32x4_to_private(a),
- b_ = simde_float32x4_to_private(b);
-
- SIMDE_VECTORIZE
- for (size_t i = 0 ; i < (sizeof(r_.values) / sizeof(r_.values[0])) ; i++) {
- r_.values[i] = SIMDE_FLOAT32_C(2.0) - (a_.values[i] * b_.values[i]);
- }
-
- return simde_float32x4_from_private(r_);
+ return simde_vmlsq_f32(simde_vdupq_n_f32(SIMDE_FLOAT32_C(2.0)), a, b);
#endif
}
#if defined(SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES)
