Browse Source

* relaxed conditions for floats in int registers, this improved softfloat code significantly

git-svn-id: trunk@27417 -
florian 11 years ago
parent
commit
73cf0b62f2
1 changed files with 5 additions and 4 deletions
  1. 5 4
      compiler/ncgcnv.pas

+ 5 - 4
compiler/ncgcnv.pas

@@ -750,16 +750,17 @@ interface
 
         { Floats should never be returned as LOC_CONSTANT, do the
           moving to memory before the new size is set.
+
           Also when converting from a float to a non-float
-          or the other way round, move to memory first to prevent
-          invalid LOC_FPUREGISTER locations }
+          move to memory first to prevent
+          invalid LOC_(C)MM/FPUREGISTER locations }
         if (
             (resultdef.typ=floatdef) and
             (location.loc=LOC_CONSTANT)
            ) or
            (
-            (left.resultdef.typ=floatdef) xor
-            (resultdef.typ=floatdef)
+            ((left.resultdef.typ=floatdef) and
+             (resultdef.typ<>floatdef) and (left.location.loc in [LOC_CFPUREGISTER,LOC_FPUREGISTER,LOC_CMMREGISTER,LOC_MMREGISTER]))
            ) then
           hlcg.location_force_mem(current_asmdata.CurrAsmList,location,left.resultdef);