+ AVX512VBMISupport and AVX512VBMI2Support

This commit is contained in:
florian 2022-03-05 20:35:15 +01:00
parent 49f45764ec
commit 39627cbdfb
3 changed files with 58 additions and 0 deletions
rtl
i386
x86_64
tests/test/units/cpu

View File

@ -43,6 +43,8 @@ unit cpu;
function AVX512CDSupport: boolean;inline;
function AVX512BWSupport: boolean;inline;
function AVX512VLSupport: boolean;inline;
function AVX512VBMISupport: boolean;inline;
function AVX512VBMI2Support: boolean;inline;
function AVX512VNNISupport: boolean;inline;
function AVX512BITALGSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
@ -80,6 +82,8 @@ unit cpu;
_AVX512CDSupport,
_AVX512BWSupport,
_AVX512VLSupport,
_AVX512VBMISupport,
_AVX512VBMI2Support,
_AVX512VNNISupport,
_AVX512BITALGSupport,
_RDSEEDSupport,
@ -267,6 +271,8 @@ unit cpu;
_AVX512ERSupport:=(_ebx and $8000000)<>0;
_AVX512CDSupport:=(_ebx and $10000000)<>0;
_AVX512BWSupport:=(_ebx and $40000000)<>0;
_AVX512VBMISupport:=(_ecx and $00000002)<>0;
_AVX512VBMI2Support:=(_ecx and $00000040)<>0;
_AVX512VNNISupport:=(_ecx and $00000800)<>0;
_AVX512BITALGSupport:=(_ecx and $00001000)<>0;
_SHASupport:=(_ebx and $20000000)<>0;
@ -353,6 +359,18 @@ unit cpu;
end;
function AVX512VBMISupport: boolean;inline;
begin
result:=_AVX512VBMISupport;
end;
function AVX512VBMI2Support: boolean;inline;
begin
result:=_AVX512VBMI2Support;
end;
function AVX512VNNISupport: boolean;inline;
begin
result:=_AVX512VNNISupport;

View File

@ -40,6 +40,8 @@ unit cpu;
function AVX512CDSupport: boolean;inline;
function AVX512BWSupport: boolean;inline;
function AVX512VLSupport: boolean;inline;
function AVX512VBMISupport: boolean;inline;
function AVX512VBMI2Support: boolean;inline;
function AVX512VNNISupport: boolean;inline;
function AVX512BITALGSupport: boolean;inline;
function RDSEEDSupport: boolean;inline;
@ -79,6 +81,8 @@ unit cpu;
_AVX512CDSupport,
_AVX512BWSupport,
_AVX512VLSupport,
_AVX512VBMISupport,
_AVX512VBMI2Support,
_AVX512VNNISupport,
_AVX512BITALGSupport,
_RDSEEDSupport,
@ -243,6 +247,8 @@ unit cpu;
_SHASupport:=(_ebx and $20000000)<>0;
_AVX512BWSupport:=(_ebx and $40000000)<>0;
_AVX512VLSupport:=(_ebx and $80000000)<>0;
_AVX512VBMISupport:=(_ecx and $00000002)<>0;
_AVX512VBMI2Support:=(_ecx and $00000040)<>0;
_AVX512VNNISupport:=(_ecx and $00000800)<>0;
_AVX512BITALGSupport:=(_ecx and $00001000)<>0;
_BMI1Support:=(_ebx and $8)<>0;
@ -324,6 +330,18 @@ unit cpu;
end;
function AVX512VBMISupport: boolean;inline;
begin
result:=_AVX512VBMISupport;
end;
function AVX512VBMI2Support: boolean;inline;
begin
result:=_AVX512VBMI2Support;
end;
function AVX512VNNISupport: boolean;inline;
begin
result:=_AVX512VNNISupport;

View File

@ -57,6 +57,28 @@ begin
end
else
writeln('no');
write('AVX512VBMI support: ');
if AVX512VBMISupport then
begin
writeln('yes');
asm
vpxor %ymm0,%ymm0,%ymm0
vpermi2b %zmm0,%zmm0,%zmm0
end;
end
else
writeln('no');
write('AVX512VBMI2 support: ');
if AVX512VBMI2Support then
begin
writeln('yes');
asm
vpxor %ymm0,%ymm0,%ymm0
vpexpandw %zmm0,%zmm0
end;
end
else
writeln('no');
write('FMA support: ');
if FMASupport then
begin