From patchwork Sat Jul 15 20:57:04 2023 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: 42747 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6da1:b0:131:a7d0:bc6d with SMTP id gl33csp4510592pzb; Sat, 15 Jul 2023 13:57:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlFd5HEcKZLjg3bm+3CyS0VGaWKgatYCJ8r9lS2azkwvzEGEBY84Q/0ZM+Nsr+whJSAjl1H0 X-Received: by 2002:a17:906:749c:b0:96f:d345:d0f7 with SMTP id e28-20020a170906749c00b0096fd345d0f7mr7388336ejl.62.1689454636886; Sat, 15 Jul 2023 13:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689454636; cv=none; d=google.com; s=arc-20160816; b=sdONrSy4iqT5cuJPuxW9/+AUBxrzLdhqPVf9o4Hgz7Svv51QMIzyOV5eTCkxtNp+qj 4oSqhvHcBGl9TnOOVfKTRDIkuPTo7a62+/Xt2jHFLhXphzOCPNi9RMMEXHDCFv0cqR6a HvmlFCEByaRr1uMgQ3o/jFh7Z6ry56pjNZBgm+3/aGyHWohVjtyHwYWlnq+vyCHF2iQI NFTxylYeMp5Ztc1IGVdjAYuo2WsVA87ZGQt62UjzoEhmF8NPKrWNsoW1b1f6nCDIVY1R +SnkaH9TvtuO6pWPBHg1tVYNvPH+kjrTvElC7UKTOYRncMgXZ22FGj9RIq5HVmUZS6z+ Gw5A== 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=MGZrsAS4hztIl9g/DR88sqFiOBWYj/7peRtCLfV5V5A=; fh=hQcp50obTJ8bXC1it5NuEN23RGKfx0/zZ3s2gmreL+A=; b=kLRewEUrmQN1/QHQWhIYMRWOEdJ5qHRbVixCDiDnc4IZnvDzVDYbj8/cA/kba4TKPc VOG8A31X9MfJWaTRYfLa4ZPjzPsYNq9DcUyJI3uHqBBFX8VLQs1NGFTHDHbyy9lJ469E giQt1HxY2BmCefGWj6h8/+V40+/KdZm3UWZlB7tHtbfNwQaX8vLS5ytJeIvKYjJctfjW 1dp4V7lyW2GyFdyN49ioS4kObUF0nyHPk8k7J1P1hmO31G6sn3f5vlLke9rupnHnHf7q nrIr3gRje40B/ECcLjCENO9RqvFxorjmc1/sHgHXmoNd+n1VhsPQEbCTosFlmCv175Ji UPQg== 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 ox10-20020a170907100a00b00993a37985dfsi11369753ejb.179.2023.07.15.13.57.16; Sat, 15 Jul 2023 13:57:16 -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 E26D168C653; Sat, 15 Jul 2023 23:57:12 +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 8CAF168C59B for ; Sat, 15 Jul 2023 23:57:06 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 1BB23C0010 for ; Sat, 15 Jul 2023 23:57:06 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 15 Jul 2023 23:57:04 +0300 Message-Id: <20230715205705.34475-1-remi@remlab.net> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/aacpsdsp: rework RISC-V add_squares 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: K8lnNAIDRvDI Segmented loads are kinda slow, so this advantageously uses a unit-strided load and narrowing shifts instead. Before: ps_add_squares_rvv_f32: 30352.2 After: ps_add_squares_rvv_f32: 11973.7 --- libavcodec/riscv/aacpsdsp_rvv.S | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/riscv/aacpsdsp_rvv.S b/libavcodec/riscv/aacpsdsp_rvv.S index 80bd19f6ad..b7ea314fc3 100644 --- a/libavcodec/riscv/aacpsdsp_rvv.S +++ b/libavcodec/riscv/aacpsdsp_rvv.S @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Rémi Denis-Courmont. + * Copyright © 2022-2023 Rémi Denis-Courmont. * * This file is part of FFmpeg. * @@ -21,13 +21,16 @@ #include "libavutil/riscv/asm.S" func ff_ps_add_squares_rvv, zve32f + li t1, 32 1: vsetvli t0, a2, e32, m1, ta, ma - vlseg2e32.v v24, (a1) - sub a2, a2, t0 + vle64.v v8, (a1) + vnsrl.wx v24, v8, zero vle32.v v16, (a0) - sh3add a1, t0, a1 + sub a2, a2, t0 + vnsrl.wx v25, v8, t1 vfmacc.vv v16, v24, v24 + sh3add a1, t0, a1 vfmacc.vv v16, v25, v25 vse32.v v16, (a0) sh2add a0, t0, a0