neon/fma: add more extensive feature checking
The f64 versions are only available on AArch64, and we should use the
__ARM_FEATURE_FMA flag to check for hardware support.
@@ -36,7 +36,7 @@ SIMDE_BEGIN_DECLS_
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x2_t
simde_vfma_f32(simde_float32x2_t a, simde_float32x2_t b, simde_float32x2_t c) {
- #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
+ #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA)
return vfma_f32(a, b, c);
#else
simde_float32x2_private
@@ -60,7 +60,7 @@ simde_vfma_f32(simde_float32x2_t a, simde_float32x2_t b, simde_float32x2_t c) {
SIMDE_FUNCTION_ATTRIBUTES
simde_float32x4_t
simde_vfmaq_f32(simde_float32x4_t a, simde_float32x4_t b, simde_float32x4_t c) {
- #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
+ #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA)
return vfmaq_f32(a, b, c);
#elif defined(SIMDE_WASM_SIMD128_NATIVE)
return wasm_f32x4_add(a, wasm_f32x4_mul(b, c));
@@ -86,7 +86,7 @@ simde_vfmaq_f32(simde_float32x4_t a, simde_float32x4_t b, simde_float32x4_t c) {
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x1_t
simde_vfma_f64(simde_float64x1_t a, simde_float64x1_t b, simde_float64x1_t c) {
- #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
+ #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA)
return vfma_f64(a, b, c);
#else
simde_float64x1_private
@@ -107,7 +107,7 @@ simde_vfma_f64(simde_float64x1_t a, simde_float64x1_t b, simde_float64x1_t c) {
SIMDE_FUNCTION_ATTRIBUTES
simde_float64x2_t
simde_vfmaq_f64(simde_float64x2_t a, simde_float64x2_t b, simde_float64x2_t c) {
- #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
+ #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && (defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA)
return vfmaq_f64(a, b, c);
#elif defined(SIMDE_X86_FMA_NATIVE)
return _mm_fmadd_pd(b, c, a);
