2
0
Эх сурвалжийг харах

* moved UseAVX from cgx86 to cpubase
+ UseAVX512

git-svn-id: trunk@47346 -

florian 4 жил өмнө
parent
commit
47066f0ce7

+ 0 - 8
compiler/x86/cgx86.pas

@@ -178,8 +178,6 @@ unit cgx86;
       winstackpagesize = 4096;
 {$endif NOTARGETWIN}
 
-    function UseAVX: boolean;
-
     function UseIncDec: boolean;
 
     { returns true, if the compiler should use leave instead of mov/pop }
@@ -196,12 +194,6 @@ unit cgx86;
        paramgr,procinfo,
        tgobj,ncgutil;
 
-    function UseAVX: boolean;
-      begin
-        Result:={$ifdef i8086}false{$else i8086}(FPUX86_HAS_AVXUNIT in fpu_capabilities[current_settings.fputype]){$endif i8086};
-      end;
-
-
     { modern CPUs prefer add/sub over inc/dec because add/sub break instructions dependencies on flags
       because they modify all flags }
     function UseIncDec: boolean;

+ 18 - 1
compiler/x86/cpubase.pas

@@ -385,11 +385,15 @@ topsize2memsize: array[topsize] of integer =
     function requires_fwait_on_8087(op: TAsmOp): boolean;
 {$endif i8086}
 
+   function UseAVX: boolean;
+   function UseAVX512: boolean;
+
 implementation
 
     uses
       globtype,
-      rgbase,verbose;
+      rgbase,verbose,
+      cpuinfo;
 
     const
     {$if defined(x86_64)}
@@ -948,4 +952,17 @@ implementation
 {$endif i8086}
 
 
+  function UseAVX: boolean;
+    begin
+      Result:={$ifdef i8086}false{$else i8086}(FPUX86_HAS_AVXUNIT in fpu_capabilities[current_settings.fputype]){$endif i8086};
+    end;
+
+
+  function UseAVX512: boolean;
+    begin
+      // Result:=(current_settings.fputype in fpu_avx_instructionsets) {$ifndef i8086}or (CPUX86_HAS_AVXUNIT in cpu_capabilities[current_settings.cputype]){$endif i8086};
+      Result:=false;
+    end;
+
+
 end.