* fix so (,reg) gets optimized to (reg)

This commit is contained in:
Jonas Maebe 1999-07-30 18:17:55 +00:00
parent 538e677425
commit 19e34088fa

View File

@ -167,29 +167,19 @@ Begin
else else
{ All other optimizes } { All other optimizes }
begin begin
If (Pai386(p)^.oper[0].typ = top_ref) Then For l := 0 to 2 Do
With Pai386(p)^.oper[0].ref^ Do If (Pai386(p)^.oper[l].typ = top_ref) Then
With Pai386(p)^.oper[l].ref^ Do
Begin Begin
If (base = R_NO) And If (base = R_NO) And
(index <> R_NO) And (index <> R_NO) And
(scalefactor = 1) (scalefactor in [0,1])
Then Then
Begin Begin
base := index; base := index;
index := R_NO index := R_NO
End End
End; End;
If (Pai386(p)^.oper[1].typ = top_ref) Then
With Pai386(p)^.oper[1].ref^ Do
Begin
If (base = R_NO) And
(index <> R_NO) And
(scalefactor = 1) Then
Begin
base := index;
index := R_NO
End
End;
Case Pai386(p)^.opcode Of Case Pai386(p)^.opcode Of
A_AND: A_AND:
Begin Begin
@ -1535,7 +1525,10 @@ End.
{ {
$Log$ $Log$
Revision 1.57 1999-07-01 18:12:16 jonas Revision 1.58 1999-07-30 18:17:55 jonas
* fix so (,reg) gets optimized to (reg)
Revision 1.57 1999/07/01 18:12:16 jonas
* enabled "mov reg1,reg2;mov (reg2,..), reg2" also if the second mov is * enabled "mov reg1,reg2;mov (reg2,..), reg2" also if the second mov is
a movzx or movsx a movzx or movsx