* spilling of doubles on sparc fixed

This commit is contained in:
florian 2004-06-20 08:47:33 +00:00
parent cf6f4fb550
commit e9bb27df36
5 changed files with 56 additions and 20 deletions

View File

@ -39,7 +39,7 @@ const
O_MOV_DEST = 1;
type
taicpu = class(taicpu_abstract)
taicpu = class(tai_cpu_abstract)
opsize : topsize;
constructor op_none(op : tasmop;_size : topsize);
@ -96,7 +96,10 @@ type
procedure DoneAsm;
implementation
implementation
uses
globtype;
{*****************************************************************************
@ -426,7 +429,10 @@ implementation
end.
{
$Log$
Revision 1.11 2004-05-06 22:01:54 florian
Revision 1.12 2004-06-20 08:47:33 florian
* spilling of doubles on sparc fixed
Revision 1.11 2004/05/06 22:01:54 florian
* register numbers for address registers fixed
Revision 1.10 2004/01/30 12:17:18 florian

View File

@ -32,9 +32,6 @@ unit cpubase;
globtype,
strings,cutils,cclasses,aasmbase,cpuinfo,cgbase;
uses
strings,cutils,cclasses,aasmbase,cpuinfo,cgbase;
{*****************************************************************************
Assembler Opcodes
*****************************************************************************}
@ -518,7 +515,10 @@ implementation
end.
{
$Log$
Revision 1.29 2004-06-16 20:07:10 florian
Revision 1.30 2004-06-20 08:47:33 florian
* spilling of doubles on sparc fixed
Revision 1.29 2004/06/16 20:07:10 florian
* dwarf branch merged
Revision 1.28 2004/05/06 22:01:54 florian

View File

@ -166,6 +166,7 @@ unit rgobj;
Preginfo=^TReginfo;
tspillreginfo = record
spillreg : tregister;
orgreg : tsuperregister;
tempreg : tregister;
regread,regwritten, mustbespilled: boolean;
@ -227,6 +228,7 @@ unit rgobj;
procedure ungetregisterinline(list:Taasmoutput;position:Tai;r:Tregister);
procedure add_constraints(reg:Tregister);virtual;
function get_spill_subreg(r : tregister) : tsubregister;virtual;
procedure do_spill_read(list:Taasmoutput;instr:Taicpu;
pos:Tai;regidx:word;
const spilltemplist:Tspill_temp_list;
@ -1879,6 +1881,12 @@ unit rgobj;
end;
function trgobj.get_spill_subreg(r : tregister) : tsubregister;
begin
result:=defaultsub;
end;
function trgobj.instr_spill_register(list:Taasmoutput;
instr:taicpu;
const r:Tsuperregisterset;
@ -1889,22 +1897,25 @@ unit rgobj;
regs: tspillregsinfo;
spilled: boolean;
procedure addreginfo(reg: tsuperregister; operation: topertype);
procedure addreginfo(reg: tregister; operation: topertype);
var
i, tmpindex: longint;
supreg : tsuperregister;
begin
tmpindex := regindex;
supreg:=getsupreg(reg);
// did we already encounter this register?
for i := 0 to pred(regindex) do
if (regs[i].orgreg = reg) then
if (regs[i].orgreg = supreg) then
begin
tmpindex := i;
break;
end;
if tmpindex > high(regs) then
internalerror(2003120301);
regs[tmpindex].orgreg := reg;
if supregset_in(r,reg) then
regs[tmpindex].orgreg := supreg;
regs[tmpindex].spillreg:=reg;
if supregset_in(r,supreg) then
begin
// add/update info on this register
regs[tmpindex].mustbespilled := true;
@ -1958,7 +1969,7 @@ unit rgobj;
top_reg:
begin
if (getregtype(reg) = regtype) then
addreginfo(getsupreg(reg),instr.spilling_get_operation_type(counter));
addreginfo(reg,instr.spilling_get_operation_type(counter));
end;
top_ref:
begin
@ -1966,9 +1977,9 @@ unit rgobj;
with ref^ do
begin
if (base <> NR_NO) then
addreginfo(getsupreg(base),operand_read);
addreginfo(base,operand_read);
if (index <> NR_NO) then
addreginfo(getsupreg(index),operand_read);
addreginfo(index,operand_read);
end;
end;
{$ifdef ARM}
@ -1993,7 +2004,7 @@ unit rgobj;
if mustbespilled then
begin
pos:=get_insert_pos(Tai(instr.previous),regs[0].orgreg,regs[1].orgreg,regs[2].orgreg);
getregisterinline(list,pos,defaultsub,tempreg);
getregisterinline(list,pos,get_spill_subreg(regs[counter].spillreg),tempreg);
if regread then
if regwritten then
do_spill_readwritten(list,instr,pos,counter,spilltemplist,regs)
@ -2034,7 +2045,10 @@ unit rgobj;
end.
{
$Log$
Revision 1.127 2004-06-16 20:07:09 florian
Revision 1.128 2004-06-20 08:47:33 florian
* spilling of doubles on sparc fixed
Revision 1.127 2004/06/16 20:07:09 florian
* dwarf branch merged
Revision 1.126 2004/05/22 23:34:28 peter
@ -2584,4 +2598,4 @@ end.
- list field removed of the tnode class because it's not used currently
and can cause hard-to-find bugs
}
}

View File

@ -234,7 +234,7 @@ implementation
begin
result:=(
((opcode=A_MOV) and (regtype = R_INTREGISTER)) or
((opcode=A_FMOVS) and (regtype = R_FPUREGISTER))
((regtype = R_FPUREGISTER) and (opcode in [A_FMOVS,A_FMOVD]))
) and
(ops=2) and
(oper[0]^.typ=top_reg) and
@ -311,7 +311,10 @@ begin
end.
{
$Log$
Revision 1.48 2004-06-16 20:07:10 florian
Revision 1.49 2004-06-20 08:47:33 florian
* spilling of doubles on sparc fixed
Revision 1.48 2004/06/16 20:07:10 florian
* dwarf branch merged
Revision 1.47.2.5 2004/06/03 19:23:41 florian

View File

@ -35,6 +35,7 @@ unit rgcpu;
type
trgcpu=class(trgobj)
procedure add_constraints(reg:tregister);override;
function get_spill_subreg(r : tregister) : tsubregister;override;
procedure do_spill_read(list : taasmoutput;instr : taicpu;pos: tai; regidx: word;
const spilltemplist:Tspill_temp_list;const regs : tspillregsinfo);override;
procedure do_spill_written(list : taasmoutput;instr : taicpu;pos: tai; regidx: word;
@ -70,6 +71,15 @@ implementation
end;
function trgcpu.get_spill_subreg(r : tregister) : tsubregister;
begin
if getregtype(r)=R_FPUREGISTER then
result:=getsubreg(r)
else
result:=defaultsub;
end;
procedure trgcpu.do_spill_read(list : taasmoutput;instr : taicpu;pos: tai; regidx: word;
const spilltemplist:Tspill_temp_list;const regs : tspillregsinfo);
var
@ -225,7 +235,10 @@ implementation
end.
{
$Log$
Revision 1.21 2004-06-16 20:07:11 florian
Revision 1.22 2004-06-20 08:47:33 florian
* spilling of doubles on sparc fixed
Revision 1.21 2004/06/16 20:07:11 florian
* dwarf branch merged
Revision 1.20.2.4 2004/06/13 20:38:38 florian