Browse Source

+ support for tai_realconst in llvm assembler writer

git-svn-id: branches/hlcgllvm@28114 -
Jonas Maebe 11 years ago
parent
commit
da3e931d68
1 changed files with 19 additions and 2 deletions
  1. 19 2
      compiler/llvm/agllvm.pas

+ 19 - 2
compiler/llvm/agllvm.pas

@@ -544,7 +544,8 @@ implementation
         pdata: pbyte;
         pdata: pbyte;
         index, step, swapmask, count: longint;
         index, step, swapmask, count: longint;
       begin
       begin
-//        if do_line then
+        if do_line and
+           (fdecllevel=0) then
           begin
           begin
             case tai_realconst(hp).realtyp of
             case tai_realconst(hp).realtyp of
               aitrealconst_s32bit:
               aitrealconst_s32bit:
@@ -562,6 +563,21 @@ implementation
                 internalerror(2014050604);
                 internalerror(2014050604);
             end;
             end;
           end;
           end;
+        case hp.realtyp of
+          aitrealconst_s32bit:
+            AsmWriteln(llvmdoubletostr(hp.value.s32val));
+          aitrealconst_s64bit:
+            AsmWriteln(llvmdoubletostr(hp.value.s64val));
+{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}
+          aitrealconst_s80bit:
+            AsmWriteln(llvmextendedtostr(hp.value.s80val));
+{$endif defined(cpuextended)}
+          aitrealconst_s64comp:
+            { handled as int64 most of the time in llvm }
+            AsmWriteln(tostr(round(hp.value.s64compval)));
+          else
+            internalerror(2014062401);
+        end;
       end;
       end;
 
 
 
 
@@ -569,7 +585,8 @@ implementation
       var
       var
         consttyp: taiconst_type;
         consttyp: taiconst_type;
       begin
       begin
-        asmwrite(target_asm.comment+' const ');
+        if fdecllevel=0 then
+          asmwrite(target_asm.comment+' const ');
         consttyp:=hp.consttype;
         consttyp:=hp.consttype;
         case consttyp of
         case consttyp of
           aitconst_got,
           aitconst_got,