From 55f7f52e604c946ea834da329da7b5a82800d4b6 Mon Sep 17 00:00:00 2001 From: Yang Hau Date: Tue, 30 Jul 2024 03:08:37 +0800 Subject: [PATCH] feat: Add vdup[b|h|s|d]_lane[q]_[s8|s16|s32|s64|u8|u16|u32|u64|f32|f64] --- neon2rvv.h | 74 ++++++--- tests/impl.cpp | 400 ++++++++++++++++++++++++++++++++++++++++++++++--- tests/impl.h | 40 ++--- 3 files changed, 454 insertions(+), 60 deletions(-) diff --git a/neon2rvv.h b/neon2rvv.h index 5d454c6c..464291ef 100644 --- a/neon2rvv.h +++ b/neon2rvv.h @@ -7922,49 +7922,83 @@ FORCE_INLINE float32x2_t vget_low_f32(float32x4_t a) { return a; } FORCE_INLINE float64x1_t vget_low_f64(float64x2_t a) { return a; } -// FORCE_INLINE int8_t vdupb_lane_s8(int8x8_t vec, const int lane); +FORCE_INLINE int8_t vdupb_lane_s8(int8x8_t a, const int lane) { + return __riscv_vmv_x_s_i8m1_i8(__riscv_vslidedown_vx_i8m1(a, lane, 8)); +} -// FORCE_INLINE int16_t vduph_lane_s16(int16x4_t vec, const int lane); +FORCE_INLINE int16_t vduph_lane_s16(int16x4_t a, const int lane) { + return __riscv_vmv_x_s_i16m1_i16(__riscv_vslidedown_vx_i16m1(a, lane, 4)); +} -// FORCE_INLINE int32_t vdups_lane_s32(int32x2_t vec, const int lane); +FORCE_INLINE int32_t vdups_lane_s32(int32x2_t a, const int lane) { + return __riscv_vmv_x_s_i32m1_i32(__riscv_vslidedown_vx_i32m1(a, lane, 2)); +} -// FORCE_INLINE int64_t vdupd_lane_s64(int64x1_t vec, const int lane); +FORCE_INLINE int64_t vdupd_lane_s64(int64x1_t a, const int lane) { return __riscv_vmv_x_s_i64m1_i64(a); } -// FORCE_INLINE uint8_t vdupb_lane_u8(uint8x8_t vec, const int lane); +FORCE_INLINE uint8_t vdupb_lane_u8(uint8x8_t a, const int lane) { + return __riscv_vmv_x_s_u8m1_u8(__riscv_vslidedown_vx_u8m1(a, lane, 8)); +} -// FORCE_INLINE uint16_t vduph_lane_u16(uint16x4_t vec, const int lane); +FORCE_INLINE uint16_t vduph_lane_u16(uint16x4_t a, const int lane) { + return __riscv_vmv_x_s_u16m1_u16(__riscv_vslidedown_vx_u16m1(a, lane, 4)); +} -// FORCE_INLINE uint32_t vdups_lane_u32(uint32x2_t vec, const int lane); +FORCE_INLINE uint32_t vdups_lane_u32(uint32x2_t a, const int lane) { + return __riscv_vmv_x_s_u32m1_u32(__riscv_vslidedown_vx_u32m1(a, lane, 2)); +} -// FORCE_INLINE uint64_t vdupd_lane_u64(uint64x1_t vec, const int lane); +FORCE_INLINE uint64_t vdupd_lane_u64(uint64x1_t a, const int lane) { return __riscv_vmv_x_s_u64m1_u64(a); } -// FORCE_INLINE float32_t vdups_lane_f32(float32x2_t vec, const int lane); +FORCE_INLINE float32_t vdups_lane_f32(float32x2_t a, const int lane) { + return __riscv_vfmv_f_s_f32m1_f32(__riscv_vslidedown_vx_f32m1(a, lane, 2)); +} -// FORCE_INLINE float64_t vdupd_lane_f64(float64x1_t vec, const int lane); +FORCE_INLINE float64_t vdupd_lane_f64(float64x1_t a, const int lane) { return __riscv_vfmv_f_s_f64m1_f64(a); } // FORCE_INLINE poly8_t vdupb_lane_p8(poly8x8_t vec, const int lane); // FORCE_INLINE poly16_t vduph_lane_p16(poly16x4_t vec, const int lane); -// FORCE_INLINE int8_t vdupb_laneq_s8(int8x16_t vec, const int lane); +FORCE_INLINE int8_t vdupb_laneq_s8(int8x16_t a, const int lane) { + return __riscv_vmv_x_s_i8m1_i8(__riscv_vslidedown_vx_i8m1(a, lane, 16)); +} -// FORCE_INLINE int16_t vduph_laneq_s16(int16x8_t vec, const int lane); +FORCE_INLINE int16_t vduph_laneq_s16(int16x8_t a, const int lane) { + return __riscv_vmv_x_s_i16m1_i16(__riscv_vslidedown_vx_i16m1(a, lane, 8)); +} -// FORCE_INLINE int32_t vdups_laneq_s32(int32x4_t vec, const int lane); +FORCE_INLINE int32_t vdups_laneq_s32(int32x4_t a, const int lane) { + return __riscv_vmv_x_s_i32m1_i32(__riscv_vslidedown_vx_i32m1(a, lane, 4)); +} -// FORCE_INLINE int64_t vdupd_laneq_s64(int64x2_t vec, const int lane); +FORCE_INLINE int64_t vdupd_laneq_s64(int64x2_t a, const int lane) { + return __riscv_vmv_x_s_i64m1_i64(__riscv_vslidedown_vx_i64m1(a, lane, 2)); +} -// FORCE_INLINE uint8_t vdupb_laneq_u8(uint8x16_t vec, const int lane); +FORCE_INLINE uint8_t vdupb_laneq_u8(uint8x16_t a, const int lane) { + return __riscv_vmv_x_s_u8m1_u8(__riscv_vslidedown_vx_u8m1(a, lane, 16)); +} -// FORCE_INLINE uint16_t vduph_laneq_u16(uint16x8_t vec, const int lane); +FORCE_INLINE uint16_t vduph_laneq_u16(uint16x8_t a, const int lane) { + return __riscv_vmv_x_s_u16m1_u16(__riscv_vslidedown_vx_u16m1(a, lane, 8)); +} -// FORCE_INLINE uint32_t vdups_laneq_u32(uint32x4_t vec, const int lane); +FORCE_INLINE uint32_t vdups_laneq_u32(uint32x4_t a, const int lane) { + return __riscv_vmv_x_s_u32m1_u32(__riscv_vslidedown_vx_u32m1(a, lane, 4)); +} -// FORCE_INLINE uint64_t vdupd_laneq_u64(uint64x2_t vec, const int lane); +FORCE_INLINE uint64_t vdupd_laneq_u64(uint64x2_t a, const int lane) { + return __riscv_vmv_x_s_u64m1_u64(__riscv_vslidedown_vx_u64m1(a, lane, 2)); +} -// FORCE_INLINE float32_t vdups_laneq_f32(float32x4_t vec, const int lane); +FORCE_INLINE float32_t vdups_laneq_f32(float32x4_t a, const int lane) { + return __riscv_vfmv_f_s_f32m1_f32(__riscv_vslidedown_vx_f32m1(a, lane, 2)); +} -// FORCE_INLINE float64_t vdupd_laneq_f64(float64x2_t vec, const int lane); +FORCE_INLINE float64_t vdupd_laneq_f64(float64x2_t a, const int lane) { + return __riscv_vfmv_f_s_f64m1_f64(__riscv_vslidedown_vx_f64m1(a, lane, 2)); +} // FORCE_INLINE poly8_t vdupb_laneq_p8(poly8x16_t vec, const int lane); diff --git a/tests/impl.cpp b/tests/impl.cpp index 94f0d682..617c3c15 100644 --- a/tests/impl.cpp +++ b/tests/impl.cpp @@ -29207,49 +29207,409 @@ result_t test_vget_low_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { #endif // ENABLE_TEST_ALL } -result_t test_vdupb_lane_s8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vdupb_lane_s8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int8_t *_a = (const int8_t *)impl.test_cases_int_pointer1; + int8_t _c, c; + int8x8_t a = vld1_s8(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupb_lane_s8(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_8_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vduph_lane_s16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int16_t *_a = (const int16_t *)impl.test_cases_int_pointer1; + int16_t _c, c; + int16x4_t a = vld1_s16(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vduph_lane_s16(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_4_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdups_lane_s32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int32_t *_a = (const int32_t *)impl.test_cases_int_pointer1; + int32_t _c, c; + int32x2_t a = vld1_s32(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdups_lane_s32(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_2_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdupd_lane_s64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int64_t *_a = (const int64_t *)impl.test_cases_int_pointer1; + int64_t _c, c; + int64x1_t a = vld1_s64(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupd_lane_s64(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_1_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdupb_lane_u8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint8_t *_a = (const uint8_t *)impl.test_cases_int_pointer1; + uint8_t _c, c; + uint8x8_t a = vld1_u8(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupb_lane_u8(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_8_ITER +#undef TEST_IMPL -result_t test_vduph_lane_s16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vduph_lane_u16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint16_t *_a = (const uint16_t *)impl.test_cases_int_pointer1; + uint16_t _c, c; + uint16x4_t a = vld1_u16(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vduph_lane_u16(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_4_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdups_lane_u32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint32_t *_a = (const uint32_t *)impl.test_cases_int_pointer1; + uint32_t _c, c; + uint32x2_t a = vld1_u32(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdups_lane_u32(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_2_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} -result_t test_vdups_lane_s32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vdupd_lane_u64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint64_t *_a = (const uint64_t *)impl.test_cases_int_pointer1; + uint64_t _c, c; + uint64x1_t a = vld1_u64(_a); -result_t test_vdupd_lane_s64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupd_lane_u64(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) -result_t test_vdupb_lane_u8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + IMM_1_ITER +#undef TEST_IMPL -result_t test_vduph_lane_u16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} -result_t test_vdups_lane_u32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vdups_lane_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const float *_a = (const float *)impl.test_cases_int_pointer1; + float _c, c; + float32x2_t a = vld1_f32(_a); -result_t test_vdupd_lane_u64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdups_lane_f32(a, IDX); \ + CHECK_RESULT(validate_float_error(c, _c, 0.0001f)) -result_t test_vdups_lane_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + IMM_2_ITER +#undef TEST_IMPL -result_t test_vdupd_lane_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdupd_lane_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const double *_a = (const double *)impl.test_cases_int_pointer1; + double _c, c; + float64x1_t a = vld1_f64(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupd_lane_f64(a, IDX); \ + CHECK_RESULT(validate_double_error(c, _c, 0.0001f)) + + IMM_1_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} result_t test_vdupb_lane_p8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } result_t test_vduph_lane_p16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } -result_t test_vdupb_laneq_s8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vdupb_laneq_s8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int8_t *_a = (const int8_t *)impl.test_cases_int_pointer1; + int8_t _c, c; + int8x16_t a = vld1q_s8(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupb_laneq_s8(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_16_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vduph_laneq_s16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int16_t *_a = (const int16_t *)impl.test_cases_int_pointer1; + int16_t _c, c; + int16x8_t a = vld1q_s16(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vduph_laneq_s16(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_8_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdups_laneq_s32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int32_t *_a = (const int32_t *)impl.test_cases_int_pointer1; + int32_t _c, c; + int32x4_t a = vld1q_s32(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdups_laneq_s32(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_4_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdupd_laneq_s64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const int64_t *_a = (const int64_t *)impl.test_cases_int_pointer1; + int64_t _c, c; + int64x2_t a = vld1q_s64(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupd_laneq_s64(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_2_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdupb_laneq_u8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint8_t *_a = (const uint8_t *)impl.test_cases_int_pointer1; + uint8_t _c, c; + uint8x16_t a = vld1q_u8(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupb_laneq_u8(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_16_ITER +#undef TEST_IMPL -result_t test_vduph_laneq_s16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vduph_laneq_u16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint16_t *_a = (const uint16_t *)impl.test_cases_int_pointer1; + uint16_t _c, c; + uint16x8_t a = vld1q_u16(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vduph_laneq_u16(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_8_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdups_laneq_u32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint32_t *_a = (const uint32_t *)impl.test_cases_int_pointer1; + uint32_t _c, c; + uint32x4_t a = vld1q_u32(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdups_laneq_u32(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) + + IMM_4_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} -result_t test_vdups_laneq_s32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vdupd_laneq_u64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const uint64_t *_a = (const uint64_t *)impl.test_cases_int_pointer1; + uint64_t _c, c; + uint64x2_t a = vld1q_u64(_a); -result_t test_vdupd_laneq_s64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupd_laneq_u64(a, IDX); \ + CHECK_RESULT(c == _c ? TEST_SUCCESS : TEST_FAIL) -result_t test_vdupb_laneq_u8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + IMM_2_ITER +#undef TEST_IMPL -result_t test_vduph_laneq_u16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} -result_t test_vdups_laneq_u32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +result_t test_vdups_laneq_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const float *_a = (const float *)impl.test_cases_int_pointer1; + float _c, c; + float32x4_t a = vld1q_f32(_a); -result_t test_vdupd_laneq_u64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdups_laneq_f32(a, IDX); \ + CHECK_RESULT(validate_float_error(c, _c, 0.0001f)) -result_t test_vdups_laneq_f32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + IMM_4_ITER +#undef TEST_IMPL -result_t test_vdupd_laneq_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} + +result_t test_vdupd_laneq_f64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { +#ifdef ENABLE_TEST_ALL + const double *_a = (const double *)impl.test_cases_int_pointer1; + double _c, c; + float64x2_t a = vld1q_f64(_a); + +#define TEST_IMPL(IDX) \ + _c = _a[IDX]; \ + c = vdupd_laneq_f64(a, IDX); \ + CHECK_RESULT(validate_double_error(c, _c, 0.0001f)) + + IMM_2_ITER +#undef TEST_IMPL + + return TEST_SUCCESS; +#else + return TEST_UNIMPL; +#endif // ENABLE_TEST_ALL +} result_t test_vdupb_laneq_p8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; } diff --git a/tests/impl.h b/tests/impl.h index 2e4aaa21..abf3bb79 100644 --- a/tests/impl.h +++ b/tests/impl.h @@ -1625,28 +1625,28 @@ /*_(vget_low_p8) */ \ /*_(vget_low_p16) */ \ _(vget_low_f64) \ - /*_(vdupb_lane_s8) */ \ - /*_(vduph_lane_s16) */ \ - /*_(vdups_lane_s32) */ \ - /*_(vdupd_lane_s64) */ \ - /*_(vdupb_lane_u8) */ \ - /*_(vduph_lane_u16) */ \ - /*_(vdups_lane_u32) */ \ - /*_(vdupd_lane_u64) */ \ - /*_(vdups_lane_f32) */ \ - /*_(vdupd_lane_f64) */ \ + _(vdupb_lane_s8) \ + _(vduph_lane_s16) \ + _(vdups_lane_s32) \ + _(vdupd_lane_s64) \ + _(vdupb_lane_u8) \ + _(vduph_lane_u16) \ + _(vdups_lane_u32) \ + _(vdupd_lane_u64) \ + _(vdups_lane_f32) \ + _(vdupd_lane_f64) \ /*_(vdupb_lane_p8) */ \ /*_(vduph_lane_p16) */ \ - /*_(vdupb_laneq_s8) */ \ - /*_(vduph_laneq_s16) */ \ - /*_(vdups_laneq_s32) */ \ - /*_(vdupd_laneq_s64) */ \ - /*_(vdupb_laneq_u8) */ \ - /*_(vduph_laneq_u16) */ \ - /*_(vdups_laneq_u32) */ \ - /*_(vdupd_laneq_u64) */ \ - /*_(vdups_laneq_f32) */ \ - /*_(vdupd_laneq_f64) */ \ + _(vdupb_laneq_s8) \ + _(vduph_laneq_s16) \ + _(vdups_laneq_s32) \ + _(vdupd_laneq_s64) \ + _(vdupb_laneq_u8) \ + _(vduph_laneq_u16) \ + _(vdups_laneq_u32) \ + _(vdupd_laneq_u64) \ + _(vdups_laneq_f32) \ + _(vdupd_laneq_f64) \ /*_(vdupb_laneq_p8) */ \ /*_(vduph_laneq_p16) */ \ /*_(vget_low_p64) */ \