mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 11:29:20 +02:00
+ better precision in determining the registers, read by mul/imul/div/idiv in
i386's TCpuAsmOptimizer.RegReadByInstruction: * mul doesn't read edx (unless included in operand) * 8-bit mul and imul don't read ah (unless included in operand) * 8-bit div and idiv don't read edx (unless included in operand) git-svn-id: trunk@35958 -
This commit is contained in:
parent
916c09af55
commit
0f010430cc
@ -160,17 +160,33 @@ unit aoptcpu;
|
||||
A_IMUL:
|
||||
case p.ops of
|
||||
1:
|
||||
regReadByInstruction :=
|
||||
(reg = NR_EAX) or RegInOp(reg,p.oper[0]^);
|
||||
regReadByInstruction := RegInOp(reg,p.oper[0]^) or
|
||||
(
|
||||
((getregtype(reg)=R_INTREGISTER) and (getsupreg(reg)=RS_EAX)) and
|
||||
((getsubreg(reg)<>R_SUBH) or (p.opsize<>S_B))
|
||||
);
|
||||
2,3:
|
||||
regReadByInstruction :=
|
||||
reginop(reg,p.oper[0]^) or
|
||||
reginop(reg,p.oper[1]^);
|
||||
end;
|
||||
A_IDIV,A_DIV,A_MUL:
|
||||
A_MUL:
|
||||
begin
|
||||
regReadByInstruction :=
|
||||
RegInOp(reg,p.oper[0]^) or ((getregtype(reg)=R_INTREGISTER) and (getsupreg(reg) in [RS_EAX,RS_EDX]));
|
||||
regReadByInstruction := RegInOp(reg,p.oper[0]^) or
|
||||
(
|
||||
((getregtype(reg)=R_INTREGISTER) and (getsupreg(reg)=RS_EAX)) and
|
||||
((getsubreg(reg)<>R_SUBH) or (p.opsize<>S_B))
|
||||
);
|
||||
end;
|
||||
A_IDIV,A_DIV:
|
||||
begin
|
||||
regReadByInstruction := RegInOp(reg,p.oper[0]^) or
|
||||
(
|
||||
(getregtype(reg)=R_INTREGISTER) and
|
||||
(
|
||||
(getsupreg(reg)=RS_EAX) or ((getsupreg(reg)=RS_EDX) and (p.opsize<>S_B))
|
||||
)
|
||||
);
|
||||
end;
|
||||
else
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user