This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -977,21 +977,18 @@ 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
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
995
992
" : " =a" (flags);
996
993
}
997
994
}
You can’t perform that action at this time.
0 commit comments