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