From patchwork Fri Aug 18 19:32:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Smith X-Patchwork-Id: 43267 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4c9d:b0:130:ccc6:6c4b with SMTP id fq29csp2894218pzb; Fri, 18 Aug 2023 12:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvBuheB1kpgetYsSFEmXwJQfMttvnB+6Fjw87A2TVeD/PPapebs/WS1TXmQla+SQQacIOP X-Received: by 2002:a17:907:8a0c:b0:98e:4f1:f987 with SMTP id sc12-20020a1709078a0c00b0098e04f1f987mr194989ejc.3.1692387173902; Fri, 18 Aug 2023 12:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692387173; cv=none; d=google.com; s=arc-20160816; b=gN8/ErTQHfUUKHLZ2y4aheXgxYl4hUzcOPGbVFreOa8+9lAw0O5U2iisvd1hUEiCZm MBmgGKJBqfJCvYTwTrN8xG0MUqViqekUev2eTuvSr2CZMb6paSGcx4kotX4a0InyCBJr ElYZQqMbYTki9F3nygiowmBR9XSNV6wuwribElVDlRXvqiDZWTkk/Ae0LQM24rDggM8X E1msQSPrbnE1r9u3x7W/fXiSh4LTp5IgGD0bzR1r5CI5Fk20pcKN/BYLkTTBjRO/oiWJ WBEhWuuF/YfNqc15+vOjCQsV7rdZHkU0get36PqdSCINuqts9D7guMSMRqd8juB16b1C fgTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-disposition:mime-version:message-id:to :from:date:domainkey-signature:dkim-signature:delivered-to; bh=dOC67P1KtXcVeKTGqol6gDWGyofYTM/qd9UyC+llCxs=; fh=+1STrpO0RulMF+g5MgEH9Wqquz8o1fugVmKEC/dDZ0I=; b=YgLl1mBkBagypkkkUDdJFGEy+bhIxfiV1vS8aBZZGmzYrTo+Brgbc3qYyf1R8t172P cDxYhRScEznpYljJDAvzm6RhInkdC+vRMN29HT4pdw5foETu1Vz5rKG6kdikczu6UV14 Q9toPWxhDpbN3YZQvCMmTnUvF0Ign/WkCYHVqK+vyXu/hoyndXb61FdsyRSs32JiJGf/ bQkmm/FSorB50tAQVVFJdwdLzDDeRKAPkkBNuUvkZX6Smup4z4OzhBRIJpPfyuGLVkHj 8IZrMCV+vkL3/wCImIITCXedfOyOfT5oSWqXy5JUh+Yn03AItLcgpUAksw2M6gS9jqaa nUDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@comstyle.com header.s=default header.b=epOCxOwV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f14-20020a170906c08e00b0099bcf34927fsi1831242ejz.640.2023.08.18.12.32.53; Fri, 18 Aug 2023 12:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@comstyle.com header.s=default header.b=epOCxOwV; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C06AE68C70C; Fri, 18 Aug 2023 22:32:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0447E68C334 for ; Fri, 18 Aug 2023 22:32:42 +0300 (EEST) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4RSBpx1hWPz8PbP for ; Fri, 18 Aug 2023 15:32:41 -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= DehbJ+a8OedpLJWZtwtdhxGgE6g=; b=epOCxOwVCqMJCc+VWeNnsjR5NeTgJ/nr VLDU6C9QEB+a3HN20CPFNPQle6SJE7I9xRxo9wTkqfesM1aqONZY8HRVI/h238gP 4BLmXedhdq7oDzyZ4MOhbNMUbFF0qZ2dxyt+1SkS3YdKr4sgME1SsPxEZIEp8yJ5 6BNXLrnAo1w= 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= RhXbDrN2dwXPfxZxQea5h3ZP9K6Fj05jART3vHN+M8/tn9mEy5UY2/7X6CyGTfsb dacYZcXtkccGt+L6ScWMyiI94didZf8cJOy2M6UqHSccvuQhVn36QXBJCB2YLUtL v4tSurG9Qdr1WLvIIqjY2i3AFDPUDHgCrmTpbzMvaJw= 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 4RSBpw6lkPz8PbN for ; Fri, 18 Aug 2023 15:32:40 -0400 (EDT) Date: Fri, 18 Aug 2023 15:32:39 -0400 From: Brad Smith To: ffmpeg-devel@ffmpeg.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [FFmpeg-devel] [PATCH] 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 29VBI27dxTiJ 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. --- configure | 8 ++++++++ libswscale/ppc/yuv2rgb_altivec.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 932998b8d6..268435fbdb 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" @@ -6218,6 +6220,11 @@ elif enabled ppc; then check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)" fi + if enabled altivec && disabled vsx; 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"' @@ -7728,6 +7735,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, \