From patchwork Sat Sep 30 09:01:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 44046 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1204:b0:15d:8365:d4b8 with SMTP id v4csp277803pzf; Sat, 30 Sep 2023 02:01:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXzd5jfgU7DDh0E2Ggu3Ah39QWw/J3VdcKQNICrVbTsntx7AQEALGUjjxSS+QSzbW51av7 X-Received: by 2002:aa7:d703:0:b0:530:bbeb:571 with SMTP id t3-20020aa7d703000000b00530bbeb0571mr6014248edq.36.1696064495420; Sat, 30 Sep 2023 02:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696064495; cv=none; d=google.com; s=arc-20160816; b=v3FIpzmSENcS0jpYSFRJ6Fw911cfbe5ABTtu260Jz1zpDdNl9ABcm+A7/1yJ0apvTD tAgN/lnAPyFsZi9slogG7ecOEq3A0NjnvTiGdhQcazwspuwNAtrcp69i/SMlAgpItF4y ZaSEbAEnP/jr2/4fTVlaY/B/0wBgP11Zoa9VpRbHGFBjJFQ5t0unWdfZsA84NQYXmlfJ 0LGU3VMVaBjUAc9wonEnVx4UN1DzQ9Yw2w57N+BtlLkdyUJwkPCKCiw8gxYOp82iWQJG 8er4Vm+r5YUrDFiCuBXKOmtspyo0pu/QM7I2ox5FVE7YLMhkNtXHpCgLOMUN5vRfRDN9 3N5Q== 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=2ZKpyS3ZNhW0xDAApiudwCijekHXXe6qeeHdTBNqcG0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=ha5PatEa7eCGugbTMRTHT0lEvpXQX8S8iwnZ0dp/sxeh01+iz8vFqcui1oUlNuLyMz /KXuUfxdjw0LDUDfHMum+fTCsh5EJSIu5nNWKj/Vo70brNrFrJAGSZFk6viQAHP8p4nh ZLhYFB5Avnn2MFiI7odTX1iEIwumTabm9V5cTCRc6uOZShR+ZaM5ZeeKYvYFmpGITFNN hwd4UmJf0/S8Q2NxVW40Gr80J5rxMeM9V9WFk43yAfAkQLEhDDgakGwoFNBk/qvBGnEa 0Kpe1f+3fmV+uQu+0lYQX2HnqA1evIW+vz6CDDol1UzvgRcKLgU/Puv/+/QY11l46zT5 LL4g== 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 w11-20020aa7d28b000000b00537707c8524si1329403edq.146.2023.09.30.02.01.35; Sat, 30 Sep 2023 02:01:35 -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 B235968CCC7; Sat, 30 Sep 2023 12:01:21 +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 8DD6768CCB1 for ; Sat, 30 Sep 2023 12:01:13 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id EEFEEC006C for ; Sat, 30 Sep 2023 12:01:12 +0300 (EEST) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 30 Sep 2023 12:01:11 +0300 Message-ID: <20230930090112.376259-2-remi@remlab.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230930090112.376259-1-remi@remlab.net> References: <20230930090112.376259-1-remi@remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] swscale/rgb2rgb: avoid S-regs in RISC-V V uyvytoyuv422 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: o2fawBx2UhxI We can make do with callee-clobbered registers only now. As an added bonus, this makes the code XLEN-independent. --- libswscale/riscv/rgb2rgb.c | 2 -- libswscale/riscv/rgb2rgb_rvv.S | 10 ++-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/libswscale/riscv/rgb2rgb.c b/libswscale/riscv/rgb2rgb.c index 162a4082b0..565f0b77f1 100644 --- a/libswscale/riscv/rgb2rgb.c +++ b/libswscale/riscv/rgb2rgb.c @@ -55,10 +55,8 @@ av_cold void rgb2rgb_init_riscv(void) shuffle_bytes_1230 = ff_shuffle_bytes_1230_rvv; shuffle_bytes_3012 = ff_shuffle_bytes_3012_rvv; interleaveBytes = ff_interleave_bytes_rvv; -#if (__riscv_xlen == 64) uyvytoyuv422 = ff_uyvytoyuv422_rvv; yuyvtoyuv422 = ff_yuyvtoyuv422_rvv; -#endif } #endif } diff --git a/libswscale/riscv/rgb2rgb_rvv.S b/libswscale/riscv/rgb2rgb_rvv.S index 3e7988ca01..3200370224 100644 --- a/libswscale/riscv/rgb2rgb_rvv.S +++ b/libswscale/riscv/rgb2rgb_rvv.S @@ -100,12 +100,9 @@ func ff_interleave_bytes_rvv, zve32x ret endfunc -#if (__riscv_xlen == 64) .macro yuy2_to_i422p y_shift - addi sp, sp, -16 - sd s0, (sp) addi a4, a4, 1 - lw s0, 16(sp) + lw t6, (sp) srai a4, a4, 1 // pixel width -> chroma width 1: mv t4, a4 @@ -131,14 +128,12 @@ endfunc add t2, t5, t2 bnez t4, 2b - add a3, a3, s0 + add a3, a3, t6 add a0, a0, a6 add a1, a1, a7 add a2, a2, a7 bnez a5, 1b - ld s0, (sp) - addi sp, sp, 16 ret .endm @@ -149,4 +144,3 @@ endfunc func ff_yuyvtoyuv422_rvv, zve32x yuy2_to_i422p 0 endfunc -#endif