* fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86

so that it doesn't include ebp and esp anymore
This commit is contained in:
Jonas Maebe 2003-07-06 21:50:33 +00:00
parent cd02a8ecca
commit f909d6a620
4 changed files with 33 additions and 19 deletions

View File

@ -776,7 +776,7 @@ implementation
begin
{No procedure is allowed to destroy ebp.}
{$ifdef newra}
regs_to_alloc:=VOLATILE_INTREGISTERS-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG];
regs_to_alloc:=VOLATILE_INTREGISTERS;
if (not is_void(resulttype.def)) and
not(paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption)) then
begin
@ -797,7 +797,7 @@ implementation
end;
end;
{$else}
regs_to_push_int := VOLATILE_INTREGISTERS-[RS_FRAME_POINTER_REG];
regs_to_push_int := VOLATILE_INTREGISTERS;
rg.saveusedintregisters(exprasmlist,pushedint,regs_to_push_int);
{$endif}
{$ifdef i386}
@ -1017,10 +1017,8 @@ implementation
else
cg.a_call_reg(exprasmlist,right.location.register);
{ cg.a_call_loc(exprasmlist,right.location);}
{$ifndef newra}
location_release(exprasmlist,right.location);
location_freetemp(exprasmlist,right.location);
{$endif newra}
end;
{ Need to remove the parameters from the stack? }
@ -1520,7 +1518,11 @@ begin
end.
{
$Log$
Revision 1.99 2003-07-06 17:58:22 peter
Revision 1.100 2003-07-06 21:50:33 jonas
* fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
so that it doesn't include ebp and esp anymore
Revision 1.99 2003/07/06 17:58:22 peter
* framepointer fixes for sparc
* parent framepointer code more generic

View File

@ -521,7 +521,7 @@ implementation
cg.a_param_loc(exprasmlist,right.location,paramanager.getintparaloc(exprasmlist,2));
cg.a_param_loc(exprasmlist,left.location,paramanager.getintparaloc(exprasmlist,1));
{$ifdef newra}
rg.allocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.saveintregvars(exprasmlist,VOLATILE_INTREGISTERS);
@ -530,7 +530,7 @@ implementation
paramanager.freeintparaloc(exprasmlist,2);
paramanager.freeintparaloc(exprasmlist,1);
{$ifdef newra}
rg.deallocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.restoreusedintregisters(exprasmlist,pushed);
{$endif}
@ -598,14 +598,14 @@ implementation
{$endif}
cg.a_param_reg(exprasmlist,OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
{$ifdef newra}
rg.allocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.saveintregvars(exprasmlist,VOLATILE_INTREGISTERS);
{$endif}
cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_CHECKZERO');
paramanager.freeintparaloc(exprasmlist,1);
{$ifdef newra}
rg.deallocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.restoreusedintregisters(exprasmlist,pushed);
{$endif}
@ -689,7 +689,7 @@ implementation
dec(href.offset,7);
cg.a_param_ref(exprasmlist,OS_INT,href,paramanager.getintparaloc(exprasmlist,1));
{$ifdef newra}
rg.allocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.saveintregvars(exprasmlist,VOLATILE_INTREGISTERS);
{$endif}
@ -697,7 +697,7 @@ implementation
paramanager.freeintparaloc(exprasmlist,2);
paramanager.freeintparaloc(exprasmlist,1);
{$ifdef newra}
rg.deallocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.restoreusedintregisters(exprasmlist,pushed);
{$endif}
@ -836,7 +836,7 @@ implementation
dec(href.offset,7);
cg.a_param_ref(exprasmlist,OS_INT,href,paramanager.getintparaloc(exprasmlist,1));
{$ifdef newra}
rg.allocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.saveintregvars(exprasmlist,VOLATILE_INTREGISTERS);
{$endif}
@ -844,7 +844,7 @@ implementation
paramanager.freeintparaloc(exprasmlist,2);
paramanager.freeintparaloc(exprasmlist,1);
{$ifdef newra}
rg.deallocexplicitregistersint(exprasmlist,[first_supreg..last_supreg]-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG]);
rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
{$else}
rg.restoreusedintregisters(exprasmlist,pushed);
{$endif}
@ -881,7 +881,11 @@ begin
end.
{
$Log$
Revision 1.65 2003-07-06 15:31:20 daniel
Revision 1.66 2003-07-06 21:50:33 jonas
* fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
so that it doesn't include ebp and esp anymore
Revision 1.65 2003/07/06 15:31:20 daniel
* Fixed register allocator. *Lots* of fixes.
Revision 1.64 2003/06/17 19:24:08 jonas

View File

@ -3415,7 +3415,7 @@ implementation
end;
lastref:=defref;
{ first, we assume that all registers are used }
usedintregisters:=VOLATILE_INTREGISTERS-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG];
usedintregisters:=VOLATILE_INTREGISTERS;
usedotherregisters:=ALL_REGISTERS;
forwarddef:=true;
interfacedef:=false;
@ -3557,7 +3557,7 @@ implementation
{ set all registers to used for simplified compilation PM }
if simplify_ppu then
begin
usedintregisters:=VOLATILE_INTREGISTERS-[RS_FRAME_POINTER_REG,RS_STACK_POINTER_REG];
usedintregisters:=VOLATILE_INTREGISTERS;
usedotherregisters:=ALL_REGISTERS;
end;
@ -5838,7 +5838,11 @@ implementation
end.
{
$Log$
Revision 1.155 2003-07-06 15:31:21 daniel
Revision 1.156 2003-07-06 21:50:33 jonas
* fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
so that it doesn't include ebp and esp anymore
Revision 1.155 2003/07/06 15:31:21 daniel
* Fixed register allocator. *Lots* of fixes.
Revision 1.154 2003/07/02 22:18:04 peter

View File

@ -177,7 +177,7 @@ uses
{$endif}
{ registers which may be destroyed by calls }
VOLATILE_INTREGISTERS = [first_supreg..last_supreg];
VOLATILE_INTREGISTERS = [first_supreg..last_supreg]-[RS_EBP,RS_ESP];
{Number of first and last imaginary register.}
first_imreg = $12;
@ -732,7 +732,11 @@ implementation
end.
{
$Log$
Revision 1.10 2003-06-17 16:34:45 jonas
Revision 1.11 2003-07-06 21:50:33 jonas
* fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
so that it doesn't include ebp and esp anymore
Revision 1.10 2003/06/17 16:34:45 jonas
* lots of newra fixes (need getfuncretparaloc implementation for i386)!
* renamed all_intregisters to volatile_intregisters and made it
processor dependent