mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
* use 3 op cgobj methods when doing shl/shr code generation, this allows the cg to generate better code on risc archs having 3 operand shifts
git-svn-id: trunk@14487 -
This commit is contained in:
parent
1583907ac4
commit
0d57b2d8da
@ -239,7 +239,7 @@ implementation
|
||||
location_copy(location,left.location);
|
||||
location_force_reg(current_asmdata.CurrAsmList,location,OS_SINT,false);
|
||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_SINT,location.register,location.register);
|
||||
|
||||
|
||||
if (cs_check_overflow in current_settings.localswitches) then
|
||||
begin
|
||||
current_asmdata.getjumplabel(hl);
|
||||
@ -412,12 +412,13 @@ implementation
|
||||
shrn: op:=OP_SHR;
|
||||
end;
|
||||
{ load left operators in a register }
|
||||
location_copy(location,left.location);
|
||||
if is_signed(left.resultdef) then
|
||||
opsize:=OS_SINT
|
||||
else
|
||||
opsize:=OS_INT;
|
||||
location_force_reg(current_asmdata.CurrAsmList,location,opsize,false);
|
||||
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
|
||||
location_reset(location,LOC_REGISTER,opsize);
|
||||
location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
|
||||
|
||||
{ shifting by a constant directly coded: }
|
||||
if (right.nodetype=ordconstn) then
|
||||
@ -425,8 +426,8 @@ implementation
|
||||
{ l shl 32 should 0 imho, but neither TP nor Delphi do it in this way (FK)
|
||||
if right.value<=31 then
|
||||
}
|
||||
cg.a_op_const_reg(current_asmdata.CurrAsmList,op,location.size,
|
||||
tordconstnode(right).value.uvalue and 31,location.register);
|
||||
cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,op,location.size,
|
||||
tordconstnode(right).value.uvalue and 31,left.location.register,location.register);
|
||||
{
|
||||
else
|
||||
emit_reg_reg(A_XOR,S_L,hregister1,
|
||||
@ -446,7 +447,7 @@ implementation
|
||||
end
|
||||
else
|
||||
hcountreg:=right.location.register;
|
||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,op,opsize,hcountreg,location.register);
|
||||
cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,op,opsize,hcountreg,left.location.register,location.register);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user