Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
54b24314
Commit
54b24314
authored
Oct 04, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86: cpu: Break out test for cpuid capabilities into separate function
parent
cc5e9e5f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
cpu.c
libavutil/x86/cpu.c
+21
-11
No files found.
libavutil/x86/cpu.c
View file @
54b24314
...
...
@@ -86,16 +86,14 @@
#endif
/* HAVE_INLINE_ASM */
/* Function to test if multimedia instructions are supported... */
int
ff_get_cpu_flags_x86
(
void
)
{
int
rval
=
0
;
int
eax
,
ebx
,
ecx
,
edx
;
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
;
#if ARCH_X86_64
#define cpuid_test() 1
#if ARCH_X86_32
#elif HAVE_INLINE_ASM || HAVE_RWEFLAGS
static
int
cpuid_test
(
void
)
{
x86_reg
a
,
c
;
/* Check if CPUID is supported by attempting to toggle the ID bit in
...
...
@@ -104,10 +102,22 @@ int ff_get_cpu_flags_x86(void)
set_eflags
(
a
^
0x200000
);
get_eflags
(
c
);
if
(
a
==
c
)
return
0
;
/* CPUID not supported */
return
a
!=
c
;
}
#endif
/* Function to test if multimedia instructions are supported... */
int
ff_get_cpu_flags_x86
(
void
)
{
int
rval
=
0
;
int
eax
,
ebx
,
ecx
,
edx
;
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
;
if
(
!
cpuid_test
())
return
0
;
/* CPUID not supported */
cpuid
(
0
,
max_std_level
,
vendor
.
i
[
0
],
vendor
.
i
[
2
],
vendor
.
i
[
1
]);
if
(
max_std_level
>=
1
)
{
...
...
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