From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CC457138334 for ; Fri, 9 Aug 2019 07:08:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF031E0819; Fri, 9 Aug 2019 07:08:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 96963E0819 for ; Fri, 9 Aug 2019 07:08:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2A453496CA for ; Fri, 9 Aug 2019 07:08:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1826462C for ; Fri, 9 Aug 2019 07:08:15 +0000 (UTC) From: "Mart Raudsepp" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mart Raudsepp" Message-ID: <1565333147.91c13cd00de06d52ab502a5074100b6ab8bf5ded.leio@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/orc/, dev-lang/orc/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/orc/files/0.4.29-test-rounding.patch dev-lang/orc/orc-0.4.29.ebuild X-VCS-Directories: dev-lang/orc/ dev-lang/orc/files/ X-VCS-Committer: leio X-VCS-Committer-Name: Mart Raudsepp X-VCS-Revision: 91c13cd00de06d52ab502a5074100b6ab8bf5ded X-VCS-Branch: master Date: Fri, 9 Aug 2019 07:08:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a0a07542-3a03-4e49-a7f9-5a02f5702c96 X-Archives-Hash: 90d8de53120193438630d2b8efea5e23 commit: 91c13cd00de06d52ab502a5074100b6ab8bf5ded Author: Mart Raudsepp gentoo org> AuthorDate: Fri Aug 9 06:45:29 2019 +0000 Commit: Mart Raudsepp gentoo 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 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 +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;in;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;in;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