Skip to content

Commit

Permalink
media-libs/openimageio: Fix AVX-512 round function
Browse files Browse the repository at this point in the history
See also: AcademySoftwareFoundation/OpenImageIO#4119

Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
  • Loading branch information
AngryLoki authored and DarkDefender committed Jan 26, 2024
1 parent cf6892b commit 07f2ff7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions media-libs/openimageio/files/fix_avx512_round.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4119
--- a/src/include/OpenImageIO/simd.h
+++ b/src/include/OpenImageIO/simd.h
@@ -10180,7 +10180,7 @@ OIIO_FORCEINLINE vfloat16 floor (const vfloat16& a)
OIIO_FORCEINLINE vfloat16 round (const vfloat16& a)
{
#if OIIO_SIMD_AVX >= 512
- return _mm512_roundscale_ps (a, (1<<4) | 3); // scale=1, round to nearest smaller mag int
+ return _mm512_roundscale_ps (a, (_MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC));
#else
return vfloat16(round(a.lo()), round(a.hi()));
#endif
3 changes: 2 additions & 1 deletion media-libs/openimageio/openimageio-2.5.5.0-r1.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
Expand Down Expand Up @@ -105,6 +105,7 @@ DOCS=(

PATCHES="
"${FILESDIR}/fix_simd_test.patch"
"${FILESDIR}/fix_avx512_round.patch"
"

pkg_setup() {
Expand Down

0 comments on commit 07f2ff7

Please sign in to comment.