|
@@ -1304,7 +1304,16 @@ begin
|
|
|
(hp2.typ = ait_instruction) and
|
|
|
(taicpu(hp2).opcode = A_MOV) and
|
|
|
(taicpu(hp2).oper[0]^.typ = top_reg) and
|
|
|
- OpsEqual(taicpu(hp2).oper[1]^,taicpu(p).oper[0]^) then
|
|
|
+ OpsEqual(taicpu(hp2).oper[1]^,taicpu(p).oper[0]^) and
|
|
|
+ (((taicpu(hp1).ops=2) and
|
|
|
+ (getsupreg(taicpu(hp2).oper[0]^.reg)=getsupreg(taicpu(hp1).oper[1]^.reg))) or
|
|
|
+ ((taicpu(hp1).ops=1) and
|
|
|
+ (getsupreg(taicpu(hp2).oper[0]^.reg)=getsupreg(taicpu(hp1).oper[0]^.reg)))) and
|
|
|
+ { reg2 must not be used after the sequence considered, so
|
|
|
+ it must be either deallocated or loaded with a new value }
|
|
|
+ (GetNextInstruction(hp2,hp3) and
|
|
|
+ (FindRegDealloc(getsupreg(taicpu(hp2).oper[0]^.reg),tai(hp3)) or
|
|
|
+ RegLoadedWithNewValue(getsupreg(taicpu(hp2).oper[0]^.reg), false, hp3))) then
|
|
|
{ change movsX/movzX reg/ref, reg2 }
|
|
|
{ add/sub/or/... reg3/$const, reg2 }
|
|
|
{ mov reg2 reg/ref }
|