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.
---
libavutil/cpu.c | 12 ++++++------
libavutil/tests/cpu.c | 10 ++++++++++
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 1e0607d581..f04068acda 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" },
+ { "zve64f", NULL,
0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_RVV_F64 }, .unit = "flags"