Skip to content
Snippets Groups Projects
Commit 9a6c1bcf authored by Lyndon Brown's avatar Lyndon Brown
Browse files

cpu: purge obsolete cpuid instruction support check

the `cpuid` instruction was introduced back in 1993 (according to
wikipedia). we can thus safely assume that this exists on all platforms we
care about.

this also removes the obsolete ability to bypass the level=0 check for
certain very old cpus.
parent 321afe4f
No related branches found
No related tags found
No related merge requests found
......@@ -132,39 +132,11 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
: "a" (reg) \
: "cc");
# endif
/* Check if the OS really supports the requested instructions */
# if defined (__i386__) && !defined (__i486__) && !defined (__i586__) \
&& !defined (__i686__) && !defined (__pentium4__) \
&& !defined (__k6__) && !defined (__athlon__) && !defined (__k8__)
/* check if cpuid instruction is supported */
asm volatile ("push %%ebx\n\t"
"pushf\n\t"
"pop %%eax\n\t"
"movl %%eax, %%ebx\n\t"
"xorl $0x200000, %%eax\n\t"
"push %%eax\n\t"
"popf\n\t"
"pushf\n\t"
"pop %%eax\n\t"
"movl %%ebx,%1\n\t"
"pop %%ebx\n\t"
: "=a" (i_eax), "=r" (i_ebx)
:
: "cc" );
if( i_eax == i_ebx )
return 0;
# endif
/* the CPU supports the CPUID instruction - get its level */
/* Get cpuid level */
cpuid( 0x00000000 );
# if defined (__i386__) && !defined (__i586__) \
&& !defined (__i686__) && !defined (__pentium4__) \
&& !defined (__k6__) && !defined (__athlon__) && !defined (__k8__)
if( !i_eax )
return 0;
#endif
cpuid( 0x00000001 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment