Browse Source

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

git-svn-id: trunk@26262 -
sergei 11 years ago
parent
commit
58cc531dd9
1 changed files with 14 additions and 1 deletions
  1. 14 1
      compiler/sparc/ncpucnv.pas

+ 14 - 1
compiler/sparc/ncpucnv.pas

@@ -78,7 +78,20 @@ implementation
         if is_64bitint(left.resultdef) or
         if is_64bitint(left.resultdef) or
           is_currency(left.resultdef) then
           is_currency(left.resultdef) then
           begin
           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;
             exit;
           end
           end
         else
         else