mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-05 06:39:04 +02:00
* optimized mul code generation
This commit is contained in:
parent
26b49014ae
commit
9594866b30
@ -299,6 +299,7 @@ unit cgcpu;
|
||||
shift : byte;
|
||||
tmpreg : tregister;
|
||||
so : tshifterop;
|
||||
l1 : longint;
|
||||
begin
|
||||
if is_shifter_const(dword(-a),shift) then
|
||||
case op of
|
||||
@ -373,6 +374,10 @@ unit cgcpu;
|
||||
a_load_const_reg(list,size,0,dst)
|
||||
else if (op in [OP_IMUL]) and (a=-1) then
|
||||
a_op_reg_reg(list,OP_NEG,size,src,dst)
|
||||
{ we do this here instead in the peephole optimizer because
|
||||
it saves us a register }
|
||||
else if (op in [OP_MUL,OP_IMUL]) and ispowerof2(a,l1) then
|
||||
a_op_const_reg_reg(list,OP_SHL,size,l1,src,dst)
|
||||
else
|
||||
begin
|
||||
tmpreg:=getintregister(list,size);
|
||||
@ -1283,7 +1288,10 @@ begin
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.48 2004-03-14 16:15:40 florian
|
||||
Revision 1.49 2004-03-14 21:42:24 florian
|
||||
* optimized mul code generation
|
||||
|
||||
Revision 1.48 2004/03/14 16:15:40 florian
|
||||
* spilling problem fixed
|
||||
* handling of floating point memory references fixed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user