Răsfoiți Sursa

* fixed fpuregister counting errors ("merged")

Jonas Maebe 23 ani în urmă
părinte
comite
92977ca6ee
3 a modificat fișierele cu 34 adăugiri și 5 ștergeri
  1. 6 1
      compiler/i386/n386mat.pas
  2. 22 1
      compiler/nadd.pas
  3. 6 3
      compiler/nmat.pas

+ 6 - 1
compiler/i386/n386mat.pas

@@ -647,6 +647,8 @@ implementation
 
          if (left.resulttype.def.deftype=floatdef) then
            begin
+             if (registersfpu < 1) then
+               registersfpu := 1;
              location.loc:=LOC_FPU;
            end
 {$ifdef SUPPORT_MMX}
@@ -1018,7 +1020,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.19  2001-12-07 13:03:49  jonas
+  Revision 1.20  2001-12-27 15:33:58  jonas
+    * fixed fpuregister counting errors ("merged")
+
+  Revision 1.19  2001/12/07 13:03:49  jonas
     * fixed web bug 1716
 
   Revision 1.18  2001/12/04 15:57:28  jonas

+ 22 - 1
compiler/nadd.pas

@@ -1351,6 +1351,15 @@ implementation
                calcregisters(self,1,1,0)
              else
                calcregisters(self,0,1,0);
+              { an add node always first loads both the left and the    }
+              { right in the fpu before doing the calculation. However, }
+              { calcregisters(0,2,0) will overestimate the number of    }
+              { necessary registers (it will make it 3 in case one of   }
+              { the operands is already in the fpu) (JM)                }
+              if ((left.location.loc <> LOC_FPU) or
+                  (right.location.loc <> LOC_FPU)) and
+                 (registersfpu < 2) then
+                inc(registersfpu);  
            end
 
          { if both are orddefs then check sub types }
@@ -1509,6 +1518,15 @@ implementation
             begin
               location.loc:=LOC_FPU;
               calcregisters(self,0,1,0);
+              { an add node always first loads both the left and the    }
+              { right in the fpu before doing the calculation. However, }
+              { calcregisters(0,2,0) will overestimate the number of    }
+              { necessary registers (it will make it 3 in case one of   }
+              { the operands is already in the fpu) (JM)                }
+              if ((left.location.loc <> LOC_FPU) or
+                  (right.location.loc <> LOC_FPU)) and
+                 (registersfpu < 2) then
+                inc(registersfpu);  
             end
 
          { pointer comperation and subtraction }
@@ -1590,7 +1608,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.41  2001-10-20 19:28:37  peter
+  Revision 1.42  2001-12-27 15:33:58  jonas
+    * fixed fpuregister counting errors ("merged")
+
+  Revision 1.41  2001/10/20 19:28:37  peter
     * interface 2 guid support
     * guid constants support
 

+ 6 - 3
compiler/nmat.pas

@@ -443,8 +443,8 @@ implementation
          if (left.resulttype.def.deftype=floatdef) then
            begin
               if (left.location.loc<>LOC_REGISTER) and
-                 (registers32<1) then
-                registers32:=1;
+                 (registersfpu<1) then
+                registersfpu:=1;
               location.loc:=LOC_REGISTER;
            end
 {$ifdef SUPPORT_MMX}
@@ -640,7 +640,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.25  2001-11-02 22:58:02  peter
+  Revision 1.26  2001-12-27 15:33:58  jonas
+    * fixed fpuregister counting errors ("merged")
+
+  Revision 1.25  2001/11/02 22:58:02  peter
     * procsym definition rewrite
 
   Revision 1.24  2001/10/12 13:51:51  jonas