|
@@ -46,6 +46,7 @@ unit cpu;
|
|
|
function SHASupport: boolean;inline;
|
|
|
function FMASupport: boolean;inline;
|
|
|
function POPCNTSupport: boolean;inline;
|
|
|
+ function LZCNTSupport: boolean;inline;
|
|
|
function SSE41Support: boolean;inline;
|
|
|
function SSE42Support: boolean;inline;
|
|
|
function MOVBESupport: boolean;inline;
|
|
@@ -78,6 +79,7 @@ unit cpu;
|
|
|
_SHASupport,
|
|
|
_FMASupport,
|
|
|
_POPCNTSupport,
|
|
|
+ _LZCNTSupport,
|
|
|
_SSE41Support,
|
|
|
_SSE42Support,
|
|
|
_MOVBESupport,
|
|
@@ -185,7 +187,7 @@ unit cpu;
|
|
|
|
|
|
procedure SetupSupport;
|
|
|
var
|
|
|
- _ecx,_ebx,maxcpuidvalue : longint;
|
|
|
+ _edx,_ecx,_ebx,maxcpuidvalue : longint;
|
|
|
begin
|
|
|
is_sse3_cpu:=false;
|
|
|
if cpuid_support then
|
|
@@ -224,6 +226,17 @@ unit cpu;
|
|
|
|
|
|
_FMASupport:=_AVXSupport and ((_ecx and $1000)<>0);
|
|
|
|
|
|
+ asm
|
|
|
+ pushl %ebx
|
|
|
+ movl $0x80000001,%eax
|
|
|
+ cpuid
|
|
|
+ movl %ecx,_ecx
|
|
|
+ movl %edx,_edx
|
|
|
+ popl %ebx
|
|
|
+ end;
|
|
|
+ _LZCNTSupport:=(_ecx and $20)<>0;
|
|
|
+
|
|
|
+
|
|
|
if maxcpuidvalue>=7 then
|
|
|
begin
|
|
|
asm
|
|
@@ -344,6 +357,12 @@ unit cpu;
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ function LZCNTSupport: boolean;inline;
|
|
|
+ begin
|
|
|
+ result:=_LZCNTSupport;
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
function SSE41Support: boolean;inline;
|
|
|
begin
|
|
|
result:=_SSE41Support;
|