Răsfoiți Sursa

Bug fix to XMM block move optimisation

J. Gareth "Kit" Moreton 3 ani în urmă
părinte
comite
79f60923ba
2 a modificat fișierele cu 16 adăugiri și 3 ștergeri
  1. 2 1
      compiler/aoptobj.pas
  2. 14 2
      compiler/x86/aoptx86.pas

+ 2 - 1
compiler/aoptobj.pas

@@ -1430,7 +1430,8 @@ Unit AoptObj;
                   { same super register, different sub register? }
                   if SuperRegistersEqual(reg,tai_regalloc(p1).reg) and (tai_regalloc(p1).reg<>reg) then
                     begin
-                      if (getsubreg(tai_regalloc(p1).reg)>getsubreg(reg)) or (getsubreg(reg)=R_SUBH) then
+                      if (getsubreg(reg)<>R_SUBMMWHOLE) and { R_SUBMMWHOLE is below R_SUBMMX, R_SUBMMY and R_SUBMMZ }
+                        ((getsubreg(tai_regalloc(p1).reg)>getsubreg(reg)) or (getsubreg(reg)=R_SUBH)) then
                         internalerror(2016101501);
                       tai_regalloc(p1).reg:=reg;
                     end;

+ 14 - 2
compiler/x86/aoptx86.pas

@@ -1036,7 +1036,7 @@ unit aoptx86;
                 Breakout := False;
                 while not Breakout and GetNextInstruction(Currentp, Currentp) and (Currentp <> hp) do
                   begin
-                    case hp.typ of
+                    case Currentp.typ of
                       ait_instruction:
                         begin
                           if RegInInstruction(CurrentReg, Currentp) then
@@ -1052,6 +1052,12 @@ unit aoptx86;
                       ait_marker:
                         { Don't try anything more if a marker is hit }
                         Exit;
+                      ait_regalloc:
+                        if (tai_regalloc(Currentp).ratype <> ra_dealloc) and SuperRegistersEqual(CurrentReg, tai_regalloc(Currentp).reg) then
+                          begin
+                            Breakout := True;
+                            Break;
+                          end;
                       else
                         ;
                     end;
@@ -1093,7 +1099,7 @@ unit aoptx86;
                 Breakout := False;
                 while not Breakout and GetNextInstruction(Currentp, Currentp) and (Currentp <> hp) do
                   begin
-                    case hp.typ of
+                    case Currentp.typ of
                       ait_instruction:
                         begin
                           if RegInInstruction(CurrentReg, Currentp) then
@@ -1109,6 +1115,12 @@ unit aoptx86;
                       ait_marker:
                         { Don't try anything more if a marker is hit }
                         Exit;
+                      ait_regalloc:
+                        if (tai_regalloc(Currentp).ratype <> ra_dealloc) and SuperRegistersEqual(CurrentReg, tai_regalloc(Currentp).reg) then
+                          begin
+                            Breakout := True;
+                            Break;
+                          end;
                       else
                         ;
                     end;