Răsfoiți Sursa

* don't generate fwait by default anymore
* SAVEFPUEXCEPTIONS switch added to enable fwait inserts

git-svn-id: trunk@4733 -

peter 19 ani în urmă
părinte
comite
0bb22a2d17
3 a modificat fișierele cu 9 adăugiri și 2 ștergeri
  1. 1 1
      compiler/globtype.pas
  2. 6 0
      compiler/scandir.pas
  3. 2 1
      compiler/x86/cgx86.pas

+ 1 - 1
compiler/globtype.pas

@@ -97,7 +97,7 @@ than 255 characters. That's why using Ansi Strings}
          cs_checkpointer,
          cs_generate_stackframes,cs_do_assertion,cs_generate_rtti,
          cs_full_boolean_eval,cs_typed_const_writable,cs_allow_enum_calc,
-         cs_do_inline,
+         cs_do_inline,cs_fpu_fwait,
          { mmx }
          cs_mmx,cs_mmx_saturation,
          { parser }

+ 6 - 0
compiler/scandir.pas

@@ -936,6 +936,11 @@ implementation
         do_localswitch(cs_mmx_saturation);
       end;
 
+    procedure dir_savefpuexceptions;
+      begin
+        do_localswitch(cs_fpu_fwait);
+      end;
+
     procedure dir_setpeflags;
       begin
         if not (target_info.system in (system_windows+system_wince)) then
@@ -1287,6 +1292,7 @@ implementation
         AddDirective('REFERENCEINFO',directive_all, @dir_referenceinfo);
         AddDirective('RESOURCE',directive_all, @dir_resource);
         AddDirective('SATURATION',directive_all, @dir_saturation);
+        AddDirective('SAVEFPUEXCEPTIONS',directive_all, @dir_savefpuexceptions);
         AddDirective('SETPEFLAGS', directive_all, @dir_setpeflags);
         AddDirective('SCREENNAME',directive_all, @dir_screenname);
         AddDirective('SMARTLINK',directive_all, @dir_smartlink);

+ 2 - 1
compiler/x86/cgx86.pas

@@ -514,7 +514,8 @@ unit cgx86;
          floatstoreops(t,op,s);
          list.concat(Taicpu.Op_ref(op,s,tmpref));
          { storing non extended floats can cause a floating point overflow }
-         if t<>OS_F80 then
+         if (t<>OS_F80) and
+            (cs_fpu_fwait in aktlocalswitches) then
            list.concat(Taicpu.Op_none(A_FWAIT,S_NO));
          dec_fpu_stack;
       end;