+ routines to test for AVX512VNNI and AVX512BITALG support

This commit is contained in:
florian 2022-01-21 18:22:28 +01:00
parent 7238985091
commit 2e8321e0fa
3 changed files with 59 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 AVX512VNNISupport: boolean;inline;
function AVX512BITALGSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
function ADXSupport: boolean;inline;
function SHASupport: boolean;inline;
@ -78,6 +80,8 @@ unit cpu;
_AVX512CDSupport,
_AVX512BWSupport,
_AVX512VLSupport,
_AVX512VNNISupport,
_AVX512BITALGSupport,
_RDSEEDSupport,
_ADXSupport,
_SHASupport,
@ -261,6 +265,8 @@ unit cpu;
_AVX512ERSupport:=(_ebx and $8000000)<>0;
_AVX512CDSupport:=(_ebx and $10000000)<>0;
_AVX512BWSupport:=(_ebx and $40000000)<>0;
_AVX512VNNISupport:=(_ecx and $00000800)<>0;
_AVX512BITALGSupport:=(_ecx and $00001000)<>0;
_SHASupport:=(_ebx and $20000000)<>0;
_AVX512VLSupport:=(_ebx and $80000000)<>0;
_BMI1Support:=(_ebx and $8)<>0;
@ -345,6 +351,18 @@ unit cpu;
end;
function AVX512VNNISupport: boolean;inline;
begin
result:=_AVX512VNNISupport;
end;
function AVX512BITALGSupport: boolean;inline;
begin
result:=_AVX512BITALGSupport;
end;
function RDSEEDSupport: boolean;inline;
begin
result:=_RDSEEDSupport;

View File

@ -40,6 +40,8 @@ unit cpu;
function AVX512CDSupport: boolean;inline;
function AVX512BWSupport: boolean;inline;
function AVX512VLSupport: boolean;inline;
function AVX512VNNISupport: boolean;inline;
function AVX512BITALGSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
function ADXSupport: boolean;inline;
function SHASupport: boolean;inline;
@ -77,6 +79,8 @@ unit cpu;
_AVX512CDSupport,
_AVX512BWSupport,
_AVX512VLSupport,
_AVX512VNNISupport,
_AVX512BITALGSupport,
_RDSEEDSupport,
_ADXSupport,
_SHASupport,
@ -237,6 +241,8 @@ unit cpu;
_SHASupport:=(_ebx and $20000000)<>0;
_AVX512BWSupport:=(_ebx and $40000000)<>0;
_AVX512VLSupport:=(_ebx and $80000000)<>0;
_AVX512VNNISupport:=(_ecx and $00000800)<>0;
_AVX512BITALGSupport:=(_ecx and $00001000)<>0;
_BMI1Support:=(_ebx and $8)<>0;
_BMI2Support:=(_ebx and $100)<>0;
_RTMSupport:=(_ebx and $800)<>0;
@ -316,6 +322,18 @@ unit cpu;
end;
function AVX512VNNISupport: boolean;inline;
begin
result:=_AVX512VNNISupport;
end;
function AVX512BITALGSupport: boolean;inline;
begin
result:=_AVX512BITALGSupport;
end;
function RDSEEDSupport: boolean;inline;
begin
result:=_RDSEEDSupport;

View File

@ -24,7 +24,7 @@ begin
end
else
writeln('no');
write('AVXF512 support: ');
write('AVX512F support: ');
if AVX512FSupport then
begin
writeln('yes');
@ -35,6 +35,28 @@ begin
end
else
writeln('no');
write('AVX512VNNI support: ');
if AVX512VNNISupport then
begin
writeln('yes');
asm
// vpxor %ymm0,%ymm0,%ymm0
// vaddpd %zmm0,%zmm0,%zmm0
end;
end
else
writeln('no');
write('AVX512BITALG support: ');
if AVX512BITALGSupport then
begin
writeln('yes');
asm
//vpxor %ymm0,%ymm0,%ymm0
//vaddpd %zmm0,%zmm0,%zmm0
end;
end
else
writeln('no');
write('FMA support: ');
if FMASupport then
begin