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 AC61349E75 for ; Tue, 13 Aug 2024 14:05:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 028D268DA9B; Tue, 13 Aug 2024 17:03:58 +0300 (EEST) Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4321E68DA82 for ; Tue, 13 Aug 2024 17:03:50 +0300 (EEST) Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 514D3138C049; Tue, 13 Aug 2024 10:03:49 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 13 Aug 2024 10:03:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1723557829; x= 1723644229; bh=xJnkRckIVBt5baXbbD+rW08szHc3SpSU3qFXUvdBY1I=; b=R cd6xKtniHEKVaQ2+qpjyF4AqnVwmxvKVMtXpH9J8ZRTWjvuP24Ky27NkVx8gOI6O 31m8Ax4n6BSMnz1Ul6E4+ZctRZuIBCETrjzvJejngGrIXUWypnI/D2PHghtP2aIK 7wTDPmfaap+iDiMR2tbBJyIVcU9LEEzvg2aFx78eVd7LrTQXTxLfvxh8c74wa6Gw vEL3JYmDhmsa/kyyiMpmqZjEAg3mtqV7C79UM8Fjl0oVkKF1s8ipwB51cD6V1pW/ ksqztOYvf/2IgUhA7hRgF/UoA7c6iW0sO3sljzLfG0U2OxQmfOpH1FSpdjgYDFAE zLlXhxX0JHfLOJuZcZFmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723557829; x= 1723644229; bh=xJnkRckIVBt5baXbbD+rW08szHc3SpSU3qFXUvdBY1I=; b=h Erl+yBrMtxHgF7UjUoJ/OndLc9opUE6l1KpS8D0t/IznL/5RgxfY5JQrVZnhhhLq sIa6IXS1D/ngyL5kB0yZc6QYjqZ0jb+Apv3NAnDL4goAUnG3oxltDHKk+PYUQq2o iXhytqpLwrnXf4j53+Z9U9Z8SfklEtNLaZxZOwPZKFTjd3hGfIn9MXDh1bFdTsA0 XZrDdoM7liI9IWiZ9i98ivpLRItApQmCUtw/72LfdLZkj/SvWRcnBi85nCmEkr56 0KE/9Yv9HrlWox7pdr0wJPy3IgqDIAivtyOF4Bvld3EBZSHDPNseJk/1CTL4lG/I sHklwLW/KYt1+6NqjTqmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddtvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceo jhguvghksehithgrnhhimhhulhdrlhhiqeenucggtffrrghtthgvrhhnpedtheekffejgf ektdehgedvieevgeegffdvvedvudeffffhteeiffelhfekvddujeenucffohhmrghinhep rghsmhdrshgsnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrh homhepjhguvghksehithgrnhhimhhulhdrlhhipdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvg hgrdhorhhgpdhrtghpthhtohepghhitheshhgrrghsnhdruggvvh X-ME-Proxy: Feedback-ID: i84994747:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Aug 2024 10:03:48 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Aug 2024 16:03:35 +0200 Message-ID: <20240813140338.143045-6-jdek@itanimul.li> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240813140338.143045-1-jdek@itanimul.li> References: <20240813140338.143045-1-jdek@itanimul.li> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/7] avutil/riscv/asm: add generic push/pop helpers 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: Niklas Haas 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: Niklas Haas Generic helper macros to push/pop multiple registers at once. Expands to a single `addi` plus a sequence of XLEN-sized stores/loads. --- libavutil/riscv/asm.S | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S index db190e99ca..3955530e4e 100644 --- a/libavutil/riscv/asm.S +++ b/libavutil/riscv/asm.S @@ -288,3 +288,40 @@ .macro count_args args:vararg count_args_inner 0, \args .endm + + /** + * Helper macro to iterate over constant sized elements in memory + * @param op operation to perform on each element (sized load/store) + * @param size size in bytes per element + * @param offset starting offset of first element + * @param addr base address to load/store + * @param regs registers to iterate over + */ + .macro for_mem op, size, offset, addr, reg, regs:vararg + .ifnb \reg + \op \reg, \offset(\addr) + for_mem \op, \size, \offset + \size, \addr, \regs + .endif + .endm + + /** + * Push a variable number of registers to the stack. + * @param n number of registers to push + * @param regs registers to push + */ + .macro push regs:vararg + count_args \regs + addi sp, sp, -(num_args * (__riscv_xlen >> 3)) + for_mem sx, __riscv_xlen >> 3, 0, sp, \regs + .endm + + /** + * Pop a variable number of registers from the stack. + * @param n number of registers to pop + * @param[out] regs registers to pop + */ + .macro pop regs:vararg + count_args \regs + for_mem lx, __riscv_xlen >> 3, 0, sp, \regs + addi sp, sp, num_args * (__riscv_xlen >> 3) + .endm -- 2.45.1 _______________________________________________ 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".