* [gentoo-commits] repo/gentoo:master commit in: dev-lang/orc/, dev-lang/orc/files/
@ 2019-08-09 7:08 Mart Raudsepp
0 siblings, 0 replies; 2+ messages in thread
From: Mart Raudsepp @ 2019-08-09 7:08 UTC (permalink / raw
To: gentoo-commits
commit: 91c13cd00de06d52ab502a5074100b6ab8bf5ded
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 06:45:29 2019 +0000
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 06:45:47 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91c13cd0
dev-lang/orc: fix tests on some platforms (Phenom, ARM)
ARM may have other tests, but this fixes some.
Fixes tests for Phenom 32bit builds.
Closes: https://bugs.gentoo.org/596128
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
dev-lang/orc/files/0.4.29-test-rounding.patch | 73 +++++++++++++++++++++++++++
dev-lang/orc/orc-0.4.29.ebuild | 6 +++
2 files changed, 79 insertions(+)
diff --git a/dev-lang/orc/files/0.4.29-test-rounding.patch b/dev-lang/orc/files/0.4.29-test-rounding.patch
new file mode 100644
index 00000000000..653132fcb8e
--- /dev/null
+++ b/dev-lang/orc/files/0.4.29-test-rounding.patch
@@ -0,0 +1,73 @@
+From 73986d82e1ae60b224b401143cd4ce2c452bf326 Mon Sep 17 00:00:00 2001
+From: Doug Nazar <nazard@nazar.ca>
+Date: Wed, 7 Aug 2019 00:11:35 -0400
+Subject: [PATCH] orctest: Switch nearby float comparison to ULP method
+
+---
+ orc-test/orcarray.c | 7 ++-----
+ orc-test/orctest.c | 8 ++++----
+ 2 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/orc-test/orcarray.c b/orc-test/orcarray.c
+index c0666c5..b27a1f9 100644
+--- a/orc-test/orcarray.c
++++ b/orc-test/orcarray.c
+@@ -211,9 +211,6 @@ orc_array_set_pattern_2 (OrcArray *array, OrcRandomContext *context,
+ }
+ }
+
+-#define MIN_NONDENORMAL (1.1754944909521339405e-38)
+-#define MIN_NONDENORMAL_D (2.2250738585072014e-308)
+-
+ int
+ orc_array_compare (OrcArray *array1, OrcArray *array2, int flags)
+ {
+@@ -230,7 +227,7 @@ orc_array_compare (OrcArray *array1, OrcArray *array2, int flags)
+ for (i=0;i<array1->n;i++){
+ if (isnan(a[i]) && isnan(b[i])) continue;
+ if (a[i] == b[i]) continue;
+- if (fabs(a[i] - b[i]) < MIN_NONDENORMAL) continue;
++ if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint32 *)&a[i] - *(orc_uint32 *)&b[i]) <= 2) continue;
+ return FALSE;
+ }
+ }
+@@ -247,7 +244,7 @@ orc_array_compare (OrcArray *array1, OrcArray *array2, int flags)
+ for (i=0;i<array1->n;i++){
+ if (isnan(a[i]) && isnan(b[i])) continue;
+ if (a[i] == b[i]) continue;
+- if (fabs(a[i] - b[i]) < MIN_NONDENORMAL_D) continue;
++ if ((a[i] < 0.0) == (b[i] < 0.0) && abs(*(orc_uint64 *)&a[i] - *(orc_uint64 *)&b[i]) <= 2) continue;
+ return FALSE;
+ }
+ }
+diff --git a/orc-test/orctest.c b/orc-test/orctest.c
+index 9f0e942..54658bc 100644
+--- a/orc-test/orctest.c
++++ b/orc-test/orctest.c
+@@ -44,8 +44,6 @@
+ #define snprintf _snprintf
+ #endif
+
+-#define MIN_NONDENORMAL (1.1754944909521339405e-38)
+-
+ void _orc_profile_init(void);
+
+ OrcRandomContext rand_context;
+@@ -527,10 +525,12 @@ float_compare (OrcArray *array1, OrcArray *array2, int i, int j)
+ case 4:
+ if (isnan(*(float *)ptr1) && isnan(*(float *)ptr2)) return TRUE;
+ if (*(float *)ptr1 == *(float *)ptr2) return TRUE;
+- if (fabs(*(float *)ptr1 - *(float *)ptr2) < MIN_NONDENORMAL) return TRUE;
++ if ((*(float *)ptr1 < 0.0) == (*(float *)ptr2 < 0.0) && abs(*(orc_uint32 *)ptr1 - *(orc_uint32 *)ptr2) <= 2) return TRUE;
+ return FALSE;
+ case 8:
+- /* FIXME */
++ if (isnan(*(double *)ptr1) && isnan(*(double *)ptr2)) return TRUE;
++ if (*(double *)ptr1 == *(double *)ptr2) return TRUE;
++ if ((*(double *)ptr1 < 0.0) == (*(double *)ptr2 < 0.0) && abs(*(orc_uint64 *)ptr1 - *(orc_uint64 *)ptr2) <= 2) return TRUE;
+ return FALSE;
+ }
+ return FALSE;
+--
+2.21.0
+
diff --git a/dev-lang/orc/orc-0.4.29.ebuild b/dev-lang/orc/orc-0.4.29.ebuild
index 974ea15e13d..7c92dcb5075 100644
--- a/dev-lang/orc/orc-0.4.29.ebuild
+++ b/dev-lang/orc/orc-0.4.29.ebuild
@@ -22,6 +22,12 @@ DEPEND="${RDEPEND}
DOCS=( README RELEASE )
+PATCHES=(
+ # Fixes some tests on various platforms (AMD Phenom, ARM, etc) with more suitable
+ # float comparison - https://gitlab.freedesktop.org/gstreamer/orc/issues/18
+ "${FILESDIR}"/${PV}-test-rounding.patch
+)
+
src_prepare() {
default
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/orc/, dev-lang/orc/files/
@ 2025-01-16 19:26 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-01-16 19:26 UTC (permalink / raw
To: gentoo-commits
commit: e82087ca0b0e9bf65d7292ce7cd6150298bbcaa9
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 16 19:19:09 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jan 16 19:25:41 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e82087ca
dev-lang/orc: backport AVX backend fix
Closes: https://bugs.gentoo.org/948164
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-lang/orc/files/orc-0.4.40-avx.patch | 77 +++++++++++++++++++++++++++++++++
dev-lang/orc/orc-0.4.40-r1.ebuild | 45 +++++++++++++++++++
2 files changed, 122 insertions(+)
diff --git a/dev-lang/orc/files/orc-0.4.40-avx.patch b/dev-lang/orc/files/orc-0.4.40-avx.patch
new file mode 100644
index 000000000000..41dddd0c7248
--- /dev/null
+++ b/dev-lang/orc/files/orc-0.4.40-avx.patch
@@ -0,0 +1,77 @@
+https://bugs.gentoo.org/948164
+https://gitlab.freedesktop.org/gstreamer/orc/-/issues/82
+https://gitlab.freedesktop.org/gstreamer/orc/-/commit/8e48a61e27f4d3e60bf2e3e7873fd61363db6ff8
+
+From 8e48a61e27f4d3e60bf2e3e7873fd61363db6ff8 Mon Sep 17 00:00:00 2001
+From: "L. E. Segovia" <amy@centricular.com>
+Date: Wed, 15 Jan 2025 22:20:14 +0000
+Subject: [PATCH] avx: Fix sqrtps encoding, it's an unary operator
+
+Fixes #82
+
+Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/213>
+---
+ orc/orcavx.h | 4 ++--
+ orc/orcprogram-c.c | 1 +
+ orc/orcrules-avx.c | 2 +-
+ testsuite/test.orc | 8 ++++++++
+ 4 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/orc/orcavx.h b/orc/orcavx.h
+index f564b63f..ca95bd02 100644
+--- a/orc/orcavx.h
++++ b/orc/orcavx.h
+@@ -224,8 +224,8 @@ ORC_API void orc_avx_restore_mxcsr (OrcCompiler *compiler);
+ #define orc_avx_emit_mulps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_mulps, 32, s1, s2, d, ORC_X86_AVX_VEX256_PREFIX)
+ #define orc_avx_sse_emit_divps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_divps, 32, s1, s2, d, ORC_X86_AVX_VEX128_PREFIX)
+ #define orc_avx_emit_divps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_divps, 32, s1, s2, d, ORC_X86_AVX_VEX256_PREFIX)
+-#define orc_avx_sse_emit_sqrtps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_sqrtps, 32, s1, s2, d, ORC_X86_AVX_VEX128_PREFIX)
+-#define orc_avx_emit_sqrtps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_sqrtps, 32, s1, s2, d, ORC_X86_AVX_VEX256_PREFIX)
++#define orc_avx_sse_emit_sqrtps(p,s1,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_sqrtps, 32, s1, 0, d, ORC_X86_AVX_VEX128_PREFIX)
++#define orc_avx_emit_sqrtps(p,s1,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_sqrtps, 32, s1, 0, d, ORC_X86_AVX_VEX256_PREFIX)
+ #define orc_avx_sse_emit_andps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_andps, 32, s1, s2, d, ORC_X86_AVX_VEX128_PREFIX)
+ #define orc_avx_emit_andps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_andps, 32, s1, s2, d, ORC_X86_AVX_VEX256_PREFIX)
+ #define orc_avx_sse_emit_orps(p,s1,s2,d) orc_vex_emit_cpuinsn_size(p, ORC_X86_orps, 32, s1, s2, d, ORC_X86_AVX_VEX128_PREFIX)
+diff --git a/orc/orcprogram-c.c b/orc/orcprogram-c.c
+index 49e0b73b..1c9ff7cf 100644
+--- a/orc/orcprogram-c.c
++++ b/orc/orcprogram-c.c
+@@ -106,6 +106,7 @@ orc_target_c_get_asm_preamble (void)
+ {
+ return "\n"
+ "/* begin Orc C target preamble */\n"
++ "#include <math.h>\n"
+ "#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))\n"
+ "#define ORC_ABS(a) ((a)<0 ? -(a) : (a))\n"
+ "#define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))\n"
+diff --git a/orc/orcrules-avx.c b/orc/orcrules-avx.c
+index 66925982..5cffe145 100644
+--- a/orc/orcrules-avx.c
++++ b/orc/orcrules-avx.c
+@@ -2678,7 +2678,7 @@ BINARY (addf, addps)
+ BINARY (subf, subps)
+ BINARY (mulf, mulps)
+ BINARY (divf, divps)
+-BINARY (sqrtf, sqrtps)
++UNARY (sqrtf, sqrtps)
+ BINARY (orf, orps)
+ BINARY (andf, andps)
+
+diff --git a/testsuite/test.orc b/testsuite/test.orc
+index 3e9c5790..9ff53236 100644
+--- a/testsuite/test.orc
++++ b/testsuite/test.orc
+@@ -2806,3 +2806,11 @@ x4 addb argb, x, c128
+ mulslq t1, d1, p1
+ shrsq t1, t1, 27
+ convql d1, t1
++
++.function sqrt_nx
++.dest 4 dst float
++.source 4 src float
++.floatparam 4 k
++.temp 4 tmp
++sqrtf tmp, src
++mulf dst, tmp, k
+--
+GitLab
diff --git a/dev-lang/orc/orc-0.4.40-r1.ebuild b/dev-lang/orc/orc-0.4.40-r1.ebuild
new file mode 100644
index 000000000000..2a32020e4637
--- /dev/null
+++ b/dev-lang/orc/orc-0.4.40-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit meson-multilib
+
+DESCRIPTION="The Oil Runtime Compiler, a just-in-time compiler for array operations"
+HOMEPAGE="https://gstreamer.freedesktop.org/"
+SRC_URI="https://gstreamer.freedesktop.org/src/${PN}/${P}.tar.xz"
+
+LICENSE="BSD BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+RESTRICT="!test? ( test )"
+IUSE="gtk-doc static-libs test"
+
+BDEPEND="
+ gtk-doc? (
+ dev-util/gtk-doc
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xml-dtd:4.3
+ )
+"
+
+DOCS=( CONTRIBUTING.md README RELEASE )
+
+PATCHES=(
+ "${FILESDIR}"/${P}-avx.patch
+)
+
+multilib_src_configure() {
+ # FIXME: handle backends per arch? What about cross-compiling for the other arches?
+ local emesonargs=(
+ -Ddefault_library=$(usex static-libs both shared)
+ -Dorc-backend=all
+ -Dorc-test=enabled
+ -Dbenchmarks=disabled
+ -Dexamples=disabled
+ $(meson_native_use_feature gtk-doc gtk_doc)
+ $(meson_feature test tests)
+ -Dtools=enabled # requires orc-test
+ )
+ meson_src_configure
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-16 19:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 19:26 [gentoo-commits] repo/gentoo:master commit in: dev-lang/orc/, dev-lang/orc/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2019-08-09 7:08 Mart Raudsepp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox