+ x86: ADXSupport

+ x86: RDSEEDSupport
This commit is contained in:
Florian Klämpfl 2022-01-03 22:50:10 +01:00
parent 983fbff871
commit 4aebfe97a9
3 changed files with 57 additions and 1 deletions

View File

@ -43,6 +43,8 @@ unit cpu;
function AVX512CDSupport: boolean;inline;
function AVX512BWSupport: boolean;inline;
function AVX512VLSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
function ADXSupport: boolean;inline;
function SHASupport: boolean;inline;
function FMASupport: boolean;inline;
function POPCNTSupport: boolean;inline;
@ -76,6 +78,8 @@ unit cpu;
_AVX512CDSupport,
_AVX512BWSupport,
_AVX512VLSupport,
_RDSEEDSupport,
_ADXSupport,
_SHASupport,
_FMASupport,
_POPCNTSupport,
@ -250,6 +254,8 @@ unit cpu;
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
_AVX512FSupport:=(_ebx and $10000)<>0;
_AVX512DQSupport:=(_ebx and $20000)<>0;
_RDSEEDSupport:=(_ebx and $40000)<>0;
_ADXSupport:=(_ebx and $80000)<>0;
_AVX512IFMASupport:=(_ebx and $200000)<>0;
_AVX512PFSupport:=(_ebx and $4000000)<>0;
_AVX512ERSupport:=(_ebx and $8000000)<>0;
@ -339,6 +345,18 @@ unit cpu;
end;
function RDSEEDSupport: boolean;inline;
begin
result:=_RDSEEDSupport;
end;
function ADXSupport: boolean;inline;
begin
result:=_ADXSupport;
end;
function SHASupport: boolean;inline;
begin
result:=_SHASupport;

View File

@ -39,7 +39,9 @@ unit cpu;
function AVX512ERSupport: boolean;inline;
function AVX512CDSupport: 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 FMASupport: boolean;inline;
function POPCNTSupport: boolean;inline;
@ -75,6 +77,8 @@ unit cpu;
_AVX512CDSupport,
_AVX512BWSupport,
_AVX512VLSupport,
_RDSEEDSupport,
_ADXSupport,
_SHASupport,
_FMASupport,
_POPCNTSupport,
@ -224,6 +228,8 @@ unit cpu;
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
_AVX512FSupport:=(_ebx and $10000)<>0;
_AVX512DQSupport:=(_ebx and $20000)<>0;
_RDSEEDSupport:=(_ebx and $40000)<>0;
_ADXSupport:=(_ebx and $80000)<>0;
_AVX512IFMASupport:=(_ebx and $200000)<>0;
_AVX512PFSupport:=(_ebx and $4000000)<>0;
_AVX512ERSupport:=(_ebx and $8000000)<>0;
@ -310,6 +316,18 @@ unit cpu;
end;
function RDSEEDSupport: boolean;inline;
begin
result:=_RDSEEDSupport;
end;
function ADXSupport: boolean;inline;
begin
result:=_ADXSupport;
end;
function SHASupport: boolean;inline;
begin
result:=_SHASupport;

View File

@ -66,5 +66,25 @@ begin
end
else
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.