Fixed postfix check in taicpu.is_same_reg_move

The old version did not check the S-Postfix for MOV, which results in
removing instructions like:

movs r0, r0

which breaks later flag usage.

git-svn-id: trunk@21676 -
This commit is contained in:
masta 2012-06-21 20:12:25 +00:00
parent 512351043c
commit aeb15ba2b6

View File

@ -567,10 +567,12 @@ implementation
function taicpu.is_same_reg_move(regtype: Tregistertype):boolean;
begin
{ allow the register allocator to remove unnecessary moves }
result:=(((opcode=A_MOV) and (regtype = R_INTREGISTER)) or
((opcode=A_MVF) and (regtype = R_FPUREGISTER) and (oppostfix in [PF_None,PF_D])) or
(((opcode=A_FCPYS) or (opcode=A_FCPYD)) and (regtype = R_MMREGISTER))
result:=(
((opcode=A_MOV) and (regtype = R_INTREGISTER)) or
((opcode=A_MVF) and (regtype = R_FPUREGISTER)) or
((opcode in [A_FCPYS, A_FCPYD]) and (regtype = R_MMREGISTER))
) and
(oppostfix in [PF_None,PF_D]) and
(condition=C_None) and
(ops=2) and
(oper[0]^.typ=top_reg) and