mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 09:39:09 +02:00
* optimize andb/w const,reg andw/l const,reg sequences as well
git-svn-id: trunk@17766 -
This commit is contained in:
parent
b65d397249
commit
b00a610aec
@ -719,12 +719,13 @@ begin
|
|||||||
(taicpu(hp1).opcode = A_AND) and
|
(taicpu(hp1).opcode = A_AND) and
|
||||||
(taicpu(hp1).oper[0]^.typ = top_const) and
|
(taicpu(hp1).oper[0]^.typ = top_const) and
|
||||||
(taicpu(hp1).oper[1]^.typ = top_reg) and
|
(taicpu(hp1).oper[1]^.typ = top_reg) and
|
||||||
(taicpu(p).oper[1]^.reg = taicpu(hp1).oper[1]^.reg) then
|
(getsupreg(taicpu(p).oper[1]^.reg)=getsupreg(taicpu(hp1).oper[1]^.reg)) and
|
||||||
|
(getsubreg(taicpu(p).oper[1]^.reg)<=getsubreg(taicpu(hp1).oper[1]^.reg)) then
|
||||||
{change "and const1, reg; and const2, reg" to "and (const1 and const2), reg"}
|
{change "and const1, reg; and const2, reg" to "and (const1 and const2), reg"}
|
||||||
begin
|
begin
|
||||||
taicpu(p).loadConst(0,taicpu(p).oper[0]^.val and taicpu(hp1).oper[0]^.val);
|
taicpu(hp1).loadConst(0,taicpu(p).oper[0]^.val and taicpu(hp1).oper[0]^.val);
|
||||||
asml.remove(hp1);
|
asml.remove(p);
|
||||||
hp1.free;
|
p.free;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{change "and x, reg; jxx" to "test x, reg", if reg is deallocated before the
|
{change "and x, reg; jxx" to "test x, reg", if reg is deallocated before the
|
||||||
|
Loading…
Reference in New Issue
Block a user