From patchwork Fri Aug 26 08:34:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 37504 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp192644pzh; Fri, 26 Aug 2022 01:35:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Nigt71hDNQ81tmWbJPG/5/w0KqAhahp1M1rQH9sDjdEu6KgmYfjWVJuytRvg00T5t2efR X-Received: by 2002:a05:6402:d05:b0:425:b5c8:faeb with SMTP id eb5-20020a0564020d0500b00425b5c8faebmr5801754edb.273.1661502902375; Fri, 26 Aug 2022 01:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661502902; cv=none; d=google.com; s=arc-20160816; b=0wka4dqlHriQF+PQFcqCsmYC4yR15o2DyfZ7UuDbqpoRHgcLjDCcjhzllP/ARbh9Ir OR1g2Dbb/3VqnLhTCVsDN2txGDOV5zc27F6H0ytibsagijVrnPKYnSjYgw1KXpMfs5h3 wNPfjQqCamacPvKx+UNeKXutVbDfNBz0BwFkwSCUFvpw9W00Z8vq/UHrJC/HXp1Ns+ar elheuCcNAEFwWqKuq/kH0bwHicZvGtsmKp+72JUiDR6Q7P1IFVMoxF/xg6QB1LAGTkUN ZZFYs7jtyH1ZIunvWy4uv1Ksc6RK/NeScSlhahLtffK9DdkQgZEldY4PSWLNko7VrJ9U S1iw== 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:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=zQlFn8bhckP51HZuBQV55O6rpMnSUN3NM4o1INESGlI=; b=c1zZcBFHKvzBNycIBoRT4MjQtL0OL1ko7HmPz3JLTSXFLRW7/9o7yZD/1JilqTV6xh Bo+pFwy1CCkPtyxW51r9t+Ki2T8vefog3f6FttyzluimgGxZWYpPpA0DO04eLt6KhL9T eHgztO8c2d1Bsb2Scea3jkZ0qFW2FD8+5a8sO+KqlyYPbcHVizgpY9BWVi94q0m8X601 92IQxy5L5nKrREF3U5VYVPx7nqH8zR9yQOQLbCSOuibRrVEbChKm4QltAyDuD/8W2wEQ TgcHxKO5yFoIFLOvhD7S7yJMjBF7wZFeOEcLWJU3rAavzVrkF/X6G4wtd0e9mZ1NBy+A IzMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=BYvifcv6; 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 dp15-20020a170906c14f00b0072f24977c82si848622ejc.841.2022.08.26.01.35.01; Fri, 26 Aug 2022 01:35:02 -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=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=BYvifcv6; 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 A329568B4E4; Fri, 26 Aug 2022 11:34:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 49BD468B4E4 for ; Fri, 26 Aug 2022 11:34:52 +0300 (EEST) Received: by mail-lf1-f48.google.com with SMTP id l1so1087163lfk.8 for ; Fri, 26 Aug 2022 01:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=YVs+5CNI+ZmwH7HUEP1z2oW1B7aH5QhipPPT9wF4VN4=; b=BYvifcv6QctJ+t4bU4gRc/UdZCplFUp1Y5vcm8/t7K+0OlcHSAVS67wzLpyIPFQoQI IkdmPQ+6VfjrDANR+loFbHfbYF3YkefrDsDGAIXmcfpbHIM3R2taOhi2crXvjmtlq95f 3G4Ak/X+RHogsPb2oGkZ60cvQ0Sj6tWyKxQhriG5qwECrxFDkj2181BMj8CifdC0Vv35 oHnxMRd/Hh1o3svU1auWhUbXhp6Pm4UW9sYzjkQRg6B8ghoMBf5/oF58wELB8xQLfo7J PkhqDMy1fyzqJQnR1NNtfsdwFiTHax6FFNf4vFCqG8mhDRe+NXZAZ937idW+08SYekc1 0EzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=YVs+5CNI+ZmwH7HUEP1z2oW1B7aH5QhipPPT9wF4VN4=; b=yS3Cq3wsQ7+4RPzT/c4XdumXzIuY2tVTMODpoMRkaaMW2g/U8/PMBtQ0peemjyyg9K M/k9YcrqI0OezSMhmBUjudZ2GijngDTtjpWGYRNxQZXrWsLDGrkMWCJmaai3M/XlbRaU HholOvpfWn7yXKJcuixVhEcWTH+J6z9ZyyK12beS4S8FJnEQLg7Wbj6PtcnYsyt3C6Kt LlBVuG4IzFmjpVEfhvkFrcKtpIMqgZOFAG4q4hFyJy08wa63YDtXAGPvaD7DuzBWEzD2 pGnvkhgOMvCpFD+AD4IfDEqFbO4vW8IcFVhrTZip1wl52V894wV3zyjaRs5w2F39bysf pZLA== X-Gm-Message-State: ACgBeo3jDR3bqY6Enl9anZpSxDfasmWnEOAb0UjrVfQeDflNZUbuAKmX uH8dYG+hVjou67J67X/hB+jFPvAwFRoYZJ2e X-Received: by 2002:a19:6402:0:b0:492:967c:1758 with SMTP id y2-20020a196402000000b00492967c1758mr2078196lfb.92.1661502891444; Fri, 26 Aug 2022 01:34:51 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id m10-20020a056512358a00b0048b279fa9a7sm295577lfr.231.2022.08.26.01.34.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 01:34:50 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Aug 2022 11:34:49 +0300 Message-Id: <20220826083450.2867072-1-martin@martin.st> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] arm: Skip certain inline assembly functions if built without optimizations 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: Fx1HvhBllwGm These inline assembly functions rely on being inlined into the caller, so that the parameter "int p" can be a known assembly time constant, instead of a variable parameter. __OPTIMIZE__ is a built-in define which is set by both GCC and Clang (the two main compilers supporting our inline assembly) when optimizations are enabled. This fixes building for arm targets with optimizations disabled. --- With older GCC versions, the inline assembly in libavcodec/arm/aac.h also might need to be disabled, but it does build successfully with optimizations disabled with modern LLVM and GCC, so not touching it immediately as part of this patch. --- libavutil/arm/intmath.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/arm/intmath.h b/libavutil/arm/intmath.h index 5311a7d52b..67a8e72dc0 100644 --- a/libavutil/arm/intmath.h +++ b/libavutil/arm/intmath.h @@ -62,6 +62,7 @@ static av_always_inline av_const int av_clip_int16_arm(int a) return x; } +#ifdef __OPTIMIZE__ #define av_clip_intp2 av_clip_intp2_arm static av_always_inline av_const int av_clip_intp2_arm(int a, int p) { @@ -77,6 +78,7 @@ static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p) __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p)); return x; } +#endif #define av_sat_add32 av_sat_add32_arm static av_always_inline int av_sat_add32_arm(int a, int b)