瀏覽代碼

* SPARC: convert from int64/qword to float using genmath helpers. Removes dependency on softfloat code.

git-svn-id: trunk@26262 -
sergei 11 年之前
父節點
當前提交
58cc531dd9
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      compiler/sparc/ncpucnv.pas

+ 14 - 1
compiler/sparc/ncpucnv.pas

@@ -78,7 +78,20 @@ implementation
         if is_64bitint(left.resultdef) or
           is_currency(left.resultdef) then
           begin
-            result:=inherited first_int_to_real;
+            { hack to avoid double division by 10000, as it's
+              already done by typecheckpass.resultdef_int_to_real }
+            if is_currency(left.resultdef) then
+              left.resultdef := s64inttype;
+            if is_signed(left.resultdef) then
+              fname := 'fpc_int64_to_double'
+            else
+              fname := 'fpc_qword_to_double';
+            result := ccallnode.createintern(fname,ccallparanode.create(
+              left,nil));
+            left:=nil;
+            if (tfloatdef(resultdef).floattype=s32real) then
+              inserttypeconv(result,s32floattype);
+            firstpass(result);
             exit;
           end
         else