@@ -954,7 +954,7 @@ void cpuidX86()
954
954
955
955
if (cf.probablyAMD && max_extended_cpuid >= 0x8000_001E) {
956
956
version (GNU_OR_LDC) asm pure nothrow @nogc {
957
- " cpuid" : " =a" a , " =b" b : " a" 0x8000_001E : " ecx" , " edx" ;
957
+ " cpuid" : " =a" (a) , " =b" (b) : " a" ( 0x8000_001E) : " ecx" , " edx" ;
958
958
} else {
959
959
asm pure nothrow @nogc {
960
960
mov EAX , 0x8000_001e;
@@ -977,22 +977,19 @@ bool hasCPUID()
977
977
else
978
978
{
979
979
uint flags;
980
- version (GNU )
980
+ version (GNU_OR_LDC )
981
981
{
982
982
// http://wiki.osdev.org/CPUID#Checking_CPUID_availability
983
- // ASM template supports both AT&T and Intel syntax.
984
983
asm nothrow @nogc { "
985
- pushf{l|d} # Save EFLAGS
986
- pushf{l|d} # Store EFLAGS
987
- xor{l $0x00200000, (%%esp)| dword ptr [esp], 0x00200000}
988
- # Invert the ID bit in stored EFLAGS
989
- popf{l|d} # Load stored EFLAGS (with ID bit inverted)
990
- pushf{l|d} # Store EFLAGS again (ID bit may or may not be inverted)
991
- pop {%%}eax # eax = modified EFLAGS (ID bit may or may not be inverted)
992
- xor {(%%esp), %%eax|eax, [esp]}
993
- # eax = whichever bits were changed
994
- popf{l|d} # Restore original EFLAGS
995
- " : " =a" flags;
984
+ pushfl # Save EFLAGS
985
+ pushfl # Store EFLAGS
986
+ xorl $0x00200000, (%%esp) # Invert the ID bit in stored EFLAGS
987
+ popfl # Load stored EFLAGS (with ID bit inverted)
988
+ pushfl # Store EFLAGS again (ID bit may or may not be inverted)
989
+ popl %%eax # eax = modified EFLAGS (ID bit may or may not be inverted)
990
+ xorl (%%esp), %%eax # eax = whichever bits were changed
991
+ popfl # Restore original EFLAGS
992
+ " : " =a" (flags);
996
993
}
997
994
}
998
995
else version (D_InlineAsm_X86 )
0 commit comments