* fixed spilling for several ppc instructions which only read registers

+ added support for registers in references that get changed (load/store
    with update)
This commit is contained in:
Jonas Maebe 2005-02-18 23:37:51 +00:00
parent 0e4f1738cd
commit 6c38093871
3 changed files with 41 additions and 10 deletions

View File

@ -549,6 +549,7 @@ interface
{ register allocator } { register allocator }
function is_same_reg_move(regtype: Tregistertype):boolean;virtual; function is_same_reg_move(regtype: Tregistertype):boolean;virtual;
function spilling_get_operation_type(opnr: longint): topertype;virtual; function spilling_get_operation_type(opnr: longint): topertype;virtual;
function spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;virtual;
end; end;
tai_cpu_class = class of tai_cpu_abstract; tai_cpu_class = class of tai_cpu_abstract;
@ -2054,6 +2055,12 @@ implementation
end; end;
function tai_cpu_abstract.spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;
begin
result := operand_read;
end;
constructor tai_cpu_abstract.ppuload(t:taitype;ppufile:tcompilerppufile); constructor tai_cpu_abstract.ppuload(t:taitype;ppufile:tcompilerppufile);
var var
i : integer; i : integer;
@ -2242,7 +2249,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.95 2005-02-14 17:13:06 peter Revision 1.96 2005-02-18 23:37:51 jonas
* fixed spilling for several ppc instructions which only read registers
+ added support for registers in references that get changed (load/store
with update)
Revision 1.95 2005/02/14 17:13:06 peter
* truncate log * truncate log
Revision 1.94 2005/02/06 00:05:56 florian Revision 1.94 2005/02/06 00:05:56 florian

View File

@ -85,6 +85,7 @@ uses
{ register spilling code } { register spilling code }
function spilling_get_operation_type(opnr: aint): topertype;override; function spilling_get_operation_type(opnr: aint): topertype;override;
function spilling_get_operation_type_ref(opnr: aint; reg: tregister): topertype;override;
end; end;
tai_align = class(tai_align_abstract) tai_align = class(tai_align_abstract)
@ -373,11 +374,9 @@ uses cutils;
begin begin
result := operand_read; result := operand_read;
case opcode of case opcode of
A_STB,A_STBX,A_STH,A_STHX,A_STW,A_STWX,A_STBU,A_STBUX,A_STHU,A_STHUX,A_STWU,A_STWUX: A_STMW,A_LMW:
begin internalerror(2005021805);
if opnr = 1 then A_STBU, A_STBUX, A_STHU, A_STHUX, A_STWU, A_STWUX, A_STFSU, A_STFSUX, A_STFDU, A_STFDUX, A_STB, A_STBX, A_STH, A_STHX, A_STW, A_STWX, A_STFS, A_STFSX, A_STFD, A_STFDX, A_STFIWX, A_STHBRX, A_STWBRX, A_STWCX_, A_CMP, A_CMPI, A_CMPL, A_CMPLI, A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ, A_ECOWX, A_FCMPO, A_FCMPU, A_MTMSR, A_TLBIE, A_TW, A_TWI, A_CMPWI, A_CMPW, A_CMPLWI, A_CMPLW, A_MT, A_MTLR, A_MTCTR:;
result := operand_write;
end;
else else
if opnr = 0 then if opnr = 0 then
result := operand_write; result := operand_write;
@ -385,6 +384,16 @@ uses cutils;
end; end;
function taicpu.spilling_get_operation_type_ref(opnr: aint; reg: tregister): topertype;
begin
result := operand_read;
case opcode of
A_STBU, A_STBUX, A_STHU, A_STHUX, A_STWU, A_STWUX, A_STFSU, A_STFSUX, A_STFDU, A_STFDUX:
if (oper[opnr]^.ref^.base = reg) then
result := operand_readwrite;
end;
end;
function spilling_create_load(const ref:treference;r:tregister): tai; function spilling_create_load(const ref:treference;r:tregister): tai;
begin begin
result:=taicpu.op_reg_ref(A_LWZ,r,ref); result:=taicpu.op_reg_ref(A_LWZ,r,ref);
@ -413,7 +422,12 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.30 2005-02-14 17:13:10 peter Revision 1.31 2005-02-18 23:37:51 jonas
* fixed spilling for several ppc instructions which only read registers
+ added support for registers in references that get changed (load/store
with update)
Revision 1.30 2005/02/14 17:13:10 peter
* truncate log * truncate log
} }

View File

@ -1834,9 +1834,9 @@ unit rgobj;
with ref^ do with ref^ do
begin begin
if (base <> NR_NO) then if (base <> NR_NO) then
addreginfo(base,operand_read); addreginfo(base,instr.spilling_get_operation_type_ref(counter,base));
if (index <> NR_NO) then if (index <> NR_NO) then
addreginfo(index,operand_read); addreginfo(index,instr.spilling_get_operation_type_ref(counter,index));
end; end;
end; end;
{$ifdef ARM} {$ifdef ARM}
@ -2006,7 +2006,12 @@ unit rgobj;
end. end.
{ {
$Log$ $Log$
Revision 1.153 2005-02-14 17:13:07 peter Revision 1.154 2005-02-18 23:37:51 jonas
* fixed spilling for several ppc instructions which only read registers
+ added support for registers in references that get changed (load/store
with update)
Revision 1.153 2005/02/14 17:13:07 peter
* truncate log * truncate log
} }