From 79cf1dd9cfe47b43d7c057709006b0206e8a0079 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 7 Feb 2022 21:21:08 +0100 Subject: [PATCH] + store also ecx and edx after cpuid call with eax=7 + test VNNI and BIGALG instructions --- rtl/i386/cpu.pp | 2 ++ rtl/x86_64/cpu.pp | 2 ++ tests/test/units/cpu/tcpu1.pp | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rtl/i386/cpu.pp b/rtl/i386/cpu.pp index 3099903172..3569c8d0a0 100644 --- a/rtl/i386/cpu.pp +++ b/rtl/i386/cpu.pp @@ -253,6 +253,8 @@ unit cpu; movl $0,%ecx cpuid movl %ebx,_ebx + movl %ecx,_ecx + movl %edx,_edx popl %ebx end; _AVX2Support:=_AVXSupport and ((_ebx and $20)<>0); diff --git a/rtl/x86_64/cpu.pp b/rtl/x86_64/cpu.pp index 70e5416f35..039c2c68d8 100644 --- a/rtl/x86_64/cpu.pp +++ b/rtl/x86_64/cpu.pp @@ -228,6 +228,8 @@ unit cpu; movl $0,%ecx cpuid movl %ebx,_ebx + movl %ecx,_ecx + movl %edx,_edx end ['rax','rbx','rcx','rdx']; _AVX2Support:=_AVXSupport and ((_ebx and $20)<>0); _AVX512FSupport:=(_ebx and $10000)<>0; diff --git a/tests/test/units/cpu/tcpu1.pp b/tests/test/units/cpu/tcpu1.pp index 88877bebfc..28a28bf604 100644 --- a/tests/test/units/cpu/tcpu1.pp +++ b/tests/test/units/cpu/tcpu1.pp @@ -40,8 +40,8 @@ begin begin writeln('yes'); asm - // vpxor %ymm0,%ymm0,%ymm0 - // vaddpd %zmm0,%zmm0,%zmm0 + vpxor %ymm0,%ymm0,%ymm0 + vpdpbusd %zmm0,%zmm0,%zmm0 end; end else @@ -51,8 +51,8 @@ begin begin writeln('yes'); asm - //vpxor %ymm0,%ymm0,%ymm0 - //vaddpd %zmm0,%zmm0,%zmm0 + vpxor %ymm0,%ymm0,%ymm0 + vpopcntb %zmm0,%zmm0 end; end else