new x86_64 cpuid that works with both calling conventions
This commit is contained in:
parent
63663ab43a
commit
339fafbc28
14
config.guess
vendored
14
config.guess
vendored
@ -681,14 +681,18 @@ EOF
|
||||
.globl _cpuid
|
||||
cpuid:
|
||||
_cpuid:
|
||||
pushq %rbx
|
||||
movq %rbx,%r11
|
||||
movq %rdi,%r9
|
||||
movq %rsi,%rax
|
||||
orq %r8,%r8
|
||||
cmovne %rcx,%r9
|
||||
cmovne %rdx,%rax
|
||||
.byte 0x0f
|
||||
.byte 0xa2
|
||||
movl %ebx,(%rdi)
|
||||
movl %edx,4(%rdi)
|
||||
movl %ecx,8(%rdi)
|
||||
popq %rbx
|
||||
movl %ebx,(%r9)
|
||||
movl %edx,4(%r9)
|
||||
movl %ecx,8(%r9)
|
||||
movq %r11,%rbx
|
||||
ret
|
||||
EOF
|
||||
cat <<EOF >${dummy}32.c
|
||||
|
2
cpuid.c
2
cpuid.c
@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA.
|
||||
#if CONFIG_GUESS
|
||||
// use's the stringinzing directive #x ie #x expands to "x"
|
||||
#define CPUIS(x) modelstr=#x
|
||||
#define __gmpn_cpuid cpuid
|
||||
#define __gmpn_cpuid(_x,_y) cpuid(_x,_y,1,0,0)
|
||||
#endif
|
||||
#if INFAT
|
||||
#define CPUIS(x) do{TRACE(printf(" "#x"\n"));CPUSETUP_##x;}while(0)
|
||||
|
Loading…
Reference in New Issue
Block a user