diff options
Diffstat (limited to 'avx512-0037785/compiler/x86/cpubase.pas')
-rw-r--r-- | avx512-0037785/compiler/x86/cpubase.pas | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/avx512-0037785/compiler/x86/cpubase.pas b/avx512-0037785/compiler/x86/cpubase.pas index 208cb2a82c..7f56482e87 100644 --- a/avx512-0037785/compiler/x86/cpubase.pas +++ b/avx512-0037785/compiler/x86/cpubase.pas @@ -170,7 +170,7 @@ uses { Number of first imaginary register } {$ifdef x86_64} - first_mm_imreg = $10; + first_mm_imreg = $20; {$else x86_64} first_mm_imreg = $08; {$endif x86_64} @@ -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)} @@ -481,7 +485,7 @@ implementation function reg_cgsize(const reg: tregister): tcgsize; const subreg2cgsize:array[Tsubregister] of Tcgsize = - (OS_NO,OS_8,OS_8,OS_16,OS_32,OS_64,OS_NO,OS_NO,OS_NO,OS_F32,OS_F64,OS_NO,OS_M128,OS_M256,OS_M512,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO); + (OS_NO,OS_8,OS_8,OS_16,OS_32,OS_64,OS_NO,OS_NO,OS_NO,OS_F32,OS_F64,OS_NO,OS_M128,OS_M256,OS_M512,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO,OS_NO); begin case getregtype(reg) of R_INTREGISTER : @@ -509,7 +513,7 @@ implementation else internalerror(2003031801); end; else - internalerror(2003031801); + internalerror(2003031802); end; end; @@ -517,7 +521,7 @@ implementation function reg2opsize(r:Tregister):topsize; const subreg2opsize : array[tsubregister] of topsize = - (S_NO,S_B,S_B,S_W,S_L,S_Q,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO); + (S_NO,S_B,S_B,S_W,S_L,S_Q,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO); begin reg2opsize:=S_L; case getregtype(r) of @@ -591,7 +595,7 @@ implementation begin result := flags_2_cond[f]; if (result=C_None) then - InternalError(2014041301); + InternalError(2014041302); end; @@ -948,4 +952,16 @@ 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:={$ifdef i8086}false{$else i8086}UseAVX and (FPUX86_HAS_AVX512F in fpu_capabilities[current_settings.fputype]){$endif i8086}; + end; + + end. |