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
|
.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
|
||||||
|
2
cpuid.c
2
cpuid.c
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user