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 1D37040BFA for ; Tue, 13 Aug 2024 14:04:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9DC0F68DA7B; Tue, 13 Aug 2024 17:03:54 +0300 (EEST) Received: from fhigh8-smtp.messagingengine.com (fhigh8-smtp.messagingengine.com [103.168.172.159]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B080968DA77 for ; Tue, 13 Aug 2024 17:03:48 +0300 (EEST) Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id B5D451150BCB; Tue, 13 Aug 2024 10:03:47 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 13 Aug 2024 10:03:47 -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=1723557827; x= 1723644227; bh=4CiPrfQX3aAVwMBWIGmdmvl2EIYuPQpB0BYoB0/2kV8=; b=P gqqEA1A8ys6ClXROrXTAnqkA+FH5ZirHpk+nfEy0A1Li7GinlDMLhWO0L6WBthdQ KAt6rGvMMaPCmzQ/C4Huc4FXsH8vSgytZRfEdl+FPNFp+NvZ0Xt7DOD96wpfQWWP 8inLDlItROH9oAcQCvnneNg8bW4yLUjrMf+TJU9LzwVafEOEG9pQ0o7EzzpNZ1mF mcbmo+rQ4tCdiYnFzh3XXvT7N1/cLN3yaAnjoNgNsFOZs3SWBku06c+IfmojjOao a5wpxFxmlrIgzx/8nhV121qylnNm2dM0WeqAG6cchS71207VdvCqMuD+PFc/EeB1 xWs9FzHuPd/lhbdbNkORg== 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=1723557827; x= 1723644227; bh=4CiPrfQX3aAVwMBWIGmdmvl2EIYuPQpB0BYoB0/2kV8=; b=G oAG40r9TsSbsEk73OlKJLTv0uK780uR4zIw/hdkURCVKPQrY7f5p27zImWDpiM28 W0zHSJfXDy8cqRW3INrz/LqiSCrmgYB8rkB3OlfPjFReN8zWNi458V8iUMNa+z8T sVLTPpQftI3Ac02UMm71CjkBgK8auJSZc4Vi9+WNvV6TzPivqGzDpKUkn54P8HRq XV9mdS1RIziX+JItehkoh85SUO6gETXO+0mpKMDaCkLZ7iY59Cz803XSJFO98I3+ XB29J95FczyfeOdHa+MPi5wepaAZcwTvT0oS6C5j68kC8QKg9EmssnCOQ4PDKEPE TPUDL+q4ESE3ryDzka0jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddtvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceo jhguvghksehithgrnhhimhhulhdrlhhiqeenucggtffrrghtthgvrhhnpedtheekffejgf ektdehgedvieevgeegffdvvedvudeffffhteeiffelhfekvddujeenucffohhmrghinhep rghsmhdrshgsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepjhguvghksehithgrnhhimhhulhdrlhhipdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvg hgrdhorhhgpdhrtghpthhtohepghhitheshhgrrghsnhdruggvvh X-ME-Proxy: Feedback-ID: i84994747:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Aug 2024 10:03:47 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Aug 2024 16:03:34 +0200 Message-ID: <20240813140338.143045-5-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 5/7] avutil/riscv/asm: add helper macro to count varargs 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 (Ab)using nested macros to get the number of arguments passed to a variadic macro. Useful for stack manipulation. --- libavutil/riscv/asm.S | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S index 175f2a8672..db190e99ca 100644 --- a/libavutil/riscv/asm.S +++ b/libavutil/riscv/asm.S @@ -271,3 +271,20 @@ #error Unhandled value of XLEN #endif .endm + + .macro count_args_inner num, arg, args:vararg + .ifb \arg + .equ num_args, \num + .else + count_args_inner \num + 1, \args + .endif + .endm + + /** + * Helper macro to count the number of arguments to a macro. Assigns + * the count to the symbol `num_args`. + * @param args arguments to count + */ + .macro count_args args:vararg + count_args_inner 0, \args + .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".