* save/restore ebx around cpuid invocations

git-svn-id: trunk@4145 -
This commit is contained in:
Jonas Maebe 2006-07-11 20:50:44 +00:00
parent 0a9a9dd69c
commit bddcc8f902

View File

@ -70,11 +70,13 @@ unit mmx;
if cpuid_support then
begin
asm
pushl %ebx
movl $0,%eax
cpuid
movl %ebx,_ebx
movl %ecx,_ecx
movl %edx,_edx
popl %ebx
end;
if ((_ebx=$68747541) and (_ecx=$444D4163) and (_edx=$69746E65)) then getdevel:=10;
if ((_ebx=$756E6547) and (_ecx=$6C65746E) and (_edx=$49656E69)) then getdevel:=20;
@ -92,9 +94,11 @@ unit mmx;
if cpuid_support then
begin
asm
pushl %ebx
movl $1,%eax
cpuid
movl %edx,_edx
popl %ebx
end;
mmx_support:=(_edx and $800000)<>0;
end
@ -113,9 +117,11 @@ unit mmx;
if cpuid_support and (getdevel=10) then
begin
asm
pushl %ebx
movl $0x80000001,%eax
cpuid
movl %edx,_edx
popl %ebx
end;
amd_3d_support:=(_edx and $80000000)<>0;
end
@ -134,9 +140,11 @@ unit mmx;
if cpuid_support and (getdevel=10) then
begin
asm
pushl %ebx
movl $0x80000001,%eax
cpuid
movl %edx,_edx
popl %ebx
end;
amd_3d_dsp_support:=(_edx and $40000000)<>0;
end
@ -155,9 +163,11 @@ unit mmx;
if cpuid_support and (getdevel=10) then
begin
asm
pushl %ebx
movl $0x80000001,%eax
cpuid
movl %edx,_edx
popl %ebx
end;
amd_3d_mmx_support:=(_edx and $400000)<>0;
end
@ -175,9 +185,11 @@ unit mmx;
if cpuid_support then
begin
asm
pushl %ebx
movl $1,%eax
cpuid
movl %edx,_edx
popl %ebx
end;
sse_support:=(_edx and $2000000)<>0;
end
@ -195,9 +207,11 @@ unit mmx;
if cpuid_support then
begin
asm
pushl %ebx
movl $1,%eax
cpuid
movl %edx,_edx
popl %ebx
end;
sse2_support:=(_edx and $4000000)<>0;
end