+ has_sse2_support for i386

+ has_sse3_support for i386

git-svn-id: trunk@25287 -
This commit is contained in:
florian 2013-08-18 18:54:56 +00:00
parent 10db067372
commit bb397e2b2f
2 changed files with 22 additions and 7 deletions

View File

@ -50,9 +50,9 @@ function cpuid_support : boolean;assembler;
{$asmmode ATT}
function sse_support : boolean;
procedure check_sse_support;
var
_edx : longint;
_ecx,_edx : longint;
begin
if cpuid_support then
begin
@ -61,13 +61,20 @@ function sse_support : boolean;
movl $1,%eax
cpuid
movl %edx,_edx
movl %ecx,_ecx
popl %ebx
end;
sse_support:=((_edx and $2000000)<>0) and os_supports_sse;
has_sse_support:=((_edx and $2000000)<>0) and os_supports_sse;
has_sse2_support:=((_edx and $4000000)<>0) and os_supports_sse;
has_sse3_support:=((_ecx and $200)<>0) and os_supports_sse;
end
else
{ a cpu with without cpuid instruction supports never sse }
sse_support:=false;
begin
{ a cpu with without cpuid instruction supports never sse }
has_sse_support:=false;
has_sse2_support:=false;
has_sse3_support:=false;
end;
end;
@ -1424,7 +1431,8 @@ Procedure SysResetFPU;
procedure fpc_cpucodeinit;
begin
os_supports_sse:=true;
os_supports_sse:=sse_support;
check_sse_support;
os_supports_sse:=has_sse_support;
if os_supports_sse then
begin
sse_check:=true;
@ -1437,6 +1445,11 @@ procedure fpc_cpucodeinit;
sse_check:=false;
end;
has_sse_support:=os_supports_sse;
if not(has_sse_support) then
begin
has_sse2_support:=false;
has_sse3_support:=false;
end;
{ don't let libraries influence the FPU cw set by the host program }
if has_sse_support and
IsLibrary then
@ -1611,4 +1624,4 @@ asm
sarl %cl,%eax
.Lexit:
end;
{$endif FPC_SYSTEM_HAS_SAR_QWORD}
{$endif FPC_SYSTEM_HAS_SAR_QWORD}

View File

@ -573,6 +573,8 @@ const
Test8087 : byte = 3;
{ will be detected at startup }
has_sse_support : boolean = false;
has_sse2_support : boolean = false;
has_sse3_support : boolean = false;
has_mmx_support : boolean = false;
{$endif cpui386}
{$ifdef cpui8086}