From fa19f0aa092817a2cabd2daeceea304d0dcf15b0 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 14 Oct 1999 14:57:51 +0000 Subject: [PATCH] - removed the hcodegen use in the new cg, use cgbase instead --- compiler/cpubase.pas | 8 +++++++- compiler/daopt386.pas | 7 +++++-- compiler/hcodegen.pas | 13 +++++++++++-- compiler/htypechk.pas | 12 ++++++++++-- compiler/new/README | 29 ++++++++++++++++++++++++++++- compiler/new/cgbase.pas | 8 ++++++-- compiler/new/powerpc/cpubase.pas | 6 +++++- compiler/new/tgobj.pas | 7 +++++-- compiler/options.pas | 12 +++++++++--- compiler/pdecl.pas | 13 +++++++++++-- compiler/pexpr.pas | 12 ++++++++++-- compiler/pstatmnt.pas | 13 +++++++++++-- compiler/ptconst.pas | 12 ++++++++++-- 13 files changed, 128 insertions(+), 24 deletions(-) diff --git a/compiler/cpubase.pas b/compiler/cpubase.pas index f36731b3a3..d66d59ef83 100644 --- a/compiler/cpubase.pas +++ b/compiler/cpubase.pas @@ -693,6 +693,9 @@ type symbol : pasmsymbol; offsetfixup : longint; options : trefoptions; +{$ifdef newcg} + alignment : byte;+ +{$endif newcg} end; {***************************************************************************** @@ -1091,7 +1094,10 @@ end; end. { $Log$ - Revision 1.13 1999-09-15 20:35:39 florian + Revision 1.14 1999-10-14 14:57:51 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.13 1999/09/15 20:35:39 florian * small fix to operator overloading when in MMX mode + the compiler uses now fldz and fld1 if possible + some fixes to floating point registers diff --git a/compiler/daopt386.pas b/compiler/daopt386.pas index d345b0ec09..e7cf25ea55 100644 --- a/compiler/daopt386.pas +++ b/compiler/daopt386.pas @@ -1653,7 +1653,7 @@ Begin RefInSequence := TmpResult End; -Function ArrayRefsEq(const r1, r2: TReference): Boolean; +Function ArrayRefsEq(const r1, r2: TReference): Boolean;{$ifdef tp}far;{$endif} Begin ArrayRefsEq := (R1.Offset+R1.OffsetFixup = R2.Offset+R2.OffsetFixup) And (R1.Segment = R2.Segment) And @@ -2385,7 +2385,10 @@ End. { $Log$ - Revision 1.62 1999-10-07 16:07:35 jonas + Revision 1.63 1999-10-14 14:57:52 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.62 1999/10/07 16:07:35 jonas * small bugfix in ArrayRefsEq Revision 1.61 1999/09/29 13:49:53 jonas diff --git a/compiler/hcodegen.pas b/compiler/hcodegen.pas index 8a1c2421a5..9e334833e0 100644 --- a/compiler/hcodegen.pas +++ b/compiler/hcodegen.pas @@ -22,6 +22,12 @@ } unit hcodegen; +{$ifdef newcg} +interface + +implementation +{$else newcg} + interface uses @@ -363,12 +369,15 @@ implementation address:=a; typ:=p; end; - +{$endif newcg} end. { $Log$ - Revision 1.44 1999-10-13 10:42:15 peter + Revision 1.45 1999-10-14 14:57:52 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.44 1999/10/13 10:42:15 peter * cgmessagepos functions Revision 1.43 1999/09/27 23:44:51 peter diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index 369500433f..2ab50c9178 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -61,7 +61,12 @@ implementation cobjects,verbose,globals, symconst, types, - hcodegen; +{$ifdef newcg} + cgbase +{$else} + hcodegen +{$endif} + ; {**************************************************************************** Convert @@ -714,7 +719,10 @@ implementation end. { $Log$ - Revision 1.40 1999-09-26 21:30:15 peter + Revision 1.41 1999-10-14 14:57:52 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.40 1999/09/26 21:30:15 peter + constant pointer support which can happend with typecasting like const p=pointer(1) * better procvar parsing in typed consts diff --git a/compiler/new/README b/compiler/new/README index 95e0bd9790..3fc2ea93c5 100644 --- a/compiler/new/README +++ b/compiler/new/README @@ -1,3 +1,12 @@ +$Id$ + +History +------- + +13th oct 1999 remark about alignment added (FK) + +CVS Log see at the end of that file + frame_pointer contains the register used as frame pointer stack_pointer contains the register used as stack pointer self_pointer contains the register used as self pointer @@ -47,7 +56,7 @@ and only important for the i386/m68k probably. > of any procedure called by the current one (the caller must reserve space > for the callee's parameters on it's own stack because you can't push > values on the stack in the middle of a procedure (no frame pointer)) -> +> > Jonas the parameter passed to g_stackframe_entry contains the size of the all local space which is @@ -60,3 +69,21 @@ and you have to add extra space to do that. +Alignment +--------- + +The alignment is handled very easily: treference contains a field +alignment which describes the ensured alignment for the node, possible +values: 1,2,4,8,16 (1 means unligned). The code generator must update +that field at the appropriate places and take care of it when +generating the code + + +CVS Log +------- + +$Log$ +Revision 1.4 1999-10-14 14:57:54 florian + - removed the hcodegen use in the new cg, use cgbase instead + + diff --git a/compiler/new/cgbase.pas b/compiler/new/cgbase.pas index 89f21061b3..e784660ff8 100644 --- a/compiler/new/cgbase.pas +++ b/compiler/new/cgbase.pas @@ -59,7 +59,8 @@ unit cgbase; retdef : pdef; { return type } sym : pprocsym; - { symbol of the function } + { symbol of the function, and the sym for result variable } + resultfuncretsym, funcretsym : pfuncretsym; { the definition of the proc itself } { why was this a pdef only ?? PM } @@ -427,7 +428,10 @@ unit cgbase; end. { $Log$ - Revision 1.10 1999-10-12 21:20:46 florian + Revision 1.11 1999-10-14 14:57:54 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.10 1999/10/12 21:20:46 florian * new codegenerator compiles again Revision 1.9 1999/09/10 18:48:11 florian diff --git a/compiler/new/powerpc/cpubase.pas b/compiler/new/powerpc/cpubase.pas index 8242cd6ca8..d6e9663954 100644 --- a/compiler/new/powerpc/cpubase.pas +++ b/compiler/new/powerpc/cpubase.pas @@ -284,6 +284,7 @@ type symaddr : trefsymaddr; offsetfixup : longint; options : trefoptions; + alignment : byte; end; const symaddr2str: array[trefsymaddr] of string[3] = ('','@ha','@l'); @@ -548,7 +549,10 @@ implementation end. { $Log$ - Revision 1.7 1999-09-15 20:35:47 florian + Revision 1.8 1999-10-14 14:57:55 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.7 1999/09/15 20:35:47 florian * small fix to operator overloading when in MMX mode + the compiler uses now fldz and fld1 if possible + some fixes to floating point registers diff --git a/compiler/new/tgobj.pas b/compiler/new/tgobj.pas index 3b491dc1bc..0259fd0c99 100644 --- a/compiler/new/tgobj.pas +++ b/compiler/new/tgobj.pas @@ -30,7 +30,7 @@ unit tgobj; cpuinfo, cpuasm, tainst, - cobjects,globals,tree,hcodegen,verbose,files,aasm; + cobjects,globals,tree,cgbase,verbose,files,aasm; type tregisterset = set of tregister; @@ -692,7 +692,10 @@ unit tgobj; end. { $Log$ - Revision 1.7 1999-10-12 21:20:47 florian + Revision 1.8 1999-10-14 14:57:54 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.7 1999/10/12 21:20:47 florian * new codegenerator compiles again Revision 1.6 1999/09/10 18:48:11 florian diff --git a/compiler/options.pas b/compiler/options.pas index f54ff54824..238722d3cf 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -1058,10 +1058,13 @@ begin def_symbol('CPU68'); {$endif} {$ifdef ALPHA} - def_symbol('ALPHA'); + def_symbol('CPUALPHA'); {$endif} {$ifdef powerpc} - def_symbol('POWERPC'); + def_symbol('CPUPOWERPC'); +{$endif} +{$ifdef m68k} + def_symbol('CPU68K'); {$endif} { get default messagefile } @@ -1230,7 +1233,10 @@ end; end. { $Log$ - Revision 1.25 1999-10-13 10:24:49 peter + Revision 1.26 1999-10-14 14:57:52 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.25 1999/10/13 10:24:49 peter * dpmi can only be set after reading the options Revision 1.24 1999/10/03 19:44:41 peter diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index bc13d2c828..b3226d5a2d 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -69,7 +69,13 @@ unit pdecl; ,pbase,ptconst,pexpr,psub,pexports { processor specific stuff } { codegen } - ,hcodegen,hcgdata +{$ifdef newcg} + ,cgbase +{$else} + ,hcodegen +{$endif} + + ,hcgdata ; const @@ -2611,7 +2617,10 @@ unit pdecl; end. { $Log$ - Revision 1.163 1999-10-06 17:39:14 peter + Revision 1.164 1999-10-14 14:57:52 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.163 1999/10/06 17:39:14 peter * fixed stabs writting for forward types Revision 1.162 1999/10/03 19:44:42 peter diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 5e97e07c29..c0474b54cc 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -49,7 +49,12 @@ unit pexpr; globtype,systems,tokens, cobjects,globals,scanner, symconst,aasm, - hcodegen,types,verbose,strings, +{$ifdef newcg} + cgbase, +{$else} + hcodegen, +{$endif} + types,verbose,strings, {$ifndef newcg} tccal, {$endif newcg} @@ -2108,7 +2113,10 @@ _LECKKLAMMER : begin end. { $Log$ - Revision 1.147 1999-09-28 11:03:54 peter + Revision 1.148 1999-10-14 14:57:52 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.147 1999/09/28 11:03:54 peter * fixed result access in 'if result = XXX then' * fixed const cr=chr(13) diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index a9698c4aa2..9e247b35f9 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -41,7 +41,13 @@ unit pstatmnt; uses globtype,systems,tokens, strings,cobjects,globals,files,verbose, - symconst,symtable,aasm,pass_1,types,scanner,hcodegen,ppu + symconst,symtable,aasm,pass_1,types,scanner, +{$ifdef newcg} + cgbase, +{$else} + hcodegen, +{$endif} + ppu ,pbase,pexpr,pdecl,cpubase,cpuasm {$ifdef i386} ,tgeni386 @@ -1318,7 +1324,10 @@ unit pstatmnt; end. { $Log$ - Revision 1.103 1999-09-27 23:44:56 peter + Revision 1.104 1999-10-14 14:57:54 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.103 1999/09/27 23:44:56 peter * procinfo is now a pointer * support for result setting in sub procedure diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas index 7df8410c29..dddec5b903 100644 --- a/compiler/ptconst.pas +++ b/compiler/ptconst.pas @@ -43,7 +43,12 @@ unit ptconst; { processor specific stuff } cpubase, { codegen } - hcodegen,hcgdata; +{$ifdef newcg} + cgbase, +{$else} + hcodegen, +{$endif} + hcgdata; { this procedure reads typed constants } @@ -740,7 +745,10 @@ unit ptconst; end. { $Log$ - Revision 1.53 1999-09-26 21:30:20 peter + Revision 1.54 1999-10-14 14:57:54 florian + - removed the hcodegen use in the new cg, use cgbase instead + + Revision 1.53 1999/09/26 21:30:20 peter + constant pointer support which can happend with typecasting like const p=pointer(1) * better procvar parsing in typed consts