* check more cpuid flags in the cpu units

This commit is contained in:
florian 2022-04-04 22:54:45 +02:00
parent d1af2c7007
commit 6bbefcae9e
3 changed files with 58 additions and 0 deletions

View File

@ -46,6 +46,8 @@ unit cpu;
function AVX512VBMISupport: boolean;inline;
function AVX512VBMI2Support: boolean;inline;
function AVX512VNNISupport: boolean;inline;
function VAESSupport: boolean;inline;
function VCLMULSupport: boolean;inline;
function AVX512BITALGSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
function ADXSupport: boolean;inline;
@ -84,6 +86,8 @@ unit cpu;
_AVX512VLSupport,
_AVX512VBMISupport,
_AVX512VBMI2Support,
_VAESSupport,
_VCLMULSupport,
_AVX512VNNISupport,
_AVX512BITALGSupport,
_RDSEEDSupport,
@ -273,6 +277,8 @@ unit cpu;
_AVX512BWSupport:=(_ebx and $40000000)<>0;
_AVX512VBMISupport:=(_ecx and $00000002)<>0;
_AVX512VBMI2Support:=(_ecx and $00000040)<>0;
_VAESSupport:=(_ecx and $00000200)<>0;
_VCLMULSupport:=(_ecx and $00000400)<>0;
_AVX512VNNISupport:=(_ecx and $00000800)<>0;
_AVX512BITALGSupport:=(_ecx and $00001000)<>0;
_SHASupport:=(_ebx and $20000000)<>0;
@ -371,6 +377,18 @@ unit cpu;
end;
function VAESSupport: boolean;inline;
begin
result:=_VAESSupport;
end;
function VCLMULSupport: boolean;inline;
begin
result:=_VCLMULSupport;
end;
function AVX512VNNISupport: boolean;inline;
begin
result:=_AVX512VNNISupport;

View File

@ -43,6 +43,8 @@ unit cpu;
function AVX512VBMISupport: boolean;inline;
function AVX512VBMI2Support: boolean;inline;
function AVX512VNNISupport: boolean;inline;
function VAESSupport: boolean;inline;
function VCLMULSupport: boolean;inline;
function AVX512BITALGSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
function ADXSupport: boolean;inline;
@ -83,6 +85,8 @@ unit cpu;
_AVX512VLSupport,
_AVX512VBMISupport,
_AVX512VBMI2Support,
_VAESSupport,
_VCLMULSupport,
_AVX512VNNISupport,
_AVX512BITALGSupport,
_RDSEEDSupport,
@ -249,6 +253,8 @@ unit cpu;
_AVX512VLSupport:=(_ebx and $80000000)<>0;
_AVX512VBMISupport:=(_ecx and $00000002)<>0;
_AVX512VBMI2Support:=(_ecx and $00000040)<>0;
_VAESSupport:=(_ecx and $00000200)<>0;
_VCLMULSupport:=(_ecx and $00000400)<>0;
_AVX512VNNISupport:=(_ecx and $00000800)<>0;
_AVX512BITALGSupport:=(_ecx and $00001000)<>0;
_BMI1Support:=(_ebx and $8)<>0;
@ -342,6 +348,18 @@ unit cpu;
end;
function VAESSupport: boolean;inline;
begin
result:=_VAESSupport;
end;
function VCLMULSupport: boolean;inline;
begin
result:=_VCLMULSupport;
end;
function AVX512VNNISupport: boolean;inline;
begin
result:=_AVX512VNNISupport;

View File

@ -4,6 +4,17 @@ uses
cpu;
begin
write('AES support: ');
if AESSupport then
begin
writeln('yes');
asm
pxor %xmm0,%xmm0
aesenc %xmm0,%xmm0
end;
end
else
writeln('no');
write('AVX support: ');
if AVXSupport then
begin
@ -79,6 +90,17 @@ begin
end
else
writeln('no');
write('VAES support: ');
if VAESSupport then
begin
writeln('yes');
asm
vpxor %ymm0,%ymm0,%ymm0
vaesenc %ymm0,%ymm0,%ymm0
end;
end
else
writeln('no');
write('FMA support: ');
if FMASupport then
begin