arm: fma msub and nmsub

This commit is contained in:
Recep Aslantas
2021-04-19 00:35:19 +03:00
parent 7b0eee497e
commit aa2fa89e6c

View File

@@ -99,5 +99,21 @@ glmm_fnmadd(float32x4_t a, float32x4_t b, float32x4_t c) {
#endif #endif
} }
static inline
float32x4_t
glmm_fmsub(float32x4_t a, float32x4_t b, float32x4_t c) {
#if defined(__aarch64__)
return vfmsq_f32(c, a, b);
#else
return vmlsq_f32(c, a, b);
#endif
}
static inline
float32x4_t
glmm_fnmsub(float32x4_t a, float32x4_t b, float32x4_t c) {
return vsubq_f32(vdupq_n_f32(0.0f), glmm_fmadd(a, b, c));
}
#endif #endif
#endif /* cglm_simd_arm_h */ #endif /* cglm_simd_arm_h */