diff --git a/neon2rvv.h b/neon2rvv.h index b97ed5ff..a65f657d 100644 --- a/neon2rvv.h +++ b/neon2rvv.h @@ -4796,9 +4796,9 @@ FORCE_INLINE float64x2_t vrecpsq_f64(float64x2_t a, float64x2_t b) { return __riscv_vfnmsac_vv_f64m1(vdupq_n_f64(2.0), a, b, 2); } -// FORCE_INLINE float32_t vrecpss_f32(float32_t a, float32_t b); +FORCE_INLINE float32_t vrecpss_f32(float32_t a, float32_t b) { return 2.0 - a * b; } -// FORCE_INLINE float64_t vrecpsd_f64(float64_t a, float64_t b); +FORCE_INLINE float64_t vrecpsd_f64(float64_t a, float64_t b) { return 2.0 - a * b; } // FORCE_INLINE float32x2_t vsqrt_f32(float32x2_t a); diff --git a/tests/impl.cpp b/tests/impl.cpp index e9d15254..466714fe 100644 --- a/tests/impl.cpp +++ b/tests/impl.cpp @@ -16984,9 +16984,31 @@ result_t test_vrecpsq_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { #endif // ENABLE_TEST_ALL } -result_t test_vrecpss_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vrecpss_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const float *_a = (const float *)impl.test_cases_float_pointer1; + const float *_b = (const float *)impl.test_cases_float_pointer2; + float _c, c; + _c = 2.0 - _a[0] * _b[0]; + c = vrecpss_f32(_a[0], _b[0]); + return validate_float_error(c, _c, 0.001f); +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} -result_t test_vrecpsd_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vrecpsd_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const double *_a = (const double *)impl.test_cases_float_pointer1; + const double *_b = (const double *)impl.test_cases_float_pointer2; + double _c, c; + _c = 2.0 - _a[0] * _b[0]; + c = vrecpsd_f64(_a[0], _b[0]); + return validate_double_error(c, _c, 0.001f); +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} result_t test_vsqrt_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } diff --git a/tests/impl.h b/tests/impl.h index fe58a6fc..23bc2562 100644 --- a/tests/impl.h +++ b/tests/impl.h @@ -959,8 +959,8 @@ _(vrecpsq_f32) \ _(vrecps_f64) \ _(vrecpsq_f64) \ - /*_(vrecpss_f32) */ \ - /*_(vrecpsd_f64) */ \ + _(vrecpss_f32) \ + _(vrecpsd_f64) \ /*_(vsqrt_f32) */ \ /*_(vsqrtq_f32) */ \ /*_(vsqrt_f64) */ \