Skip to content

Commit 59dd061

Browse files
Provide MSVC compatible implementation of ceil /floor
1 parent b91a9f8 commit 59dd061

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/xsimd/math/xsimd_rounding.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ namespace xsimd
329329

330330
static inline batch_type ceil(const batch_type& x)
331331
{
332-
auto res = _mm512_ceil_ps(x);
332+
auto res = _mm512_roundscale_ps(x, _MM_FROUND_TO_POS_INF);
333333
return res;
334334
}
335335

336336
static inline batch_type floor(const batch_type& x)
337337
{
338-
auto res = _mm512_floor_ps(x);
338+
auto res = _mm512_roundscale_ps(x, _MM_FROUND_TO_NEG_INF);
339339
return res;
340340
}
341341

@@ -359,13 +359,13 @@ namespace xsimd
359359

360360
static inline batch_type ceil(const batch_type& x)
361361
{
362-
auto res = _mm512_ceil_pd(x);
362+
auto res = _mm512_roundscale_pd(x, _MM_FROUND_TO_POS_INF);
363363
return res;
364364
}
365365

366366
static inline batch_type floor(const batch_type& x)
367367
{
368-
auto res = _mm512_floor_pd(x);
368+
auto res = _mm512_roundscale_pd(x, _MM_FROUND_TO_NEG_INF);
369369
return res;
370370
}
371371

0 commit comments

Comments
 (0)