瀏覽代碼

* emit a FWAIT after a floating point store, when targeting the 8087 and 80287

git-svn-id: trunk@26109 -
nickysn 11 年之前
父節點
當前提交
7ae59a62c5
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      compiler/x86/cgx86.pas

+ 7 - 2
compiler/x86/cgx86.pas

@@ -708,8 +708,13 @@ 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) and
-            (cs_fpu_fwait in current_settings.localswitches) then
+         if ((t<>OS_F80) and (cs_fpu_fwait in current_settings.localswitches))
+{$ifdef i8086}
+           { 8087 and 80287 need a FWAIT after a memory store, before it can be
+             read with the integer unit }
+           or (current_settings.cputype<=cpu_286)
+{$endif i8086}
+           then
            list.concat(Taicpu.Op_none(A_FWAIT,S_NO));
          dec_fpu_stack;
       end;