Merge pull request #899 from devnexen/i386_build_fix
Preserves EBX manually for the i386 architecture with PIC builds.
This commit is contained in:
commit
502e02a2df
@ -16,6 +16,11 @@ namespace spades {
|
||||
std::array<uint32_t, 4> regs;
|
||||
#ifdef WIN32
|
||||
__cpuid(reinterpret_cast<int *>(regs.data()), a);
|
||||
#else
|
||||
#if defined(__i386__) && (defined(__pic__) || defined(__PIC__))
|
||||
asm volatile("mov %%ebx, %%edi\ncpuid\nxchg %%edi, %%ebx\n"
|
||||
: "=a"(regs[0]), "=D"(regs[1]), "=c"(regs[2]), "=d"(regs[2])
|
||||
: "a"(a), "c"(0));
|
||||
#else
|
||||
asm volatile("cpuid"
|
||||
: "=a"(regs[0]), "=b"(regs[1]), "=c"(regs[2]), "=d"(regs[3])
|
||||
|
Loading…
x
Reference in New Issue
Block a user