aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2023-12-14 14:45:27 +0200
committerMartin Storsjö <martin@martin.st>2023-12-17 23:47:04 +0200
commit8d24a28d066ddd0f865a76860f19ef71fd0dcc24 (patch)
tree32f970bfa435185074c959f94312ff389e35d005 /libavutil
parentd7ac7101ee8c70a253f7caf400d9ae3870880d7f (diff)
downloadffmpeg-8d24a28d066ddd0f865a76860f19ef71fd0dcc24.tar.gz
riscv: Tweak names of cpu flags, print flags in libavutil/tests/cpu
The names of the cpu flags, when parsed from a string with av_parse_cpu_caps, are parsed by the libavutil eval functions. These interpret dashes as subtractions. Therefore, these previous cpu flag names haven't been possible to set. Use the official names for these extensions, as the previous ad-hoc names wasn't parseable. libavutil/tests/cpu tests that the cpu flags can be set, and prints the detected flags. Acked-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/cpu.c12
-rw-r--r--libavutil/tests/cpu.c10
-rw-r--r--libavutil/version.h2
3 files changed, 17 insertions, 7 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 1e0607d581..48d195168c 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -186,12 +186,12 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
{ "rvi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVI }, .unit = "flags" },
{ "rvf", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVF }, .unit = "flags" },
{ "rvd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVD }, .unit = "flags" },
- { "rvv-i32", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I32 }, .unit = "flags" },
- { "rvv-f32", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F32 }, .unit = "flags" },
- { "rvv-i64", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I64 }, .unit = "flags" },
- { "rvv", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F64 }, .unit = "flags" },
- { "rvb-addr",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_ADDR }, .unit = "flags" },
- { "rvb-basic",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_BASIC }, .unit = "flags" },
+ { "zve32x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I32 }, .unit = "flags" },
+ { "zve32f", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F32 }, .unit = "flags" },
+ { "zve64x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_I64 }, .unit = "flags" },
+ { "zve64d", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F64 }, .unit = "flags" },
+ { "zba", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_ADDR }, .unit = "flags" },
+ { "zbb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVB_BASIC }, .unit = "flags" },
#endif
{ NULL },
};
diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
index 200f20388a..d91bfeab5c 100644
--- a/libavutil/tests/cpu.c
+++ b/libavutil/tests/cpu.c
@@ -84,6 +84,16 @@ static const struct {
#elif ARCH_LOONGARCH
{ AV_CPU_FLAG_LSX, "lsx" },
{ AV_CPU_FLAG_LASX, "lasx" },
+#elif ARCH_RISCV
+ { AV_CPU_FLAG_RVI, "rvi" },
+ { AV_CPU_FLAG_RVF, "rvf" },
+ { AV_CPU_FLAG_RVD, "rvd" },
+ { AV_CPU_FLAG_RVB_ADDR, "zba" },
+ { AV_CPU_FLAG_RVB_BASIC, "zbb" },
+ { AV_CPU_FLAG_RVV_I32, "zve32x" },
+ { AV_CPU_FLAG_RVV_F32, "zve32f" },
+ { AV_CPU_FLAG_RVV_I64, "zve64x" },
+ { AV_CPU_FLAG_RVV_F64, "zve64d" },
#endif
{ 0 }
};
diff --git a/libavutil/version.h b/libavutil/version.h
index 0684996bf2..dcb39764a5 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 58
-#define LIBAVUTIL_VERSION_MINOR 33
+#define LIBAVUTIL_VERSION_MINOR 34
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \