mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-10 08:41:23 +02:00
* better rules if a 3 op mul operation is tried
git-svn-id: trunk@45605 -
This commit is contained in:
parent
2c053b4f9c
commit
5f67d830e7
@ -2327,7 +2327,7 @@ unit cgx86;
|
|||||||
if (op=OP_MUL) and not (cs_check_overflow in current_settings.localswitches) then
|
if (op=OP_MUL) and not (cs_check_overflow in current_settings.localswitches) then
|
||||||
op:=OP_IMUL;
|
op:=OP_IMUL;
|
||||||
case op of
|
case op of
|
||||||
OP_NEG,OP_NOT,OP_IMUL:
|
OP_NEG,OP_NOT:
|
||||||
begin
|
begin
|
||||||
inherited a_op_ref_reg(list,op,size,tmpref,reg);
|
inherited a_op_ref_reg(list,op,size,tmpref,reg);
|
||||||
end;
|
end;
|
||||||
|
@ -1514,6 +1514,13 @@ unit nx86add;
|
|||||||
make no sense if right is a reference }
|
make no sense if right is a reference }
|
||||||
if ((left.location.loc<>LOC_REGISTER) and (right.location.loc<>LOC_REGISTER) and
|
if ((left.location.loc<>LOC_REGISTER) and (right.location.loc<>LOC_REGISTER) and
|
||||||
((nodetype<>subn) or not(right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE])) and
|
((nodetype<>subn) or not(right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE])) and
|
||||||
|
{ 3 op mul makes only sense if a constant is involed }
|
||||||
|
((nodetype<>muln) or (left.location.loc=LOC_CONSTANT) or (right.location.loc=LOC_CONSTANT)
|
||||||
|
{$ifndef i8086}
|
||||||
|
or ((CPUX86_HAS_BMI2 in cpu_capabilities[current_settings.cputype]) and (not(needoverflowcheck))
|
||||||
|
)
|
||||||
|
{$endif i8086}
|
||||||
|
) and
|
||||||
(not(nodetype in [orn,andn,xorn]))) or
|
(not(nodetype in [orn,andn,xorn]))) or
|
||||||
((nodetype=addn) and (left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT]) and (right.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT])) then
|
((nodetype=addn) and (left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT]) and (right.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT])) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user