Skip to content
Snippets Groups Projects
Verified Commit 484af258 authored by sezero's avatar sezero Committed by Jean-Marc Valin
Browse files

configure: adjust x86 get cpu info inline assembly method for PIC case


.. just like the way it is done in celt/x86/x86cpu.c.

Signed-off-by: default avatarJean-Marc Valin <jmvalin@jmvalin.ca>
parent f8ed894b
No related branches found
No related tags found
No related merge requests found
Pipeline #2043 passed
...@@ -691,6 +691,18 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[ ...@@ -691,6 +691,18 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[
unsigned int CPUInfo2; unsigned int CPUInfo2;
unsigned int CPUInfo3; unsigned int CPUInfo3;
unsigned int InfoType; unsigned int InfoType;
#if defined(__i386__) && defined(__PIC__)
__asm__ __volatile__ (
"xchg %%ebx, %1\n"
"cpuid\n"
"xchg %%ebx, %1\n":
"=a" (CPUInfo0),
"=r" (CPUInfo1),
"=c" (CPUInfo2),
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#else
__asm__ __volatile__ ( __asm__ __volatile__ (
"cpuid": "cpuid":
"=a" (CPUInfo0), "=a" (CPUInfo0),
...@@ -699,6 +711,7 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[ ...@@ -699,6 +711,7 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[
"=d" (CPUInfo3) : "=d" (CPUInfo3) :
"a" (InfoType), "c" (0) "a" (InfoType), "c" (0)
); );
#endif
]])], ]])],
[get_cpuid_by_asm="yes" [get_cpuid_by_asm="yes"
AC_MSG_RESULT([Inline Assembly]) AC_MSG_RESULT([Inline Assembly])
......
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