summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoxsen <foxsen@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-06-09 03:01:56 +0000
committerfoxsen <foxsen@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-06-09 03:01:56 +0000
commitfd5ffbe6e851d2d6b66cd15511773c7ce5af5c91 (patch)
tree2b44668255f2471372aed647c546d7bb64f61dfa
parentb6b92f3425b5d38384be5c933a136c888af7ea3f (diff)
downloadfpc-fd5ffbe6e851d2d6b66cd15511773c7ce5af5c91.tar.gz
use inherited first_int_to_real to avoid mixing doubles and singles
it fixes the failure of test/cg/taddcurr.pp git-svn-id: http://svn.freepascal.org/svn/fpc/branches/foxsen@21558 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--mips/compiler/mips/ncpucnv.pas41
1 files changed, 15 insertions, 26 deletions
diff --git a/mips/compiler/mips/ncpucnv.pas b/mips/compiler/mips/ncpucnv.pas
index 6f4c0b4fbe..7023ce2394 100644
--- a/mips/compiler/mips/ncpucnv.pas
+++ b/mips/compiler/mips/ncpucnv.pas
@@ -70,39 +70,28 @@ uses
FirstTypeConv
*****************************************************************************}
-function tMIPSELtypeconvnode.first_int_to_real: tnode;
+function tmipseltypeconvnode.first_int_to_real: tnode;
var
fname: string[19];
begin
{ converting a 64bit integer to a float requires a helper }
if is_64bitint(left.resultdef) or
- is_currency(left.resultdef) then
- begin
- { hack to avoid double division by 10000, as it's
- already done by resulttypepass.resulttype_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;
- firstpass(Result);
- exit;
- end
+ is_currency(left.resultdef) then
+ begin
+ result:=inherited first_int_to_real;
+ exit;
+ end
else
{ other integers are supposed to be 32 bit }
- begin
- if is_signed(left.resultdef) then
- inserttypeconv(left, s32inttype)
- else
- inserttypeconv(left, u32inttype);
- firstpass(left);
- end;
- Result := nil;
- expectloc := LOC_FPUREGISTER;
+ begin
+ if is_signed(left.resultdef) then
+ inserttypeconv(left,s32inttype)
+ else
+ inserttypeconv(left,u32inttype);
+ firstpass(left);
+ end;
+ result := nil;
+ expectloc:=LOC_FPUREGISTER;
end;