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

AVX512F(_mm512_ceil_*, _mm512_floor_*) for MSVC, GCC and Clang #143

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 deletions simdpp/detail/insn/f_ceil.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ float32x8 i_ceil(const float32x8& a)
static SIMDPP_INL
float32<16> i_ceil(const float32<16>& a)
{
return _mm512_ceil_ps(a.native());
#if SIMDPP_USE_SVML
return _mm512_ceil_ps(a.native());
#else
return _mm512_roundscale_ps(a.native(), (_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC));
#endif
}
#endif

Expand Down Expand Up @@ -151,7 +155,11 @@ float64x4 i_ceil(const float64x4& a)
static SIMDPP_INL
float64<8> i_ceil(const float64<8>& a)
{
return _mm512_ceil_pd(a.native());
#if SIMDPP_USE_SVML
return _mm512_ceil_pd(a.native());
#else
return _mm512_roundscale_pd(a.native(), (_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC));
#endif
}
#endif

Expand Down
12 changes: 10 additions & 2 deletions simdpp/detail/insn/f_floor.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ float32x8 i_floor(const float32x8& a)
static SIMDPP_INL
float32<16> i_floor(const float32<16>& a)
{
return _mm512_floor_ps(a.native());
#if SIMDPP_USE_SVML
return _mm512_floor_ps(a.native());
#else
return _mm512_roundscale_ps(a.native(), (_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC));
#endif
}
#endif

Expand Down Expand Up @@ -148,7 +152,11 @@ float64x4 i_floor(const float64x4& a)
static SIMDPP_INL
float64<8> i_floor(const float64<8>& a)
{
return _mm512_floor_pd(a.native());
#if SIMDPP_USE_SVML
return _mm512_floor_pd(a.native());
#else
return _mm512_roundscale_pd(a.native(), (_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC));
#endif
}
#endif

Expand Down
5 changes: 5 additions & 0 deletions simdpp/setup_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
#else
#define SIMDPP_USE_AVX512VL 0
#endif
#if SIMDPP_ARCH_PP_USE_SVML
#define SIMDPP_USE_SVML 1
#else
#define SIMDPP_USE_SVML 0
#endif
#if SIMDPP_ARCH_PP_USE_NEON
#define SIMDPP_USE_NEON 1
#else
Expand Down