From nobody Tue Nov 16 14:49:48 2021 X-Original-To: dev-commits-ports-all@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 D591D18886B8; Tue, 16 Nov 2021 14:49:48 +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 4Htpqw5SXqz3LcW; Tue, 16 Nov 2021 14:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 9C4797408; Tue, 16 Nov 2021 14:49:48 +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 1AGEnmAQ084665; Tue, 16 Nov 2021 14:49:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AGEnm06084664; Tue, 16 Nov 2021 14:49:48 GMT (envelope-from git) Date: Tue, 16 Nov 2021 14:49:48 GMT Message-Id: <202111161449.1AGEnm06084664@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: cc29ad659847 - main - multimedia/x265: add option to use altivec on powerpc64 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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: cc29ad6598478ba1125b88114d88838f86a6b8be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=cc29ad6598478ba1125b88114d88838f86a6b8be commit cc29ad6598478ba1125b88114d88838f86a6b8be Author: Piotr Kubaj AuthorDate: 2021-11-16 14:44:19 +0000 Commit: Piotr Kubaj CommitDate: 2021-11-16 14:44:19 +0000 multimedia/x265: add option to use altivec on powerpc64 PR: 259564 Approved by: mi@ALDAN.algebra.com (maintainer timeout) --- multimedia/x265/Makefile | 42 +++++++++++++++++++++-- multimedia/x265/files/patch-source_CMakeLists.txt | 20 ++++++++--- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/multimedia/x265/Makefile b/multimedia/x265/Makefile index d2a0b8dd52b0..712a954ff091 100644 --- a/multimedia/x265/Makefile +++ b/multimedia/x265/Makefile @@ -23,6 +23,7 @@ OPTIONS_DEFAULT= OPTIMIZED_FLAGS HI8P HI10P HI12P OPTIONS_DEFINE_aarch64= ASM OPTIONS_DEFINE_amd64= ASM SVTHEVC OPTIONS_DEFINE_i386= ASM +OPTIONS_DEFINE_powerpc64= ASM OPTIONS_DEFAULT_amd64= ASM OPTIONS_MULTI= PixelWidth @@ -62,11 +63,14 @@ WRKSRC= ${WRKDIR}/source .if ${ARCH} == aarch64 && ${PORT_OPTIONS:MASM} BUILD_DEPENDS= as:devel/binutils USE_GCC= yes -ASM_PREVENTS= HI10P HI12P -ASM_PREVENTS_MSG= Currently HI10P and HI12P doesn't build with assembly .endif -.if ${ARCH} != aarch64 && ${PORT_OPTIONS:MASM} +.if ${ARCH} == powerpc64 && ${PORT_OPTIONS:MASM} +CMAKE_ARGS+= -DCPU_POWER8=ON \ + -DENABLE_ALTIVEC=ON +.endif + +.if ${ARCH} != aarch64 && ${ARCH} != powerpc64 && ${PORT_OPTIONS:MASM} BUILD_DEPENDS= nasm:devel/nasm .endif @@ -90,6 +94,32 @@ CFLAGS:= ${CFLAGS:N-O*} -O0 -g .for b in ${OTHER_DEPTHS:C/HI([0-9]+)P/\1/} EXTRA_LINK_FLAGS+=-L${WRKSRC:H}/$bbit +.if ${ARCH} == powerpc64 + +.if $b != 8 || ! ${PORT_OPTIONS:MASM} +ASSEMBLY=false +.else +ASSEMBLY=true +.endif + +.if ${PORT_OPTIONS:MASM} +POWER8= true +.else +POWER8= false +.endif + +pre-build:: + @${ECHO_MSG} "---> Building the $b-bit library ---" + ${MKDIR} ${WRKSRC:H}/$bbit + ${CMAKE_BIN} -S ${WRKSRC} -B ${WRKSRC:H}/$bbit \ + ${CMAKE_OTHER_ARGS} ${b:C/1./-DHIGH_BIT_DEPTH:BOOL=true/} \ + -DMAIN$b:BOOL=true -DENABLE_ALTIVEC=${ASSEMBLY} -DCPU_POWER8=${POWER8} \ + -DEXPORT_C_API:BOOL=false -DENABLE_CLI=false + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC:H}/$bbit ${MAKE_ARGS} + ${LN} -f ${WRKSRC:H}/$bbit/libx265.a ${WRKSRC:H}/$bbit/libx265_$bbit.a + ${ECHO_MSG} "---> Built the $b-bit library ---" + +.else .if ${ARCH} == i386 && $b != 8 || ! ${PORT_OPTIONS:MASM} ASSEMBLY=false .else @@ -106,6 +136,7 @@ pre-build:: ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC:H}/$bbit ${MAKE_ARGS} ${LN} -f ${WRKSRC:H}/$bbit/libx265.a ${WRKSRC:H}/$bbit/libx265_$bbit.a ${ECHO_MSG} "---> Built the $b-bit library ---" +.endif .endfor .if "${EXTRA_LINK_FLAGS}" @@ -119,7 +150,12 @@ CMAKE_ARGS+= -DENABLE_SHARED:BOOL=true .if ${ARCH} == i386 && ${DEFAULT_DEPTH} != "HI8P" || ! ${PORT_OPTIONS:MASM} CMAKE_ARGS+= -DENABLE_ASSEMBLY:BOOL=false .else +.if ${ARCH} != powerpc64 CMAKE_ARGS+= -DENABLE_ASSEMBLY:BOOL=true +.else +CMAKE_ARGS+= -DCPU_POWER8=ON \ + -DENABLE_ALTIVEC=ON +.endif do-test: ${WRKDIR}/.build/test/TestBench diff --git a/multimedia/x265/files/patch-source_CMakeLists.txt b/multimedia/x265/files/patch-source_CMakeLists.txt index 8758bc33e723..19fa130e3b0e 100644 --- a/multimedia/x265/files/patch-source_CMakeLists.txt +++ b/multimedia/x265/files/patch-source_CMakeLists.txt @@ -1,11 +1,23 @@ ---- source/CMakeLists.txt.orig 2020-06-06 08:18:40 UTC +--- source/CMakeLists.txt.orig 2021-10-31 01:46:10 UTC +++ source/CMakeLists.txt -@@ -122,3 +122,4 @@ +@@ -43,7 +43,7 @@ set(X86_ALIASES x86 i386 i686 x86_64 amd64) + set(ARM_ALIASES armv6l armv7l aarch64) + list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) + list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) +-set(POWER_ALIASES ppc64 ppc64le) ++set(POWER_ALIASES powerpc64 powerpc64le ppc64 ppc64le) + list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH) + if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1") + set(X86 1) +@@ -121,6 +121,7 @@ if(UNIX) + option(ENABLE_LIBVMAF "Enable VMAF" OFF) if(ENABLE_LIBVMAF) add_definitions(-DENABLE_LIBVMAF) + include_directories(${VMAF_INCLUDE_DIR}) endif() -@@ -592,12 +592,6 @@ if(ENABLE_HDR10_PLUS) + endif(UNIX) + +@@ -592,12 +593,6 @@ if(ENABLE_HDR10_PLUS) ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) endif() @@ -18,7 +30,7 @@ install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED)) if(MSVC_IDE) -@@ -649,7 +643,10 @@ if(ENABLE_SHARED) +@@ -649,7 +644,10 @@ if(ENABLE_SHARED) if(EXTRA_LIB) target_link_libraries(x265-shared ${EXTRA_LIB}) endif()