|
@@ -43,6 +43,7 @@ unit cpu;
|
|
function SHASupport: boolean;inline;
|
|
function SHASupport: boolean;inline;
|
|
function FMASupport: boolean;inline;
|
|
function FMASupport: boolean;inline;
|
|
function POPCNTSupport: boolean;inline;
|
|
function POPCNTSupport: boolean;inline;
|
|
|
|
+ function LZCNTSupport: boolean;inline;
|
|
function SSE41Support: boolean;inline;
|
|
function SSE41Support: boolean;inline;
|
|
function SSE42Support: boolean;inline;
|
|
function SSE42Support: boolean;inline;
|
|
function MOVBESupport: boolean;inline;
|
|
function MOVBESupport: boolean;inline;
|
|
@@ -77,6 +78,7 @@ unit cpu;
|
|
_SHASupport,
|
|
_SHASupport,
|
|
_FMASupport,
|
|
_FMASupport,
|
|
_POPCNTSupport,
|
|
_POPCNTSupport,
|
|
|
|
+ _LZCNTSupport,
|
|
_SSE41Support,
|
|
_SSE41Support,
|
|
_SSE42Support,
|
|
_SSE42Support,
|
|
_MOVBESupport,
|
|
_MOVBESupport,
|
|
@@ -167,6 +169,7 @@ unit cpu;
|
|
|
|
|
|
procedure SetupSupport;
|
|
procedure SetupSupport;
|
|
var
|
|
var
|
|
|
|
+ _edx,
|
|
_ecx,
|
|
_ecx,
|
|
_ebx,maxcpuidvalue : longint;
|
|
_ebx,maxcpuidvalue : longint;
|
|
begin
|
|
begin
|
|
@@ -201,6 +204,14 @@ unit cpu;
|
|
|
|
|
|
_FMASupport:=_AVXSupport and ((_ecx and $1000)<>0);
|
|
_FMASupport:=_AVXSupport and ((_ecx and $1000)<>0);
|
|
|
|
|
|
|
|
+ asm
|
|
|
|
+ movl $0x80000001,%eax
|
|
|
|
+ cpuid
|
|
|
|
+ movl %ecx,_ecx
|
|
|
|
+ movl %edx,_edx
|
|
|
|
+ end;
|
|
|
|
+ _LZCNTSupport:=(_ecx and $20)<>0;
|
|
|
|
+
|
|
{ very early x86-64 CPUs might not support eax=7 }
|
|
{ very early x86-64 CPUs might not support eax=7 }
|
|
if maxcpuidvalue>=7 then
|
|
if maxcpuidvalue>=7 then
|
|
begin
|
|
begin
|
|
@@ -316,6 +327,13 @@ unit cpu;
|
|
result:=_POPCNTSupport;
|
|
result:=_POPCNTSupport;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ function LZCNTSupport: boolean;inline;
|
|
|
|
+ begin
|
|
|
|
+ result:=_LZCNTSupport;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
function SSE41Support: boolean;inline;
|
|
function SSE41Support: boolean;inline;
|
|
begin
|
|
begin
|
|
result:=_SSE41Support;
|
|
result:=_SSE41Support;
|