diff mbox series

[FFmpeg-devel] ppc: Recognize the PPC VSX and Power8 CPU flags

Message ID Zu6MXNZ4PRYtvD38@humpty.home.comstyle.com
State New
Headers show
Series [FFmpeg-devel] ppc: Recognize the PPC VSX and Power8 CPU flags | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Brad Smith Sept. 21, 2024, 9:05 a.m. UTC
ppc: Recognize the PPC VSX and Power8 CPU flags

Signed-off-by: Brad Smith <brad@comstyle.com>
---
 libavutil/cpu.c       | 2 ++
 libavutil/tests/cpu.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Brad Smith Sept. 28, 2024, 2:15 a.m. UTC | #1
ping.

On 2024-09-21 5:05 a.m., Brad Smith wrote:
> ppc: Recognize the PPC VSX and Power8 CPU flags
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
>   libavutil/cpu.c       | 2 ++
>   libavutil/tests/cpu.c | 2 ++
>   2 files changed, 4 insertions(+)
>
> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> index df00bd541f..44cbb9e9ff 100644
> --- a/libavutil/cpu.c
> +++ b/libavutil/cpu.c
> @@ -120,6 +120,8 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
>           { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
>   #if   ARCH_PPC
>           { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ALTIVEC  },    .unit = "flags" },
> +        { "vsx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VSX      },    .unit = "flags" },
> +        { "power8"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_POWER8   },    .unit = "flags" },
>   #elif ARCH_X86
>           { "mmx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX      },    .unit = "flags" },
>           { "mmx2"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX2     },    .unit = "flags" },
> diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
> index 0a459c1d9e..53e9f99950 100644
> --- a/libavutil/tests/cpu.c
> +++ b/libavutil/tests/cpu.c
> @@ -51,6 +51,8 @@ static const struct {
>       { AV_CPU_FLAG_SETEND,    "setend"     },
>   #elif ARCH_PPC
>       { AV_CPU_FLAG_ALTIVEC,   "altivec"    },
> +    { AV_CPU_FLAG_VSX,       "vsx"        },
> +    { AV_CPU_FLAG_POWER8,    "power8"     },
>   #elif ARCH_MIPS
>       { AV_CPU_FLAG_MMI,       "mmi"        },
>       { AV_CPU_FLAG_MSA,       "msa"        },
Sean McGovern Sept. 28, 2024, 7:26 p.m. UTC | #2
Hi Brad,


On Fri, Sep 27, 2024, 22:16 Brad Smith <brad-at-comstyle.com@ffmpeg.org>
wrote:

> ping.
>
> On 2024-09-21 5:05 a.m., Brad Smith wrote:
> > ppc: Recognize the PPC VSX and Power8 CPU flags
> >
> > Signed-off-by: Brad Smith <brad@comstyle.com>
> > ---
> >   libavutil/cpu.c       | 2 ++
> >   libavutil/tests/cpu.c | 2 ++
> >   2 files changed, 4 insertions(+)
> >
> > diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> > index df00bd541f..44cbb9e9ff 100644
> > --- a/libavutil/cpu.c
> > +++ b/libavutil/cpu.c
> > @@ -120,6 +120,8 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
> >           { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 },
> INT64_MIN, INT64_MAX, .unit = "flags" },
> >   #if   ARCH_PPC
> >           { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> AV_CPU_FLAG_ALTIVEC  },    .unit = "flags" },
> > +        { "vsx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> AV_CPU_FLAG_VSX      },    .unit = "flags" },
> > +        { "power8"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> AV_CPU_FLAG_POWER8   },    .unit = "flags" },
> >   #elif ARCH_X86
> >           { "mmx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> AV_CPU_FLAG_MMX      },    .unit = "flags" },
> >           { "mmx2"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> AV_CPU_FLAG_MMX2     },    .unit = "flags" },
> > diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
> > index 0a459c1d9e..53e9f99950 100644
> > --- a/libavutil/tests/cpu.c
> > +++ b/libavutil/tests/cpu.c
> > @@ -51,6 +51,8 @@ static const struct {
> >       { AV_CPU_FLAG_SETEND,    "setend"     },
> >   #elif ARCH_PPC
> >       { AV_CPU_FLAG_ALTIVEC,   "altivec"    },
> > +    { AV_CPU_FLAG_VSX,       "vsx"        },
> > +    { AV_CPU_FLAG_POWER8,    "power8"     },
> >   #elif ARCH_MIPS
> >       { AV_CPU_FLAG_MMI,       "mmi"        },
> >       { AV_CPU_FLAG_MSA,       "msa"        },
> _______________________________________________
> 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".
>

I have not tested this but it looks OK to me. Sorry for the delay.

-- Sean McGovern
diff mbox series

Patch

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index df00bd541f..44cbb9e9ff 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -120,6 +120,8 @@  int av_parse_cpu_caps(unsigned *flags, const char *s)
         { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" },
 #if   ARCH_PPC
         { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ALTIVEC  },    .unit = "flags" },
+        { "vsx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VSX      },    .unit = "flags" },
+        { "power8"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_POWER8   },    .unit = "flags" },
 #elif ARCH_X86
         { "mmx"     , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX      },    .unit = "flags" },
         { "mmx2"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX2     },    .unit = "flags" },
diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
index 0a459c1d9e..53e9f99950 100644
--- a/libavutil/tests/cpu.c
+++ b/libavutil/tests/cpu.c
@@ -51,6 +51,8 @@  static const struct {
     { AV_CPU_FLAG_SETEND,    "setend"     },
 #elif ARCH_PPC
     { AV_CPU_FLAG_ALTIVEC,   "altivec"    },
+    { AV_CPU_FLAG_VSX,       "vsx"        },
+    { AV_CPU_FLAG_POWER8,    "power8"     },
 #elif ARCH_MIPS
     { AV_CPU_FLAG_MMI,       "mmi"        },
     { AV_CPU_FLAG_MSA,       "msa"        },