Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 1/2] lavu/riscv: assembler macros for VTYPE fields
Date: Tue, 14 May 2024 22:35:56 +0300
Message-ID: <20240514193557.32759-1-remi@remlab.net> (raw)

---
 libavutil/riscv/asm.S | 48 +++++++++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 15 deletions(-)

diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
index 14be5055f5..ecf3081e61 100644
--- a/libavutil/riscv/asm.S
+++ b/libavutil/riscv/asm.S
@@ -96,20 +96,38 @@
         .endm
 #endif
 
+#define VTYPE_E8   000
+#define VTYPE_E16  010
+#define VTYPE_E32  020
+#define VTYPE_E64  030
+
+#define VTYPE_MF8   05
+#define VTYPE_MF4   06
+#define VTYPE_MF2   07
+#define VTYPE_M1    00
+#define VTYPE_M2    01
+#define VTYPE_M4    02
+#define VTYPE_M8    03
+
+#define VTYPE_TU  0000
+#define VTYPE_TA  0100
+#define VTYPE_MU  0000
+#define VTYPE_MA  0200
+
         /* Convenience macro to load a Vector type (vtype) as immediate */
         .macro  lvtypei rd, e, m=m1, tp=tu, mp=mu
 
         .ifc \e,e8
-        .equ ei, 0
+        .equ ei, VTYPE_E8
         .else
         .ifc \e,e16
-        .equ ei, 8
+        .equ ei, VTYPE_E16
         .else
         .ifc \e,e32
-        .equ ei, 16
+        .equ ei, VTYPE_E32
         .else
         .ifc \e,e64
-        .equ ei, 24
+        .equ ei, VTYPE_E64
         .else
         .error "Unknown element type"
         .endif
@@ -118,25 +136,25 @@
         .endif
 
         .ifc \m,m1
-        .equ mi, 0
+        .equ mi, VTYPE_M1
         .else
         .ifc \m,m2
-        .equ mi, 1
+        .equ mi, VTYPE_M2
         .else
         .ifc \m,m4
-        .equ mi, 2
+        .equ mi, VTYPE_M4
         .else
         .ifc \m,m8
-        .equ mi, 3
+        .equ mi, VTYPE_M8
         .else
         .ifc \m,mf8
-        .equ mi, 5
+        .equ mi, VTYPE_MF8
         .else
         .ifc \m,mf4
-        .equ mi, 6
+        .equ mi, VTYPE_MF4
         .else
         .ifc \m,mf2
-        .equ mi, 7
+        .equ mi, VTYPE_MF2
         .else
         .error "Unknown multiplier"
         .equ mi, 3
@@ -149,20 +167,20 @@
         .endif
 
         .ifc \tp,tu
-        .equ tpi, 0
+        .equ tpi, VTYPE_TU
         .else
         .ifc \tp,ta
-        .equ tpi, 64
+        .equ tpi, VTYPE_TA
         .else
         .error "Unknown tail policy"
         .endif
         .endif
 
         .ifc \mp,mu
-        .equ mpi, 0
+        .equ mpi, VTYPE_MU
         .else
         .ifc \mp,ma
-        .equ mpi, 128
+        .equ mpi, VTYPE_MA
         .else
         .error "Unknown mask policy"
         .endif
-- 
2.43.0

_______________________________________________
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".

             reply	other threads:[~2024-05-14 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 19:35 Rémi Denis-Courmont [this message]
2024-05-14 19:35 ` [FFmpeg-devel] [PATCH 2/2] lavc/flacdsp: optimise RVV vector type for lpc16 Rémi Denis-Courmont
2024-05-14 19:42   ` Rémi Denis-Courmont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240514193557.32759-1-remi@remlab.net \
    --to=remi@remlab.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git