Browse Source

* bugfix of FPU emulation code

carl 22 years ago
parent
commit
2c19def917
3 changed files with 35 additions and 6 deletions
  1. 9 1
      compiler/ncgcal.pas
  2. 10 2
      compiler/ncgflw.pas
  3. 16 3
      compiler/ncgutil.pas

+ 9 - 1
compiler/ncgcal.pas

@@ -449,6 +449,11 @@ implementation
               floatdef :
                 begin
                   location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
+{$ifdef cpufpemu}
+                  if cs_fp_emulation in aktmoduleswitches then
+                    location.register.enum := accumulator
+                 else
+{$endif cpufpemu}
                   location.register.enum:=fpu_result_reg;
 {$ifdef x86}
                   inc(trgcpu(rg).fpuvaroffset);
@@ -1622,7 +1627,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.37  2003-02-12 22:10:07  carl
+  Revision 1.38  2003-02-15 22:17:38  carl
+   * bugfix of FPU emulation code
+
+  Revision 1.37  2003/02/12 22:10:07  carl
     * load_frame_pointer is now generic
     * change fpu emulation routine names
 

+ 10 - 2
compiler/ncgflw.pas

@@ -735,7 +735,12 @@ implementation
                       end;
                     floatdef :
                       begin
-                        r.enum:=fpu_result_reg;
+{$ifdef cpufpemu}
+                        if cs_fp_emulation in aktmoduleswitches then
+                           r.enum := accumulator
+                        else
+{$endif cpufpemu}
+                           r.enum:=fpu_result_reg;
 {$ifndef i386}
                         cg.a_reg_alloc(exprasmlist,r);
 {$endif not i386}
@@ -1470,7 +1475,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.49  2003-01-08 18:43:56  daniel
+  Revision 1.50  2003-02-15 22:17:38  carl
+   * bugfix of FPU emulation code
+
+  Revision 1.49  2003/01/08 18:43:56  daniel
    * Tregister changed into a record
 
   Revision 1.48  2003/01/03 09:51:58  daniel

+ 16 - 3
compiler/ncgutil.pas

@@ -1188,7 +1188,12 @@ function returns in a register and the caller receives it in an other one}
              floatdef :
                begin
                  uses_fpu := true;
-                 r.enum:=fpu_result_reg;
+{$ifdef cpufpemu}
+                  if cs_fp_emulation in aktmoduleswitches then
+                    r.enum := accumulator
+                 else
+{$endif cpufpemu}
+                  r.enum:=fpu_result_reg;
                  cg.a_loadfpu_ref_reg(list,cgsize,href,r);
                end;
              else
@@ -1249,7 +1254,12 @@ function returns in a register and the caller receives it in an other one}
                end;
              floatdef :
                begin
-                 r.enum:=fpu_result_reg;
+{$ifdef cpufpemu}
+                  if cs_fp_emulation in aktmoduleswitches then
+                    r.enum := accumulator
+                 else
+{$endif cpufpemu}
+                    r.enum:=fpu_result_reg;
                  cg.a_loadfpu_reg_ref(list,cgsize,r,href);
                end;
              else
@@ -1964,7 +1974,10 @@ function returns in a register and the caller receives it in an other one}
 end.
 {
   $Log$
-  Revision 1.75  2003-01-09 22:00:53  florian
+  Revision 1.76  2003-02-15 22:17:38  carl
+   * bugfix of FPU emulation code
+
+  Revision 1.75  2003/01/09 22:00:53  florian
     * fixed some PowerPC issues
 
   Revision 1.74  2003/01/09 20:41:10  florian