Skip to content

Commit

Permalink
Merge pull request #496 from howjmay/vcvts_f32
Browse files Browse the repository at this point in the history
feat: Add vcvts_f32_[s32|u32]
  • Loading branch information
howjmay authored Jul 31, 2024
2 parents 519b350 + d752c2d commit bad5bfe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions neon2rvv.h
Original file line number Diff line number Diff line change
Expand Up @@ -8068,9 +8068,9 @@ FORCE_INLINE float32x4_t vcvtq_f32_s32(int32x4_t a) { return __riscv_vfcvt_f_x_v

FORCE_INLINE float32x4_t vcvtq_f32_u32(uint32x4_t a) { return __riscv_vfcvt_f_xu_v_f32m1(a, 4); }

// FORCE_INLINE float32_t vcvts_f32_s32(int32_t a);
FORCE_INLINE float32_t vcvts_f32_s32(int32_t a) { return (float32_t)a; }

// FORCE_INLINE float32_t vcvts_f32_u32(uint32_t a);
FORCE_INLINE float32_t vcvts_f32_u32(uint32_t a) { return (float32_t)a; }

// FORCE_INLINE float64x1_t vcvt_f64_s64(int64x1_t a);

Expand Down
24 changes: 22 additions & 2 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30014,9 +30014,29 @@ result_t test_vcvtq_f32_u32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) {
#endif // ENABLE_TEST_ALL
}

result_t test_vcvts_f32_s32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; }
result_t test_vcvts_f32_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;
float _c, c;
_c = (float)_a[0];
c = vcvts_f32_s32(_a[0]);
return c == _c ? TEST_SUCCESS : TEST_FAIL;
#else
return TEST_UNIMPL;
#endif // ENABLE_TEST_ALL
}

result_t test_vcvts_f32_u32(const NEON2RVV_TEST_IMPL &impl, uint32_t iter) { return TEST_UNIMPL; }
result_t test_vcvts_f32_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;
float _c, c;
_c = (float)_a[0];
c = vcvts_f32_u32(_a[0]);
return c == _c ? TEST_SUCCESS : TEST_FAIL;
#else
return TEST_UNIMPL;
#endif // ENABLE_TEST_ALL
}

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

Expand Down
4 changes: 2 additions & 2 deletions tests/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1659,8 +1659,8 @@
_(vcvtq_s32_f32) \
_(vcvtq_f32_s32) \
_(vcvtq_f32_u32) \
/*_(vcvts_f32_s32) */ \
/*_(vcvts_f32_u32) */ \
_(vcvts_f32_s32) \
_(vcvts_f32_u32) \
/*_(vcvt_f64_s64) */ \
/*_(vcvtq_f64_s64) */ \
/*_(vcvt_f64_u64) */ \
Expand Down

0 comments on commit bad5bfe

Please sign in to comment.