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 0EB914AB9F for ; Thu, 13 Jun 2024 17:20:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 284A968D941; Thu, 13 Jun 2024 20:20:48 +0300 (EEST) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 71A0D68D857 for ; Thu, 13 Jun 2024 20:20:41 +0300 (EEST) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2c2c6b27428so1013549a91.3 for ; Thu, 13 Jun 2024 10:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718299239; x=1718904039; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=uno1cNfQSqN9uVY7q9zcJE0y+p6JpRc1TlPuJuckYQQ=; b=ft9MfkOZZ9RpcTKnw40rz8q6ljyYwcIqB3mU40TDKMsNRb7fowc3lAhT4RQ19BP3lw 2tUhfTs/RQrbL3IWZ2K17V/oiu8JIq7A79UHqmFOQd1SRxLBrtc7rr/nbrKu8AEPFJHr MK9hQate66Cvn0/qoGjYuNHh3rV7r83K8/dn07+bZ7YCZ9ocVI9ZPJJz47X12D94bnuz 4RsUBwQOVTPiHosYKwS0cwQQl39FYD132Jk+0wxvt+zAHVOrkiM19k+5nf6W2tR2S0Qj 2/lqRdSDo2+RoT0Jz19mUCtKCKQHC9PHTVMHrusuxSwyuP5YNC0Hjwsn/Oob21rFX9Uc eDhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718299239; x=1718904039; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uno1cNfQSqN9uVY7q9zcJE0y+p6JpRc1TlPuJuckYQQ=; b=AM9KzFYjGQOLt1w1qA8kg6A6DPOb/CP6Awog7C+TolZC8RZTkrTx5aw/YRGvSOojz4 pesxq+DNJB2DI5y422FMZMIdPK6Q88dx88lK2/JgisB20uyJpFSAXqgE1LJiPuXAkpsy nEYNdJNYdhlZnkaHPBeQIgPm4vNLMG47iDXJcJYdYCKnJOYkU1aWNe/nxoUTHkQIzO3o AL4UwaQ9Q6GxOAttKqRQ2CVaqHiFK99w3LKjjP+L57Rkpo54Jh/rtKZ9I5qw3JbehGi0 D58FiG8mYAtKMZjHbGfApNUjiWTQwRi3xpFV3DKvlpHjhwBIJ6ima1Wzc2G+cmVJJx+g Gtpg== X-Gm-Message-State: AOJu0Yy22YGbo2lXsSfBTLiV04pEDLoHoqjlYCbLNDGJCDT8n0rC/WkT 9ZnnQYaFUCvfKI5lxz5/1BRHnRXjcTfXpeoajACugix7m+qAufd8ccO4Xg== X-Google-Smtp-Source: AGHT+IGug/OyZhEnMYpwr5b5RhF2zLcHG4aLvaDQq01TqWAbMFgbIqk3SX6cYMBLF3Udx3tF+okzww== X-Received: by 2002:a17:90a:fa98:b0:2c3:1b66:19b2 with SMTP id 98e67ed59e1d1-2c4db12c4b0mr453018a91.1.1718299238967; Thu, 13 Jun 2024 10:20:38 -0700 (PDT) Received: from [192.168.0.16] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c4c45f4749sm2012370a91.26.2024.06.13.10.20.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jun 2024 10:20:38 -0700 (PDT) Message-ID: <9b50aff5-2e3a-4c7e-a7dc-0f510dd0646d@gmail.com> Date: Thu, 13 Jun 2024 14:21:05 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240611185232.5384-1-jamrial@gmail.com> Content-Language: en-US From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutil: rename av_mod_uintp2 to av_zero_extend 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 6/11/2024 5:26 PM, Andreas Rheinhardt wrote: > James Almer: >> It's more descriptive of what it does. >> >> Signed-off-by: James Almer >> --- >> libavutil/common.h | 16 +++++++++++++++- >> libavutil/version.h | 1 + >> libavutil/x86/intmath.h | 6 +++--- >> 3 files changed, 19 insertions(+), 4 deletions(-) >> >> diff --git a/libavutil/common.h b/libavutil/common.h >> index 3e4c339893..acd041fb67 100644 >> --- a/libavutil/common.h >> +++ b/libavutil/common.h >> @@ -42,6 +42,7 @@ >> #include "attributes.h" >> #include "error.h" >> #include "macros.h" >> +#include "version.h" >> >> #ifdef HAVE_AV_CONFIG_H >> # include "config.h" >> @@ -122,9 +123,11 @@ >> #ifndef av_clip_uintp2 >> # define av_clip_uintp2 av_clip_uintp2_c >> #endif >> +#if FF_API_MOD_UINTP2 >> #ifndef av_mod_uintp2 >> # define av_mod_uintp2 av_mod_uintp2_c >> #endif >> +#endif > > For the record: This patch on its own will disable the x86 optimization > in this patch, only to be restored in #3. > >> #ifndef av_sat_add32 >> # define av_sat_add32 av_sat_add32_c >> #endif >> @@ -149,6 +152,9 @@ >> #ifndef av_clipd >> # define av_clipd av_clipd_c >> #endif >> +#ifndef av_zero_extend >> +# define av_zero_extend av_zero_extend_c >> +#endif >> #ifndef av_popcount >> # define av_popcount av_popcount_c >> #endif >> @@ -288,11 +294,19 @@ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) >> * @param p bit position to clip at >> * @return clipped value >> */ >> -static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) >> +static av_always_inline av_const unsigned av_zero_extend_c(unsigned a, unsigned p) >> { >> return a & ((1U << p) - 1); >> } >> >> +#if FF_API_MOD_UINTP2 >> +attribute_deprecated >> +static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) >> +{ >> + return av_zero_extend_c(a, p); >> +} >> +#endif >> + >> /** >> * Add two signed 32-bit values with saturation. >> * >> diff --git a/libavutil/version.h b/libavutil/version.h >> index 9d08d56884..38456affb8 100644 >> --- a/libavutil/version.h >> +++ b/libavutil/version.h >> @@ -112,6 +112,7 @@ >> #define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60) >> #define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60) >> #define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60) >> +#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60) >> >> /** >> * @} >> diff --git a/libavutil/x86/intmath.h b/libavutil/x86/intmath.h >> index 8a6b5ae261..821a06ab66 100644 >> --- a/libavutil/x86/intmath.h >> +++ b/libavutil/x86/intmath.h >> @@ -82,13 +82,13 @@ static av_always_inline av_const int ff_ctzll_x86(long long v) >> #if defined(__BMI2__) >> >> #if AV_GCC_VERSION_AT_LEAST(5,1) >> -#define av_mod_uintp2 __builtin_ia32_bzhi_si >> +#define av_zero_extend __builtin_ia32_bzhi_si >> #elif HAVE_INLINE_ASM >> /* GCC releases before 5.1.0 have a broken bzhi builtin, so for those we >> * implement it using inline assembly >> */ >> -#define av_mod_uintp2 av_mod_uintp2_bmi2 >> -static av_always_inline av_const unsigned av_mod_uintp2_bmi2(unsigned a, unsigned p) >> +#define av_zero_extend av_zero_extend_bmi2 >> +static av_always_inline av_const unsigned av_zero_extend_bmi2(unsigned a, unsigned p) >> { >> if (av_builtin_constant_p(p)) >> return a & ((1 << p) - 1); > > Missing APIchanges and version bump. Will add both and push the set soon. _______________________________________________ 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".