소스 검색

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

git-svn-id: trunk@26109 -
nickysn 12 년 전
부모
커밋
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;