Skip to content

Commit

Permalink
Merge pull request #60 from howjmay/storeu_si64
Browse files Browse the repository at this point in the history
feat: Add _mm_storeu_si64
  • Loading branch information
howjmay authored Jan 26, 2024
2 parents 60879d4 + 5380188 commit 52ea063
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
5 changes: 4 additions & 1 deletion sse2rvv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2916,7 +2916,10 @@ FORCE_INLINE void _mm_storeu_si32(void *mem_addr, __m128i a) {
__riscv_vse32_v_i32m1((int32_t *)mem_addr, _a, 1);
}

// FORCE_INLINE void _mm_storeu_si64 (void* mem_addr, __m128i a) {}
FORCE_INLINE void _mm_storeu_si64(void *mem_addr, __m128i a) {
vuint64m1_t _a = vreinterpretq_m128i_u64(a);
__riscv_vse64_v_u64m1((uint64_t *)mem_addr, _a, 1);
}

FORCE_INLINE __m128i _mm_stream_load_si128(void *mem_addr) {
return vreinterpretq_i32_m128i(
Expand Down
35 changes: 16 additions & 19 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3414,26 +3414,23 @@ result_t test_mm_storeu_si16(const SSE2RVV_TEST_IMPL &impl, uint32_t iter) {
}

result_t test_mm_storeu_si64(const SSE2RVV_TEST_IMPL &impl, uint32_t iter) {
// #ifdef ENABLE_TEST_ALL
// Versions of GCC prior to 9 do not implement intrinsic function
// _mm_storeu_si64. Check https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87558
// for more information.
// #if (defined(__GNUC__) && !defined(__clang__)) && (__GNUC__ < 9)
// #else
return TEST_UNIMPL;
// #endif // ENABLE_TEST_ALL
// #else
// const int32_t *_a = (const int32_t *)impl.test_cases_int_pointer1;
// __m128i b;
// __m128i a = load_m128i(_a);
// _mm_storeu_si64(&b, a);
// int64_t *_b = (int64_t *)&b;
// int64_t *_c = (int64_t *)&a;
// return validate_int64(b, _c[0], _b[1]);
// #endif
// #else
#ifdef ENABLE_TEST_ALL
// Versions of GCC prior to 9 do not implement intrinsic function
// _mm_storeu_si64. Check https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87558
// for more information.
#if (defined(__GNUC__) && !defined(__clang__)) && (__GNUC__ < 9)
#else
const int32_t *_a = (const int32_t *)impl.test_cases_int_pointer1;
__m128i b;
__m128i a = load_m128i(_a);
_mm_storeu_si64(&b, a);
int64_t *_b = (int64_t *)&b;
int64_t *_c = (int64_t *)&a;
return validate_int64(b, _c[0], _b[1]);
#endif
#else
return TEST_UNIMPL;
// #endif // ENABLE_TEST_ALL
#endif // ENABLE_TEST_ALL
}

result_t test_mm_stream_pi(const SSE2RVV_TEST_IMPL &impl, uint32_t iter) {
Expand Down

0 comments on commit 52ea063

Please sign in to comment.