new x86_64 cpuid that works with both calling conventions

This commit is contained in:
jasonmoxham 2010-08-14 14:46:32 +00:00
parent 63663ab43a
commit 339fafbc28
2 changed files with 10 additions and 6 deletions

14
config.guess vendored
View File

@ -681,14 +681,18 @@ EOF
.globl _cpuid .globl _cpuid
cpuid: cpuid:
_cpuid: _cpuid:
pushq %rbx movq %rbx,%r11
movq %rdi,%r9
movq %rsi,%rax movq %rsi,%rax
orq %r8,%r8
cmovne %rcx,%r9
cmovne %rdx,%rax
.byte 0x0f .byte 0x0f
.byte 0xa2 .byte 0xa2
movl %ebx,(%rdi) movl %ebx,(%r9)
movl %edx,4(%rdi) movl %edx,4(%r9)
movl %ecx,8(%rdi) movl %ecx,8(%r9)
popq %rbx movq %r11,%rbx
ret ret
EOF EOF
cat <<EOF >${dummy}32.c cat <<EOF >${dummy}32.c

View File

@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA.
#if CONFIG_GUESS #if CONFIG_GUESS
// use's the stringinzing directive #x ie #x expands to "x" // use's the stringinzing directive #x ie #x expands to "x"
#define CPUIS(x) modelstr=#x #define CPUIS(x) modelstr=#x
#define __gmpn_cpuid cpuid #define __gmpn_cpuid(_x,_y) cpuid(_x,_y,1,0,0)
#endif #endif
#if INFAT #if INFAT
#define CPUIS(x) do{TRACE(printf(" "#x"\n"));CPUSETUP_##x;}while(0) #define CPUIS(x) do{TRACE(printf(" "#x"\n"));CPUSETUP_##x;}while(0)