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 4115F139082 for ; Tue, 28 Nov 2017 11:00:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 91588E0E92; Tue, 28 Nov 2017 11:00:12 +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 5DF6CE0E92 for ; Tue, 28 Nov 2017 11:00:12 +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 76D1933BEC7 for ; Tue, 28 Nov 2017 11:00:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DD6BEAA62 for ; Tue, 28 Nov 2017 11:00:03 +0000 (UTC) From: "Michael Palimaka" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Palimaka" Message-ID: <1511866793.3e0bbe689cf555a4b68cea32a5ba5d5f5b898641.kensington@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-qt/qtcore/files/qtcore-5.9.3-avx.patch dev-qt/qtcore/qtcore-5.9.3.ebuild X-VCS-Directories: dev-qt/qtcore/ dev-qt/qtcore/files/ X-VCS-Committer: kensington X-VCS-Committer-Name: Michael Palimaka X-VCS-Revision: 3e0bbe689cf555a4b68cea32a5ba5d5f5b898641 X-VCS-Branch: master Date: Tue, 28 Nov 2017 11:00:03 +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-Archives-Salt: 3b1f1c2a-7b51-4265-bc94-c1c21cc5850e X-Archives-Hash: 7984e90a5af513643517f9a00f7371aa commit: 3e0bbe689cf555a4b68cea32a5ba5d5f5b898641 Author: Michael Palimaka gentoo org> AuthorDate: Tue Nov 28 10:58:58 2017 +0000 Commit: Michael Palimaka gentoo org> CommitDate: Tue Nov 28 10:59:53 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e0bbe68 dev-qt/qtcore: backport patch from upstream fixing build when AVX2 is enabled but __F16C__ isn't defined Closes: https://bugs.gentoo.org/635388 Package-Manager: Portage-2.3.14, Repoman-2.3.6 dev-qt/qtcore/files/qtcore-5.9.3-avx.patch | 69 ++++++++++++++++++++++++++++++ dev-qt/qtcore/qtcore-5.9.3.ebuild | 2 + 2 files changed, 71 insertions(+) diff --git a/dev-qt/qtcore/files/qtcore-5.9.3-avx.patch b/dev-qt/qtcore/files/qtcore-5.9.3-avx.patch new file mode 100644 index 00000000000..be18433be20 --- /dev/null +++ b/dev-qt/qtcore/files/qtcore-5.9.3-avx.patch @@ -0,0 +1,69 @@ +From d813c66bfcfac1837814ec4d174d0389172f0d4c Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Tue, 25 Apr 2017 12:02:09 -0300 +Subject: Fix the build when AVX2 is enabled but __F16C__ isn't defined + +If -mavx2 is used, __AVX2__ is defined, which enables the F16C code +after commit 280e321e52fd4e86545f3f0d4bd4e047786a897e, but that was +wrong since we aren't allowed to use the F16C intrinsics with either +Clang or GCC (we can only do that with GCC 4.9 and Clang 4.8, and only +with an __attribute__ decoration). + +With ICC and MSVC, we are allowed to use the intrinsics, but the +#include was missing. + +[ChangeLog][QtCore] Fixed a compilation issue with qfloat16 if AVX2 +support is enabled in the compiler. Since all processors that support +AVX2 also support F16C, for GCC and Clang it is recommended to either +add -mf16c to your build or to use the corresponding -march= switch. + +Task-number: QTBUG-64529 +Change-Id: I84e363d735b443cb9beefffd14b8ac1fd4baa978 +Reviewed-by: Allan Sandfeld Jensen +--- + src/corelib/global/qfloat16.h | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h +index 89a62a93db..a0aa9496b4 100644 +--- a/src/corelib/global/qfloat16.h ++++ b/src/corelib/global/qfloat16.h +@@ -44,7 +44,16 @@ + #include + #include + +-#if defined __F16C__ ++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__) ++// All processors that support AVX2 do support F16C too. That doesn't mean ++// we're allowed to use the intrinsics directly, so we'll do it only for ++// the Intel and Microsoft's compilers. ++# if defined(Q_CC_INTEL) || defined(Q_CC_MSVC) ++# define __F16C__ 1 ++# endif ++#endif ++ ++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) + #include + #endif + +@@ -116,7 +125,7 @@ QT_WARNING_DISABLE_CLANG("-Wc99-extensions") + QT_WARNING_DISABLE_GCC("-Wold-style-cast") + inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW + { +-#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__)) ++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) + __m128 packsingle = _mm_set_ss(f); + __m128i packhalf = _mm_cvtps_ph(packsingle, 0); + b16 = _mm_extract_epi16(packhalf, 0); +@@ -134,7 +143,7 @@ QT_WARNING_POP + + inline qfloat16::operator float() const Q_DECL_NOTHROW + { +-#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__)) ++#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) + __m128i packhalf = _mm_cvtsi32_si128(b16); + __m128 packsingle = _mm_cvtph_ps(packhalf); + return _mm_cvtss_f32(packsingle); +-- +cgit v1.1-6-g87c4 + diff --git a/dev-qt/qtcore/qtcore-5.9.3.ebuild b/dev-qt/qtcore/qtcore-5.9.3.ebuild index 779bc30c7b9..5442d7c47bf 100644 --- a/dev-qt/qtcore/qtcore-5.9.3.ebuild +++ b/dev-qt/qtcore/qtcore-5.9.3.ebuild @@ -24,6 +24,8 @@ DEPEND=" " RDEPEND="${DEPEND}" +PATCHES=( "${FILESDIR}/${P}-avx.patch" ) + QT5_TARGET_SUBDIRS=( src/tools/bootstrap src/tools/moc