mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 09:23:48 +02:00
+ x86: ADXSupport
+ x86: RDSEEDSupport
This commit is contained in:
parent
983fbff871
commit
4aebfe97a9
@ -43,6 +43,8 @@ unit cpu;
|
|||||||
function AVX512CDSupport: boolean;inline;
|
function AVX512CDSupport: boolean;inline;
|
||||||
function AVX512BWSupport: boolean;inline;
|
function AVX512BWSupport: boolean;inline;
|
||||||
function AVX512VLSupport: boolean;inline;
|
function AVX512VLSupport: boolean;inline;
|
||||||
|
function RDSEEDSupport: boolean;inline;
|
||||||
|
function ADXSupport: boolean;inline;
|
||||||
function SHASupport: boolean;inline;
|
function SHASupport: boolean;inline;
|
||||||
function FMASupport: boolean;inline;
|
function FMASupport: boolean;inline;
|
||||||
function POPCNTSupport: boolean;inline;
|
function POPCNTSupport: boolean;inline;
|
||||||
@ -76,6 +78,8 @@ unit cpu;
|
|||||||
_AVX512CDSupport,
|
_AVX512CDSupport,
|
||||||
_AVX512BWSupport,
|
_AVX512BWSupport,
|
||||||
_AVX512VLSupport,
|
_AVX512VLSupport,
|
||||||
|
_RDSEEDSupport,
|
||||||
|
_ADXSupport,
|
||||||
_SHASupport,
|
_SHASupport,
|
||||||
_FMASupport,
|
_FMASupport,
|
||||||
_POPCNTSupport,
|
_POPCNTSupport,
|
||||||
@ -250,6 +254,8 @@ unit cpu;
|
|||||||
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
||||||
_AVX512FSupport:=(_ebx and $10000)<>0;
|
_AVX512FSupport:=(_ebx and $10000)<>0;
|
||||||
_AVX512DQSupport:=(_ebx and $20000)<>0;
|
_AVX512DQSupport:=(_ebx and $20000)<>0;
|
||||||
|
_RDSEEDSupport:=(_ebx and $40000)<>0;
|
||||||
|
_ADXSupport:=(_ebx and $80000)<>0;
|
||||||
_AVX512IFMASupport:=(_ebx and $200000)<>0;
|
_AVX512IFMASupport:=(_ebx and $200000)<>0;
|
||||||
_AVX512PFSupport:=(_ebx and $4000000)<>0;
|
_AVX512PFSupport:=(_ebx and $4000000)<>0;
|
||||||
_AVX512ERSupport:=(_ebx and $8000000)<>0;
|
_AVX512ERSupport:=(_ebx and $8000000)<>0;
|
||||||
@ -339,6 +345,18 @@ unit cpu;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function RDSEEDSupport: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_RDSEEDSupport;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ADXSupport: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_ADXSupport;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function SHASupport: boolean;inline;
|
function SHASupport: boolean;inline;
|
||||||
begin
|
begin
|
||||||
result:=_SHASupport;
|
result:=_SHASupport;
|
||||||
|
@ -39,7 +39,9 @@ unit cpu;
|
|||||||
function AVX512ERSupport: boolean;inline;
|
function AVX512ERSupport: boolean;inline;
|
||||||
function AVX512CDSupport: boolean;inline;
|
function AVX512CDSupport: boolean;inline;
|
||||||
function AVX512BWSupport: boolean;inline;
|
function AVX512BWSupport: boolean;inline;
|
||||||
function AVX512VLSupport: boolean;inline;
|
function AVX512VLSupport: boolean;inline;
|
||||||
|
function RDSEEDSupport: boolean;inline;
|
||||||
|
function ADXSupport: boolean;inline;
|
||||||
function SHASupport: boolean;inline;
|
function SHASupport: boolean;inline;
|
||||||
function FMASupport: boolean;inline;
|
function FMASupport: boolean;inline;
|
||||||
function POPCNTSupport: boolean;inline;
|
function POPCNTSupport: boolean;inline;
|
||||||
@ -75,6 +77,8 @@ unit cpu;
|
|||||||
_AVX512CDSupport,
|
_AVX512CDSupport,
|
||||||
_AVX512BWSupport,
|
_AVX512BWSupport,
|
||||||
_AVX512VLSupport,
|
_AVX512VLSupport,
|
||||||
|
_RDSEEDSupport,
|
||||||
|
_ADXSupport,
|
||||||
_SHASupport,
|
_SHASupport,
|
||||||
_FMASupport,
|
_FMASupport,
|
||||||
_POPCNTSupport,
|
_POPCNTSupport,
|
||||||
@ -224,6 +228,8 @@ unit cpu;
|
|||||||
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
||||||
_AVX512FSupport:=(_ebx and $10000)<>0;
|
_AVX512FSupport:=(_ebx and $10000)<>0;
|
||||||
_AVX512DQSupport:=(_ebx and $20000)<>0;
|
_AVX512DQSupport:=(_ebx and $20000)<>0;
|
||||||
|
_RDSEEDSupport:=(_ebx and $40000)<>0;
|
||||||
|
_ADXSupport:=(_ebx and $80000)<>0;
|
||||||
_AVX512IFMASupport:=(_ebx and $200000)<>0;
|
_AVX512IFMASupport:=(_ebx and $200000)<>0;
|
||||||
_AVX512PFSupport:=(_ebx and $4000000)<>0;
|
_AVX512PFSupport:=(_ebx and $4000000)<>0;
|
||||||
_AVX512ERSupport:=(_ebx and $8000000)<>0;
|
_AVX512ERSupport:=(_ebx and $8000000)<>0;
|
||||||
@ -310,6 +316,18 @@ unit cpu;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function RDSEEDSupport: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_RDSEEDSupport;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ADXSupport: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_ADXSupport;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function SHASupport: boolean;inline;
|
function SHASupport: boolean;inline;
|
||||||
begin
|
begin
|
||||||
result:=_SHASupport;
|
result:=_SHASupport;
|
||||||
|
@ -66,5 +66,25 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
writeln('no');
|
writeln('no');
|
||||||
|
write('ADX support: ');
|
||||||
|
if ADXSupport then
|
||||||
|
begin
|
||||||
|
writeln('yes');
|
||||||
|
asm
|
||||||
|
adcx %eax,%eax
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
writeln('no');
|
||||||
|
write('RDSEED support: ');
|
||||||
|
if RDSEEDSupport then
|
||||||
|
begin
|
||||||
|
writeln('yes');
|
||||||
|
asm
|
||||||
|
rdseed %eax
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
writeln('no');
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user