* better rules if a 3 op mul operation is tried

git-svn-id: trunk@45605 -
This commit is contained in:
florian 2020-06-06 19:21:04 +00:00
parent 2c053b4f9c
commit 5f67d830e7
2 changed files with 8 additions and 1 deletions

View File

@ -2327,7 +2327,7 @@ unit cgx86;
if (op=OP_MUL) and not (cs_check_overflow in current_settings.localswitches) then
op:=OP_IMUL;
case op of
OP_NEG,OP_NOT,OP_IMUL:
OP_NEG,OP_NOT:
begin
inherited a_op_ref_reg(list,op,size,tmpref,reg);
end;

View File

@ -1514,6 +1514,13 @@ unit nx86add;
make no sense if right is a reference }
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
{ 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
((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