+ make use of the 3-operand form of IMUL on i386 and x86_64

git-svn-id: trunk@26508 -
This commit is contained in:
nickysn 2014-01-18 17:04:57 +00:00
parent 1de847c754
commit cc1faad3d2

View File

@ -1584,6 +1584,14 @@ unit cgx86;
href.scalefactor:=a;
list.concat(taicpu.op_ref_reg(A_LEA,TCgSize2OpSize[size],href,dst));
end
else if (op in [OP_MUL,OP_IMUL]) and (size in [OS_32,OS_S32,OS_64,OS_S64]) and
(a>1) and not ispowerof2(int64(a),power) then
begin
{ MUL with overflow checking should be handled specifically in the code generator }
if (op=OP_MUL) and (cs_check_overflow in current_settings.localswitches) then
internalerror(2014011801);
list.concat(taicpu.op_const_reg_reg(A_IMUL,TCgSize2OpSize[size],a,src,dst));
end
else if (op=OP_ADD) and
((size in [OS_32,OS_S32]) or
{ lea supports only 32 bit signed displacments }