From d76dc1047ee542fb014e6e5bfdfe56bf0f777152 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 14 Sep 2003 19:19:04 +0000 Subject: [PATCH] * updates for new ra --- compiler/sparc/aasmcpu.pas | 13 +++++++++++-- compiler/sparc/cgcpu.pas | 22 +++++++++++++++++++++- compiler/sparc/cpubase.pas | 9 ++++++--- compiler/sparc/cpupara.pas | 29 ++++++----------------------- compiler/sparc/cpupi.pas | 7 +++++-- compiler/sparc/rgcpu.pas | 15 ++++----------- 6 files changed, 53 insertions(+), 42 deletions(-) diff --git a/compiler/sparc/aasmcpu.pas b/compiler/sparc/aasmcpu.pas index 9b3ca61430..3c1315a78b 100644 --- a/compiler/sparc/aasmcpu.pas +++ b/compiler/sparc/aasmcpu.pas @@ -218,7 +218,13 @@ implementation function taicpu.is_nop:boolean; begin - result:=(opcode=A_NOP); + { Note: This should not check for A_NOP, because that is + used for the delay slots } + result:=(opcode=A_MOV) and + (ops=2) and + (oper[0].typ=top_reg) and + (oper[1].typ=top_reg) and + (oper[0].reg=oper[1].reg); end; @@ -291,7 +297,10 @@ implementation end. { $Log$ - Revision 1.32 2003-09-03 15:55:01 peter + Revision 1.33 2003-09-14 19:19:04 peter + * updates for new ra + + Revision 1.32 2003/09/03 15:55:01 peter * NEWRA branch merged Revision 1.31.2.1 2003/08/31 21:08:16 peter diff --git a/compiler/sparc/cgcpu.pas b/compiler/sparc/cgcpu.pas index c777f564d5..d6a89144ac 100644 --- a/compiler/sparc/cgcpu.pas +++ b/compiler/sparc/cgcpu.pas @@ -37,6 +37,8 @@ interface protected function IsSimpleRef(const ref:treference):boolean; public + procedure init_register_allocators;override; + procedure done_register_allocators;override; { sparc special, needed by cg64 } procedure handle_load_store(list:taasmoutput;isstore:boolean;op: tasmop;reg:tregister;ref: treference); procedure handle_reg_const_reg(list:taasmoutput;op:Tasmop;src:tregister;a:aword;dst:tregister); @@ -218,6 +220,21 @@ implementation Assembler code ****************************************************************************} + procedure Tcgsparc.init_register_allocators; + begin + rg:=Trgcpu.create(15,chr(RS_O0)+chr(RS_O1)+chr(RS_O2)+chr(RS_O3)+ + chr(RS_O4)+chr(RS_O5)+chr(RS_O7)+ + chr(RS_L0)+chr(RS_L1)+chr(RS_L2)+chr(RS_L3)+ + chr(RS_L4)+chr(RS_L5)+chr(RS_L6)+chr(RS_L7)); + end; + + + procedure Tcgsparc.done_register_allocators; + begin + rg.free; + end; + + function TCgSparc.reg_cgsize(const reg:tregister):tcgsize; begin result:=OS_32; @@ -1090,7 +1107,10 @@ begin end. { $Log$ - Revision 1.66 2003-09-03 15:55:01 peter + Revision 1.67 2003-09-14 19:19:04 peter + * updates for new ra + + Revision 1.66 2003/09/03 15:55:01 peter * NEWRA branch merged Revision 1.65.2.1 2003/09/01 21:02:55 peter diff --git a/compiler/sparc/cpubase.pas b/compiler/sparc/cpubase.pas index 34c760a37a..b9a72e15f6 100644 --- a/compiler/sparc/cpubase.pas +++ b/compiler/sparc/cpubase.pas @@ -73,8 +73,8 @@ uses { Integer Super registers first and last } {$warning Supreg shall be $00-$1f} - first_int_supreg = RS_O0; - last_int_supreg = RS_L7; + first_int_supreg = $00; + last_int_supreg = $1f; first_int_imreg = $20; last_int_imreg = $fe; @@ -626,7 +626,10 @@ implementation end. { $Log$ - Revision 1.49 2003-09-03 16:29:37 peter + Revision 1.50 2003-09-14 19:19:05 peter + * updates for new ra + + Revision 1.49 2003/09/03 16:29:37 peter * superregisters also from .dat file Revision 1.48 2003/09/03 15:55:01 peter diff --git a/compiler/sparc/cpupara.pas b/compiler/sparc/cpupara.pas index f69e1ce91f..359f818ce8 100644 --- a/compiler/sparc/cpupara.pas +++ b/compiler/sparc/cpupara.pas @@ -36,9 +36,7 @@ interface {Returns a structure giving the information on the storage of the parameter (which must be an integer parameter) @param(nr Parameter number of routine, starting from 1)} - function getintparaloc(list: taasmoutput; nr : longint) : tparalocation;override; - procedure freeintparaloc(list: taasmoutput; nr : longint); override; - {Creates location information related to the parameter of the function} + function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;override; procedure allocparaloc(list: taasmoutput; const loc: tparalocation);override; procedure freeparaloc(list: taasmoutput; const loc: tparalocation);override; procedure create_paraloc_info(p:TAbstractProcDef; side: tcallercallee);override; @@ -81,7 +79,7 @@ implementation end; - function TSparcParaManager.GetIntParaLoc(List:TAasmOutput;nr:longint):TParaLocation; + function TSparcParaManager.GetIntParaLoc(calloption : tproccalloption; nr : longint) : tparalocation; begin if nr<1 then InternalError(2002100806); @@ -94,7 +92,6 @@ implementation begin loc:=LOC_REGISTER; register:=newreg(R_INTREGISTER,(RS_O0+nr),R_SUBWHOLE); - rg.getexplicitregisterint(list,register); end else { The other parameters are passed on the stack } @@ -108,23 +105,6 @@ implementation end; - procedure tsparcparamanager.freeintparaloc(list: taasmoutput; nr : longint); - - var - hreg : tregister; - - begin - if nr<1 then - internalerror(2003060401); - Dec(nr); - if nr<6 then - begin - hreg:=newreg(R_INTREGISTER,RS_O0+nr,R_SUBWHOLE); - rg.ungetregisterint(list,hreg); - end; - end; - - procedure tsparcparamanager.allocparaloc(list: taasmoutput; const loc: tparalocation); begin if (loc.loc=LOC_REFERENCE) and @@ -291,7 +271,10 @@ begin end. { $Log$ - Revision 1.28 2003-09-03 15:55:01 peter + Revision 1.29 2003-09-14 19:19:05 peter + * updates for new ra + + Revision 1.28 2003/09/03 15:55:01 peter * NEWRA branch merged Revision 1.27.2.1 2003/08/31 21:08:16 peter diff --git a/compiler/sparc/cpupi.pas b/compiler/sparc/cpupi.pas index 11cc2e8361..e7b2e9d83d 100644 --- a/compiler/sparc/cpupi.pas +++ b/compiler/sparc/cpupi.pas @@ -77,7 +77,7 @@ implementation %sp } - result:=Align(tg.lasttemp+savearea,4); + result:=Align(tg.direction*tg.lasttemp+savearea,4); end; @@ -86,7 +86,10 @@ begin end. { $Log$ - Revision 1.20 2003-09-03 15:55:01 peter + Revision 1.21 2003-09-14 19:19:05 peter + * updates for new ra + + Revision 1.20 2003/09/03 15:55:01 peter * NEWRA branch merged Revision 1.19.2.1 2003/09/01 21:02:55 peter diff --git a/compiler/sparc/rgcpu.pas b/compiler/sparc/rgcpu.pas index 968133fc08..ecda2e7179 100644 --- a/compiler/sparc/rgcpu.pas +++ b/compiler/sparc/rgcpu.pas @@ -38,7 +38,6 @@ interface trgcpu=class(trgobj) function GetRegisterFpu(list:TAasmOutput;size:Tcgsize):TRegister;override; procedure UngetRegisterFpu(list:taasmoutput;reg:tregister;size:TCGsize);override; - procedure ClearTempGen;override; end; @@ -103,19 +102,13 @@ implementation list.concat(tai_regalloc.dealloc(reg)); end; - - procedure trgcpu.cleartempgen; - begin - inherited cleartempgen; - end; - -begin - { Only use %o and %l } - rg := trgcpu.create(16); end. { $Log$ - Revision 1.17 2003-09-03 15:55:01 peter + Revision 1.18 2003-09-14 19:19:05 peter + * updates for new ra + + Revision 1.17 2003/09/03 15:55:01 peter * NEWRA branch merged Revision 1.16.2.2 2003/09/02 17:49:17 peter