Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f942343d
Commit
f942343d
authored
Oct 25, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve x86 cpuid
There is no need for hoops around EBX for non-PIC code.
parent
35a45488
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
src/misc/cpu.c
src/misc/cpu.c
+15
-22
No files found.
src/misc/cpu.c
View file @
f942343d
...
...
@@ -105,28 +105,21 @@ void vlc_CPU_init (void)
bool
b_amd
;
/* Needed for x86 CPU capabilities detection */
# if defined( __x86_64__ )
# define cpuid( reg ) \
asm volatile ( "cpuid\n\t" \
: "=a" ( i_eax ), \
"=b" ( 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 (__i386__) && defined (__PIC__)
# define cpuid(reg) \
asm volatile ("xchgl %%ebx,%1\n\t" \
"cpuid\n\t" \
"xchgl %%ebx,%1\n\t" \
: "=a" (i_eax), "=r" (i_ebx), "=c" (i_ecx), "=d" (i_edx) \
: "a" (reg) \
: "cc");
# else
# define cpuid(reg) \
asm volatile ("cpuid\n\t" \
: "=a" (i_eax), "=b" (i_ebx), "=c" (i_ecx), "=d" (i_edx) \
: "a" (reg) \
: "cc");
# endif
/* Check if the OS really supports the requested instructions */
# if defined (__i386__) && !defined (__i486__) && !defined (__i586__) \
&& !defined (__i686__) && !defined (__pentium4__) \
...
...
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