瀏覽代碼

* changed the llvm type of comp/currency in parameter and return type
on platforms that use the x87 for these types to extended in order
to gaurantee the expected parameter passing conventions

git-svn-id: trunk@30719 -

Jonas Maebe 10 年之前
父節點
當前提交
b9138a1c90
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      compiler/llvm/llvmdef.pas

+ 8 - 0
compiler/llvm/llvmdef.pas

@@ -764,6 +764,14 @@ implementation
             usedef:=cgpara.location^.def;
             if beforevalueext then
               llvmextractvalueextinfo(cgpara.def,usedef,valueext);
+            { comp and currency are handled by the x87 in this case. They cannot
+              be represented directly in llvm, and llvmdef translates them into
+              i64 (since that's their storage size and internally they also are
+              int64). Solve this by changing the type to s80real in the
+              returndef/parameter declaration. }
+            if (usedef.typ=floatdef) and
+               (tfloatdef(usedef).floattype in [s64comp,s64currency]) then
+              usedef:=s80floattype;
             result:=usedef;
             exit
           end;