From patchwork Fri Sep 9 15:48:47 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: 37801 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp998370pzh; Fri, 9 Sep 2022 08:50:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR43btux2gtvaeRDIy1XoA4c2Mo7BevZTAPAi8qvJgRK+/cVP4nXMoz2tSaA5fJf//O12RUA X-Received: by 2002:a17:906:fe0a:b0:76f:e373:d84b with SMTP id wy10-20020a170906fe0a00b0076fe373d84bmr10348012ejb.297.1662738643785; Fri, 09 Sep 2022 08:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662738643; cv=none; d=google.com; s=arc-20160816; b=nAQcWJ9IDCkqU/4jS+SgF3Aki+p1X8Te44moiA2XNjJBmmz2WEF7oAux879/Q7EkVC A+NXdJFVeoILVwA2Hl6qSODxUd1Qsw8gC1ty/BWLU7S+HUPY4z7+fzfKP8IqIzhBodxY v5vrJm+x5Wmmjhhx12LQ+3BsjrRoRTqFvRWVEcwsCtNIsMkxA3UfgTwG+U5jMObPj4iu VcnJy4rIQKhO5Wqcs6a58OvX1DY4cx6UntllQgTWzi1tNZJFEZVw2/0MZDVLVd30XeUR lU8uAqKuBESs1IWfiv0hShM3izv94PTf7y0HfXNZc9Gxn4BtpAB1iyDZv89TxYTHbw7T Ruvw== 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:message-id:date:to:from :delivered-to; bh=HwNy8donc04RdinaQp7yc3YhFdPSoNTa/Kt6zJrcJv4=; b=y/io1YaTDhikXEjsPGOdBE4TH29AIJIfd2NFDoloS/+NQA7pUUjUWaz3wU2EkjGjfO VHyG3zQ+HdtxynkC9c/LtJecY689j9YgEyto82Tz6c/FYQK4moTLrtyP4Ut73P8gxpsP yyLFupgHlV9AINZ31u/fOzxZPJIgaGnaalxnBIYmaKXC/l9WyRoiiyh7ezQz0fPuHVJe 4s/BrRnOG7s5giytZAazCK1RbMoOuNQbpAVXbTCi903AbhJfkg6eXRcGFggrdsNaidPT l0QqkOby4j57q0GtXGmRgDVYywt88HO8l+xPeO4qNwLokXnwuz3/WS3o/tW05vPjYiha MUIg== 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 h3-20020aa7de03000000b00450e1ffe3edsi596366edv.382.2022.09.09.08.50.43; Fri, 09 Sep 2022 08:50:43 -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 6E72E68BB7E; Fri, 9 Sep 2022 18:49:17 +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 223E968BB47 for ; Fri, 9 Sep 2022 18:49:05 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 48BE9C00B2 for ; Fri, 9 Sep 2022 18:49:00 +0300 (EEST) From: remi@remlab.net To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Sep 2022 18:48:47 +0300 Message-Id: <20220909154859.68954-6-remi@remlab.net> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/18] configure: probe RISC-V Vector extension 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: LllvtsAXb+5g From: RĂ©mi Denis-Courmont --- configure | 15 +++++++++++++++ ffbuild/arch.mak | 2 ++ 2 files changed, 17 insertions(+) diff --git a/configure b/configure index b7dc1d8656..c5f20cc323 100755 --- a/configure +++ b/configure @@ -462,6 +462,7 @@ Optimization options (experts only): --disable-mmi disable Loongson MMI optimizations --disable-lsx disable Loongson LSX optimizations --disable-lasx disable Loongson LASX optimizations + --disable-rvv disable RISC-V Vector optimizations --disable-fast-unaligned consider unaligned accesses slow Developer options (useful when working on FFmpeg itself): @@ -2126,6 +2127,10 @@ ARCH_EXT_LIST_PPC=" vsx " +ARCH_EXT_LIST_RISCV=" + rvv +" + ARCH_EXT_LIST_X86=" $ARCH_EXT_LIST_X86_SIMD cpunop @@ -2135,6 +2140,7 @@ ARCH_EXT_LIST_X86=" ARCH_EXT_LIST=" $ARCH_EXT_LIST_ARM $ARCH_EXT_LIST_PPC + $ARCH_EXT_LIST_RISCV $ARCH_EXT_LIST_X86 $ARCH_EXT_LIST_MIPS $ARCH_EXT_LIST_LOONGSON @@ -2642,6 +2648,8 @@ ppc4xx_deps="ppc" vsx_deps="altivec" power8_deps="vsx" +rvv_deps="riscv" + loongson2_deps="mips" loongson3_deps="mips" mmi_deps_any="loongson2 loongson3" @@ -6110,6 +6118,10 @@ elif enabled ppc; then check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)" fi +elif enabled riscv; then + + enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"' + elif enabled x86; then check_builtin rdtsc intrin.h "__rdtsc()" @@ -7596,6 +7608,9 @@ if enabled loongarch; then echo "LSX enabled ${lsx-no}" echo "LASX enabled ${lasx-no}" fi +if enabled riscv; then + echo "RISC-V Vector enabled ${riscv-no}" +fi echo "debug symbols ${debug-no}" echo "strip symbols ${stripping-no}" echo "optimize for size ${small-no}" diff --git a/ffbuild/arch.mak b/ffbuild/arch.mak index 997e31e85e..39d76ee152 100644 --- a/ffbuild/arch.mak +++ b/ffbuild/arch.mak @@ -15,5 +15,7 @@ OBJS-$(HAVE_LASX) += $(LASX-OBJS) $(LASX-OBJS-yes) OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes) OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes) +OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes) + OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes) OBJS-$(HAVE_X86ASM) += $(X86ASM-OBJS) $(X86ASM-OBJS-yes)