mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:29:28 +02:00
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:
parent
512351043c
commit
aeb15ba2b6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user