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 4093B47A17 for ; Fri, 29 Sep 2023 11:38:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 898D468CAC8; Fri, 29 Sep 2023 14:38:17 +0300 (EEST) Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F39E168CA8D for ; Fri, 29 Sep 2023 14:38:10 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=frankplowman.com; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type:cc:content-type:from:subject:to; s=s1; bh=kQO61+o7LEFt82AV8IqBIZEjoWgvkLiH9M3ZMcxuGd4=; b=btmipWSoNvIW39TrnsRnyVh1cbKw6G7oB4vPBB/Tpm5plhJu4GGbMnJ6XsTGgxNabp8x sRY90huzmz50T2Hm49GTjoont4LjKh1AkiNI/CIQcWEX/x2YjbmBMB0uTsjUGS/yrBu8jM Ls2+4z12TxmspU3uMpRdconUEWYcIkF/VjtZFr5gGTaQTq/HDeQ+XQi18Lj0d3b6Xp/F5k WkRNq3zWRhlNFUhFBesR2SnJKITEyxZIaiyt3/Dh3TU50k964x9xzsMIJgL5vfvhZL3aYk SjrHayV2oj5Xg9iZCUeCrn2RIB8ax2tmq8O/nGlv1g/Ze2DttWk1NsAlUHDFKp8g== Received: by filterdrecv-84b96456cb-fbbmz with SMTP id filterdrecv-84b96456cb-fbbmz-1-6516B6B7-B 2023-09-29 11:36:23.427829888 +0000 UTC m=+659389.826007166 Received: from nuc.. (unknown) by geopod-ismtpd-9 (SG) with ESMTP id 60z5i_3hT2mvo-_cdpIB1g Fri, 29 Sep 2023 11:36:22.872 +0000 (UTC) From: Frank Plowman Date: Fri, 29 Sep 2023 11:36:23 +0000 (UTC) Message-ID: <20230929113622.122769-1-post@frankplowman.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?Uj3aYg52c+LLQjRSx2kNrre9PZxeM4UYymiuV7D=2FDFCrUPtmdddVVDUZk3miaV?= =?us-ascii?Q?h1=2FJO1FFHK2V1NQv9+VwRIHFf5JH89t7Wvu1ztE?= =?us-ascii?Q?9TSgQgl4R=2F1vT0jjhnlpJgwSp+M1cvMjAGX2DFG?= =?us-ascii?Q?K1tvci+8rAC7BgI5b+4fKrQE7WA+nnq7eZdi7M2?= =?us-ascii?Q?k=2FIlSXRQkPeIHsRr2UK9sRrIZ5Lf0ajTDIKShxU?= =?us-ascii?Q?qOIhbeJjZUXceOmkz+2pLXRvS1UIG+C3t=2FNikV?= To: ffmpeg-devel@ffmpeg.org X-Entity-ID: LpPALsXh5JN/Quf2dstifQ== Subject: [FFmpeg-devel] [PATCH] x86inc: Add REPX macro to repeat instructions/operations 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 Cc: Frank Plowman 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: From: Henrik Gramner When operating on large blocks of data it's common to repeatedly use an instruction on multiple registers. Using the REPX macro makes it easy to quickly write dense code to achieve this without having to explicitly duplicate the same instruction over and over. For example, REPX {paddw x, m4}, m0, m1, m2, m3 REPX {mova [r0+16*x], m5}, 0, 1, 2, 3 will expand to paddw m0, m4 paddw m1, m4 paddw m2, m4 paddw m3, m4 mova [r0+16*0], m5 mova [r0+16*1], m5 mova [r0+16*2], m5 mova [r0+16*3], m5 Commit taken from x264: https://code.videolan.org/videolan/x264/-/commit/6d10612ab0007f8f60dd2399182efd696da3ffe4 Signed-off-by: Frank Plowman --- libavutil/x86/x86inc.asm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 251ee797de..e099ee4b10 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -232,6 +232,16 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 %define gprsize 4 %endif +; Repeats an instruction/operation for multiple arguments. +; Example usage: "REPX {psrlw x, 8}, m0, m1, m2, m3" +%macro REPX 2-* ; operation, args + %xdefine %%f(x) %1 + %rep %0 - 1 + %rotate 1 + %%f(%1) + %endrep +%endmacro + %macro PUSH 1 push %1 %ifidn rstk, rsp -- 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".