From nobody Wed Aug 10 00:32:09 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M2W9529Tfz4Y5pM; Wed, 10 Aug 2022 00:32:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M2W951fMGz3rCX; Wed, 10 Aug 2022 00:32:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660091529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FW+KVQFxux/50JEpkMfmZGGmTdvMD74Td8U7X3Q78pc=; b=c9ZmouoT40zHC53RyO8N+y4MgzGG6O9cAKhpSv+pcTKRDvWJRSSvZAKDaDhdaB9L0MuSNW M8fKZ2vSRon9j1d5YDw/Semi+M7xbySFFeBMp1PxpP+fAzTSBKkOer2jHurGa9BSlHjl2g vgVOp9FK4tBmeMIM8iC30hRKJeCkr4LWlKCGlhIbm8CpNW6okV3vNeRCCy3ZA7Eb5F1NVb dQ8gzC1K5nQuLwSz+SEuOBoQmSXn1pXWGNJJ0BOvjAC3x/0Lqx2OlfFXR6wubOe7G//qz1 gOh2fO/Xh1RtYVabcjb7+CtPxdtPCx4UFpu0i4rwGswWijvzPUVQ9KgJSCcrOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M2W950khnzrh5; Wed, 10 Aug 2022 00:32:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27A0W9O9004012; Wed, 10 Aug 2022 00:32:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27A0W9C2004011; Wed, 10 Aug 2022 00:32:09 GMT (envelope-from git) Date: Wed, 10 Aug 2022 00:32:09 GMT Message-Id: <202208100032.27A0W9C2004011@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: 1b3f665f8f94 - main - math/eigen3: fix runtime on powerpc64 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b3f665f8f94be33397d2da714466eb796d5dfef Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660091529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FW+KVQFxux/50JEpkMfmZGGmTdvMD74Td8U7X3Q78pc=; b=JljOjSLyjZ/HxvhLHYsTHeUzEzK0lBagW6x5LZHrFo7EyERzIT994f5ADgcOc1b5quMt9P fo/KOSebCXaYAjDTdD8oddTKxMgAI4sH0WxPOr16ZuXPzoz08Bg2z7M/jfnHGvb++9duFG GBG3hXKhncGzGKVwX8GKi2/KPhGlbyNWSIBvTHzwxGyFCPb1uAnk+XpAuzJR9bHFq/AiW+ cNgy7pJ3VvKDBjV2ouXKijd1jT7cj6j0bHZtkGGpe6NLXywij3O8S487wAqPW/OF4Mxc2c akbl8aYGAHvISTeewqIReGbzXLfyjPQwWYktYMYcMMyq+hwH9jSk8UzKHvqLZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660091529; a=rsa-sha256; cv=none; b=iW6R1xq+OpXjjd5q9v3X0azXGqKjDx3WYTrUmiWcU8miLvINYM9xhyth1EgWltKNzIRRGa BzQJuuORzb6WbGkOdHNSLyNxQqii5KbZFPmcxvBxI/OBISmuLTpnQffd3ur4/5srwnTQOi RRoenMDS7TlDKTEK1xBnhQugd7RfoYCR5A1110Cqer7G59n/Z7yUoYvA53ouZEP1mO5LZi WpaxN71jQkx5vzlgZltJS+Bf6FzGORw2njvVmu841hBD4Cm5CmDehdf4jK1fQeRea3ezw/ o45j4PfXFCJe2BXj40GuJaV0T+VQs7ChFa7CMCMJx6DKkZc7XGPNrPETlWttDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=1b3f665f8f94be33397d2da714466eb796d5dfef commit 1b3f665f8f94be33397d2da714466eb796d5dfef Author: Piotr Kubaj AuthorDate: 2022-08-10 00:30:00 +0000 Commit: Piotr Kubaj CommitDate: 2022-08-10 00:32:04 +0000 math/eigen3: fix runtime on powerpc64 Merge https://gitlab.com/libeigen/eigen/-/merge_requests/1028 and https://gitlab.com/libeigen/eigen/-/merge_requests/1025 to fix build of reverse dependencies. --- math/eigen3/Makefile | 1 + math/eigen3/files/patch-Eigen_Core | 11 ++ .../patch-Eigen_src_Core_arch_AltiVec_Complex.h | 18 ++++ ...tch-Eigen_src_Core_arch_AltiVec_MathFunctions.h | 47 +++++++++ .../patch-Eigen_src_Core_arch_AltiVec_PacketMath.h | 117 +++++++++++++++++++++ 5 files changed, 194 insertions(+) diff --git a/math/eigen3/Makefile b/math/eigen3/Makefile index 537bb9e9f654..5cb289e1c513 100644 --- a/math/eigen3/Makefile +++ b/math/eigen3/Makefile @@ -1,5 +1,6 @@ PORTNAME= eigen DISTVERSION= 3.4.0 +PORTREVISION= 1 CATEGORIES= math MASTER_SITES= https://gitlab.com/libeigen/eigen/-/archive/${DISTVERSION}/ diff --git a/math/eigen3/files/patch-Eigen_Core b/math/eigen3/files/patch-Eigen_Core new file mode 100644 index 000000000000..e132efbc152d --- /dev/null +++ b/math/eigen3/files/patch-Eigen_Core @@ -0,0 +1,11 @@ +--- Eigen/Core.orig 2021-08-18 20:41:58 UTC ++++ Eigen/Core +@@ -346,7 +346,7 @@ using std::ptrdiff_t; + #include "src/Core/CoreIterators.h" + #include "src/Core/ConditionEstimator.h" + +-#if defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX) ++#if defined(EIGEN_VECTORIZE_VSX) + #include "src/Core/arch/AltiVec/MatrixProduct.h" + #elif defined EIGEN_VECTORIZE_NEON + #include "src/Core/arch/NEON/GeneralBlockPanelKernel.h" diff --git a/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_Complex.h b/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_Complex.h new file mode 100644 index 000000000000..5aa71fed0310 --- /dev/null +++ b/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_Complex.h @@ -0,0 +1,18 @@ +--- Eigen/src/Core/arch/AltiVec/Complex.h.orig 2021-08-18 20:41:58 UTC ++++ Eigen/src/Core/arch/AltiVec/Complex.h +@@ -100,6 +100,7 @@ template<> struct packet_traits > + HasAbs2 = 0, + HasMin = 0, + HasMax = 0, ++ HasSqrt = 1, + #ifdef __VSX__ + HasBlend = 1, + #endif +@@ -320,6 +321,7 @@ template<> struct packet_traits > + HasAbs2 = 0, + HasMin = 0, + HasMax = 0, ++ HasSqrt = 1, + HasSetLinear = 0 + }; + }; diff --git a/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_MathFunctions.h b/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_MathFunctions.h new file mode 100644 index 000000000000..a27c2bc166c1 --- /dev/null +++ b/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_MathFunctions.h @@ -0,0 +1,47 @@ +--- Eigen/src/Core/arch/AltiVec/MathFunctions.h.orig 2021-08-18 20:41:58 UTC ++++ Eigen/src/Core/arch/AltiVec/MathFunctions.h +@@ -40,16 +40,14 @@ Packet4f pcos(const Packet4f& _x) + return pcos_float(_x); + } + ++#ifdef __VSX__ + #ifndef EIGEN_COMP_CLANG + template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED + Packet4f prsqrt(const Packet4f& x) + { + return vec_rsqrt(x); + } +-#endif + +-#ifdef __VSX__ +-#ifndef EIGEN_COMP_CLANG + template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED + Packet2d prsqrt(const Packet2d& x) + { +@@ -73,6 +71,26 @@ template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEF + Packet2d pexp(const Packet2d& _x) + { + return pexp_double(_x); ++} ++ ++template<> EIGEN_STRONG_INLINE Packet8bf psqrt (const Packet8bf& a){ ++ BF16_TO_F32_UNARY_OP_WRAPPER(psqrt, a); ++} ++ ++#ifndef EIGEN_COMP_CLANG ++template<> EIGEN_STRONG_INLINE Packet8bf prsqrt (const Packet8bf& a){ ++ BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt, a); ++} ++#endif ++#else ++template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS ++Packet4f psqrt(const Packet4f& x) ++{ ++ Packet4f a; ++ for (Index i = 0; i < packet_traits::size; i++) { ++ a[i] = numext::sqrt(x[i]); ++ } ++ return a; + } + #endif + diff --git a/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_PacketMath.h b/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_PacketMath.h new file mode 100644 index 000000000000..db517c61b677 --- /dev/null +++ b/math/eigen3/files/patch-Eigen_src_Core_arch_AltiVec_PacketMath.h @@ -0,0 +1,117 @@ +--- Eigen/src/Core/arch/AltiVec/PacketMath.h.orig 2021-08-18 20:41:58 UTC ++++ Eigen/src/Core/arch/AltiVec/PacketMath.h +@@ -175,16 +175,19 @@ struct packet_traits : default_packet_traits { + #else + HasRsqrt = 0, + #endif ++ HasTanh = EIGEN_FAST_MATH, ++ HasErf = EIGEN_FAST_MATH, ++ HasRint = 1, + #else + HasSqrt = 0, + HasRsqrt = 0, +- HasTanh = EIGEN_FAST_MATH, +- HasErf = EIGEN_FAST_MATH, ++ HasTanh = 0, ++ HasErf = 0, ++ HasRint = 0, + #endif + HasRound = 1, + HasFloor = 1, + HasCeil = 1, +- HasRint = 1, + HasNegate = 1, + HasBlend = 1 + }; +@@ -217,16 +220,17 @@ struct packet_traits : default_packet_traits + #else + HasRsqrt = 0, + #endif ++ HasRint = 1, + #else + HasSqrt = 0, + HasRsqrt = 0, +- HasTanh = EIGEN_FAST_MATH, +- HasErf = EIGEN_FAST_MATH, ++ HasRint = 0, + #endif ++ HasTanh = 0, ++ HasErf = 0, + HasRound = 1, + HasFloor = 1, + HasCeil = 1, +- HasRint = 1, + HasNegate = 1, + HasBlend = 1 + }; +@@ -872,19 +876,29 @@ template<> EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan + return vec_nor(c,c); + } + ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet4i pcmp_le(const Packet4i& a, const Packet4i& b) { return reinterpret_cast(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i& a, const Packet4i& b) { return reinterpret_cast(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet4i pcmp_eq(const Packet4i& a, const Packet4i& b) { return reinterpret_cast(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet8s pcmp_le(const Packet8s& a, const Packet8s& b) { return reinterpret_cast(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet8s pcmp_lt(const Packet8s& a, const Packet8s& b) { return reinterpret_cast(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet8s pcmp_eq(const Packet8s& a, const Packet8s& b) { return reinterpret_cast(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet8us pcmp_le(const Packet8us& a, const Packet8us& b) { return reinterpret_cast(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet8us pcmp_lt(const Packet8us& a, const Packet8us& b) { return reinterpret_cast(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet8us pcmp_eq(const Packet8us& a, const Packet8us& b) { return reinterpret_cast(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet16c pcmp_le(const Packet16c& a, const Packet16c& b) { return reinterpret_cast(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet16c pcmp_lt(const Packet16c& a, const Packet16c& b) { return reinterpret_cast(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet16c pcmp_eq(const Packet16c& a, const Packet16c& b) { return reinterpret_cast(vec_cmpeq(a,b)); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet16uc pcmp_le(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast(vec_cmple(a,b)); } ++#endif + template<> EIGEN_STRONG_INLINE Packet16uc pcmp_lt(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast(vec_cmplt(a,b)); } + template<> EIGEN_STRONG_INLINE Packet16uc pcmp_eq(const Packet16uc& a, const Packet16uc& b) { return reinterpret_cast(vec_cmpeq(a,b)); } + +@@ -937,6 +951,7 @@ template<> EIGEN_STRONG_INLINE Packet4f pround EIGEN_STRONG_INLINE Packet4f pceil(const Packet4f& a) { return vec_ceil(a); } + template<> EIGEN_STRONG_INLINE Packet4f pfloor(const Packet4f& a) { return vec_floor(a); } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet4f print(const Packet4f& a) + { + Packet4f res; +@@ -947,6 +962,7 @@ template<> EIGEN_STRONG_INLINE Packet4f print EIGEN_STRONG_INLINE Packet ploadu_common(const __UNPACK_TYPE__(Packet)* from) + { +@@ -1341,12 +1357,6 @@ template<> EIGEN_STRONG_INLINE Packet8bf psub, a, b); + } + +-template<> EIGEN_STRONG_INLINE Packet8bf psqrt (const Packet8bf& a){ +- BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a); +-} +-template<> EIGEN_STRONG_INLINE Packet8bf prsqrt (const Packet8bf& a){ +- BF16_TO_F32_UNARY_OP_WRAPPER(prsqrt, a); +-} + template<> EIGEN_STRONG_INLINE Packet8bf pexp (const Packet8bf& a){ + BF16_TO_F32_UNARY_OP_WRAPPER(pexp_float, a); + } +@@ -1390,9 +1400,11 @@ template<> EIGEN_STRONG_INLINE Packet8bf pceil EIGEN_STRONG_INLINE Packet8bf pround (const Packet8bf& a){ + BF16_TO_F32_UNARY_OP_WRAPPER(pround, a); + } ++#ifdef __VSX__ + template<> EIGEN_STRONG_INLINE Packet8bf print (const Packet8bf& a){ + BF16_TO_F32_UNARY_OP_WRAPPER(print, a); + } ++#endif + template<> EIGEN_STRONG_INLINE Packet8bf pmadd(const Packet8bf& a, const Packet8bf& b, const Packet8bf& c) { + Packet4f a_even = Bf16ToF32Even(a); + Packet4f a_odd = Bf16ToF32Odd(a);