Răsfoiți Sursa

* use the current cgsizes instead of the def to determine if loadfpu can be used, else softfloats are broken

git-svn-id: trunk@9728 -
florian 17 ani în urmă
părinte
comite
295fdbe37c
2 a modificat fișierele cu 12 adăugiri și 2 ștergeri
  1. 10 0
      compiler/cgbase.pas
  2. 2 2
      compiler/ncgld.pas

+ 10 - 0
compiler/cgbase.pas

@@ -321,6 +321,9 @@ interface
     function int_cgsize(const a: aint): tcgsize;{$ifdef USEINLINE}inline;{$endif}
     function int_float_cgsize(const a: aint): tcgsize;
 
+    { returns true if s is a size handled by the fpu }
+    function isfloatsize(s : tcgsize) : boolean;{$ifdef USEINLINE}inline;{$endif}
+
     { return the inverse condition of opcmp }
     function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
 
@@ -672,6 +675,13 @@ implementation
       end;
 
 
+    { returns true if s is a size handled by the fpu }
+    function isfloatsize(s : tcgsize) : boolean;{$ifdef USEINLINE}inline;{$endif}
+      begin
+        result:=s in [OS_F32,OS_F64,OS_F80,OS_C64,OS_F128]
+      end;
+
+
 initialization
   new(mms_movescalar);
   mms_movescalar^.len:=0;

+ 2 - 2
compiler/ncgld.pas

@@ -692,8 +692,8 @@ implementation
                     LOC_REFERENCE,
                     LOC_CREFERENCE :
                       begin
-                        if (left.resultdef.typ=floatdef) and
-                           (right.resultdef.typ=floatdef) and
+                        if isfloatsize(left.location.size) and
+                           isfloatsize(right.location.size) and
                            (left.location.size<>right.location.size) then
                           begin
                             cg.a_loadfpu_ref_ref(current_asmdata.CurrAsmList,