mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 03:39:28 +02:00
+ optimize LDS/STS into IN/OUT, resolves issue #27884
git-svn-id: trunk@30649 -
This commit is contained in:
parent
9e51283ae0
commit
987b66636d
@ -129,6 +129,30 @@ Implementation
|
||||
result:=true;
|
||||
end;
|
||||
end;
|
||||
A_STS:
|
||||
if (taicpu(p).oper[0]^.ref^.symbol=nil) and
|
||||
(taicpu(p).oper[0]^.ref^.relsymbol=nil) and
|
||||
(getsupreg(taicpu(p).oper[0]^.ref^.base)=RS_NO) and
|
||||
(getsupreg(taicpu(p).oper[0]^.ref^.index)=RS_NO) and
|
||||
(taicpu(p).oper[0]^.ref^.addressmode=AM_UNCHANGED) and
|
||||
(taicpu(p).oper[0]^.ref^.offset>=32) and
|
||||
(taicpu(p).oper[0]^.ref^.offset<=95) then
|
||||
begin
|
||||
taicpu(p).opcode:=A_OUT;
|
||||
taicpu(p).loadconst(0,taicpu(p).oper[0]^.ref^.offset-32);
|
||||
end;
|
||||
A_LDS:
|
||||
if (taicpu(p).oper[1]^.ref^.symbol=nil) and
|
||||
(taicpu(p).oper[1]^.ref^.relsymbol=nil) and
|
||||
(getsupreg(taicpu(p).oper[1]^.ref^.base)=RS_NO) and
|
||||
(getsupreg(taicpu(p).oper[1]^.ref^.index)=RS_NO) and
|
||||
(taicpu(p).oper[1]^.ref^.addressmode=AM_UNCHANGED) and
|
||||
(taicpu(p).oper[1]^.ref^.offset>=32) and
|
||||
(taicpu(p).oper[1]^.ref^.offset<=95) then
|
||||
begin
|
||||
taicpu(p).opcode:=A_IN;
|
||||
taicpu(p).loadconst(1,taicpu(p).oper[1]^.ref^.offset-32);
|
||||
end;
|
||||
A_CLR:
|
||||
begin
|
||||
{ turn the common
|
||||
|
Loading…
Reference in New Issue
Block a user