Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4783a01c
Commit
4783a01c
authored
Oct 26, 2017
by
James Darnley
Committed by
James Darnley
Dec 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil: detect when AVX-512 is available
parent
8b81eabe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
cpu.c
libavutil/x86/cpu.c
+10
-2
No files found.
libavutil/x86/cpu.c
View file @
4783a01c
...
...
@@ -97,6 +97,7 @@ int ff_get_cpu_flags_x86(void)
int
max_std_level
,
max_ext_level
,
std_caps
=
0
,
ext_caps
=
0
;
int
family
=
0
,
model
=
0
;
union
{
int
i
[
3
];
char
c
[
12
];
}
vendor
;
int
xcr0_lo
=
0
,
xcr0_hi
=
0
;
if
(
!
cpuid_test
())
return
0
;
/* CPUID not supported */
...
...
@@ -132,8 +133,8 @@ int ff_get_cpu_flags_x86(void)
/* Check OXSAVE and AVX bits */
if
((
ecx
&
0x18000000
)
==
0x18000000
)
{
/* Check for OS support */
xgetbv
(
0
,
eax
,
edx
);
if
((
eax
&
0x6
)
==
0x6
)
{
xgetbv
(
0
,
xcr0_lo
,
xcr0_hi
);
if
((
xcr0_lo
&
0x6
)
==
0x6
)
{
rval
|=
AV_CPU_FLAG_AVX
;
if
(
ecx
&
0x00001000
)
rval
|=
AV_CPU_FLAG_FMA3
;
...
...
@@ -147,6 +148,13 @@ int ff_get_cpu_flags_x86(void)
#if HAVE_AVX2
if
((
rval
&
AV_CPU_FLAG_AVX
)
&&
(
ebx
&
0x00000020
))
rval
|=
AV_CPU_FLAG_AVX2
;
#if HAVE_AVX512
/* F, CD, BW, DQ, VL */
if
((
xcr0_lo
&
0xe0
)
==
0xe0
)
{
/* OPMASK/ZMM state */
if
((
rval
&
AV_CPU_FLAG_AVX2
)
&&
(
ebx
&
0xd0030000
)
==
0xd0030000
)
rval
|=
AV_CPU_FLAG_AVX512
;
}
#endif
/* HAVE_AVX512 */
#endif
/* HAVE_AVX2 */
/* BMI1/2 don't need OS support */
if
(
ebx
&
0x00000008
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment