From patchwork Tue Sep 20 14:39:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 38076 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1988472pzh; Tue, 20 Sep 2022 07:40:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM721+vkYp6OEmlcFallX+nxAFUvyE/XNeZgOh8YfBlqeW8VPeRYFrKMImXRFzryrrD361nZ X-Received: by 2002:aa7:c448:0:b0:44f:c01:2fdb with SMTP id n8-20020aa7c448000000b0044f0c012fdbmr19775616edr.88.1663684833555; Tue, 20 Sep 2022 07:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663684833; cv=none; d=google.com; s=arc-20160816; b=ZAF7PKEzCFW7wlaThQk4cryrdLkGgzbmiKNeM+OM26iE1uJlH9PnLbxo+UcNqMvZMJ V5X5ow/EGfAzK+K1BGuSGULHxel0IUr3uRbxdJI4pjQj/n5il61W81RZ0SaFKXiuMnBl et0CuuvUxUlt+WytwFmFQVR0LHgS+QF9Ib4TPBguVVLAECzCVEQseTD020Pwx/EKFYbQ RKspEc+l7rLElLLmH3aHiYBPWKxPk0Gw4MgBYrmbUGt9ygtnIGvCmNAaQ0r5DD62Zjf1 kTzsTs6iz71gXQdJAPDgUeqqI0c/TOPQDrl0mQVSInfLNGP4lbYIwNHd/wJth2TlzRo7 D/NQ== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=O+HgSwCNmXwf3ppSUZbEowfy1qCjm51aUTfBxBrqgAo=; b=iaCMPbxx4uZ96zzF/H/ADAlDB5pTI2P9gmjN5VOGvOGwPzdr4o56FDk+8On6Vm0a/q xuFo5yhJGyGis4PC5mjgKDciS7M1hy39Htw82SQfO5/GUAA2T26NX0drdfvwGqIxwFYr xyMAeH4Fi3kC/L2hXcqr6JE/TyefJ0EdRdRvhYSP/OTn4z50Z0fyqBas6Xys6VmGIOeV T3qHYNWWZfJ1CMGMRMoHPuPypPar5J3LAFPQ9Enp13349v+Z6/e5K3E5uw55IViYgWAJ cQHhsxKzFLijvt+pdDY+Kq58Q7wr7nC3i+Buy/r0HBFBN2WbE8XbS9A0qnbnyUNs1o8C QCdw== ARC-Authentication-Results: i=1; mx.google.com; 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 h14-20020aa7cdce000000b004469a602b4esi1295edw.66.2022.09.20.07.40.33; Tue, 20 Sep 2022 07:40:33 -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; 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 1DFDF68BA35; Tue, 20 Sep 2022 17:40:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 87BAA68B7AB for ; Tue, 20 Sep 2022 17:40:14 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 42795C00AD for ; Tue, 20 Sep 2022 17:40:14 +0300 (EEST) From: remi@remlab.net To: ffmpeg-devel@ffmpeg.org Date: Tue, 20 Sep 2022 17:39:49 +0300 Message-Id: <20220920144013.4959-2-remi@remlab.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <5602865.DvuYhMxLoT@basile.remlab.net> References: <5602865.DvuYhMxLoT@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/26] lavu/riscv: initial common header for assembler macros 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: GiIH7SShcIkb From: Rémi Denis-Courmont --- libavutil/riscv/asm.S | 77 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 libavutil/riscv/asm.S diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S new file mode 100644 index 0000000000..dbd97f40a4 --- /dev/null +++ b/libavutil/riscv/asm.S @@ -0,0 +1,77 @@ +/* + * Copyright © 2022 Rémi Denis-Courmont. + * Loosely based on earlier work copyrighted by Måns Rullgård, 2008. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" + +#if defined (__riscv_float_abi_soft) +#define NOHWF +#define NOHWD +#define HWF # +#define HWD # +#elif defined (__riscv_float_abi_single) +#define NOHWF # +#define NOHWD +#define HWF +#define HWD # +#else +#define NOHWF # +#define NOHWD # +#define HWF +#define HWD +#endif + + .macro func sym, ext= + .text + .align 2 + + .option push + .ifnb \ext + .option arch, +\ext + .endif + + .global \sym + .hidden \sym + .type \sym, %function + \sym: + + .macro endfunc + .size \sym, . - \sym + .option pop + .previous + .purgem endfunc + .endm + .endm + + .macro const sym, align=3, relocate=0 + .if \relocate + .pushsection .data.rel.ro + .else + .pushsection .rodata + .endif + .align \align + \sym: + + .macro endconst + .size \sym, . - \sym + .popsection + .purgem endconst + .endm + .endm