summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-03-17 23:39:36 +0000
committerLars Wendler <polynomial-c@gentoo.org>2021-03-22 09:57:45 +0100
commit45b09e06d88073cbb2a59b2dcadc7b5139000285 (patch)
tree5bed7968a24826430c1687aa01f32c54c15d426f /sys-libs/zlib-ng
parentsys-libs/zlib-ng: disable unaligned access (diff)
downloadgentoo-45b09e06d88073cbb2a59b2dcadc7b5139000285.tar.gz
gentoo-45b09e06d88073cbb2a59b2dcadc7b5139000285.tar.bz2
gentoo-45b09e06d88073cbb2a59b2dcadc7b5139000285.zip
sys-libs/zlib-ng: add preliminary intrinics
Adds support various intrinsics for amd64, arm{,64}, ppc{,64}, x86. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'sys-libs/zlib-ng')
-rw-r--r--sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild34
1 files changed, 33 insertions, 1 deletions
diff --git a/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild b/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild
index 5fd01079542f..c00074bbf786 100644
--- a/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild
+++ b/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild
@@ -12,7 +12,9 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="ZLIB"
SLOT="0"
#KEYWORDS="~amd64 ~x86"
-IUSE="compat test"
+
+CPU_USE=( cpu_flags_{x86_{avx2,sse2,ssse3,sse4a,pclmul},arm_{crc32,neon},ppc_vsx2} )
+IUSE="compat ${CPU_USE[@]} test"
RESTRICT="!test? ( test )"
@@ -33,5 +35,35 @@ src_configure() {
# https://github.com/gentoo/gentoo/pull/17167
-DWITH_UNALIGNED="OFF"
)
+
+ # The intrinsics options are all defined conditionally, so we need
+ # to enable them on/off per-arch here for now.
+ if use amd64 || use x86 ; then
+ mycmakeargs+=(
+ -DWITH_AVX2=$(usex cpu_flags_x86_avx2)
+ -DWITH_SSE2=$(usex cpu_flags_x86_sse2)
+ -DWITH_SSSE3=$(usex cpu_flags_x86_ssse3)
+ -DWITH_SSE4=$(usex cpu_flags_x86_sse4a)
+ -DWITH_PCLMULQDQ=$(usex cpu_flags_x86_pclmul)
+ )
+ fi
+
+ if use arm || use arm64 ; then
+ mycmakeargs+=(
+ -DWITH_ACLE=$(usex cpu_flags_arm_crc32)
+ -DWITH_NEON=$(usex cpu_flags_arm_neon)
+ )
+ fi
+
+ if use ppc || use ppc64 ; then
+ # The POWER8 support is VSX which was introduced
+ # VSX2 was introduced with POWER8, so use that as a proxy for it
+ mycmakeargs+=(
+ -DWITH_POWER8=$(usex cpu_flags_ppc_vsx2)
+ )
+ fi
+
+ # TODO: There's no s390x USE_EXPAND yet
+
cmake_src_configure
}