* moved UseAVX from cgx86 to cpubase

+ UseAVX512

git-svn-id: trunk@47346 -
This commit is contained in:
florian 2020-11-08 19:39:18 +00:00
parent e46b426ca1
commit 47066f0ce7
2 changed files with 18 additions and 9 deletions

View File

@ -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;

View File

@ -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.