From eb742bcacc3a3a2ce3902813da90a1a35fbfc419 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 1 Dec 2018 20:30:46 +0000 Subject: [PATCH] * pass on the value of -CfXXX to llc/clang for x86-64 git-svn-id: branches/debug_eh@40438 - --- compiler/llvm/agllvm.pas | 7 ++++++- compiler/x86_64/cpuinfo.pas | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/compiler/llvm/agllvm.pas b/compiler/llvm/agllvm.pas index f16f1fa2fc..d44509513a 100644 --- a/compiler/llvm/agllvm.pas +++ b/compiler/llvm/agllvm.pas @@ -112,7 +112,7 @@ implementation objcasm, aasmcnst,symconst,symdef,symtable, llvmbase,itllvm,llvmdef, - cgbase,cgutils,cpubase,llvminfo; + cgbase,cgutils,cpubase,cpuinfo,llvminfo; const line_length = 70; @@ -1507,6 +1507,8 @@ implementation optstr:=optstr+' -stack-alignment='+tostr(target_info.stackalign*8); { force object output instead of textual assembler code } optstr:=optstr+' -filetype=obj'; + if fputypestrllvm[current_settings.fputype]<>'' then + optstr:=optstr+' -mattr=+'+fputypestrllvm[current_settings.fputype]; replace(result,'$OPT',optstr); end; @@ -1567,6 +1569,9 @@ implementation optstr:=optstr+' --target='+llvm_target_name; end; + if fputypestrllvm[current_settings.fputype]<>'' then + optstr:=optstr+' -m'+fputypestrllvm[current_settings.fputype]; + replace(result,'$OPT',optstr); end; diff --git a/compiler/x86_64/cpuinfo.pas b/compiler/x86_64/cpuinfo.pas index c8aed365a2..c699b2b9dc 100644 --- a/compiler/x86_64/cpuinfo.pas +++ b/compiler/x86_64/cpuinfo.pas @@ -130,6 +130,17 @@ Const 'AVX2' ); + fputypestrllvm : array[tfputype] of string[6] = ('', +// 'SOFT', + '', + 'sse3', + 'ssse3', + 'sse4.1', + 'sse4.2', + 'avx', + 'avx2' + ); + sse_singlescalar = [fpu_sse64..fpu_avx2]; sse_doublescalar = [fpu_sse64..fpu_avx2];