mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 10:50:59 +02:00
* Further register allocator work. Compiler now smaller with new
allocator than without. * Somebody forgot to adjust ppu version number
This commit is contained in:
parent
d1eb9015ae
commit
9e2084b8d5
@ -742,6 +742,7 @@ unit cgobj;
|
|||||||
pushed_reg.enum:=R_INTREGISTER;
|
pushed_reg.enum:=R_INTREGISTER;
|
||||||
pushed_reg.number:=NR_NO;
|
pushed_reg.number:=NR_NO;
|
||||||
if size in [OS_8,OS_S8] then
|
if size in [OS_8,OS_S8] then
|
||||||
|
{$ifndef newra}
|
||||||
if (rg.countunusedregsint = 0) then
|
if (rg.countunusedregsint = 0) then
|
||||||
begin
|
begin
|
||||||
if (dref.base.enum<>R_NO) and (dref.base.enum<>R_INTREGISTER) then
|
if (dref.base.enum<>R_NO) and (dref.base.enum<>R_INTREGISTER) then
|
||||||
@ -762,6 +763,7 @@ unit cgobj;
|
|||||||
list.concat(taicpu.op_reg(A_PUSH,S_L,pushed_reg));
|
list.concat(taicpu.op_reg(A_PUSH,S_L,pushed_reg));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
{$endif}
|
||||||
tmpreg := rg.getregisterint(list,size)
|
tmpreg := rg.getregisterint(list,size)
|
||||||
else
|
else
|
||||||
{$endif i386}
|
{$endif i386}
|
||||||
@ -773,6 +775,7 @@ unit cgobj;
|
|||||||
a_load_ref_reg(list,size,sref,tmpreg);
|
a_load_ref_reg(list,size,sref,tmpreg);
|
||||||
a_load_reg_ref(list,size,tmpreg,dref);
|
a_load_reg_ref(list,size,tmpreg,dref);
|
||||||
{$ifdef i386}
|
{$ifdef i386}
|
||||||
|
{$ifndef newra}
|
||||||
if size in [OS_8,OS_S8] then
|
if size in [OS_8,OS_S8] then
|
||||||
begin
|
begin
|
||||||
if (pushed_reg.number<>NR_NO) then
|
if (pushed_reg.number<>NR_NO) then
|
||||||
@ -781,6 +784,7 @@ unit cgobj;
|
|||||||
rg.ungetregisterint(list,tmpreg)
|
rg.ungetregisterint(list,tmpreg)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
{$endif}
|
||||||
{$endif i386}
|
{$endif i386}
|
||||||
{$ifdef newra}
|
{$ifdef newra}
|
||||||
rg.ungetregisterint(list,tmpreg);
|
rg.ungetregisterint(list,tmpreg);
|
||||||
@ -1838,7 +1842,12 @@ finalization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.86 2003-04-23 13:20:34 peter
|
Revision 1.87 2003-04-23 14:42:07 daniel
|
||||||
|
* Further register allocator work. Compiler now smaller with new
|
||||||
|
allocator than without.
|
||||||
|
* Somebody forgot to adjust ppu version number
|
||||||
|
|
||||||
|
Revision 1.86 2003/04/23 13:20:34 peter
|
||||||
* fix self passing to fpc_help_fail
|
* fix self passing to fpc_help_fail
|
||||||
|
|
||||||
Revision 1.85 2003/04/23 12:35:34 florian
|
Revision 1.85 2003/04/23 12:35:34 florian
|
||||||
|
@ -163,8 +163,8 @@ implementation
|
|||||||
else
|
else
|
||||||
if (pop_size=8) and
|
if (pop_size=8) and
|
||||||
not(cs_littlesize in aktglobalswitches) and
|
not(cs_littlesize in aktglobalswitches) and
|
||||||
(aktoptprocessor=ClassP5) and
|
(aktoptprocessor=ClassP5)
|
||||||
(rg.countunusedregsint>0) then
|
{$ifndef newra} and (rg.countunusedregsint>0){$endif} then
|
||||||
begin
|
begin
|
||||||
{$ifdef newra}
|
{$ifdef newra}
|
||||||
hreg:=rg.getregisterint(exprasmlist,OS_INT);
|
hreg:=rg.getregisterint(exprasmlist,OS_INT);
|
||||||
@ -201,7 +201,12 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.89 2003-04-22 14:33:38 peter
|
Revision 1.90 2003-04-23 14:42:08 daniel
|
||||||
|
* Further register allocator work. Compiler now smaller with new
|
||||||
|
allocator than without.
|
||||||
|
* Somebody forgot to adjust ppu version number
|
||||||
|
|
||||||
|
Revision 1.89 2003/04/22 14:33:38 peter
|
||||||
* removed some notes/hints
|
* removed some notes/hints
|
||||||
|
|
||||||
Revision 1.88 2003/04/22 10:09:35 daniel
|
Revision 1.88 2003/04/22 10:09:35 daniel
|
||||||
|
@ -358,7 +358,9 @@ unit rgcpu;
|
|||||||
{ then save it }
|
{ then save it }
|
||||||
list.concat(Taicpu.Op_reg(A_PUSH,S_L,r2));
|
list.concat(Taicpu.Op_reg(A_PUSH,S_L,r2));
|
||||||
include(unusedregsint,r);
|
include(unusedregsint,r);
|
||||||
|
{$ifndef newra}
|
||||||
inc(countunusedregsint);
|
inc(countunusedregsint);
|
||||||
|
{$endif}
|
||||||
pushed[r].pushed:=true;
|
pushed[r].pushed:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -393,7 +395,9 @@ unit rgcpu;
|
|||||||
r2.enum:=r;
|
r2.enum:=r;
|
||||||
list.concat(Taicpu.Op_reg_ref(A_MOVQ,S_NO,r2,hr));
|
list.concat(Taicpu.Op_reg_ref(A_MOVQ,S_NO,r2,hr));
|
||||||
include(unusedregsmm,r);
|
include(unusedregsmm,r);
|
||||||
|
{$ifndef newra}
|
||||||
inc(countunusedregsmm);
|
inc(countunusedregsmm);
|
||||||
|
{$endif}
|
||||||
pushed[r].pushed:=true;
|
pushed[r].pushed:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -422,7 +426,7 @@ unit rgcpu;
|
|||||||
that appear as used
|
that appear as used
|
||||||
due to a unused tmep storage PM }
|
due to a unused tmep storage PM }
|
||||||
else
|
else
|
||||||
dec(countunusedregsint);
|
{$ifndef newra}dec(countunusedregsint){$endif};
|
||||||
exclude(unusedregsint,r);
|
exclude(unusedregsint,r);
|
||||||
end;
|
end;
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
@ -454,7 +458,7 @@ unit rgcpu;
|
|||||||
that appear as used
|
that appear as used
|
||||||
due to a unused tmep storage PM }
|
due to a unused tmep storage PM }
|
||||||
else
|
else
|
||||||
dec(countunusedregsmm);
|
{$ifndef newra}dec(countunusedregsmm){$endif};
|
||||||
exclude(unusedregsmm,r);
|
exclude(unusedregsmm,r);
|
||||||
end;
|
end;
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
@ -562,7 +566,12 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.19 2003-04-22 10:09:35 daniel
|
Revision 1.20 2003-04-23 14:42:08 daniel
|
||||||
|
* Further register allocator work. Compiler now smaller with new
|
||||||
|
allocator than without.
|
||||||
|
* Somebody forgot to adjust ppu version number
|
||||||
|
|
||||||
|
Revision 1.19 2003/04/22 10:09:35 daniel
|
||||||
+ Implemented the actual register allocator
|
+ Implemented the actual register allocator
|
||||||
+ Scratch registers unavailable when new register allocator used
|
+ Scratch registers unavailable when new register allocator used
|
||||||
+ maybe_save/maybe_restore unavailable when new register allocator used
|
+ maybe_save/maybe_restore unavailable when new register allocator used
|
||||||
|
@ -41,7 +41,7 @@ type
|
|||||||
{$endif Test_Double_checksum}
|
{$endif Test_Double_checksum}
|
||||||
|
|
||||||
const
|
const
|
||||||
CurrentPPUVersion=32;
|
CurrentPPUVersion=33;
|
||||||
|
|
||||||
{ buffer sizes }
|
{ buffer sizes }
|
||||||
maxentrysize = 1024;
|
maxentrysize = 1024;
|
||||||
@ -985,7 +985,12 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.31 2003-04-10 17:57:53 peter
|
Revision 1.32 2003-04-23 14:42:07 daniel
|
||||||
|
* Further register allocator work. Compiler now smaller with new
|
||||||
|
allocator than without.
|
||||||
|
* Somebody forgot to adjust ppu version number
|
||||||
|
|
||||||
|
Revision 1.31 2003/04/10 17:57:53 peter
|
||||||
* vs_hidden released
|
* vs_hidden released
|
||||||
|
|
||||||
Revision 1.30 2003/03/17 15:54:22 peter
|
Revision 1.30 2003/03/17 15:54:22 peter
|
||||||
|
@ -65,6 +65,10 @@ the div instruction modifies edx, so variables that are in use at that time
|
|||||||
cannot be stored into edx. This can be modelled by making edx interfere
|
cannot be stored into edx. This can be modelled by making edx interfere
|
||||||
with those variables.
|
with those variables.
|
||||||
|
|
||||||
|
Graph colouring is an NP complete problem. Therefore we use an approximation
|
||||||
|
that pushes registers to colour on to a stack. This is done in the "simplify"
|
||||||
|
procedure.
|
||||||
|
|
||||||
*******************************************************************************}
|
*******************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
@ -148,8 +152,10 @@ unit rgobj;
|
|||||||
unusedregsmm,usableregsmm : tregisterset;
|
unusedregsmm,usableregsmm : tregisterset;
|
||||||
{ these counters contain the number of elements in the }
|
{ these counters contain the number of elements in the }
|
||||||
{ unusedregsxxx/usableregsxxx sets }
|
{ unusedregsxxx/usableregsxxx sets }
|
||||||
|
{$ifndef newra}
|
||||||
countunusedregsint,
|
countunusedregsint,
|
||||||
countunusedregsaddr,
|
countunusedregsaddr,
|
||||||
|
{$endif}
|
||||||
countunusedregsfpu,
|
countunusedregsfpu,
|
||||||
countunusedregsmm : byte;
|
countunusedregsmm : byte;
|
||||||
countusableregsint,
|
countusableregsint,
|
||||||
@ -343,17 +349,17 @@ unit rgobj;
|
|||||||
{ the following two contain the common (generic) code for all }
|
{ the following two contain the common (generic) code for all }
|
||||||
{ get- and ungetregisterxxx functions/procedures }
|
{ get- and ungetregisterxxx functions/procedures }
|
||||||
function getregistergen(list: taasmoutput; const lowreg, highreg: Toldregister;
|
function getregistergen(list: taasmoutput; const lowreg, highreg: Toldregister;
|
||||||
var unusedregs:Tregisterset; var countunusedregs: byte): tregister;
|
var unusedregs:Tregisterset;var countunusedregs:byte): tregister;
|
||||||
function getregistergenint(list:Taasmoutput;subreg:Tsubregister;
|
function getregistergenint(list:Taasmoutput;subreg:Tsubregister;
|
||||||
const lowreg,highreg:Tsuperregister;
|
const lowreg,highreg:Tsuperregister;
|
||||||
var fusedinproc,fusedbyproc,unusedregs:Tsupregset;
|
var fusedinproc,fusedbyproc,unusedregs:Tsupregset
|
||||||
var countunusedregs:byte):Tregister;
|
{$ifndef newra};var countunusedregs:byte{$endif}):Tregister;
|
||||||
procedure ungetregistergen(list: taasmoutput; const r: tregister;
|
procedure ungetregistergen(list: taasmoutput; const r: tregister;
|
||||||
const usableregs: tregisterset; var unusedregs: tregisterset; var countunusedregs: byte);
|
const usableregs:tregisterset;var unusedregs: tregisterset; var countunusedregs: byte);
|
||||||
procedure ungetregistergenint(list:taasmoutput;const r:Tregister;
|
procedure ungetregistergenint(list:taasmoutput;const r:Tregister;
|
||||||
const usableregs:Tsupregset;
|
const usableregs:Tsupregset;
|
||||||
var unusedregs:Tsupregset;
|
var unusedregs:Tsupregset
|
||||||
var countunusedregs:byte);
|
{$ifndef newra};var countunusedregs:byte{$endif});
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
reg_user : regvar_ptreearray;
|
reg_user : regvar_ptreearray;
|
||||||
reg_releaser : regvar_ptreearray;
|
reg_releaser : regvar_ptreearray;
|
||||||
@ -425,8 +431,10 @@ unit rgobj;
|
|||||||
unusedregsaddr,usableregsaddr : Tsupregset;
|
unusedregsaddr,usableregsaddr : Tsupregset;
|
||||||
unusedregsfpu,usableregsfpu : tregisterset;
|
unusedregsfpu,usableregsfpu : tregisterset;
|
||||||
unusedregsmm,usableregsmm : tregisterset;
|
unusedregsmm,usableregsmm : tregisterset;
|
||||||
|
{$ifndef newra}
|
||||||
countunusedregsint,
|
countunusedregsint,
|
||||||
countunusedregsaddr,
|
countunusedregsaddr,
|
||||||
|
{$endif}
|
||||||
countunusedregsfpu,
|
countunusedregsfpu,
|
||||||
countunusedregsmm : byte;
|
countunusedregsmm : byte;
|
||||||
countusableregsint,
|
countusableregsint,
|
||||||
@ -452,8 +460,10 @@ unit rgobj;
|
|||||||
unusedregsaddr : Tsupregset;
|
unusedregsaddr : Tsupregset;
|
||||||
unusedregsfpu : tregisterset;
|
unusedregsfpu : tregisterset;
|
||||||
unusedregsmm : tregisterset;
|
unusedregsmm : tregisterset;
|
||||||
|
{$ifndef newra}
|
||||||
countunusedregsint,
|
countunusedregsint,
|
||||||
countunusedregsaddr,
|
countunusedregsaddr,
|
||||||
|
{$endif}
|
||||||
countunusedregsfpu,
|
countunusedregsfpu,
|
||||||
countunusedregsmm : byte;
|
countunusedregsmm : byte;
|
||||||
end;
|
end;
|
||||||
@ -514,8 +524,8 @@ unit rgobj;
|
|||||||
function Trgobj.getregistergenint(list:Taasmoutput;
|
function Trgobj.getregistergenint(list:Taasmoutput;
|
||||||
subreg:Tsubregister;
|
subreg:Tsubregister;
|
||||||
const lowreg,highreg:Tsuperregister;
|
const lowreg,highreg:Tsuperregister;
|
||||||
var fusedinproc,fusedbyproc,unusedregs:Tsupregset;
|
var fusedinproc,fusedbyproc,unusedregs:Tsupregset
|
||||||
var countunusedregs:byte):Tregister;
|
{$ifndef newra};var countunusedregs:byte{$endif}):Tregister;
|
||||||
|
|
||||||
var i:Tsuperregister;
|
var i:Tsuperregister;
|
||||||
r:Tregister;
|
r:Tregister;
|
||||||
@ -534,7 +544,9 @@ unit rgobj;
|
|||||||
exclude(unusedregs,i);
|
exclude(unusedregs,i);
|
||||||
include(fusedinproc,i);
|
include(fusedinproc,i);
|
||||||
include(fusedbyproc,i);
|
include(fusedbyproc,i);
|
||||||
|
{$ifndef newra}
|
||||||
dec(countunusedregs);
|
dec(countunusedregs);
|
||||||
|
{$endif}
|
||||||
r.enum:=R_INTREGISTER;
|
r.enum:=R_INTREGISTER;
|
||||||
r.number:=i shl 8 or subreg;
|
r.number:=i shl 8 or subreg;
|
||||||
list.concat(Tai_regalloc.alloc(r));
|
list.concat(Tai_regalloc.alloc(r));
|
||||||
@ -542,9 +554,9 @@ unit rgobj;
|
|||||||
lastintreg:=i;
|
lastintreg:=i;
|
||||||
if i>maxintreg then
|
if i>maxintreg then
|
||||||
maxintreg:=i;
|
maxintreg:=i;
|
||||||
{$ifdef newra}
|
{$ifdef newra}
|
||||||
add_edges_used(i);
|
add_edges_used(i);
|
||||||
{$endif}
|
{$endif}
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
until i=lastintreg;
|
until i=lastintreg;
|
||||||
@ -580,8 +592,8 @@ unit rgobj;
|
|||||||
|
|
||||||
procedure trgobj.ungetregistergenint(list:taasmoutput;const r:Tregister;
|
procedure trgobj.ungetregistergenint(list:taasmoutput;const r:Tregister;
|
||||||
const usableregs:Tsupregset;
|
const usableregs:Tsupregset;
|
||||||
var unusedregs:Tsupregset;
|
var unusedregs:Tsupregset
|
||||||
var countunusedregs:byte);
|
{$ifndef newra}var countunusedregs:byte{$endif});
|
||||||
|
|
||||||
var supreg:Tsuperregister;
|
var supreg:Tsuperregister;
|
||||||
|
|
||||||
@ -607,7 +619,7 @@ unit rgobj;
|
|||||||
{$endif EXTTEMPREGDEBUG}
|
{$endif EXTTEMPREGDEBUG}
|
||||||
else
|
else
|
||||||
{$endif TEMPREGDEBUG}
|
{$endif TEMPREGDEBUG}
|
||||||
inc(countunusedregs);
|
{$ifndef newra}inc(countunusedregs){$endif};
|
||||||
include(unusedregs,supreg);
|
include(unusedregs,supreg);
|
||||||
list.concat(tai_regalloc.dealloc(r));
|
list.concat(tai_regalloc.dealloc(r));
|
||||||
{$ifdef newra}
|
{$ifdef newra}
|
||||||
@ -621,16 +633,18 @@ unit rgobj;
|
|||||||
var subreg:Tsubregister;
|
var subreg:Tsubregister;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$ifndef newra}
|
||||||
if countunusedregsint=0 then
|
if countunusedregsint=0 then
|
||||||
internalerror(10);
|
internalerror(10);
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
if curptree^^.usableregs-countunusedregsint>curptree^^.registers32 then
|
if curptree^^.usableregs-countunusedregsint>curptree^^.registers32 then
|
||||||
internalerror(10);
|
internalerror(10);
|
||||||
{$endif TEMPREGDEBUG}
|
{$endif TEMPREGDEBUG}
|
||||||
{$ifdef EXTTEMPREGDEBUG}
|
{$ifdef EXTTEMPREGDEBUG}
|
||||||
if curptree^^.usableregs-countunusedregsint>curptree^^.reallyusedregs then
|
if curptree^^.usableregs-countunusedregsint>curptree^^.reallyusedregs then
|
||||||
curptree^^.reallyusedregs:=curptree^^.usableregs-countunusedregsint;
|
curptree^^.reallyusedregs:=curptree^^.usableregs-countunusedregsint;
|
||||||
{$endif EXTTEMPREGDEBUG}
|
{$endif EXTTEMPREGDEBUG}
|
||||||
|
{$endif}
|
||||||
subreg:=cgsize2subreg(size);
|
subreg:=cgsize2subreg(size);
|
||||||
result:=getregistergenint(list,
|
result:=getregistergenint(list,
|
||||||
subreg,
|
subreg,
|
||||||
@ -643,8 +657,8 @@ unit rgobj;
|
|||||||
{$endif}
|
{$endif}
|
||||||
usedintbyproc,
|
usedintbyproc,
|
||||||
usedintinproc,
|
usedintinproc,
|
||||||
unusedregsint,
|
unusedregsint{$ifndef newra},
|
||||||
countunusedregsint);
|
countunusedregsint{$endif});
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
reg_user[result]:=curptree^;
|
reg_user[result]:=curptree^;
|
||||||
testregisters32;
|
testregisters32;
|
||||||
@ -655,8 +669,8 @@ unit rgobj;
|
|||||||
procedure trgobj.ungetregisterint(list : taasmoutput; r : tregister);
|
procedure trgobj.ungetregisterint(list : taasmoutput; r : tregister);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ungetregistergenint(list,r,usableregsint,unusedregsint,
|
ungetregistergenint(list,r,usableregsint,unusedregsint{$ifndef newra},
|
||||||
countunusedregsint);
|
countunusedregsint{$endif});
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
reg_releaser[r]:=curptree^;
|
reg_releaser[r]:=curptree^;
|
||||||
testregisters32;
|
testregisters32;
|
||||||
@ -672,12 +686,14 @@ unit rgobj;
|
|||||||
begin
|
begin
|
||||||
if (r shr 8) in unusedregsint then
|
if (r shr 8) in unusedregsint then
|
||||||
begin
|
begin
|
||||||
|
{$ifndef newra}
|
||||||
dec(countunusedregsint);
|
dec(countunusedregsint);
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
if curptree^^.usableregs-countunusedregsint>curptree^^.registers32 then
|
if curptree^^.usableregs-countunusedregsint>curptree^^.registers32 then
|
||||||
internalerror(10);
|
internalerror(10);
|
||||||
reg_user[r shr 8]:=curptree^;
|
reg_user[r shr 8]:=curptree^;
|
||||||
{$endif TEMPREGDEBUG}
|
{$endif TEMPREGDEBUG}
|
||||||
|
{$endif newra}
|
||||||
exclude(unusedregsint,r shr 8);
|
exclude(unusedregsint,r shr 8);
|
||||||
include(usedintinproc,r shr 8);
|
include(usedintinproc,r shr 8);
|
||||||
include(usedintbyproc,r shr 8);
|
include(usedintbyproc,r shr 8);
|
||||||
@ -801,7 +817,9 @@ unit rgobj;
|
|||||||
{$endif newra}
|
{$endif newra}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$ifndef newra}
|
||||||
countunusedregsint:=countusableregsint;
|
countunusedregsint:=countusableregsint;
|
||||||
|
{$endif}
|
||||||
countunusedregsfpu:=countusableregsfpu;
|
countunusedregsfpu:=countusableregsfpu;
|
||||||
countunusedregsmm:=countusableregsmm;
|
countunusedregsmm:=countusableregsmm;
|
||||||
lastintreg:=0;
|
lastintreg:=0;
|
||||||
@ -899,7 +917,9 @@ unit rgobj;
|
|||||||
cg.a_load_reg_ref(list,OS_INT,r2,hr);
|
cg.a_load_reg_ref(list,OS_INT,r2,hr);
|
||||||
cg.a_reg_dealloc(list,r2);
|
cg.a_reg_dealloc(list,r2);
|
||||||
include(unusedregsint,r);
|
include(unusedregsint,r);
|
||||||
|
{$ifndef newra}
|
||||||
inc(countunusedregsint);
|
inc(countunusedregsint);
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef TEMPREGDEBUG}
|
{$ifdef TEMPREGDEBUG}
|
||||||
@ -993,7 +1013,9 @@ unit rgobj;
|
|||||||
may not be real (JM) }
|
may not be real (JM) }
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
{$ifndef newra}
|
||||||
dec(countunusedregsint);
|
dec(countunusedregsint);
|
||||||
|
{$endif}
|
||||||
exclude(unusedregsint,r);
|
exclude(unusedregsint,r);
|
||||||
end;
|
end;
|
||||||
tg.UnGetTemp(list,hr);
|
tg.UnGetTemp(list,hr);
|
||||||
@ -1130,7 +1152,9 @@ unit rgobj;
|
|||||||
begin
|
begin
|
||||||
supreg:=reg shr 8;
|
supreg:=reg shr 8;
|
||||||
dec(countusableregsint);
|
dec(countusableregsint);
|
||||||
|
{$ifndef newra}
|
||||||
dec(countunusedregsint);
|
dec(countunusedregsint);
|
||||||
|
{$endif}
|
||||||
exclude(usableregsint,reg);
|
exclude(usableregsint,reg);
|
||||||
exclude(unusedregsint,reg);
|
exclude(unusedregsint,reg);
|
||||||
include(is_reg_var_int,supreg);
|
include(is_reg_var_int,supreg);
|
||||||
@ -1184,7 +1208,9 @@ unit rgobj;
|
|||||||
psavedstate(state)^.usableregsfpu := usableregsfpu;
|
psavedstate(state)^.usableregsfpu := usableregsfpu;
|
||||||
psavedstate(state)^.unusedregsmm := unusedregsmm;
|
psavedstate(state)^.unusedregsmm := unusedregsmm;
|
||||||
psavedstate(state)^.usableregsmm := usableregsmm;
|
psavedstate(state)^.usableregsmm := usableregsmm;
|
||||||
|
{$ifndef newra}
|
||||||
psavedstate(state)^.countunusedregsint := countunusedregsint;
|
psavedstate(state)^.countunusedregsint := countunusedregsint;
|
||||||
|
{$endif}
|
||||||
psavedstate(state)^.countunusedregsfpu := countunusedregsfpu;
|
psavedstate(state)^.countunusedregsfpu := countunusedregsfpu;
|
||||||
psavedstate(state)^.countunusedregsmm := countunusedregsmm;
|
psavedstate(state)^.countunusedregsmm := countunusedregsmm;
|
||||||
psavedstate(state)^.countusableregsint := countusableregsint;
|
psavedstate(state)^.countusableregsint := countusableregsint;
|
||||||
@ -1212,7 +1238,9 @@ unit rgobj;
|
|||||||
usableregsfpu := psavedstate(state)^.usableregsfpu;
|
usableregsfpu := psavedstate(state)^.usableregsfpu;
|
||||||
unusedregsmm := psavedstate(state)^.unusedregsmm;
|
unusedregsmm := psavedstate(state)^.unusedregsmm;
|
||||||
usableregsmm := psavedstate(state)^.usableregsmm;
|
usableregsmm := psavedstate(state)^.usableregsmm;
|
||||||
|
{$ifndef newra}
|
||||||
countunusedregsint := psavedstate(state)^.countunusedregsint;
|
countunusedregsint := psavedstate(state)^.countunusedregsint;
|
||||||
|
{$endif}
|
||||||
countunusedregsfpu := psavedstate(state)^.countunusedregsfpu;
|
countunusedregsfpu := psavedstate(state)^.countunusedregsfpu;
|
||||||
countunusedregsmm := psavedstate(state)^.countunusedregsmm;
|
countunusedregsmm := psavedstate(state)^.countunusedregsmm;
|
||||||
countusableregsint := psavedstate(state)^.countusableregsint;
|
countusableregsint := psavedstate(state)^.countusableregsint;
|
||||||
@ -1240,7 +1268,9 @@ unit rgobj;
|
|||||||
punusedstate(state)^.unusedregsint := unusedregsint;
|
punusedstate(state)^.unusedregsint := unusedregsint;
|
||||||
punusedstate(state)^.unusedregsfpu := unusedregsfpu;
|
punusedstate(state)^.unusedregsfpu := unusedregsfpu;
|
||||||
punusedstate(state)^.unusedregsmm := unusedregsmm;
|
punusedstate(state)^.unusedregsmm := unusedregsmm;
|
||||||
|
{$ifndef newra}
|
||||||
punusedstate(state)^.countunusedregsint := countunusedregsint;
|
punusedstate(state)^.countunusedregsint := countunusedregsint;
|
||||||
|
{$endif}
|
||||||
punusedstate(state)^.countunusedregsfpu := countunusedregsfpu;
|
punusedstate(state)^.countunusedregsfpu := countunusedregsfpu;
|
||||||
punusedstate(state)^.countunusedregsmm := countunusedregsmm;
|
punusedstate(state)^.countunusedregsmm := countunusedregsmm;
|
||||||
end;
|
end;
|
||||||
@ -1251,7 +1281,9 @@ unit rgobj;
|
|||||||
unusedregsint := punusedstate(state)^.unusedregsint;
|
unusedregsint := punusedstate(state)^.unusedregsint;
|
||||||
unusedregsfpu := punusedstate(state)^.unusedregsfpu;
|
unusedregsfpu := punusedstate(state)^.unusedregsfpu;
|
||||||
unusedregsmm := punusedstate(state)^.unusedregsmm;
|
unusedregsmm := punusedstate(state)^.unusedregsmm;
|
||||||
|
{$ifndef newra}
|
||||||
countunusedregsint := punusedstate(state)^.countunusedregsint;
|
countunusedregsint := punusedstate(state)^.countunusedregsint;
|
||||||
|
{$endif}
|
||||||
countunusedregsfpu := punusedstate(state)^.countunusedregsfpu;
|
countunusedregsfpu := punusedstate(state)^.countunusedregsfpu;
|
||||||
countunusedregsmm := punusedstate(state)^.countunusedregsmm;
|
countunusedregsmm := punusedstate(state)^.countunusedregsmm;
|
||||||
dispose(punusedstate(state));
|
dispose(punusedstate(state));
|
||||||
@ -1969,7 +2001,12 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.37 2003-04-22 23:50:23 peter
|
Revision 1.38 2003-04-23 14:42:07 daniel
|
||||||
|
* Further register allocator work. Compiler now smaller with new
|
||||||
|
allocator than without.
|
||||||
|
* Somebody forgot to adjust ppu version number
|
||||||
|
|
||||||
|
Revision 1.37 2003/04/22 23:50:23 peter
|
||||||
* firstpass uses expectloc
|
* firstpass uses expectloc
|
||||||
* checks if there are differences between the expectloc and
|
* checks if there are differences between the expectloc and
|
||||||
location.loc from secondpass in EXTDEBUG
|
location.loc from secondpass in EXTDEBUG
|
||||||
|
@ -1180,6 +1180,16 @@ unit cgx86;
|
|||||||
cgsize:=OS_32;
|
cgsize:=OS_32;
|
||||||
while len<>0 do
|
while len<>0 do
|
||||||
begin
|
begin
|
||||||
|
if len<2 then
|
||||||
|
begin
|
||||||
|
copysize:=1;
|
||||||
|
cgsize:=OS_8;
|
||||||
|
end
|
||||||
|
else if len<4 then
|
||||||
|
begin
|
||||||
|
copysize:=2;
|
||||||
|
cgsize:=OS_16;
|
||||||
|
end;
|
||||||
dec(len,copysize);
|
dec(len,copysize);
|
||||||
r:=rg.getregisterint(list,cgsize);
|
r:=rg.getregisterint(list,cgsize);
|
||||||
a_load_ref_reg(list,cgsize,srcref,r);
|
a_load_ref_reg(list,cgsize,srcref,r);
|
||||||
@ -1189,16 +1199,6 @@ unit cgx86;
|
|||||||
inc(srcref.offset,copysize);
|
inc(srcref.offset,copysize);
|
||||||
inc(dstref.offset,copysize);
|
inc(dstref.offset,copysize);
|
||||||
rg.ungetregisterint(list,r);
|
rg.ungetregisterint(list,r);
|
||||||
if copysize<2 then
|
|
||||||
begin
|
|
||||||
copysize:=1;
|
|
||||||
cgsize:=OS_8;
|
|
||||||
end
|
|
||||||
else if copysize<4 then
|
|
||||||
begin
|
|
||||||
copysize:=2;
|
|
||||||
cgsize:=OS_16;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1938,7 +1938,12 @@ unit cgx86;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.41 2003-04-23 09:51:16 daniel
|
Revision 1.42 2003-04-23 14:42:08 daniel
|
||||||
|
* Further register allocator work. Compiler now smaller with new
|
||||||
|
allocator than without.
|
||||||
|
* Somebody forgot to adjust ppu version number
|
||||||
|
|
||||||
|
Revision 1.41 2003/04/23 09:51:16 daniel
|
||||||
* Removed usage of edi in a lot of places when new register allocator used
|
* Removed usage of edi in a lot of places when new register allocator used
|
||||||
+ Added newra versions of g_concatcopy and secondadd_float
|
+ Added newra versions of g_concatcopy and secondadd_float
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user