mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-09 18:19:46 +01:00
* cpuid_support: translated to ATT syntax and optimized a bit.
git-svn-id: trunk@27168 -
This commit is contained in:
parent
4dfc731bdc
commit
a9b0a92873
@ -22,33 +22,27 @@ var
|
|||||||
{ this variable is set to true, if currently an sse check is executed and no sig ill should be generated }
|
{ this variable is set to true, if currently an sse check is executed and no sig ill should be generated }
|
||||||
sse_check : boolean;
|
sse_check : boolean;
|
||||||
|
|
||||||
{$asmmode intel}
|
{$asmmode ATT}
|
||||||
|
|
||||||
function cpuid_support : boolean;assembler;
|
function cpuid_support : boolean;assembler;nostackframe;
|
||||||
{
|
{
|
||||||
Check if the ID-flag can be changed, if changed then CpuID is supported.
|
Check if the ID-flag can be changed, if changed then CpuID is supported.
|
||||||
Tested under go32v1 and Linux on c6x86 with CpuID enabled and disabled (PFV)
|
Tested under go32v1 and Linux on c6x86 with CpuID enabled and disabled (PFV)
|
||||||
}
|
}
|
||||||
asm
|
asm
|
||||||
push ebx
|
pushfl
|
||||||
pushfd
|
movl (%esp),%eax
|
||||||
pushfd
|
xorl $0x200000,%eax
|
||||||
pop eax
|
pushl %eax
|
||||||
mov ebx,eax
|
popfl
|
||||||
xor eax,200000h
|
pushfl
|
||||||
push eax
|
popl %eax
|
||||||
popfd
|
xorl (%esp),%eax
|
||||||
pushfd
|
popfl
|
||||||
pop eax
|
testl $0x200000,%eax
|
||||||
popfd
|
setnz %al
|
||||||
and eax,200000h
|
|
||||||
and ebx,200000h
|
|
||||||
cmp eax,ebx
|
|
||||||
setnz al
|
|
||||||
pop ebx
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$asmmode ATT}
|
|
||||||
|
|
||||||
procedure check_sse_support;
|
procedure check_sse_support;
|
||||||
var
|
var
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user