* fixed several issues with flags

This commit is contained in:
florian 2004-01-22 20:13:18 +00:00
parent f65558b4c4
commit e7aba71412
4 changed files with 32 additions and 8 deletions

View File

@ -37,6 +37,8 @@ unit cgcpu;
type
tcgarm = class(tcg)
{ true, if the next arithmetic operation should modify the flags }
setflags : boolean;
procedure init_register_allocators;override;
procedure done_register_allocators;override;
@ -387,7 +389,7 @@ unit cgcpu;
end;
end;
else
list.concat(taicpu.op_reg_reg_reg(op_reg_reg_opcg2asmop[op],dst,src2,src1));
list.concat(setoppostfix(taicpu.op_reg_reg_reg(op_reg_reg_opcg2asmop[op],dst,src2,src1),toppostfix(ord(setflags)*ord(PF_S))));
end;
end;
@ -1208,7 +1210,10 @@ begin
end.
{
$Log$
Revision 1.36 2004-01-22 02:22:47 florian
Revision 1.37 2004-01-22 20:13:18 florian
* fixed several issues with flags
Revision 1.36 2004/01/22 02:22:47 florian
* op_const_reg_reg with OP_SAR fixed
Revision 1.35 2004/01/22 01:47:15 florian

View File

@ -509,7 +509,7 @@ unit cpubase;
procedure inverse_flags(var f: TResFlags);
const
inv_flags: array[TResFlags] of TResFlags =
(F_NE,F_NE,F_CC,F_CS,F_PL,F_MI,F_VC,F_VS,F_LS,F_HI,
(F_NE,F_EQ,F_CC,F_CS,F_PL,F_MI,F_VC,F_VS,F_LS,F_HI,
F_LT,F_GE,F_LE,F_GT);
begin
f:=inv_flags[f];
@ -566,7 +566,10 @@ unit cpubase;
end.
{
$Log$
Revision 1.23 2004-01-21 19:01:03 florian
Revision 1.24 2004-01-22 20:13:18 florian
* fixed several issues with flags
Revision 1.23 2004/01/21 19:01:03 florian
* fixed handling of max. distance of pc relative symbols
Revision 1.22 2003/12/26 14:02:30 peter

View File

@ -301,7 +301,7 @@ interface
end;
end
else
exprasmlist.concat(taicpu.op_reg_reg(A_CMP,left.location.register,right.location.register));
exprasmlist.concat(taicpu.op_reg_reg(A_CMP,right.location.register,left.location.register));
location_reset(location,LOC_FLAGS,OS_NO);
location.resflags:=getresflags(unsigned);
@ -314,7 +314,10 @@ begin
end.
{
$Log$
Revision 1.6 2004-01-22 01:47:15 florian
Revision 1.7 2004-01-22 20:13:18 florian
* fixed several issues with flags
Revision 1.6 2004/01/22 01:47:15 florian
* improved register usage
+ implemented second_cmp64bit

View File

@ -65,7 +65,7 @@ implementation
ncon,ncal,
ncgutil,
cpubase,aasmcpu,
rgobj,tgobj,cgobj;
rgobj,tgobj,cgobj,cgcpu;
{*****************************************************************************
@ -158,13 +158,17 @@ implementation
href:=left.location.reference;
inc(href.offset,4);
cg.ungetregister(exprasmlist,hregister);
tcgarm(cg).setflags:=true;
cg.a_op_ref_reg(exprasmlist,OP_OR,OS_32,href,hregister);
tcgarm(cg).setflags:=false;
end
else
begin
location_force_reg(exprasmlist,left.location,left.location.size,true);
location_release(exprasmlist,left.location);
tcgarm(cg).setflags:=true;
cg.a_op_reg_reg(exprasmlist,OP_OR,left.location.size,left.location.register,left.location.register);
tcgarm(cg).setflags:=false;
end;
end;
LOC_FLAGS :
@ -179,12 +183,16 @@ implementation
cg.a_load_reg_reg(exprasmlist,OS_32,OS_32,left.location.registerlow,hregister);
cg.ungetregister(exprasmlist,hregister);
location_release(exprasmlist,left.location);
tcgarm(cg).setflags:=true;
cg.a_op_reg_reg(exprasmlist,OP_OR,OS_32,left.location.registerhigh,hregister);
tcgarm(cg).setflags:=false;
end
else
begin
location_release(exprasmlist,left.location);
tcgarm(cg).setflags:=true;
cg.a_op_reg_reg(exprasmlist,OP_OR,left.location.size,left.location.register,left.location.register);
tcgarm(cg).setflags:=false;
end;
end;
LOC_JUMP :
@ -198,7 +206,9 @@ implementation
cg.a_load_const_reg(exprasmlist,OS_INT,0,hregister);
cg.a_label(exprasmlist,hlabel);
cg.ungetregister(exprasmlist,hregister);
tcgarm(cg).setflags:=true;
cg.a_op_reg_reg(exprasmlist,OP_OR,OS_INT,hregister,hregister);
tcgarm(cg).setflags:=false;
end;
else
internalerror(200311301);
@ -217,7 +227,10 @@ begin
end.
{
$Log$
Revision 1.7 2003-11-30 19:35:29 florian
Revision 1.8 2004-01-22 20:13:18 florian
* fixed several issues with flags
Revision 1.7 2003/11/30 19:35:29 florian
* fixed several arm related problems
Revision 1.6 2003/11/04 22:30:15 florian