From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E58C6464E0 for ; Sat, 19 Aug 2023 02:14:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 13C2968C691; Sat, 19 Aug 2023 05:14:15 +0300 (EEST) Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A1FEE68C2C7 for ; Sat, 19 Aug 2023 05:14:08 +0300 (EEST) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4RSMk61PsLz8PbP for ; Fri, 18 Aug 2023 22:14:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h=date:from :to:subject:message-id:mime-version:content-type; s=default; bh= 3JFXAX6CSvrS9vOin3Y1gK9zSN0=; b=Z20LO/qkphAVdvdiR1E6xL0sIM8xr+7S /726VG13UgwwRHvjRW7ZxhIRAwHzsu3QHEqLNlbXnKgJGiPzyTwc9qUjq9JoEceg azk2rYC4uojXW3zSgF4C+Wf35q/MeUCVfj+MKa6XBeI0y5DEq+1uE5YFrgi7Ocp6 b9dbvr5ADFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :subject:message-id:mime-version:content-type; q=dns; s=default; b= HxBfo1s7uzcRf0oJb9hh6cajdntJXbQJ2HyctP4QNRsTZPSJVUxXwBp2hkHuJv3d XPtXMI6DavXVT8usvoOEyw4jep+UEVABM3V3/JkrlKkX2rADSCucxRXiCMVmLCGv fehp5yWAyabXjD+RiUOdmcK82gwuxWAPFlVH6muXg9c= Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b050:3:b6ca:a725:d758:4b89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4RSMk56Tq3z8PbN for ; Fri, 18 Aug 2023 22:14:05 -0400 (EDT) Date: Fri, 18 Aug 2023 22:14:04 -0400 From: Brad Smith To: ffmpeg-devel@ffmpeg.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [FFmpeg-devel] [PATCH v2] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang Add a check for the existence of the vec_xl() function. Clang provides the function even with VSX not enabled. v2: test for function if AltiVec is enabled instead of with AltiVec and without VSX --- configure | 8 ++++++++ libswscale/ppc/yuv2rgb_altivec.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ff6a5c3600..637034e87d 100755 --- a/configure +++ b/configure @@ -2154,6 +2154,7 @@ ARCH_EXT_LIST_PPC=" ldbrx power8 ppc4xx + vec_xl vsx " @@ -2679,6 +2680,7 @@ altivec_deps="ppc" dcbzl_deps="ppc" ldbrx_deps="ppc" ppc4xx_deps="ppc" +vec_xl_deps="altivec" vsx_deps="altivec" power8_deps="vsx" @@ -6221,6 +6223,11 @@ elif enabled ppc; then check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)" fi + if enabled altivec; then + check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 }; + vector unsigned char y0 = vec_xl(0, y1i);" + fi + elif enabled riscv; then enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"' @@ -7731,6 +7738,7 @@ if enabled ppc; then echo "POWER8 enabled ${power8-no}" echo "PPC 4xx optimizations ${ppc4xx-no}" echo "dcbzl available ${dcbzl-no}" + echo "vec_xl available ${vec_xl-no}" fi if enabled loongarch; then echo "LSX enabled ${lsx-no}" diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c index 5e1033a973..8b0a93796f 100644 --- a/libswscale/ppc/yuv2rgb_altivec.c +++ b/libswscale/ppc/yuv2rgb_altivec.c @@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed short Y, * ------------------------------------------------------------------------------ */ -#if !HAVE_VSX +#if !HAVE_VEC_XL static inline vector unsigned char vec_xl(signed long long offset, const ubyte *addr) { const vector unsigned char *v_addr = (const vector unsigned char *) (addr + offset); @@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long offset, const ubyte * return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm); } -#endif /* !HAVE_VSX */ +#endif /* !HAVE_VEC_XL */ #define DEFCSP420_CVT(name, out_pixels) \ static int altivec_ ## name(SwsContext *c, const unsigned char **in, \ -- 2.41.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".