Skip to content

Commit 7183ba4

Browse files
committed
Fixed implementation of floor and ceil for AVX512
1 parent a134b05 commit 7183ba4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include-refactoring/xsimd/arch/xsimd_avx512f.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,10 @@ namespace xsimd {
453453

454454
// ceil
455455
template<class A> batch<float, A> ceil(batch<float, A> const& self, requires<avx512f>) {
456-
return _mm512_ceil_ps(self);
456+
return _mm512_roundscale_ps(self, _MM_FROUND_TO_POS_INF);
457457
}
458458
template<class A> batch<double, A> ceil(batch<double, A> const& self, requires<avx512f>) {
459-
return _mm512_ceil_pd(self);
459+
return _mm512_roundscale_pd(self, _MM_FROUND_TO_POS_INF);
460460
}
461461

462462

@@ -522,10 +522,10 @@ namespace xsimd {
522522

523523
// floor
524524
template<class A> batch<float, A> floor(batch<float, A> const& self, requires<avx512f>) {
525-
return _mm512_floor_ps(self);
525+
return _mm512_roundscale_ps(self, _MM_FROUND_TO_NEG_INF);
526526
}
527527
template<class A> batch<double, A> floor(batch<double, A> const& self, requires<avx512f>) {
528-
return _mm512_floor_pd(self);
528+
return _mm512_roundscale_pd(self, _MM_FROUND_TO_NEG_INF);
529529
}
530530

531531
// from bool

0 commit comments

Comments
 (0)