Browse Source

* pass on the value of -CfXXX to llc/clang for x86-64

git-svn-id: branches/debug_eh@40438 -
Jonas Maebe 6 years ago
parent
commit
eb742bcacc
2 changed files with 17 additions and 1 deletions
  1. 6 1
      compiler/llvm/agllvm.pas
  2. 11 0
      compiler/x86_64/cpuinfo.pas

+ 6 - 1
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;
 

+ 11 - 0
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];