Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
howjmay committed Jul 9, 2024
1 parent da4b834 commit 4f8cae9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2458,7 +2458,7 @@ FORCE_INLINE __m128 _mm_set_ps1(float _w)
// the following flags: _MM_ROUND_NEAREST, _MM_ROUND_DOWN, _MM_ROUND_UP,
// _MM_ROUND_TOWARD_ZERO
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_SET_ROUNDING_MODE
FORCE_INLINE void _MM_SET_ROUNDING_MODE(int rounding)
FORCE_INLINE_OPTNONE void _MM_SET_ROUNDING_MODE(int rounding)
{
union {
fpcr_bitfield field;
Expand Down Expand Up @@ -2520,7 +2520,7 @@ FORCE_INLINE __m128 _mm_set1_ps(float _w)
// integer a.
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_setcsr
// FIXME: _mm_setcsr() implementation supports changing the rounding mode only.
FORCE_INLINE void _mm_setcsr(unsigned int a)
FORCE_INLINE_OPTNONE void _mm_setcsr(unsigned int a)
{
_MM_SET_ROUNDING_MODE(a);
}
Expand Down Expand Up @@ -9258,7 +9258,7 @@ FORCE_INLINE int64_t _mm_popcnt_u64(uint64_t a)
#endif
}

FORCE_INLINE void _sse2neon_mm_set_denormals_zero_mode(unsigned int flag)
FORCE_INLINE_OPTNONE void _sse2neon_mm_set_denormals_zero_mode(unsigned int flag)
{
// AArch32 Advanced SIMD arithmetic always uses the Flush-to-zero setting,
// regardless of the value of the FZ bit.
Expand Down
9 changes: 9 additions & 0 deletions tests/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ typedef union ALIGN_STRUCT(16) SIMDVec {
#endif
#endif

#if defined(__GNUC__) && !defined(__clang__)
#pragma push_macro("OPTNONE")
#define OPTNONE __attribute__((optimize("O0")))
#elif defined(__clang__)
#pragma push_macro("OPTNONE")
#define OPTNONE __attribute__((optnone))
#else
#endif

#define ASSERT_RETURN(x) \
if (!(x)) \
return TEST_FAIL;
Expand Down
4 changes: 2 additions & 2 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4459,7 +4459,7 @@ result_t test_mm_cvtepi32_ps(const SSE2NEONTestImpl &impl, uint32_t iter)
return validateFloat(ret, trun[0], trun[1], trun[2], trun[3]);
}

result_t test_mm_cvtpd_epi32(const SSE2NEONTestImpl &impl, uint32_t iter)
OPTNONE result_t test_mm_cvtpd_epi32(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
int32_t d[2] = {};
Expand Down Expand Up @@ -11837,7 +11837,7 @@ result_t test_mm_popcnt_u64(const SSE2NEONTestImpl &impl, uint32_t iter)
return TEST_SUCCESS;
}

result_t test_mm_set_denormals_zero_mode(const SSE2NEONTestImpl &impl,
OPTNONE result_t test_mm_set_denormals_zero_mode(const SSE2NEONTestImpl &impl,
uint32_t iter)
{
result_t res_set_denormals_zero_on, res_set_denormals_zero_off;
Expand Down

0 comments on commit 4f8cae9

Please sign in to comment.