소스 검색

+ fix RegReadByInstruction for the x86 MOVSD instruction

git-svn-id: trunk@35968 -
nickysn 8 년 전
부모
커밋
ff1ee6836d
5개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 11 0
      compiler/i386/aoptcpu.pas
  2. 1 1
      compiler/i386/i386prop.inc
  3. 1 1
      compiler/i8086/i8086prop.inc
  4. 2 2
      compiler/x86/x86ins.dat
  5. 1 1
      compiler/x86_64/x8664pro.inc

+ 11 - 0
compiler/i386/aoptcpu.pas

@@ -197,6 +197,17 @@ unit aoptcpu;
                   RegReadByInstruction := true;
                   exit
                 end;
+            { special handling for SSE MOVSD }
+            if (p.opcode=A_MOVSD) and (p.ops>0) then
+              begin
+                if p.ops<>2 then
+                  internalerror(2017042702);
+                regReadByInstruction := reginop(reg,p.oper[1]^) or
+                  (
+                   (p.oper[0]^.typ=top_reg) and (p.oper[1]^.typ=top_reg) and reginop(reg, p.oper[0]^)
+                  );
+                exit;
+              end;
             with insprop[p.opcode] do
               begin
                 if getregtype(reg)=R_INTREGISTER then

+ 1 - 1
compiler/i386/i386prop.inc

@@ -197,7 +197,7 @@
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
-(Ch: [Ch_All, Ch_RDirFlag]),
+(Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
 (Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),

+ 1 - 1
compiler/i8086/i8086prop.inc

@@ -197,7 +197,7 @@
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
-(Ch: [Ch_All, Ch_RDirFlag]),
+(Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
 (Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
 (Ch: [Ch_Wop2, Ch_Rop1]),
 (Ch: [Ch_Wop2, Ch_Rop1]),

+ 2 - 2
compiler/x86/x86ins.dat

@@ -1108,8 +1108,8 @@ reg64,xmmreg          \361\326\2\x0F\x7E\101          WILLAMETTE,SSE2,X86_64
 void                  \1\xA4                          8086
 
 [MOVSD,movsl]
-; Ch_All and Ch_RDirFlag aren't correct for the sse move, but how can it be solved? (FK)
-(Ch_All, Ch_RDirFlag)
+; Change flags aren't correct for the sse move, so it is handled as a special case in the compiler code
+(Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag)
 void                  \325\1\xA5                      386
 xmmreg,xmmrm          \334\2\x0F\x10\110              WILLAMETTE,SSE2
 xmmrm,xmmreg          \334\2\x0F\x11\101              WILLAMETTE,SSE2

+ 1 - 1
compiler/x86_64/x8664pro.inc

@@ -187,7 +187,7 @@
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_Rop1, Ch_Wop2]),
 (Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
-(Ch: [Ch_All, Ch_RDirFlag]),
+(Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
 (Ch: [Ch_RWRSI, Ch_WMemEDI, Ch_RWRDI, Ch_RDirFlag]),
 (Ch: [Ch_RWESI, Ch_WMemEDI, Ch_RWEDI, Ch_RDirFlag]),
 (Ch: [Ch_Wop2, Ch_Rop1]),