endprologue
// First, check that this is even a thing, using the complicated
- // dance with the flags register.
+ // dance with the flags register. This is unnecessary on AMD64,
+ // which postdates the introduction of `cpuid'.
+#if CPUFAM_X86
pushf
pop DX // current flags in d
pop DX
test edx, EFLAGS_ID
jnz 8f
+#endif
// OK, that seemed to work.
cpuid
ret
// Failed.
+#if CPUFAM_X86
8: xor eax, eax
mov [OUT + 0], eax
mov [OUT + 4], eax
mov [OUT + 12], eax
mov eax, -1
jmp 9b
+#endif
ENDFUNC
///--------------------------------------------------------------------------
#if CPUFAM_X86
# define Z_OUT edi
- mov edi, [esp + 4]
- mov ecx, [esp + 8]
+ pushreg edi
+ mov edi, [esp + 8]
+ mov ecx, [esp + 12]
#endif
#if CPUFAM_AMD64 && ABI_SYSV
# define Z_OUT rdi
mov [Z_OUT + 0], eax
mov [Z_OUT + 4], edx
+#if CPUFAM_X86
+ popreg edi
+#endif
ret
#undef Z_OUT