Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
5077a231
Commit
5077a231
authored
Jul 06, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/cpu.c: Fixed the use of cpuid() on amd64 (thanks to Aison on
IRC).
parent
d1667dd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
src/misc/cpu.c
src/misc/cpu.c
+33
-14
No files found.
src/misc/cpu.c
View file @
5077a231
...
...
@@ -84,17 +84,31 @@ uint32_t CPUCapabilities( void )
volatile
vlc_bool_t
b_amd
;
/* Needed for x86 CPU capabilities detection */
# define cpuid( reg ) \
asm volatile ( "push %%ebx\n\t" \
"cpuid\n\t" \
"movl %%ebx,%1\n\t" \
"pop %%ebx\n\t" \
: "=a" ( i_eax ), \
"=r" ( i_ebx ), \
"=c" ( i_ecx ), \
"=d" ( i_edx ) \
: "a" ( reg ) \
: "cc" );
# if defined( __x86_64__ )
# define cpuid( reg ) \
asm volatile ( "push %%rbx\n\t" \
"cpuid\n\t" \
"movl %%ebx,%1\n\t" \
"pop %%rbx\n\t" \
: "=a" ( i_eax ), \
"=r" ( i_ebx ), \
"=c" ( i_ecx ), \
"=d" ( i_edx ) \
: "a" ( reg ) \
: "cc" );
# else
# define cpuid( reg ) \
asm volatile ( "push %%ebx\n\t" \
"cpuid\n\t" \
"movl %%ebx,%1\n\t" \
"pop %%ebx\n\t" \
: "=a" ( i_eax ), \
"=r" ( i_ebx ), \
"=c" ( i_ecx ), \
"=d" ( i_edx ) \
: "a" ( reg ) \
: "cc" );
# endif
# if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW ) \
&& defined( HAVE_SIGNAL_H )
...
...
@@ -103,6 +117,8 @@ uint32_t CPUCapabilities( void )
i_capabilities
|=
CPU_CAPABILITY_FPU
;
# if defined( __i386__ )
/* check if cpuid instruction is supported */
asm
volatile
(
"push %%ebx
\n\t
"
"pushf
\n\t
"
"pop %%eax
\n\t
"
...
...
@@ -121,12 +137,15 @@ uint32_t CPUCapabilities( void )
if
(
i_eax
==
i_ebx
)
{
# if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW ) \
&& defined( HAVE_SIGNAL_H )
#
if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW ) \
&& defined( HAVE_SIGNAL_H )
signal
(
SIGILL
,
pf_sigill
);
# endif
#
endif
return
i_capabilities
;
}
# else
/* x86_64 supports cpuid instruction, so we dont need to check it */
# endif
i_capabilities
|=
CPU_CAPABILITY_486
;
...
...
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