1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * This file is part of FFmpeg.
3cabdff1aSopenharmony_ci *
4cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or
5cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
6cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either
7cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version.
8cabdff1aSopenharmony_ci *
9cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful,
10cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
11cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12cabdff1aSopenharmony_ci * Lesser General Public License for more details.
13cabdff1aSopenharmony_ci *
14cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
15cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software
16cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17cabdff1aSopenharmony_ci */
18cabdff1aSopenharmony_ci
19cabdff1aSopenharmony_ci#ifndef AVUTIL_X86_CPU_H
20cabdff1aSopenharmony_ci#define AVUTIL_X86_CPU_H
21cabdff1aSopenharmony_ci
22cabdff1aSopenharmony_ci#include "libavutil/cpu.h"
23cabdff1aSopenharmony_ci#include "libavutil/cpu_internal.h"
24cabdff1aSopenharmony_ci
25cabdff1aSopenharmony_ci#define AV_CPU_FLAG_AMD3DNOW    AV_CPU_FLAG_3DNOW
26cabdff1aSopenharmony_ci#define AV_CPU_FLAG_AMD3DNOWEXT AV_CPU_FLAG_3DNOWEXT
27cabdff1aSopenharmony_ci
28cabdff1aSopenharmony_ci#define X86_AMD3DNOW(flags)         CPUEXT(flags, AMD3DNOW)
29cabdff1aSopenharmony_ci#define X86_AMD3DNOWEXT(flags)      CPUEXT(flags, AMD3DNOWEXT)
30cabdff1aSopenharmony_ci#define X86_MMX(flags)              CPUEXT(flags, MMX)
31cabdff1aSopenharmony_ci#define X86_MMXEXT(flags)           CPUEXT(flags, MMXEXT)
32cabdff1aSopenharmony_ci#define X86_SSE(flags)              CPUEXT(flags, SSE)
33cabdff1aSopenharmony_ci#define X86_SSE2(flags)             CPUEXT(flags, SSE2)
34cabdff1aSopenharmony_ci#define X86_SSE2_FAST(flags)        CPUEXT_FAST(flags, SSE2)
35cabdff1aSopenharmony_ci#define X86_SSE2_SLOW(flags)        CPUEXT_SLOW(flags, SSE2)
36cabdff1aSopenharmony_ci#define X86_SSE3(flags)             CPUEXT(flags, SSE3)
37cabdff1aSopenharmony_ci#define X86_SSE3_FAST(flags)        CPUEXT_FAST(flags, SSE3)
38cabdff1aSopenharmony_ci#define X86_SSE3_SLOW(flags)        CPUEXT_SLOW(flags, SSE3)
39cabdff1aSopenharmony_ci#define X86_SSSE3(flags)            CPUEXT(flags, SSSE3)
40cabdff1aSopenharmony_ci#define X86_SSSE3_FAST(flags)       CPUEXT_FAST(flags, SSSE3)
41cabdff1aSopenharmony_ci#define X86_SSSE3_SLOW(flags)       CPUEXT_SLOW(flags, SSSE3)
42cabdff1aSopenharmony_ci#define X86_SSE4(flags)             CPUEXT(flags, SSE4)
43cabdff1aSopenharmony_ci#define X86_SSE42(flags)            CPUEXT(flags, SSE42)
44cabdff1aSopenharmony_ci#define X86_AVX(flags)              CPUEXT(flags, AVX)
45cabdff1aSopenharmony_ci#define X86_AVX_FAST(flags)         CPUEXT_FAST(flags, AVX)
46cabdff1aSopenharmony_ci#define X86_AVX_SLOW(flags)         CPUEXT_SLOW(flags, AVX)
47cabdff1aSopenharmony_ci#define X86_XOP(flags)              CPUEXT(flags, XOP)
48cabdff1aSopenharmony_ci#define X86_FMA3(flags)             CPUEXT(flags, FMA3)
49cabdff1aSopenharmony_ci#define X86_FMA4(flags)             CPUEXT(flags, FMA4)
50cabdff1aSopenharmony_ci#define X86_AVX2(flags)             CPUEXT(flags, AVX2)
51cabdff1aSopenharmony_ci#define X86_AESNI(flags)            CPUEXT(flags, AESNI)
52cabdff1aSopenharmony_ci#define X86_AVX512(flags)           CPUEXT(flags, AVX512)
53cabdff1aSopenharmony_ci
54cabdff1aSopenharmony_ci#define EXTERNAL_AMD3DNOW(flags)    CPUEXT_SUFFIX(flags, _EXTERNAL, AMD3DNOW)
55cabdff1aSopenharmony_ci#define EXTERNAL_AMD3DNOWEXT(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, AMD3DNOWEXT)
56cabdff1aSopenharmony_ci#define EXTERNAL_MMX(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, MMX)
57cabdff1aSopenharmony_ci#define EXTERNAL_MMXEXT(flags)      CPUEXT_SUFFIX(flags, _EXTERNAL, MMXEXT)
58cabdff1aSopenharmony_ci#define EXTERNAL_SSE(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, SSE)
59cabdff1aSopenharmony_ci#define EXTERNAL_SSE2(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, SSE2)
60cabdff1aSopenharmony_ci#define EXTERNAL_SSE2_FAST(flags)   CPUEXT_SUFFIX_FAST(flags, _EXTERNAL, SSE2)
61cabdff1aSopenharmony_ci#define EXTERNAL_SSE2_SLOW(flags)   CPUEXT_SUFFIX_SLOW(flags, _EXTERNAL, SSE2)
62cabdff1aSopenharmony_ci#define EXTERNAL_SSE3(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, SSE3)
63cabdff1aSopenharmony_ci#define EXTERNAL_SSE3_FAST(flags)   CPUEXT_SUFFIX_FAST(flags, _EXTERNAL, SSE3)
64cabdff1aSopenharmony_ci#define EXTERNAL_SSE3_SLOW(flags)   CPUEXT_SUFFIX_SLOW(flags, _EXTERNAL, SSE3)
65cabdff1aSopenharmony_ci#define EXTERNAL_SSSE3(flags)       CPUEXT_SUFFIX(flags, _EXTERNAL, SSSE3)
66cabdff1aSopenharmony_ci#define EXTERNAL_SSSE3_FAST(flags)  CPUEXT_SUFFIX_FAST(flags, _EXTERNAL, SSSE3)
67cabdff1aSopenharmony_ci#define EXTERNAL_SSSE3_SLOW(flags)  CPUEXT_SUFFIX_SLOW(flags, _EXTERNAL, SSSE3)
68cabdff1aSopenharmony_ci#define EXTERNAL_SSE4(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, SSE4)
69cabdff1aSopenharmony_ci#define EXTERNAL_SSE42(flags)       CPUEXT_SUFFIX(flags, _EXTERNAL, SSE42)
70cabdff1aSopenharmony_ci#define EXTERNAL_AVX(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, AVX)
71cabdff1aSopenharmony_ci#define EXTERNAL_AVX_FAST(flags)    CPUEXT_SUFFIX_FAST(flags, _EXTERNAL, AVX)
72cabdff1aSopenharmony_ci#define EXTERNAL_AVX_SLOW(flags)    CPUEXT_SUFFIX_SLOW(flags, _EXTERNAL, AVX)
73cabdff1aSopenharmony_ci#define EXTERNAL_XOP(flags)         CPUEXT_SUFFIX(flags, _EXTERNAL, XOP)
74cabdff1aSopenharmony_ci#define EXTERNAL_FMA3(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, FMA3)
75cabdff1aSopenharmony_ci#define EXTERNAL_FMA3_FAST(flags)   CPUEXT_SUFFIX_FAST2(flags, _EXTERNAL, FMA3, AVX)
76cabdff1aSopenharmony_ci#define EXTERNAL_FMA3_SLOW(flags)   CPUEXT_SUFFIX_SLOW2(flags, _EXTERNAL, FMA3, AVX)
77cabdff1aSopenharmony_ci#define EXTERNAL_FMA4(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, FMA4)
78cabdff1aSopenharmony_ci#define EXTERNAL_AVX2(flags)        CPUEXT_SUFFIX(flags, _EXTERNAL, AVX2)
79cabdff1aSopenharmony_ci#define EXTERNAL_AVX2_FAST(flags)   CPUEXT_SUFFIX_FAST2(flags, _EXTERNAL, AVX2, AVX)
80cabdff1aSopenharmony_ci#define EXTERNAL_AVX2_SLOW(flags)   CPUEXT_SUFFIX_SLOW2(flags, _EXTERNAL, AVX2, AVX)
81cabdff1aSopenharmony_ci#define EXTERNAL_AESNI(flags)       CPUEXT_SUFFIX(flags, _EXTERNAL, AESNI)
82cabdff1aSopenharmony_ci#define EXTERNAL_AVX512(flags)      CPUEXT_SUFFIX(flags, _EXTERNAL, AVX512)
83cabdff1aSopenharmony_ci#define EXTERNAL_AVX512ICL(flags)   CPUEXT_SUFFIX(flags, _EXTERNAL, AVX512ICL)
84cabdff1aSopenharmony_ci
85cabdff1aSopenharmony_ci#define INLINE_AMD3DNOW(flags)      CPUEXT_SUFFIX(flags, _INLINE, AMD3DNOW)
86cabdff1aSopenharmony_ci#define INLINE_AMD3DNOWEXT(flags)   CPUEXT_SUFFIX(flags, _INLINE, AMD3DNOWEXT)
87cabdff1aSopenharmony_ci#define INLINE_MMX(flags)           CPUEXT_SUFFIX(flags, _INLINE, MMX)
88cabdff1aSopenharmony_ci#define INLINE_MMXEXT(flags)        CPUEXT_SUFFIX(flags, _INLINE, MMXEXT)
89cabdff1aSopenharmony_ci#define INLINE_SSE(flags)           CPUEXT_SUFFIX(flags, _INLINE, SSE)
90cabdff1aSopenharmony_ci#define INLINE_SSE2(flags)          CPUEXT_SUFFIX(flags, _INLINE, SSE2)
91cabdff1aSopenharmony_ci#define INLINE_SSE2_FAST(flags)     CPUEXT_SUFFIX_FAST(flags, _INLINE, SSE2)
92cabdff1aSopenharmony_ci#define INLINE_SSE2_SLOW(flags)     CPUEXT_SUFFIX_SLOW(flags, _INLINE, SSE2)
93cabdff1aSopenharmony_ci#define INLINE_SSE3(flags)          CPUEXT_SUFFIX(flags, _INLINE, SSE3)
94cabdff1aSopenharmony_ci#define INLINE_SSE3_FAST(flags)     CPUEXT_SUFFIX_FAST(flags, _INLINE, SSE3)
95cabdff1aSopenharmony_ci#define INLINE_SSE3_SLOW(flags)     CPUEXT_SUFFIX_SLOW(flags, _INLINE, SSE3)
96cabdff1aSopenharmony_ci#define INLINE_SSSE3(flags)         CPUEXT_SUFFIX(flags, _INLINE, SSSE3)
97cabdff1aSopenharmony_ci#define INLINE_SSSE3_FAST(flags)    CPUEXT_SUFFIX_FAST(flags, _INLINE, SSSE3)
98cabdff1aSopenharmony_ci#define INLINE_SSSE3_SLOW(flags)    CPUEXT_SUFFIX_SLOW(flags, _INLINE, SSSE3)
99cabdff1aSopenharmony_ci#define INLINE_SSE4(flags)          CPUEXT_SUFFIX(flags, _INLINE, SSE4)
100cabdff1aSopenharmony_ci#define INLINE_SSE42(flags)         CPUEXT_SUFFIX(flags, _INLINE, SSE42)
101cabdff1aSopenharmony_ci#define INLINE_AVX(flags)           CPUEXT_SUFFIX(flags, _INLINE, AVX)
102cabdff1aSopenharmony_ci#define INLINE_AVX_FAST(flags)      CPUEXT_SUFFIX_FAST(flags, _INLINE, AVX)
103cabdff1aSopenharmony_ci#define INLINE_AVX_SLOW(flags)      CPUEXT_SUFFIX_SLOW(flags, _INLINE, AVX)
104cabdff1aSopenharmony_ci#define INLINE_XOP(flags)           CPUEXT_SUFFIX(flags, _INLINE, XOP)
105cabdff1aSopenharmony_ci#define INLINE_FMA3(flags)          CPUEXT_SUFFIX(flags, _INLINE, FMA3)
106cabdff1aSopenharmony_ci#define INLINE_FMA4(flags)          CPUEXT_SUFFIX(flags, _INLINE, FMA4)
107cabdff1aSopenharmony_ci#define INLINE_AVX2(flags)          CPUEXT_SUFFIX(flags, _INLINE, AVX2)
108cabdff1aSopenharmony_ci#define INLINE_AESNI(flags)         CPUEXT_SUFFIX(flags, _INLINE, AESNI)
109cabdff1aSopenharmony_ci
110cabdff1aSopenharmony_civoid ff_cpu_cpuid(int index, int *eax, int *ebx, int *ecx, int *edx);
111cabdff1aSopenharmony_civoid ff_cpu_xgetbv(int op, int *eax, int *edx);
112cabdff1aSopenharmony_ciint  ff_cpu_cpuid_test(void);
113cabdff1aSopenharmony_ci
114cabdff1aSopenharmony_ci#endif /* AVUTIL_X86_CPU_H */
115