Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add vdup_lane_s8 #19

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neon2rvv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ FORCE_INLINE int8x8_t vmov_n_s8(int8_t __a) { return vdup_n_s8(__a); }

// FORCE_INLINE uint64x2_t vmovq_n_u64(uint64_t __a);

// FORCE_INLINE int8x8_t vdup_lane_s8(int8x8_t __a, const int __b);
FORCE_INLINE int8x8_t vdup_lane_s8(int8x8_t __a, const int __b) { return __riscv_vrgather_vx_i8mf2(__a, __b, 8); }

// FORCE_INLINE int16x4_t vdup_lane_s16(int16x4_t __a, const int __b);

Expand Down
8 changes: 7 additions & 1 deletion tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,13 @@ result_t test_vmovq_n_s64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { retur

result_t test_vmovq_n_u64(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; }

result_t test_vdup_lane_s8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; }
result_t test_vdup_lane_s8(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) {
const int8_t *_a = (int8_t *)impl.test_cases_int_pointer1;
int8x8_t a = vld1_s8(_a);
// TODO cover more possible values
int8x8_t c = vdup_lane_s8(a, 3);
return validate_int8(c, _a[3], _a[3], _a[3], _a[3], _a[3], _a[3], _a[3], _a[3]);
}

result_t test_vdup_lane_s16(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; }

Expand Down