mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 21:31:40 +02:00
m68k: do not try to optimize CMP #0,Ax to TST Ax, if the CPU doesn't support it
This commit is contained in:
parent
7c01edf831
commit
e09304f671
@ -570,8 +570,12 @@ unit aoptcpu;
|
||||
end;
|
||||
{ CMP #0,<ea> equals to TST <ea>, just shorter and TST is more flexible anyway }
|
||||
A_CMP,A_CMPI:
|
||||
if (taicpu(p).oper[0]^.typ = top_const) and
|
||||
(taicpu(p).oper[0]^.val = 0) then
|
||||
if ((taicpu(p).oper[0]^.typ = top_const) and
|
||||
(taicpu(p).oper[0]^.val = 0)) and
|
||||
((taicpu(p).oper[1]^.typ = top_ref) or
|
||||
((taicpu(p).oper[1]^.typ = top_reg) and
|
||||
not (isaddressregister(taicpu(p).oper[1]^.reg) and
|
||||
not (CPUM68K_HAS_TSTAREG in cpu_capabilities[current_settings.cputype])))) then
|
||||
begin
|
||||
DebugMsg('Optimizer: CMP #0 to TST',p);
|
||||
taicpu(p).opcode:=A_TST;
|
||||
|
Loading…
Reference in New Issue
Block a user