mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-25 00:51:29 +02:00
+ has_sse2_support for i386
+ has_sse3_support for i386 git-svn-id: trunk@25287 -
This commit is contained in:
parent
10db067372
commit
bb397e2b2f
@ -50,9 +50,9 @@ function cpuid_support : boolean;assembler;
|
|||||||
|
|
||||||
{$asmmode ATT}
|
{$asmmode ATT}
|
||||||
|
|
||||||
function sse_support : boolean;
|
procedure check_sse_support;
|
||||||
var
|
var
|
||||||
_edx : longint;
|
_ecx,_edx : longint;
|
||||||
begin
|
begin
|
||||||
if cpuid_support then
|
if cpuid_support then
|
||||||
begin
|
begin
|
||||||
@ -61,13 +61,20 @@ function sse_support : boolean;
|
|||||||
movl $1,%eax
|
movl $1,%eax
|
||||||
cpuid
|
cpuid
|
||||||
movl %edx,_edx
|
movl %edx,_edx
|
||||||
|
movl %ecx,_ecx
|
||||||
popl %ebx
|
popl %ebx
|
||||||
end;
|
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
|
end
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
{ a cpu with without cpuid instruction supports never sse }
|
{ a cpu with without cpuid instruction supports never sse }
|
||||||
sse_support:=false;
|
has_sse_support:=false;
|
||||||
|
has_sse2_support:=false;
|
||||||
|
has_sse3_support:=false;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1424,7 +1431,8 @@ Procedure SysResetFPU;
|
|||||||
procedure fpc_cpucodeinit;
|
procedure fpc_cpucodeinit;
|
||||||
begin
|
begin
|
||||||
os_supports_sse:=true;
|
os_supports_sse:=true;
|
||||||
os_supports_sse:=sse_support;
|
check_sse_support;
|
||||||
|
os_supports_sse:=has_sse_support;
|
||||||
if os_supports_sse then
|
if os_supports_sse then
|
||||||
begin
|
begin
|
||||||
sse_check:=true;
|
sse_check:=true;
|
||||||
@ -1437,6 +1445,11 @@ procedure fpc_cpucodeinit;
|
|||||||
sse_check:=false;
|
sse_check:=false;
|
||||||
end;
|
end;
|
||||||
has_sse_support:=os_supports_sse;
|
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 }
|
{ don't let libraries influence the FPU cw set by the host program }
|
||||||
if has_sse_support and
|
if has_sse_support and
|
||||||
IsLibrary then
|
IsLibrary then
|
||||||
|
|||||||
@ -573,6 +573,8 @@ const
|
|||||||
Test8087 : byte = 3;
|
Test8087 : byte = 3;
|
||||||
{ will be detected at startup }
|
{ will be detected at startup }
|
||||||
has_sse_support : boolean = false;
|
has_sse_support : boolean = false;
|
||||||
|
has_sse2_support : boolean = false;
|
||||||
|
has_sse3_support : boolean = false;
|
||||||
has_mmx_support : boolean = false;
|
has_mmx_support : boolean = false;
|
||||||
{$endif cpui386}
|
{$endif cpui386}
|
||||||
{$ifdef cpui8086}
|
{$ifdef cpui8086}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user