Browse Source

SSESupport SEE2Support return true allays in 64 bit mode. +More bugfixes.

Margers 1 month ago
parent
commit
4459510e5c
2 changed files with 10 additions and 11 deletions
  1. 4 4
      rtl/i386/cpu.pp
  2. 6 7
      rtl/x86_64/cpu.pp

+ 4 - 4
rtl/i386/cpu.pp

@@ -49,7 +49,7 @@ type
     function AVX102Support: boolean;inline; { AVX10.2 }
     function AVX10_256Support: boolean;inline; { AVX10/256 indicates that 256-bit vector support is present }
     function AVX10_512Support: boolean;inline; { AVX10/512 indicates that 512-bit vector support is present }
-    function APXFSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
+    function APXSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
     function AVX512FSupport: boolean;inline;
     function AVX512DQSupport: boolean;inline;
     function AVX512IFMASupport: boolean;inline;
@@ -261,7 +261,7 @@ type
               { xmm and ymm state enabled? }
               ((XGETBV(0) and %110)=%110);
 
-            if (data.cpuid7_1.edx and (19 shl 0))<>0 then { CPUID.(EAX=24H) leaf is supported }
+            if (data.cpuid7_1.edx and (1 shl 19))<>0 then { CPUID.(EAX=24H) leaf is supported }
               data.cpuid24_0_ebx:=CPUID($24, 0).ebx;
 
             data.LZCNTSupport:=(CPUID($80000001).ecx and (1 shl 5))<>0;
@@ -337,9 +337,9 @@ type
       end;
 
 
-    function APXFSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
+    function APXSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
       begin
-        result:=(data.cpuid7_1.ebx and (1 shl 21))<>0;
+        result:=(data.cpuid7_1.edx and (1 shl 21))<>0;
       end;
 
 

+ 6 - 7
rtl/x86_64/cpu.pp

@@ -46,7 +46,7 @@ type
     function AVX102Support: boolean;inline; { AVX10.2 }
     function AVX10_256Support: boolean;inline; { AVX10/256 indicates that 256-bit vector support is present }
     function AVX10_512Support: boolean;inline; { AVX10/512 indicates that 512-bit vector support is present }
-    function APXFSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
+    function APXSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
     function AVX512FSupport: boolean;inline;
     function AVX512DQSupport: boolean;inline;
     function AVX512IFMASupport: boolean;inline;
@@ -221,7 +221,6 @@ type
     {$endif win64}
         // older FPCs don't know the xgetbv opcode
         .byte 0x0f,0x01,0xd0
-        andl $0xffffffff,%eax
         shlq $32,%rdx
         orq %rdx,%rax
       end;
@@ -248,7 +247,7 @@ type
           { xmm and ymm state enabled? }
           ((XGETBV(0) and %110)=%110);
 
-        if (data.cpuid7_1.edx and (19 shl 0))<>0 then { CPUID.(EAX=24H) leaf is supported }
+        if (data.cpuid7_1.edx and (1 shl 19))<>0 then { CPUID.(EAX=24H) leaf is supported }
           data.cpuid24_0_ebx:=CPUID($24, 0).ebx;
 
         data.LZCNTSupport:=(CPUID($80000001).ecx and (1 shl 5))<>0;
@@ -321,9 +320,9 @@ type
       end;
 
 
-    function APXFSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
+    function APXSupport: boolean;inline;  { APX_F Advanced Performance Extension Foundation }
       begin
-        result:=(data.cpuid7_1.ebx and (1 shl 21))<>0;
+        result:=(data.cpuid7_1.edx and (1 shl 21))<>0;
       end;
 
 
@@ -515,13 +514,13 @@ type
 
     function SSESupport: boolean;inline;
       begin
-        result:=(data.cpuid1.edx and (1 shl 25))<>0;
+        result:=true;
       end;
 
 
     function SSE2Support: boolean;inline;
       begin
-        result:=(data.cpuid1.edx and (1 shl 26))<>0;
+        result:=true;
       end;