diff --git a/rtl/i386/cpu.pp b/rtl/i386/cpu.pp index 590c651234..3099903172 100644 --- a/rtl/i386/cpu.pp +++ b/rtl/i386/cpu.pp @@ -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; diff --git a/rtl/x86_64/cpu.pp b/rtl/x86_64/cpu.pp index a4446c2ef1..70e5416f35 100644 --- a/rtl/x86_64/cpu.pp +++ b/rtl/x86_64/cpu.pp @@ -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; diff --git a/tests/test/units/cpu/tcpu1.pp b/tests/test/units/cpu/tcpu1.pp index 600e37a852..88877bebfc 100644 --- a/tests/test/units/cpu/tcpu1.pp +++ b/tests/test/units/cpu/tcpu1.pp @@ -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