فهرست منبع

* top_symbol killed
+ refaddr to treference added
+ refsymbol to treference added
* top_local stuff moved to an extra record to save memory
+ aint introduced
* tppufile.get/putint64/aint implemented

florian 21 سال پیش
والد
کامیت
fabb9c33ac
47فایلهای تغییر یافته به همراه1041 افزوده شده و 497 حذف شده
  1. 54 34
      compiler/aasmtai.pas
  2. 11 5
      compiler/assemble.pas
  3. 13 1
      compiler/cgbase.pas
  4. 11 47
      compiler/cgobj.pas
  5. 95 0
      compiler/cgutils.pas
  6. 19 2
      compiler/cutils.pas
  7. 74 59
      compiler/i386/ag386int.pas
  8. 52 40
      compiler/i386/ag386nsm.pas
  9. 11 2
      compiler/i386/cgcpu.pas
  10. 10 1
      compiler/i386/cpuinfo.pas
  11. 10 2
      compiler/i386/csopt386.pas
  12. 10 6
      compiler/i386/daopt386.pas
  13. 10 2
      compiler/i386/n386mem.pas
  14. 10 2
      compiler/i386/n386obj.pas
  15. 10 2
      compiler/i386/n386set.pas
  16. 27 19
      compiler/i386/popt386.pas
  17. 17 5
      compiler/i386/rropt386.pas
  18. 24 11
      compiler/ncgbas.pas
  19. 11 2
      compiler/ncgcal.pas
  20. 10 2
      compiler/ncgcnv.pas
  21. 11 2
      compiler/ncgflw.pas
  22. 12 2
      compiler/ncginl.pas
  23. 13 3
      compiler/ncgld.pas
  24. 11 2
      compiler/ncgmem.pas
  25. 11 2
      compiler/ncgset.pas
  26. 10 2
      compiler/ncgutil.pas
  27. 10 2
      compiler/nobj.pas
  28. 37 27
      compiler/powerpc/agppcgas.pas
  29. 48 36
      compiler/powerpc/agppcmpw.pas
  30. 48 19
      compiler/powerpc/cgcpu.pas
  31. 15 16
      compiler/powerpc/cpubase.pas
  32. 10 1
      compiler/powerpc/cpuinfo.pas
  33. 10 2
      compiler/powerpc/nppcobj.pas
  34. 16 6
      compiler/powerpc/rappcgas.pas
  35. 59 2
      compiler/ppu.pas
  36. 10 2
      compiler/procinfo.pas
  37. 9 5
      compiler/sparc/cpubase.pas
  38. 11 2
      compiler/symconst.pas
  39. 14 6
      compiler/systems/t_bsd.pas
  40. 12 1
      compiler/systems/t_win32.pas
  41. 77 71
      compiler/x86/aasmcpu.pas
  42. 42 29
      compiler/x86/agx86att.pas
  43. 10 1
      compiler/x86/cgx86.pas
  44. 15 5
      compiler/x86/cpubase.pas
  45. 10 2
      compiler/x86/nx86cnv.pas
  46. 10 2
      compiler/x86/nx86inl.pas
  47. 11 3
      compiler/x86/nx86set.pas

+ 54 - 34
compiler/aasmtai.pas

@@ -36,7 +36,7 @@ interface
        cutils,cclasses,
        cutils,cclasses,
        globtype,globals,systems,
        globtype,globals,systems,
        cpuinfo,cpubase,
        cpuinfo,cpubase,
-       cgbase,
+       cgbase,cgutils,
        symtype,
        symtype,
        aasmbase;
        aasmbase;
 
 
@@ -140,7 +140,7 @@ interface
 
 
     type
     type
       { Types of operand }
       { Types of operand }
-      toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_bool,top_local,
+      toptype=(top_none,top_reg,top_ref,top_const,top_bool,top_local,
        { ARM only }
        { ARM only }
        top_regset,
        top_regset,
        top_shifterop,
        top_shifterop,
@@ -150,24 +150,33 @@ interface
       { kinds of operations that an instruction can perform on an operand }
       { kinds of operations that an instruction can perform on an operand }
       topertype = (operand_read,operand_write,operand_readwrite);
       topertype = (operand_read,operand_write,operand_readwrite);
 
 
-      toper=record
+      tlocaloper = record
+        localsym : pointer;
+        localsymderef : tderef;
+        localsymofs : longint;
+        localindexreg : tregister;
+        localscale : byte;
+        localgetoffset : boolean
+      end;
+      plocaloper = ^tlocaloper;
+
+      { please keep the size of this record <=12 bytes and keep it properly aligned }
+      toper = record
         ot : longint;
         ot : longint;
         case typ : toptype of
         case typ : toptype of
-         top_none   : ();
-         top_reg    : (reg:tregister);
-         top_ref    : (ref:preference);
-         top_const  : (val:aword);
-         top_symbol : (sym:tasmsymbol;symofs:longint);
-         top_bool   : (b:boolean);
-         { local varsym that will be inserted in pass_2 }
-         top_local  : (localsym:pointer;localsymderef:tderef;localsymofs:longint;localindexreg:tregister;
-                       localscale:byte;localgetoffset:boolean);
+          top_none   : ();
+          top_reg    : (reg:tregister);
+          top_ref    : (ref:preference);
+          top_const  : (val:aword);
+          top_bool   : (b:boolean);
+          { local varsym that will be inserted in pass_2 }
+          top_local  : (localoper:plocaloper);
       {$ifdef arm}
       {$ifdef arm}
-         top_regset : (regset:^tcpuregisterset);
-         top_shifterop : (shifterop : pshifterop);
+          top_regset : (regset:^tcpuregisterset);
+          top_shifterop : (shifterop : pshifterop);
       {$endif arm}
       {$endif arm}
       {$ifdef m68k}
       {$ifdef m68k}
-         top_regset : (regset:^tcpuregisterset);
+          top_regset : (regset:^tcpuregisterset);
       {$endif m68k}
       {$endif m68k}
       end;
       end;
       poper=^toper;
       poper=^toper;
@@ -1657,19 +1666,12 @@ implementation
 
 
 
 
     procedure taicpu_abstract.loadsymbol(opidx:longint;s:tasmsymbol;sofs:longint);
     procedure taicpu_abstract.loadsymbol(opidx:longint;s:tasmsymbol;sofs:longint);
+      var
+        r : treference;
       begin
       begin
-        if not assigned(s) then
-         internalerror(200204251);
-        allocate_oper(opidx+1);
-        with oper[opidx]^ do
-         begin
-           if typ<>top_symbol then
-             clearop(opidx);
-           sym:=s;
-           symofs:=sofs;
-           typ:=top_symbol;
-         end;
-        s.increfs;
+        reference_reset_symbol(r,s,sofs);
+        r.refaddr:=addr_full;
+        loadref(opidx,r);
       end;
       end;
 
 
 
 
@@ -1681,12 +1683,18 @@ implementation
         with oper[opidx]^ do
         with oper[opidx]^ do
          begin
          begin
            if typ<>top_local then
            if typ<>top_local then
-             clearop(opidx);
-           localsym:=s;
-           localsymofs:=sofs;
-           localindexreg:=indexreg;
-           localscale:=scale;
-           localgetoffset:=getoffset;
+             begin
+               clearop(opidx);
+               new(localoper);
+             end;
+           with oper[opidx]^.localoper^ do
+             begin
+               localsym:=s;
+               localsymofs:=sofs;
+               localindexreg:=indexreg;
+               localscale:=scale;
+               localgetoffset:=getoffset;
+             end;
            typ:=top_local;
            typ:=top_local;
          end;
          end;
       end;
       end;
@@ -1791,6 +1799,8 @@ implementation
             case typ of
             case typ of
               top_ref:
               top_ref:
                 dispose(ref);
                 dispose(ref);
+              top_local:
+                dispose(localoper);
 {$ifdef ARM}
 {$ifdef ARM}
               top_shifterop:
               top_shifterop:
                 dispose(shifterop);
                 dispose(shifterop);
@@ -1992,10 +2002,20 @@ implementation
         inherited InsertAfter(Item,Loc);
         inherited InsertAfter(Item,Loc);
       end;
       end;
 
 
+begin
+  writeln(sizeof(toper));
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.72  2004-02-26 16:16:38  peter
+  Revision 1.73  2004-02-27 10:21:04  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.72  2004/02/26 16:16:38  peter
     * tai_const.create_ptr added
     * tai_const.create_ptr added
 
 
   Revision 1.71  2004/02/08 23:10:21  jonas
   Revision 1.71  2004/02/08 23:10:21  jonas

+ 11 - 5
compiler/assemble.pas

@@ -1192,10 +1192,8 @@ Implementation
                            begin
                            begin
                              if assigned(ref^.symbol) then
                              if assigned(ref^.symbol) then
                               objectlibrary.UsedAsmSymbolListInsert(ref^.symbol);
                               objectlibrary.UsedAsmSymbolListInsert(ref^.symbol);
-                           end;
-                         top_symbol :
-                           begin
-                             objectlibrary.UsedAsmSymbolListInsert(sym);
+                             if assigned(ref^.relsymbol) then
+                              objectlibrary.UsedAsmSymbolListInsert(ref^.symbol);
                            end;
                            end;
                        end;
                        end;
                      end;
                      end;
@@ -1661,7 +1659,15 @@ Implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.61  2004-01-31 17:45:17  peter
+  Revision 1.62  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.61  2004/01/31 17:45:17  peter
     * Change several $ifdef i386 to x86
     * Change several $ifdef i386 to x86
     * Change several OS_32 to OS_INT/OS_ADDR
     * Change several OS_32 to OS_INT/OS_ADDR
 
 

+ 13 - 1
compiler/cgbase.pas

@@ -54,6 +54,10 @@ interface
          LOC_CMMREGISTER
          LOC_CMMREGISTER
        );
        );
 
 
+       { since we have only 16 offsets, we need to be able to specify the high
+         and low 16 bits of the address of a symbol                            }
+       trefaddr = (addr_no,addr_full,addr_hi,addr_lo);
+
        {# Generic opcodes, which must be supported by all processors
        {# Generic opcodes, which must be supported by all processors
        }
        }
        topcg =
        topcg =
@@ -583,7 +587,15 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.87  2004-02-09 22:14:17  peter
+  Revision 1.88  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.87  2004/02/09 22:14:17  peter
     * more x86_64 parameter fixes
     * more x86_64 parameter fixes
     * tparalocation.lochigh is now used to indicate if registerhigh
     * tparalocation.lochigh is now used to indicate if registerhigh
       is used and what the type is
       is used and what the type is

+ 11 - 47
compiler/cgobj.pas

@@ -504,21 +504,7 @@ unit cgobj;
         procedure g_rangecheck64(list: taasmoutput; const l:tlocation; fromdef,todef: tdef);virtual;abstract;
         procedure g_rangecheck64(list: taasmoutput; const l:tlocation; fromdef,todef: tdef);virtual;abstract;
     end;
     end;
 
 
-
-    { trerefence handling }
-
-    {# Clear to zero a treference }
-    procedure reference_reset(var ref : treference);
-    {# Clear to zero a treference, and set is base address
-       to base register.
-    }
-    procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
-    procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
     procedure reference_release(list: taasmoutput; const ref : treference);
     procedure reference_release(list: taasmoutput; const ref : treference);
-    { This routine verifies if two references are the same, and
-       if so, returns TRUE, otherwise returns false.
-    }
-    function references_equal(sref : treference;dref : treference) : boolean;
 
 
     { tlocation handling }
     { tlocation handling }
 
 
@@ -541,7 +527,8 @@ implementation
     uses
     uses
        globals,globtype,options,systems,
        globals,globtype,options,systems,
        verbose,defutil,paramgr,
        verbose,defutil,paramgr,
-       tgobj,cutils;
+       tgobj,cutils,
+       cgutils;
 
 
     const
     const
       { Please leave this here, this module should NOT use
       { Please leave this here, this module should NOT use
@@ -2049,43 +2036,12 @@ implementation
                                   TReference
                                   TReference
 ****************************************************************************}
 ****************************************************************************}
 
 
-    procedure reference_reset(var ref : treference);
-      begin
-        FillChar(ref,sizeof(treference),0);
-{$ifdef arm}
-        ref.signindex:=1;
-{$endif arm}
-      end;
-
-
-    procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
-      begin
-        reference_reset(ref);
-        ref.base:=base;
-        ref.offset:=offset;
-      end;
-
-
-    procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
-      begin
-        reference_reset(ref);
-        ref.symbol:=sym;
-        ref.offset:=offset;
-      end;
-
-
     procedure reference_release(list: taasmoutput; const ref : treference);
     procedure reference_release(list: taasmoutput; const ref : treference);
       begin
       begin
         cg.ungetreference(list,ref);
         cg.ungetreference(list,ref);
       end;
       end;
 
 
 
 
-    function references_equal(sref : treference;dref : treference):boolean;
-      begin
-        references_equal:=CompareByte(sref,dref,sizeof(treference))=0;
-      end;
-
-
 {****************************************************************************
 {****************************************************************************
                                   TLocation
                                   TLocation
 ****************************************************************************}
 ****************************************************************************}
@@ -2153,7 +2109,15 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.158  2004-02-20 22:16:34  florian
+  Revision 1.159  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.158  2004/02/20 22:16:34  florian
     * handling of float parameters passed in mm registers fixed
     * handling of float parameters passed in mm registers fixed
 
 
   Revision 1.157  2004/02/12 15:54:03  peter
   Revision 1.157  2004/02/12 15:54:03  peter

+ 95 - 0
compiler/cgutils.pas

@@ -0,0 +1,95 @@
+{
+    $Id$
+    Copyright (c) 1998-2004 by Florian Klaempfl
+
+    Some basic types and constants for the code generation
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+{ This unit exports some helper routines which are used across the code generator }
+unit cgutils;
+
+{$i fpcdefs.inc}
+
+  interface
+
+    uses
+      aasmbase,
+      cgbase,
+      cpubase;
+
+    { trerefence handling }
+
+    {# Clear to zero a treference }
+    procedure reference_reset(var ref : treference);
+    {# Clear to zero a treference, and set is base address
+       to base register.
+    }
+    procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
+    procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
+    { This routine verifies if two references are the same, and
+       if so, returns TRUE, otherwise returns false.
+    }
+    function references_equal(sref : treference;dref : treference) : boolean;
+
+  implementation
+
+{****************************************************************************
+                                  TReference
+****************************************************************************}
+
+    procedure reference_reset(var ref : treference);
+      begin
+        FillChar(ref,sizeof(treference),0);
+{$ifdef arm}
+        ref.signindex:=1;
+{$endif arm}
+      end;
+
+
+    procedure reference_reset_base(var ref : treference;base : tregister;offset : longint);
+      begin
+        reference_reset(ref);
+        ref.base:=base;
+        ref.offset:=offset;
+      end;
+
+
+    procedure reference_reset_symbol(var ref : treference;sym : tasmsymbol;offset : longint);
+      begin
+        reference_reset(ref);
+        ref.symbol:=sym;
+        ref.offset:=offset;
+      end;
+
+
+    function references_equal(sref : treference;dref : treference):boolean;
+      begin
+        references_equal:=CompareByte(sref,dref,sizeof(treference))=0;
+      end;
+
+end.
+{
+  $Log$
+  Revision 1.1  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+}

+ 19 - 2
compiler/cutils.pas

@@ -42,6 +42,8 @@ interface
     {# Returns the maximum value between @var(a) and @var(b) }
     {# Returns the maximum value between @var(a) and @var(b) }
     function max(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
     function max(a,b : longint) : longint;{$ifdef USEINLINE}inline;{$endif}
     {# Returns the value in @var(x) swapped to different endian }
     {# Returns the value in @var(x) swapped to different endian }
+    Function SwapInt64(x : int64): int64;{$ifdef USEINLINE}inline;{$endif}
+    {# Returns the value in @var(x) swapped to different endian }
     function SwapLong(x : longint): longint;{$ifdef USEINLINE}inline;{$endif}
     function SwapLong(x : longint): longint;{$ifdef USEINLINE}inline;{$endif}
     {# Returns the value in @va(x) swapped to different endian }
     {# Returns the value in @va(x) swapped to different endian }
     function SwapWord(x : word): word;{$ifdef USEINLINE}inline;{$endif}
     function SwapWord(x : word): word;{$ifdef USEINLINE}inline;{$endif}
@@ -174,6 +176,13 @@ uses
       End;
       End;
 
 
 
 
+    Function SwapInt64(x : int64): int64;{$ifdef USEINLINE}inline;{$endif}
+      Begin
+        result:=swaplong(hi(x));
+        result:=result or (swaplong(lo(x)) shl 32);
+      End;
+
+
     Function SwapWord(x : word): word;{$ifdef USEINLINE}inline;{$endif}
     Function SwapWord(x : word): word;{$ifdef USEINLINE}inline;{$endif}
       var
       var
         z : byte;
         z : byte;
@@ -829,7 +838,7 @@ uses
             inc(len);
             inc(len);
           inc(i);
           inc(i);
         end;
         end;
-      
+
       {Second pass, writeout stabstring.}
       {Second pass, writeout stabstring.}
       getmem(r,len+1);
       getmem(r,len+1);
       string_evaluate:=r;
       string_evaluate:=r;
@@ -1127,7 +1136,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.35  2004-02-22 22:13:27  daniel
+  Revision 1.36  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.35  2004/02/22 22:13:27  daniel
     * Escape newlines in constant string stabs
     * Escape newlines in constant string stabs
 
 
   Revision 1.34  2004/01/26 22:08:20  daniel
   Revision 1.34  2004/01/26 22:08:20  daniel

+ 74 - 59
compiler/i386/ag386int.pas

@@ -55,7 +55,8 @@ implementation
 {$endif}
 {$endif}
       cutils,globtype,globals,systems,cclasses,
       cutils,globtype,globals,systems,cclasses,
       verbose,finput,fmodule,script,cpuinfo,
       verbose,finput,fmodule,script,cpuinfo,
-      itx86int
+      itx86int,
+      cgbase
       ;
       ;
 
 
     const
     const
@@ -211,51 +212,54 @@ implementation
             AsmWrite(masm_regname(o.reg));
             AsmWrite(masm_regname(o.reg));
           top_const :
           top_const :
             AsmWrite(tostr(longint(o.val)));
             AsmWrite(tostr(longint(o.val)));
-          top_symbol :
-            begin
-              AsmWrite('offset ');
-              if assigned(o.sym) then
-                AsmWrite(o.sym.name);
-              if o.symofs>0 then
-               AsmWrite('+'+tostr(o.symofs))
-              else
-               if o.symofs<0 then
-                AsmWrite(tostr(o.symofs))
-              else
-               if not(assigned(o.sym)) then
-                 AsmWrite('0');
-            end;
           top_ref :
           top_ref :
             begin
             begin
-              if ((opcode <> A_LGS) and (opcode <> A_LSS) and
-                  (opcode <> A_LFS) and (opcode <> A_LDS) and
-                  (opcode <> A_LES)) then
-               Begin
-                 case s of
-                  S_B : AsmWrite('byte ptr ');
-                  S_W : AsmWrite('word ptr ');
-                  S_L : AsmWrite('dword ptr ');
-                 S_IS : AsmWrite('word ptr ');
-                 S_IL : AsmWrite('dword ptr ');
-                 S_IQ : AsmWrite('qword ptr ');
-                 S_FS : AsmWrite('dword ptr ');
-                 S_FL : AsmWrite('qword ptr ');
-                 S_FX : AsmWrite('tbyte ptr ');
-                 S_BW : if dest then
-                         AsmWrite('word ptr ')
-                        else
-                         AsmWrite('byte ptr ');
-                 S_BL : if dest then
-                         AsmWrite('dword ptr ')
-                        else
-                         AsmWrite('byte ptr ');
-                 S_WL : if dest then
-                         AsmWrite('dword ptr ')
-                        else
-                         AsmWrite('word ptr ');
-                 end;
-               end;
-              WriteReference(o.ref^);
+              if o.ref^.refaddr=addr_no then
+                begin
+                  if ((opcode <> A_LGS) and (opcode <> A_LSS) and
+                      (opcode <> A_LFS) and (opcode <> A_LDS) and
+                      (opcode <> A_LES)) then
+                   Begin
+                     case s of
+                      S_B : AsmWrite('byte ptr ');
+                      S_W : AsmWrite('word ptr ');
+                      S_L : AsmWrite('dword ptr ');
+                     S_IS : AsmWrite('word ptr ');
+                     S_IL : AsmWrite('dword ptr ');
+                     S_IQ : AsmWrite('qword ptr ');
+                     S_FS : AsmWrite('dword ptr ');
+                     S_FL : AsmWrite('qword ptr ');
+                     S_FX : AsmWrite('tbyte ptr ');
+                     S_BW : if dest then
+                             AsmWrite('word ptr ')
+                            else
+                             AsmWrite('byte ptr ');
+                     S_BL : if dest then
+                             AsmWrite('dword ptr ')
+                            else
+                             AsmWrite('byte ptr ');
+                     S_WL : if dest then
+                             AsmWrite('dword ptr ')
+                            else
+                             AsmWrite('word ptr ');
+                     end;
+                   end;
+                  WriteReference(o.ref^);
+                end
+              else
+                begin
+                  AsmWrite('offset ');
+                  if assigned(o.ref^.symbol) then
+                    AsmWrite(o.ref^.symbol.name);
+                  if o.ref^.offset>0 then
+                   AsmWrite('+'+tostr(o.ref^.offset))
+                  else
+                   if o.ref^.offset<0 then
+                    AsmWrite(tostr(o.ref^.offset))
+                  else
+                   if not(assigned(o.ref^.symbol)) then
+                     AsmWrite('0');
+                end;
             end;
             end;
           else
           else
             internalerror(10001);
             internalerror(10001);
@@ -270,26 +274,29 @@ implementation
           AsmWrite(masm_regname(o.reg));
           AsmWrite(masm_regname(o.reg));
         top_const :
         top_const :
           AsmWrite(tostr(longint(o.val)));
           AsmWrite(tostr(longint(o.val)));
-        top_symbol :
-          begin
-            AsmWrite(o.sym.name);
-            if o.symofs>0 then
-             AsmWrite('+'+tostr(o.symofs))
-            else
-             if o.symofs<0 then
-              AsmWrite(tostr(o.symofs));
-          end;
         top_ref :
         top_ref :
           { what about lcall or ljmp ??? }
           { what about lcall or ljmp ??? }
           begin
           begin
-            if (aktoutputformat <> as_i386_tasm) then
+            if o.ref^.refaddr=addr_no then
+              begin
+                if (aktoutputformat <> as_i386_tasm) then
+                  begin
+                    if s=S_FAR then
+                      AsmWrite('far ptr ')
+                    else
+                      AsmWrite('dword ptr ');
+                  end;
+                WriteReference(o.ref^);
+              end
+            else
               begin
               begin
-                if s=S_FAR then
-                  AsmWrite('far ptr ')
+                AsmWrite(o.ref^.symbol.name);
+                if o.ref^.offset>0 then
+                 AsmWrite('+'+tostr(o.ref^.offset))
                 else
                 else
-                  AsmWrite('dword ptr ');
+                 if o.ref^.offset<0 then
+                  AsmWrite(tostr(o.ref^.offset));
               end;
               end;
-            WriteReference(o.ref^);
           end;
           end;
         else
         else
           internalerror(10001);
           internalerror(10001);
@@ -875,7 +882,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.45  2003-12-15 15:58:17  peter
+  Revision 1.46  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.45  2003/12/15 15:58:17  peter
     * wasm args fix from wiktor
     * wasm args fix from wiktor
 
 
   Revision 1.44  2003/12/14 22:42:39  peter
   Revision 1.44  2003/12/14 22:42:39  peter

+ 52 - 40
compiler/i386/ag386nsm.pas

@@ -280,29 +280,32 @@ interface
                AsmWrite(sizestr(s,dest));
                AsmWrite(sizestr(s,dest));
               AsmWrite(tostr(longint(o.val)));
               AsmWrite(tostr(longint(o.val)));
             end;
             end;
-          top_symbol :
-            begin
-              asmwrite('dword ');
-              if assigned(o.sym) then
-               begin
-                asmwrite(o.sym.name);
-                if o.symofs=0 then
-                  exit;
-               end;
-              if o.symofs>0 then
-               asmwrite('+');
-              asmwrite(tostr(o.symofs))
-            end;
           top_ref :
           top_ref :
             begin
             begin
-              if not ((opcode = A_LEA) or (opcode = A_LGS) or
-                      (opcode = A_LSS) or (opcode = A_LFS) or
-                      (opcode = A_LES) or (opcode = A_LDS) or
-                      (opcode = A_SHR) or (opcode = A_SHL) or
-                      (opcode = A_SAR) or (opcode = A_SAL) or
-                      (opcode = A_OUT) or (opcode = A_IN)) then
-                AsmWrite(sizestr(s,dest));
-              WriteReference(o.ref^);
+              if o.ref^.refaddr=addr_no then
+                begin
+                  if not ((opcode = A_LEA) or (opcode = A_LGS) or
+                          (opcode = A_LSS) or (opcode = A_LFS) or
+                          (opcode = A_LES) or (opcode = A_LDS) or
+                          (opcode = A_SHR) or (opcode = A_SHL) or
+                          (opcode = A_SAR) or (opcode = A_SAL) or
+                          (opcode = A_OUT) or (opcode = A_IN)) then
+                    AsmWrite(sizestr(s,dest));
+                  WriteReference(o.ref^);
+                end
+              else
+                begin
+                  asmwrite('dword ');
+                  if assigned(o.ref^.symbol) then
+                   begin
+                    asmwrite(o.ref^.symbol.name);
+                    if o.ref^.offset=0 then
+                      exit;
+                   end;
+                  if o.ref^.offset>0 then
+                   asmwrite('+');
+                  asmwrite(tostr(o.ref^.offset));
+                end;
             end;
             end;
           else
           else
             internalerror(10001);
             internalerror(10001);
@@ -316,25 +319,26 @@ interface
           top_reg :
           top_reg :
             AsmWrite(nasm_regname(o.reg));
             AsmWrite(nasm_regname(o.reg));
           top_ref :
           top_ref :
-            WriteReference(o.ref^);
+            if o.ref^.refaddr=addr_no then
+              WriteReference(o.ref^)
+            else
+              begin
+                if not(
+                       (op=A_JCXZ) or (op=A_JECXZ) or
+                       (op=A_LOOP) or (op=A_LOOPE) or
+                       (op=A_LOOPNE) or (op=A_LOOPNZ) or
+                       (op=A_LOOPZ)
+                      ) then
+                  AsmWrite('NEAR ');
+                AsmWrite(o.ref^.symbol.name);
+                if o.ref^.offset>0 then
+                 AsmWrite('+'+tostr(o.ref^.offset))
+                else
+                 if o.ref^.offset<0 then
+                  AsmWrite(tostr(o.ref^.offset));
+              end;
           top_const :
           top_const :
-            AsmWrite(tostr(longint(o.val)));
-          top_symbol :
-            begin
-              if not(
-                     (op=A_JCXZ) or (op=A_JECXZ) or
-                     (op=A_LOOP) or (op=A_LOOPE) or
-                     (op=A_LOOPNE) or (op=A_LOOPNZ) or
-                     (op=A_LOOPZ)
-                    ) then
-                AsmWrite('NEAR ');
-              AsmWrite(o.sym.name);
-              if o.symofs>0 then
-               AsmWrite('+'+tostr(o.symofs))
-              else
-               if o.symofs<0 then
-                AsmWrite(tostr(o.symofs));
-            end;
+            AsmWrite(tostr(aint(o.val)));
           else
           else
             internalerror(10001);
             internalerror(10001);
         end;
         end;
@@ -920,7 +924,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.43  2003-12-14 22:42:39  peter
+  Revision 1.44  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.43  2003/12/14 22:42:39  peter
     * fixed range check errors
     * fixed range check errors
 
 
   Revision 1.42  2003/11/29 15:53:06  florian
   Revision 1.42  2003/11/29 15:53:06  florian

+ 11 - 2
compiler/i386/cgcpu.pas

@@ -61,7 +61,8 @@ unit cgcpu;
     uses
     uses
        globtype,globals,verbose,systems,cutils,
        globtype,globals,verbose,systems,cutils,
        symdef,symsym,defutil,paramgr,procinfo,
        symdef,symsym,defutil,paramgr,procinfo,
-       rgcpu,rgx86,tgobj;
+       rgcpu,rgx86,tgobj,
+       cgutils;
 
 
     procedure Tcg386.init_register_allocators;
     procedure Tcg386.init_register_allocators;
       begin
       begin
@@ -388,7 +389,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.46  2004-02-22 16:48:09  florian
+  Revision 1.47  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.46  2004/02/22 16:48:09  florian
     * x86_64 uses generic concatcopy_valueopenarray for now
     * x86_64 uses generic concatcopy_valueopenarray for now
 
 
   Revision 1.45  2004/02/04 22:01:13  peter
   Revision 1.45  2004/02/04 22:01:13  peter

+ 10 - 1
compiler/i386/cpuinfo.pas

@@ -32,6 +32,7 @@ Interface
 Type
 Type
    { Natural integer register type and size for the target machine }
    { Natural integer register type and size for the target machine }
    AWord = longword;
    AWord = longword;
+   AInt = longint;
    PAWord = ^AWord;
    PAWord = ^AWord;
 
 
    { This must be an ordinal type with the same size as a pointer
    { This must be an ordinal type with the same size as a pointer
@@ -123,7 +124,15 @@ Implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.22  2003-12-25 12:01:35  florian
+  Revision 1.23  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.22  2003/12/25 12:01:35  florian
     + possible sse2 unit usage for double calculations
     + possible sse2 unit usage for double calculations
     * some sse2 assembler issues fixed
     * some sse2 assembler issues fixed
 
 

+ 10 - 2
compiler/i386/csopt386.pas

@@ -1864,7 +1864,7 @@ begin
                               getNextInstruction(p,p);
                               getNextInstruction(p,p);
                           end;
                           end;
                       end;
                       end;
-                    top_symbol,Top_Const:
+                    top_Const:
                       begin
                       begin
                         case taicpu(p).oper[1]^.typ of
                         case taicpu(p).oper[1]^.typ of
                           Top_Reg:
                           Top_Reg:
@@ -2115,7 +2115,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.60  2004-02-25 20:39:58  jonas
+  Revision 1.61  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.60  2004/02/25 20:39:58  jonas
     * fixed bugs that caused pasjpeg crashes
     * fixed bugs that caused pasjpeg crashes
 
 
   Revision 1.59  2003/12/20 22:53:33  jonas
   Revision 1.59  2003/12/20 22:53:33  jonas

+ 10 - 6
compiler/i386/daopt386.pas

@@ -1384,8 +1384,6 @@ begin {checks whether the two ops are equal}
         OpsEqual := RefsEqual(o1.ref^, o2.ref^);
         OpsEqual := RefsEqual(o1.ref^, o2.ref^);
       Top_Const :
       Top_Const :
         OpsEqual:=o1.val=o2.val;
         OpsEqual:=o1.val=o2.val;
-      Top_Symbol :
-        OpsEqual:=(o1.sym=o2.sym) and (o1.symofs=o2.symofs);
       Top_None :
       Top_None :
         OpsEqual := True
         OpsEqual := True
     end;
     end;
@@ -1590,7 +1588,6 @@ begin
   case o.typ Of
   case o.typ Of
     top_reg: readreg(p, getsupreg(o.reg));
     top_reg: readreg(p, getsupreg(o.reg));
     top_ref: readref(p, o.ref);
     top_ref: readref(p, o.ref);
-    top_symbol : ;
   end;
   end;
 end;
 end;
 
 
@@ -1880,7 +1877,6 @@ begin
         readref(ptaiprop(taiObj.OptInfo), o.ref);
         readref(ptaiprop(taiObj.OptInfo), o.ref);
         DestroyRefs(taiObj, o.ref^, RS_INVALID);
         DestroyRefs(taiObj, o.ref^, RS_INVALID);
       end;
       end;
-    top_symbol:;
   end;
   end;
 end;
 end;
 
 
@@ -2454,7 +2450,7 @@ begin
                               DestroyRefs(p, taicpu(p).oper[1]^.ref^, RS_INVALID);
                               DestroyRefs(p, taicpu(p).oper[1]^.ref^, RS_INVALID);
                           end;
                           end;
                       end;
                       end;
-                    top_symbol,Top_Const:
+                    top_Const:
                       begin
                       begin
                         case taicpu(p).oper[1]^.typ Of
                         case taicpu(p).oper[1]^.typ Of
                           top_reg:
                           top_reg:
@@ -2713,7 +2709,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.64  2003-12-23 19:52:55  peter
+  Revision 1.65  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.64  2003/12/23 19:52:55  peter
     * more byte->word
     * more byte->word
 
 
   Revision 1.63  2003/12/22 23:11:41  peter
   Revision 1.63  2003/12/22 23:11:41  peter

+ 10 - 2
compiler/i386/n386mem.pas

@@ -55,7 +55,7 @@ implementation
       symdef,paramgr,
       symdef,paramgr,
       aasmtai,
       aasmtai,
       nld,ncon,nadd,
       nld,ncon,nadd,
-      cgobj;
+      cgutils,cgobj;
 
 
 {*****************************************************************************
 {*****************************************************************************
                              TI386ADDRNODE
                              TI386ADDRNODE
@@ -144,7 +144,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.59  2003-10-21 15:13:27  peter
+  Revision 1.60  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.59  2003/10/21 15:13:27  peter
     * fix vecnode code that caused to much register conflicts
     * fix vecnode code that caused to much register conflicts
 
 
   Revision 1.58  2003/10/10 17:48:14  peter
   Revision 1.58  2003/10/10 17:48:14  peter

+ 10 - 2
compiler/i386/n386obj.pas

@@ -37,7 +37,7 @@ uses
   fmodule,
   fmodule,
   nobj,
   nobj,
   cpuinfo,cpubase,
   cpuinfo,cpubase,
-  cga,cgobj;
+  cga,cgutils,cgobj;
 
 
    type
    type
      ti386classheader=class(tclassheader)
      ti386classheader=class(tclassheader)
@@ -235,7 +235,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.29  2003-12-23 23:12:44  peter
+  Revision 1.30  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.29  2003/12/23 23:12:44  peter
     * extnumber failure is $ffff instead of -1
     * extnumber failure is $ffff instead of -1
     * fix non-vmt call for register calling on i386
     * fix non-vmt call for register calling on i386
 
 

+ 10 - 2
compiler/i386/n386set.pas

@@ -48,7 +48,7 @@ implementation
       cgbase,pass_2,
       cgbase,pass_2,
       ncon,
       ncon,
       cpubase,cpuinfo,procinfo,
       cpubase,cpuinfo,procinfo,
-      cga,cgobj,ncgutil,
+      cga,cgutils,cgobj,ncgutil,
       cgx86;
       cgx86;
 
 
 
 
@@ -224,7 +224,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.72  2004-02-22 12:04:04  florian
+  Revision 1.73  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.72  2004/02/22 12:04:04  florian
     + nx86set added
     + nx86set added
     * some more x86-64 fixes
     * some more x86-64 fixes
 
 

+ 27 - 19
compiler/i386/popt386.pas

@@ -42,7 +42,7 @@ uses
 {$ifdef finaldestdebug}
 {$ifdef finaldestdebug}
   cobjects,
   cobjects,
 {$endif finaldestdebug}
 {$endif finaldestdebug}
-  cpuinfo,cpubase,cgobj,daopt386,rgobj;
+  cpuinfo,cpubase,cgutils,daopt386,rgobj;
 
 
 function RegUsedAfterInstruction(reg: Tregister; p: tai; var UsedRegs: TRegSet): Boolean;
 function RegUsedAfterInstruction(reg: Tregister; p: tai; var UsedRegs: TRegSet): Boolean;
 var
 var
@@ -465,7 +465,7 @@ var
     if level > 20 then
     if level > 20 then
       exit;
       exit;
     GetfinalDestination := false;
     GetfinalDestination := false;
-    p1 := dfa.getlabelwithsym(tasmlabel(hp.oper[0]^.sym));
+    p1 := dfa.getlabelwithsym(tasmlabel(hp.oper[0]^.ref^.symbol));
     if assigned(p1) then
     if assigned(p1) then
       begin
       begin
         SkipLabels(p1,p1);
         SkipLabels(p1,p1);
@@ -487,14 +487,14 @@ var
               SkipLabels(p1,p1)) then
               SkipLabels(p1,p1)) then
             begin
             begin
               { quick check for loops of the form "l5: ; jmp l5 }
               { quick check for loops of the form "l5: ; jmp l5 }
-              if (tasmlabel(taicpu(p1).oper[0]^.sym).labelnr =
-                   tasmlabel(hp.oper[0]^.sym).labelnr) then
+              if (tasmlabel(taicpu(p1).oper[0]^.ref^.symbol).labelnr =
+                   tasmlabel(hp.oper[0]^.ref^.symbol).labelnr) then
                 exit;
                 exit;
               if not GetFinalDestination(asml, taicpu(p1),succ(level)) then
               if not GetFinalDestination(asml, taicpu(p1),succ(level)) then
                 exit;
                 exit;
-              tasmlabel(hp.oper[0]^.sym).decrefs;
-              hp.oper[0]^.sym:=taicpu(p1).oper[0]^.sym;
-              tasmlabel(hp.oper[0]^.sym).increfs;
+              tasmlabel(hp.oper[0]^.ref^.symbol).decrefs;
+              hp.oper[0]^.ref^.symbol:=taicpu(p1).oper[0]^.ref^.symbol;
+              tasmlabel(hp.oper[0]^.ref^.symbol).increfs;
             end
             end
           else
           else
             if (taicpu(p1).condition = inverse_cond[hp.condition]) then
             if (taicpu(p1).condition = inverse_cond[hp.condition]) then
@@ -506,8 +506,8 @@ var
   {$endif finaldestdebug}
   {$endif finaldestdebug}
                   objectlibrary.getlabel(l);
                   objectlibrary.getlabel(l);
                   insertllitem(asml,p1,p1.next,tai_label.Create(l));
                   insertllitem(asml,p1,p1.next,tai_label.Create(l));
-                  tasmlabel(taicpu(hp).oper[0]^.sym).decrefs;
-                  hp.oper[0]^.sym := l;
+                  tasmlabel(taicpu(hp).oper[0]^.ref^.symbol).decrefs;
+                  hp.oper[0]^.ref^.symbol := l;
                   l.increfs;
                   l.increfs;
   {               this won't work, since the new label isn't in the labeltable }
   {               this won't work, since the new label isn't in the labeltable }
   {               so it will fail the rangecheck. Labeltable should become a   }
   {               so it will fail the rangecheck. Labeltable should become a   }
@@ -521,7 +521,7 @@ var
                     strpnew('next label reused'))));
                     strpnew('next label reused'))));
   {$endif finaldestdebug}
   {$endif finaldestdebug}
                   l.increfs;
                   l.increfs;
-                  hp.oper[0]^.sym := l;
+                  hp.oper[0]^.ref^.symbol := l;
                   if not GetFinalDestination(asml, hp,succ(level)) then
                   if not GetFinalDestination(asml, hp,succ(level)) then
                     exit;
                     exit;
                 end;
                 end;
@@ -602,7 +602,7 @@ begin
                 { remove jumps to a label coming right after them }
                 { remove jumps to a label coming right after them }
                 if GetNextInstruction(p, hp1) then
                 if GetNextInstruction(p, hp1) then
                   begin
                   begin
-                    if FindLabel(tasmlabel(taicpu(p).oper[0]^.sym), hp1) and
+                    if FindLabel(tasmlabel(taicpu(p).oper[0]^.ref^.symbol), hp1) and
   {$warning FIXME removing the first instruction fails}
   {$warning FIXME removing the first instruction fails}
                         (p<>blockstart) then
                         (p<>blockstart) then
                       begin
                       begin
@@ -619,14 +619,14 @@ begin
                         if (tai(hp1).typ=ait_instruction) and
                         if (tai(hp1).typ=ait_instruction) and
                             (taicpu(hp1).opcode=A_JMP) and
                             (taicpu(hp1).opcode=A_JMP) and
                             GetNextInstruction(hp1, hp2) and
                             GetNextInstruction(hp1, hp2) and
-                            FindLabel(tasmlabel(taicpu(p).oper[0]^.sym), hp2) then
+                            FindLabel(tasmlabel(taicpu(p).oper[0]^.ref^.symbol), hp2) then
                           begin
                           begin
                             if taicpu(p).opcode=A_Jcc then
                             if taicpu(p).opcode=A_Jcc then
                               begin
                               begin
                                 taicpu(p).condition:=inverse_cond[taicpu(p).condition];
                                 taicpu(p).condition:=inverse_cond[taicpu(p).condition];
                                 tai_label(hp2).l.decrefs;
                                 tai_label(hp2).l.decrefs;
-                                taicpu(p).oper[0]^.sym:=taicpu(hp1).oper[0]^.sym;
-                                taicpu(p).oper[0]^.sym.increfs;
+                                taicpu(p).oper[0]^.ref^.symbol:=taicpu(hp1).oper[0]^.ref^.symbol;
+                                taicpu(p).oper[0]^.ref^.symbol.increfs;
                                 asml.remove(hp1);
                                 asml.remove(hp1);
                                 hp1.free;
                                 hp1.free;
                                 GetFinalDestination(asml, taicpu(p),0);
                                 GetFinalDestination(asml, taicpu(p),0);
@@ -705,7 +705,7 @@ begin
                          (taicpu(hp3).is_jmp) and
                          (taicpu(hp3).is_jmp) and
                          (taicpu(hp3).opcode = A_JMP) and
                          (taicpu(hp3).opcode = A_JMP) and
                          GetNextInstruction(hp3, hp4) and
                          GetNextInstruction(hp3, hp4) and
-                         FindLabel(tasmlabel(taicpu(hp1).oper[0]^.sym),hp4) then
+                         FindLabel(tasmlabel(taicpu(hp1).oper[0]^.ref^.symbol),hp4) then
                         begin
                         begin
                           taicpu(hp2).Opcode := A_SUB;
                           taicpu(hp2).Opcode := A_SUB;
                           taicpu(hp2).Loadoper(1,taicpu(hp2).oper[0]^);
                           taicpu(hp2).Loadoper(1,taicpu(hp2).oper[0]^);
@@ -1751,7 +1751,7 @@ begin
                 begin
                 begin
                   if (taicpu(p).ops >= 2) and
                   if (taicpu(p).ops >= 2) and
                      ((taicpu(p).oper[0]^.typ = top_const) or
                      ((taicpu(p).oper[0]^.typ = top_const) or
-                      (taicpu(p).oper[0]^.typ = top_symbol)) and
+                      ((taicpu(p).oper[0]^.typ = top_ref) and (taicpu(p).oper[0]^.ref^.refaddr=addr_full))) and
                      (taicpu(p).oper[1]^.typ = top_reg) and
                      (taicpu(p).oper[1]^.typ = top_reg) and
                      ((taicpu(p).ops = 2) or
                      ((taicpu(p).ops = 2) or
                       ((taicpu(p).oper[2]^.typ = top_reg) and
                       ((taicpu(p).oper[2]^.typ = top_reg) and
@@ -1857,9 +1857,9 @@ begin
                    GetNextInstruction(p, hp1) and
                    GetNextInstruction(p, hp1) and
                    (hp1.typ = ait_instruction) and
                    (hp1.typ = ait_instruction) and
                    (taicpu(hp1).opcode = A_JMP) and
                    (taicpu(hp1).opcode = A_JMP) and
-                   (taicpu(hp1).oper[0]^.typ = top_symbol) then
+                   ((taicpu(hp1).oper[0]^.typ=top_ref) and (taicpu(p).oper[0]^.ref^.refaddr=addr_full)) then
                   begin
                   begin
-                    hp2 := taicpu.Op_sym(A_PUSH,S_L,taicpu(hp1).oper[0]^.sym);
+                    hp2 := taicpu.Op_sym(A_PUSH,S_L,taicpu(hp1).oper[0]^.ref^.symbol);
                     InsertLLItem(asml, p.previous, p, hp2);
                     InsertLLItem(asml, p.previous, p, hp2);
                     taicpu(p).opcode := A_JMP;
                     taicpu(p).opcode := A_JMP;
                     taicpu(p).is_jmp := true;
                     taicpu(p).is_jmp := true;
@@ -1999,7 +1999,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.56  2004-02-03 21:19:40  peter
+  Revision 1.57  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.56  2004/02/03 21:19:40  peter
     * remove previous commit
     * remove previous commit
 
 
   Revision 1.55  2004/02/03 16:53:37  peter
   Revision 1.55  2004/02/03 16:53:37  peter

+ 17 - 5
compiler/i386/rropt386.pas

@@ -35,7 +35,8 @@ implementation
 
 
 uses
 uses
   {$ifdef replaceregdebug}cutils,{$endif}
   {$ifdef replaceregdebug}cutils,{$endif}
-  verbose,globals,cpubase,daopt386,csopt386,rgobj, cgbase, cgobj;
+  verbose,globals,cpubase,daopt386,csopt386,rgobj,
+  cgbase,cgutils,cgobj;
 
 
 function canBeFirstSwitch(p: taicpu; supreg: tsuperregister): boolean;
 function canBeFirstSwitch(p: taicpu; supreg: tsuperregister): boolean;
 { checks whether an operation on reg can be switched to another reg without an }
 { checks whether an operation on reg can be switched to another reg without an }
@@ -54,7 +55,7 @@ begin
         (p.oper[0]^.typ <> top_ref) and
         (p.oper[0]^.typ <> top_ref) and
         (not pTaiprop(p.optinfo)^.FlagsUsed);
         (not pTaiprop(p.optinfo)^.FlagsUsed);
     A_INC,A_DEC:
     A_INC,A_DEC:
-      canBeFirstSwitch := 
+      canBeFirstSwitch :=
         (p.oper[0]^.typ = top_reg) and
         (p.oper[0]^.typ = top_reg) and
         (p.opsize = S_L) and
         (p.opsize = S_L) and
         (not pTaiprop(p.optinfo)^.FlagsUsed);
         (not pTaiprop(p.optinfo)^.FlagsUsed);
@@ -159,8 +160,11 @@ begin
               if p.opcode = A_SUB then
               if p.opcode = A_SUB then
                 tmpref.offset := - tmpRef.offset;
                 tmpref.offset := - tmpRef.offset;
             end;
             end;
-          top_symbol:
-            tmpref.symbol := p.oper[0]^.sym;
+          top_ref:
+            if (p.oper[0]^.ref^.refaddr=addr_full) then
+              tmpref.symbol := p.oper[0]^.ref^.symbol
+            else
+              internalerror(200402261);
           top_reg:
           top_reg:
             begin
             begin
               tmpref.index := p.oper[0]^.reg;
               tmpref.index := p.oper[0]^.reg;
@@ -360,7 +364,15 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.25  2003-12-15 16:08:16  jonas
+  Revision 1.26  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.25  2003/12/15 16:08:16  jonas
     - disable removal of dead loads before a call, because register
     - disable removal of dead loads before a call, because register
       parameters are released before a call
       parameters are released before a call
     * fix storeback of registers in case of different sizes (e.g., first
     * fix storeback of registers in case of different sizes (e.g., first

+ 24 - 11
compiler/ncgbas.pas

@@ -72,7 +72,10 @@ interface
       aasmbase,aasmtai,aasmcpu,symsym,
       aasmbase,aasmtai,aasmcpu,symsym,
       defutil,
       defutil,
       nflw,pass_2,
       nflw,pass_2,
-      cgbase,procinfo,cgobj,tgobj
+      cgbase,
+      cgutils,cgobj,
+      procinfo,
+      tgobj
       ;
       ;
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -142,13 +145,13 @@ interface
         begin
         begin
           if (op.typ=top_local) then
           if (op.typ=top_local) then
             begin
             begin
-              sofs:=op.localsymofs;
-              indexreg:=op.localindexreg;
+              sofs:=op.localoper^.localsymofs;
+              indexreg:=op.localoper^.localindexreg;
 {$ifdef x86}
 {$ifdef x86}
-              scale:=op.localscale;
+              scale:=op.localoper^.localscale;
 {$endif x86}
 {$endif x86}
-              getoffset:=op.localgetoffset;
-              sym:=tvarsym(pointer(op.localsym));
+              getoffset:=op.localoper^.localgetoffset;
+              sym:=tvarsym(pointer(op.localoper^.localsym));
               case sym.localloc.loc of
               case sym.localloc.loc of
                 LOC_REFERENCE :
                 LOC_REFERENCE :
                   begin
                   begin
@@ -249,10 +252,12 @@ interface
                            begin
                            begin
                              case typ of
                              case typ of
                                top_ref :
                                top_ref :
-                                 if assigned(ref^.symbol) then
-                                   ReLabel(ref^.symbol);
-                               top_symbol :
-                                 ReLabel(sym);
+                                 begin
+                                   if assigned(ref^.symbol) then
+                                     ReLabel(ref^.symbol);
+                                   if assigned(ref^.relsymbol) then
+                                     ReLabel(ref^.symbol);
+                                 end;
                              end;
                              end;
                            end;
                            end;
                         end;
                         end;
@@ -469,7 +474,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.55  2004-02-04 18:45:29  jonas
+  Revision 1.56  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.55  2004/02/04 18:45:29  jonas
     + some more usage of register temps
     + some more usage of register temps
 
 
   Revision 1.54  2004/02/03 19:48:06  jonas
   Revision 1.54  2004/02/03 19:48:06  jonas

+ 11 - 2
compiler/ncgcal.pas

@@ -92,7 +92,8 @@ implementation
 {$ifdef x86}
 {$ifdef x86}
       cga,cgx86,
       cga,cgx86,
 {$endif x86}
 {$endif x86}
-      ncgutil,cgobj,tgobj,
+      ncgutil,
+      cgutils,cgobj,tgobj,
       procinfo;
       procinfo;
 
 
 
 
@@ -1241,7 +1242,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.159  2004-02-26 16:12:04  peter
+  Revision 1.160  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.159  2004/02/26 16:12:04  peter
     * support typecasts for passing @var to formal const
     * support typecasts for passing @var to formal const
 
 
   Revision 1.158  2004/02/22 13:01:15  daniel
   Revision 1.158  2004/02/22 13:01:15  daniel

+ 10 - 2
compiler/ncgcnv.pas

@@ -63,7 +63,7 @@ interface
       cpubase,cpuinfo,systems,
       cpubase,cpuinfo,systems,
       pass_2,
       pass_2,
       procinfo,cgbase,
       procinfo,cgbase,
-      cgobj,
+      cgutils,cgobj,
       ncgutil,
       ncgutil,
       tgobj
       tgobj
       ;
       ;
@@ -535,7 +535,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.54  2004-02-05 01:24:08  florian
+  Revision 1.55  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.54  2004/02/05 01:24:08  florian
     * several fixes to compile x86-64 system
     * several fixes to compile x86-64 system
 
 
   Revision 1.53  2004/01/31 17:45:17  peter
   Revision 1.53  2004/01/31 17:45:17  peter

+ 11 - 2
compiler/ncgflw.pas

@@ -91,7 +91,8 @@ implementation
       nld,ncon,
       nld,ncon,
       ncgutil,
       ncgutil,
       tgobj,paramgr,
       tgobj,paramgr,
-      regvars,cgobj
+      regvars,
+      cgutils,cgobj
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
       ,cg64f32
       ,cg64f32
 {$endif cpu64bit}
 {$endif cpu64bit}
@@ -1461,7 +1462,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.92  2004-02-12 15:54:03  peter
+  Revision 1.93  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.92  2004/02/12 15:54:03  peter
     * make extcycle is working again
     * make extcycle is working again
 
 
   Revision 1.91  2004/02/05 18:28:37  peter
   Revision 1.91  2004/02/05 18:28:37  peter

+ 12 - 2
compiler/ncginl.pas

@@ -61,7 +61,9 @@ implementation
       cgbase,pass_1,pass_2,
       cgbase,pass_1,pass_2,
       cpuinfo,cpubase,paramgr,procinfo,
       cpuinfo,cpubase,paramgr,procinfo,
       nbas,ncon,ncal,ncnv,nld,
       nbas,ncon,ncal,ncnv,nld,
-      tgobj,ncgutil,cgobj,rgobj
+      tgobj,ncgutil,
+      cgutils,cgobj,
+      rgobj
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
       ,cg64f32
       ,cg64f32
 {$endif cpu64bit}
 {$endif cpu64bit}
@@ -676,7 +678,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.54  2004-02-05 16:58:43  florian
+  Revision 1.55  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.54  2004/02/05 16:58:43  florian
     * fixed (hopefully) the ansistring length bug
     * fixed (hopefully) the ansistring length bug
 
 
   Revision 1.53  2004/02/05 01:24:08  florian
   Revision 1.53  2004/02/05 01:24:08  florian

+ 13 - 3
compiler/ncgld.pas

@@ -56,7 +56,9 @@ implementation
       cgbase,pass_2,
       cgbase,pass_2,
       procinfo,
       procinfo,
       cpubase,cpuinfo,
       cpubase,cpuinfo,
-      tgobj,ncgutil,cgobj,ncgbas;
+      tgobj,ncgutil,
+      cgutils,cgobj,
+      ncgbas;
 
 
 {*****************************************************************************
 {*****************************************************************************
                              SecondLoad
                              SecondLoad
@@ -906,7 +908,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.111  2004-02-22 16:48:09  florian
+  Revision 1.112  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.111  2004/02/22 16:48:09  florian
     * x86_64 uses generic concatcopy_valueopenarray for now
     * x86_64 uses generic concatcopy_valueopenarray for now
 
 
   Revision 1.110  2004/02/22 16:30:37  florian
   Revision 1.110  2004/02/22 16:30:37  florian
@@ -1355,4 +1365,4 @@ end.
   * bugfix of hdisponen (base must be set, not index)
   * bugfix of hdisponen (base must be set, not index)
   * more portability fixes
   * more portability fixes
 
 
-}
+}

+ 11 - 2
compiler/ncgmem.pas

@@ -94,7 +94,8 @@ implementation
       aasmbase,aasmtai,
       aasmbase,aasmtai,
       procinfo,pass_2,
       procinfo,pass_2,
       pass_1,nld,ncon,nadd,nutils,
       pass_1,nld,ncon,nadd,nutils,
-      cgobj,tgobj,ncgutil,symbase
+      cgutils,cgobj,
+      tgobj,ncgutil,symbase
       ;
       ;
 
 
 
 
@@ -881,7 +882,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.87  2004-02-20 21:55:59  peter
+  Revision 1.88  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.87  2004/02/20 21:55:59  peter
     * procvar cleanup
     * procvar cleanup
 
 
   Revision 1.86  2004/02/03 22:32:54  peter
   Revision 1.86  2004/02/03 22:32:54  peter

+ 11 - 2
compiler/ncgset.pas

@@ -90,7 +90,8 @@ implementation
       paramgr,
       paramgr,
       pass_2,
       pass_2,
       nbas,ncon,nflw,
       nbas,ncon,nflw,
-      ncgutil,regvars,cpuinfo;
+      ncgutil,regvars,cpuinfo,
+      cgutils;
 
 
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -990,7 +991,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.59  2004-02-08 14:51:04  jonas
+  Revision 1.60  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.59  2004/02/08 14:51:04  jonas
     * fixed for regvars + simplification
     * fixed for regvars + simplification
 
 
   Revision 1.58  2004/02/05 19:35:27  florian
   Revision 1.58  2004/02/05 19:35:27  florian

+ 10 - 2
compiler/ncgutil.pas

@@ -120,7 +120,7 @@ implementation
     gdb,
     gdb,
 {$endif GDB}
 {$endif GDB}
     ncon,
     ncon,
-    tgobj,cgobj;
+    tgobj,cgutils,cgobj;
 
 
 
 
   const
   const
@@ -2141,7 +2141,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.193  2004-02-22 18:27:21  florian
+  Revision 1.194  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.193  2004/02/22 18:27:21  florian
     * fixed exception reason size for 64 bit systems
     * fixed exception reason size for 64 bit systems
 
 
   Revision 1.192  2004/02/08 17:48:59  jonas
   Revision 1.192  2004/02/08 17:48:59  jonas

+ 10 - 2
compiler/nobj.pas

@@ -154,7 +154,7 @@ implementation
 {$endif GDB}
 {$endif GDB}
        aasmcpu,
        aasmcpu,
        cpubase,cgbase,
        cpubase,cgbase,
-       cgobj
+       cgutils,cgobj
        ;
        ;
 
 
 
 
@@ -1380,7 +1380,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.63  2004-02-26 16:16:38  peter
+  Revision 1.64  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.63  2004/02/26 16:16:38  peter
     * tai_const.create_ptr added
     * tai_const.create_ptr added
 
 
   Revision 1.62  2004/02/19 17:07:42  florian
   Revision 1.62  2004/02/19 17:07:42  florian

+ 37 - 27
compiler/powerpc/agppcgas.pas

@@ -107,8 +107,8 @@ unit agppcgas;
           );
           );
 
 
 
 
-     symaddr2str: array[trefsymaddr] of string[3] = ('','@ha','@l');
-     symaddr2str_darwin: array[trefsymaddr] of string[4] = ('','ha16','lo16');
+       refaddr2str: array[trefaddr] of string[3] = ('','','@ha','@l');
+       refaddr2str_darwin: array[trefaddr] of string[4] = ('','','ha16','lo16');
 
 
 
 
     function getreferencestring(var ref : treference) : string;
     function getreferencestring(var ref : treference) : string;
@@ -117,16 +117,15 @@ unit agppcgas;
     begin
     begin
        with ref do
        with ref do
         begin
         begin
-          inc(offset,offsetfixup);
           if ((offset < -32768) or (offset > 32767)) and
           if ((offset < -32768) or (offset > 32767)) and
-             (symaddr = refs_full) then
+             (refaddr = addr_no) then
             internalerror(19991);
             internalerror(19991);
-          if (symaddr = refs_full) then
+          if (refaddr = addr_no) then
             s := ''
             s := ''
           else
           else
             begin
             begin
               if target_info.system = system_powerpc_darwin then
               if target_info.system = system_powerpc_darwin then
-                s := symaddr2str_darwin[symaddr]
+                s := refaddr2str_darwin[refaddr]
               else
               else
                 s :='';
                 s :='';
               s := s+'(';
               s := s+'(';
@@ -144,11 +143,11 @@ unit agppcgas;
                s:=s+tostr(offset);
                s:=s+tostr(offset);
             end;
             end;
 
 
-           if (symaddr <> refs_full) then
+           if (refaddr in [addr_lo,addr_hi]) then
              begin
              begin
                s := s+')';
                s := s+')';
                if (target_info.system <> system_powerpc_darwin) then
                if (target_info.system <> system_powerpc_darwin) then
-                 s := s+symaddr2str[symaddr];
+                 s := s+refaddr2str[refaddr];
              end;
              end;
 
 
            if (index=NR_NO) and (base<>NR_NO) then
            if (index=NR_NO) and (base<>NR_NO) then
@@ -187,14 +186,16 @@ unit agppcgas;
         { no top_ref jumping for powerpc }
         { no top_ref jumping for powerpc }
         top_const :
         top_const :
           getopstr_jmp:=tostr(o.val);
           getopstr_jmp:=tostr(o.val);
-        top_symbol :
+        top_ref :
           begin
           begin
-            hs:=o.sym.name;
-            if o.symofs>0 then
-             hs:=hs+'+'+tostr(o.symofs)
+            if o.ref^.refaddr<>addr_full then
+              internalerror(200402262);
+            hs:=o.ref^.symbol.name;
+            if o.ref^.offset>0 then
+             hs:=hs+'+'+tostr(o.ref^.offset)
             else
             else
-             if o.symofs<0 then
-              hs:=hs+tostr(o.symofs);
+             if o.ref^.offset<0 then
+              hs:=hs+tostr(o.ref^.offset);
             getopstr_jmp:=hs;
             getopstr_jmp:=hs;
           end;
           end;
         top_none:
         top_none:
@@ -214,17 +215,18 @@ unit agppcgas;
         top_const:
         top_const:
           getopstr:=tostr(longint(o.val));
           getopstr:=tostr(longint(o.val));
         top_ref:
         top_ref:
-          getopstr:=getreferencestring(o.ref^);
-        top_symbol:
-          begin
-            hs:=o.sym.name;
-            if o.symofs>0 then
-             hs:=hs+'+'+tostr(o.symofs)
-            else
-             if o.symofs<0 then
-              hs:=hs+tostr(o.symofs);
-            getopstr:=hs;
-          end;
+          if o.ref^.refaddr=addr_full then
+            begin
+              hs:=o.ref^.symbol.name;
+              if o.ref^.offset>0 then
+               hs:=hs+'+'+tostr(o.ref^.offset)
+              else
+               if o.ref^.offset<0 then
+                hs:=hs+tostr(o.ref^.offset);
+              getopstr:=hs;
+            end
+          else
+            getopstr:=getreferencestring(o.ref^);
         else
         else
           internalerror(2002070604);
           internalerror(2002070604);
       end;
       end;
@@ -328,7 +330,7 @@ unit agppcgas;
              else
              else
                begin
                begin
                  s:=cond2str(op,taicpu(hp).condition);
                  s:=cond2str(op,taicpu(hp).condition);
-                 if (s[length(s)] <> #9) and 
+                 if (s[length(s)] <> #9) and
                     (taicpu(hp).ops>0) then
                     (taicpu(hp).ops>0) then
                    s := s + ',';
                    s := s + ',';
                end;
                end;
@@ -373,7 +375,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.40  2004-01-04 21:17:51  jonas
+  Revision 1.41  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.40  2004/01/04 21:17:51  jonas
     + added log message for last commit
     + added log message for last commit
 
 
   Revision 1.39  2004/01/04 21:12:47  jonas
   Revision 1.39  2004/01/04 21:12:47  jonas

+ 48 - 36
compiler/powerpc/agppcmpw.pas

@@ -114,9 +114,7 @@ var
     begin
     begin
        with ref do
        with ref do
         begin
         begin
-          inc(offset,offsetfixup);
-
-          if (symaddr <> refs_full) then
+          if (refaddr <> addr_no) then
             InternalError(2002110301)
             InternalError(2002110301)
           else if ((offset < -32768) or (offset > 32767)) then
           else if ((offset < -32768) or (offset > 32767)) then
             InternalError(19991);
             InternalError(19991);
@@ -180,28 +178,33 @@ var
         { no top_ref jumping for powerpc }
         { no top_ref jumping for powerpc }
         top_const :
         top_const :
           getopstr_jmp:=tostr(o.val);
           getopstr_jmp:=tostr(o.val);
-        top_symbol :
+        top_ref :
           begin
           begin
-            hs:=o.sym.name;
-            ReplaceForbiddenChars(hs);
-            case o.sym.typ of
-              AT_FUNCTION:
-                begin
-                  if hs[1] <> '@' then {if not local label}
-                    if use_PR then
-                      hs:= '.'+hs+'[PR]'
-                    else
-                      hs:= '.'+hs
-                end
-              else
-                ;
-            end;
-            if o.symofs>0 then
-             hs:=hs+'+'+tostr(o.symofs)
+            if o.ref^.refaddr=addr_full then
+              begin
+                hs:=o.ref^.symbol.name;
+                ReplaceForbiddenChars(hs);
+                case o.ref^.symbol.typ of
+                  AT_FUNCTION:
+                    begin
+                      if hs[1] <> '@' then {if not local label}
+                        if use_PR then
+                          hs:= '.'+hs+'[PR]'
+                        else
+                          hs:= '.'+hs
+                    end
+                  else
+                    ;
+                end;
+                if o.ref^.offset>0 then
+                 hs:=hs+'+'+tostr(o.ref^.offset)
+                else
+                 if o.ref^.offset<0 then
+                  hs:=hs+tostr(o.ref^.offset);
+                getopstr_jmp:=hs;
+              end
             else
             else
-             if o.symofs<0 then
-              hs:=hs+tostr(o.symofs);
-            getopstr_jmp:=hs;
+              internalerror(200402263);
           end;
           end;
         top_none:
         top_none:
           getopstr_jmp:='';
           getopstr_jmp:='';
@@ -220,18 +223,19 @@ var
         top_const:
         top_const:
           getopstr:=tostr(longint(o.val));
           getopstr:=tostr(longint(o.val));
         top_ref:
         top_ref:
-          getopstr:=getreferencestring(o.ref^);
-        top_symbol:
-          begin
-            hs:=o.sym.name;
-            ReplaceForbiddenChars(hs);
-            if o.symofs>0 then
-             hs:=hs+'+'+tostr(o.symofs)
-            else
-             if o.symofs<0 then
-              hs:=hs+tostr(o.symofs);
-            getopstr:=hs;
-          end;
+          if o.ref^.refaddr=addr_no then
+            getopstr:=getreferencestring(o.ref^)
+          else
+            begin
+              hs:=o.ref^.symbol.name;
+              ReplaceForbiddenChars(hs);
+              if o.ref^.offset>0 then
+               hs:=hs+'+'+tostr(o.ref^.offset)
+              else
+               if o.ref^.offset<0 then
+                hs:=hs+tostr(o.ref^.offset);
+              getopstr:=hs;
+            end;
         else
         else
           internalerror(2002070604);
           internalerror(2002070604);
       end;
       end;
@@ -1382,7 +1386,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.30  2004-02-04 15:28:24  olle
+  Revision 1.31  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.30  2004/02/04 15:28:24  olle
     * made more in phase with agppcgas.pas
     * made more in phase with agppcgas.pas
 
 
   Revision 1.29  2004/01/12 00:08:03  olle
   Revision 1.29  2004/01/12 00:08:03  olle

+ 48 - 19
compiler/powerpc/cgcpu.pas

@@ -158,7 +158,8 @@ const
     uses
     uses
        globtype,globals,verbose,systems,cutils,
        globtype,globals,verbose,systems,cutils,
        symconst,symdef,symsym,
        symconst,symdef,symsym,
-       rgobj,tgobj,cpupi,procinfo,paramgr;
+       rgobj,tgobj,cpupi,procinfo,paramgr,
+       cgutils;
 
 
 
 
     procedure tcgppc.init_register_allocators;
     procedure tcgppc.init_register_allocators;
@@ -172,11 +173,19 @@ const
              RS_R14,RS_R13],first_int_imreg,[]);
              RS_R14,RS_R13],first_int_imreg,[]);
         case target_info.abi of
         case target_info.abi of
           abi_powerpc_aix:
           abi_powerpc_aix:
-            rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
-                [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
-                 RS_F10,RS_F11,RS_F12,RS_F13,RS_F31,RS_F30,RS_F29,RS_F28,RS_F27,
-                 RS_F26,RS_F25,RS_F24,RS_F23,RS_F22,RS_F21,RS_F20,RS_F19,RS_F18,
-                 RS_F17,RS_F16,RS_F15,RS_F14],first_fpu_imreg,[]);
+            { darwin uses R10 as got }
+            if target_info.system=system_powerpc_darwin then
+              rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
+                  [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
+                   RS_F11,RS_F12,RS_F13,RS_F31,RS_F30,RS_F29,RS_F28,RS_F27,
+                   RS_F26,RS_F25,RS_F24,RS_F23,RS_F22,RS_F21,RS_F20,RS_F19,RS_F18,
+                   RS_F17,RS_F16,RS_F15,RS_F14],first_fpu_imreg,[])
+            else
+              rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
+                  [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
+                   RS_F10,RS_F11,RS_F12,RS_F13,RS_F31,RS_F30,RS_F29,RS_F28,RS_F27,
+                   RS_F26,RS_F25,RS_F24,RS_F23,RS_F22,RS_F21,RS_F20,RS_F19,RS_F18,
+                   RS_F17,RS_F16,RS_F15,RS_F14],first_fpu_imreg,[]);
           abi_powerpc_sysv:
           abi_powerpc_sysv:
             rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
             rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
                 [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
                 [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
@@ -951,6 +960,7 @@ const
          usesfpr,usesgpr,gotgot : boolean;
          usesfpr,usesgpr,gotgot : boolean;
          parastart : aword;
          parastart : aword;
 //         r,r2,rsp:Tregister;
 //         r,r2,rsp:Tregister;
+         l : tasmlabel;
          regcounter2, firstfpureg: Tsuperregister;
          regcounter2, firstfpureg: Tsuperregister;
          hp: tparaitem;
          hp: tparaitem;
 
 
@@ -1153,13 +1163,24 @@ const
         if cs_create_pic in aktmoduleswitches then
         if cs_create_pic in aktmoduleswitches then
           begin
           begin
              { if we didn't get the GOT pointer till now, we've to calculate it now }
              { if we didn't get the GOT pointer till now, we've to calculate it now }
-             if not(gotgot) then
-               begin
-                  {!!!!!!!!!!!!!}
-               end;
-             a_reg_alloc(list,NR_R31);
-             { place GOT ptr in r31 }
-             list.concat(taicpu.op_reg_reg(A_MFSPR,NR_R31,NR_LR));
+             if not(gotgot) and (pi_needs_got in current_procinfo.flags) then
+             case target_info.system of
+               system_powerpc_darwin:
+                 begin
+                   list.concat(taicpu.op_reg_reg(A_MFSPR,NR_R0,NR_LR));
+                   objectlibrary.getlabel(l);
+                   list.concat(taicpu.op_const_const_sym(A_BCL,20,31,l));
+                   a_label(list,l);
+                   list.concat(taicpu.op_reg_reg(A_MFSPR,NR_R10,NR_LR));
+                   list.concat(taicpu.op_reg_reg(A_MTSPR,NR_R0,NR_LR));
+                 end;
+               else
+                 begin
+                   a_reg_alloc(list,NR_R31);
+                   { place GOT ptr in r31 }
+                   list.concat(taicpu.op_reg_reg(A_MFSPR,NR_R31,NR_LR));
+                 end;
+             end;
           end;
           end;
         { save the CR if necessary ( !!! always done currently ) }
         { save the CR if necessary ( !!! always done currently ) }
         { still need to find out where this has to be done for SystemV
         { still need to find out where this has to be done for SystemV
@@ -1332,7 +1353,7 @@ const
      var regcounter,firstregfpu,firstreggpr: TSuperRegister;
      var regcounter,firstregfpu,firstreggpr: TSuperRegister;
          usesfpr,usesgpr: boolean;
          usesfpr,usesgpr: boolean;
          href : treference;
          href : treference;
-         offset: integer;
+         offset: aint;
          regcounter2, firstfpureg: Tsuperregister;
          regcounter2, firstfpureg: Tsuperregister;
     begin
     begin
       usesfpr:=false;
       usesfpr:=false;
@@ -1678,7 +1699,7 @@ const
                  reference_reset(tmpref);
                  reference_reset(tmpref);
                  tmpref.offset := ref2.offset;
                  tmpref.offset := ref2.offset;
                  tmpref.symbol := ref2.symbol;
                  tmpref.symbol := ref2.symbol;
-                 tmpref.symaddr := refs_ha;
+                 tmpref.refaddr := addr_hi;
                  if ref2.base<> NR_NO then
                  if ref2.base<> NR_NO then
                    begin
                    begin
                      list.concat(taicpu.op_reg_reg_ref(A_ADDIS,r,
                      list.concat(taicpu.op_reg_reg_ref(A_ADDIS,r,
@@ -1692,7 +1713,7 @@ const
                  else
                  else
                    list.concat(taicpu.op_reg_ref(A_LIS,r,tmpref));
                    list.concat(taicpu.op_reg_ref(A_LIS,r,tmpref));
                  tmpref.base := NR_NO;
                  tmpref.base := NR_NO;
-                 tmpref.symaddr := refs_l;
+                 tmpref.refaddr := addr_lo;
                  { can be folded with one of the next instructions by the }
                  { can be folded with one of the next instructions by the }
                  { optimizer probably                                     }
                  { optimizer probably                                     }
                  list.concat(taicpu.op_reg_reg_ref(A_ADDI,r,r,tmpref));
                  list.concat(taicpu.op_reg_reg_ref(A_ADDI,r,r,tmpref));
@@ -2154,14 +2175,14 @@ const
                 reference_reset(tmpref);
                 reference_reset(tmpref);
                 tmpref.symbol := ref.symbol;
                 tmpref.symbol := ref.symbol;
                 tmpref.offset := ref.offset;
                 tmpref.offset := ref.offset;
-                tmpref.symaddr := refs_ha;
+                tmpref.refaddr := addr_hi;
                 if ref.base <> NR_NO then
                 if ref.base <> NR_NO then
                   list.concat(taicpu.op_reg_reg_ref(A_ADDIS,tmpreg,
                   list.concat(taicpu.op_reg_reg_ref(A_ADDIS,tmpreg,
                     ref.base,tmpref))
                     ref.base,tmpref))
                 else
                 else
                   list.concat(taicpu.op_reg_ref(A_LIS,tmpreg,tmpref));
                   list.concat(taicpu.op_reg_ref(A_LIS,tmpreg,tmpref));
                 ref.base := tmpreg;
                 ref.base := tmpreg;
-                ref.symaddr := refs_l;
+                ref.refaddr := addr_lo;
                 list.concat(taicpu.op_reg_ref(op,reg,ref));
                 list.concat(taicpu.op_reg_ref(op,reg,ref));
               end
               end
             else
             else
@@ -2300,7 +2321,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.163  2004-02-09 22:45:49  florian
+  Revision 1.164  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.163  2004/02/09 22:45:49  florian
     * compilation fixed
     * compilation fixed
 
 
   Revision 1.162  2004/02/09 20:44:40  olle
   Revision 1.162  2004/02/09 20:44:40  olle

+ 15 - 16
compiler/powerpc/cpubase.pas

@@ -240,10 +240,6 @@ uses
     type
     type
       trefoptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
       trefoptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
 
 
-      { since we have only 16 offsets, we need to be able to specify the high }
-      { and low 16 bits of the address of a symbol                            }
-      trefsymaddr = (refs_full,refs_ha,refs_l);
-
       { reference record }
       { reference record }
       preference = ^treference;
       preference = ^treference;
       treference = packed record
       treference = packed record
@@ -252,18 +248,13 @@ uses
          { index register, R_NO if none }
          { index register, R_NO if none }
          index       : tregister;
          index       : tregister;
          { offset, 0 if none }
          { offset, 0 if none }
-         offset      : longint;
+         offset      : aint;
          { symbol this reference refers to, nil if none }
          { symbol this reference refers to, nil if none }
          symbol      : tasmsymbol;
          symbol      : tasmsymbol;
-         { used in conjunction with symbols and offsets: refs_full means }
-         { means a full 32bit reference, refs_ha means the upper 16 bits }
-         { and refs_l the lower 16 bits of the address                   }
-         symaddr     : trefsymaddr;
-         { changed when inlining and possibly in other cases, don't }
-         { set manually                                             }
-         offsetfixup : longint;
-         { used in conjunction with the previous field }
-         options     : trefoptions;
+         { symbol the symbol of this reference is relative to, nil if none }
+         relsymbol      : tasmsymbol;
+         { reference type addr or symbol itself }
+         refaddr : trefaddr;
          { alignment this reference is guaranteed to have }
          { alignment this reference is guaranteed to have }
          alignment   : byte;
          alignment   : byte;
       end;
       end;
@@ -276,7 +267,7 @@ uses
       end;
       end;
 
 
     const
     const
-      symaddr2str: array[trefsymaddr] of string[3] = ('','@ha','@l');
+      symaddr2str: array[trefaddr] of string[3] = ('','','@ha','@l');
 
 
     const
     const
       { MacOS only. Whether the direct data area (TOC) directly contain
       { MacOS only. Whether the direct data area (TOC) directly contain
@@ -632,7 +623,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.85  2004-02-09 22:45:49  florian
+  Revision 1.86  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.85  2004/02/09 22:45:49  florian
     * compilation fixed
     * compilation fixed
 
 
   Revision 1.84  2004/02/08 18:08:59  jonas
   Revision 1.84  2004/02/08 18:08:59  jonas

+ 10 - 1
compiler/powerpc/cpuinfo.pas

@@ -23,6 +23,7 @@ Interface
 Type
 Type
    { Architecture word - Native unsigned type }
    { Architecture word - Native unsigned type }
    AWord  = Longword;
    AWord  = Longword;
+   AInt = Longint;
    PAWord = ^AWord;
    PAWord = ^AWord;
 
 
    { this must be an ordinal type with the same size as a pointer }
    { this must be an ordinal type with the same size as a pointer }
@@ -100,7 +101,15 @@ Implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  2003-11-12 16:05:40  florian
+  Revision 1.17  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.16  2003/11/12 16:05:40  florian
     * assembler readers OOPed
     * assembler readers OOPed
     + typed currency constants
     + typed currency constants
     + typed 128 bit float constants if the CPU supports it
     + typed 128 bit float constants if the CPU supports it

+ 10 - 2
compiler/powerpc/nppcobj.pas

@@ -37,7 +37,7 @@ uses
   fmodule,
   fmodule,
   nobj,
   nobj,
   cpuinfo,cpubase,
   cpuinfo,cpubase,
-  cgobj;
+  cgutils,cgobj;
 
 
    type
    type
      tppcclassheader=class(tclassheader)
      tppcclassheader=class(tclassheader)
@@ -167,7 +167,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2003-12-28 15:14:14  jonas
+  Revision 1.4  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.3  2003/12/28 15:14:14  jonas
     * hopefully fixed interfaces (untested)
     * hopefully fixed interfaces (untested)
 
 
   Revision 1.2  2003/12/23 23:12:44  peter
   Revision 1.2  2003/12/23 23:12:44  peter

+ 16 - 6
compiler/powerpc/rappcgas.pas

@@ -38,7 +38,7 @@ Unit rappcgas;
         procedure BuildOpCode(instr : tppcinstruction);
         procedure BuildOpCode(instr : tppcinstruction);
         procedure ReadAt(oper : tppcoperand);
         procedure ReadAt(oper : tppcoperand);
         procedure ReadSym(oper : tppcoperand);
         procedure ReadSym(oper : tppcoperand);
-        procedure ConvertCalljmp(instr : tppcinstruction);
+        { procedure ConvertCalljmp(instr : tppcinstruction); }
       end;
       end;
 
 
 
 
@@ -104,9 +104,9 @@ Unit rappcgas;
             if actasmtoken=AS_ID then
             if actasmtoken=AS_ID then
               begin
               begin
                 if upper(actasmpattern)='L' then
                 if upper(actasmpattern)='L' then
-                  oper.opr.ref.symaddr:=refs_l
+                  oper.opr.ref.refaddr:=addr_lo
                 else if upper(actasmpattern)='HA' then
                 else if upper(actasmpattern)='HA' then
-                  oper.opr.ref.symaddr:=refs_ha
+                  oper.opr.ref.refaddr:=addr_hi
                 else
                 else
                   Message(asmr_e_invalid_reference_syntax);
                   Message(asmr_e_invalid_reference_syntax);
                 Consume(AS_ID);
                 Consume(AS_ID);
@@ -695,7 +695,7 @@ Unit rappcgas;
           end;
           end;
       end;
       end;
 
 
-
+{
     procedure tppcattreader.ConvertCalljmp(instr : tppcinstruction);
     procedure tppcattreader.ConvertCalljmp(instr : tppcinstruction);
       var
       var
         newopr : toprrec;
         newopr : toprrec;
@@ -712,7 +712,7 @@ Unit rappcgas;
             instr.Operands[1].opr:=newopr;
             instr.Operands[1].opr:=newopr;
           end;
           end;
       end;
       end;
-
+}
 
 
     procedure tppcattreader.handleopcode;
     procedure tppcattreader.handleopcode;
       var
       var
@@ -721,8 +721,10 @@ Unit rappcgas;
         instr:=TPPCInstruction.Create(TPPCOperand);
         instr:=TPPCInstruction.Create(TPPCOperand);
         BuildOpcode(instr);
         BuildOpcode(instr);
         instr.condition := actcondition;
         instr.condition := actcondition;
+        {
         if is_calljmp(instr.opcode) then
         if is_calljmp(instr.opcode) then
           ConvertCalljmp(instr);
           ConvertCalljmp(instr);
+        }
         {
         {
         instr.AddReferenceSizes;
         instr.AddReferenceSizes;
         instr.SetInstructionOpsize;
         instr.SetInstructionOpsize;
@@ -758,7 +760,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2004-02-04 15:23:28  olle
+  Revision 1.10  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.9  2004/02/04 15:23:28  olle
     * uodated header comment
     * uodated header comment
 
 
   Revision 1.8  2003/11/29 22:54:32  jonas
   Revision 1.8  2003/11/29 22:54:32  jonas

+ 59 - 2
compiler/ppu.pas

@@ -26,6 +26,9 @@ unit ppu;
 
 
 interface
 interface
 
 
+  uses
+    cpuinfo;
+
 { Also write the ppu if only crc if done, this can be used with ppudump to
 { Also write the ppu if only crc if done, this can be used with ppudump to
   see the differences between the intf and implementation }
   see the differences between the intf and implementation }
 { define INTFPPU}
 { define INTFPPU}
@@ -217,6 +220,8 @@ type
     function  getbyte:byte;
     function  getbyte:byte;
     function  getword:word;
     function  getword:word;
     function  getlongint:longint;
     function  getlongint:longint;
+    function getint64:int64;
+    function getaint:aint;
     function  getreal:ppureal;
     function  getreal:ppureal;
     function  getstring:string;
     function  getstring:string;
     procedure getnormalset(var b);
     procedure getnormalset(var b);
@@ -232,6 +237,8 @@ type
     procedure putbyte(b:byte);
     procedure putbyte(b:byte);
     procedure putword(w:word);
     procedure putword(w:word);
     procedure putlongint(l:longint);
     procedure putlongint(l:longint);
+    procedure putint64(i:int64);
+    procedure putaint(i:aint);
     procedure putreal(d:ppureal);
     procedure putreal(d:ppureal);
     procedure putstring(s:string);
     procedure putstring(s:string);
     procedure putnormalset(const b);
     procedure putnormalset(const b);
@@ -246,7 +253,8 @@ implementation
 {$ifdef Test_Double_checksum}
 {$ifdef Test_Double_checksum}
     comphook,
     comphook,
 {$endif def Test_Double_checksum}
 {$endif def Test_Double_checksum}
-    crc;
+    crc,
+    cutils;
 
 
 {*****************************************************************************
 {*****************************************************************************
                              Endian Handling
                              Endian Handling
@@ -606,6 +614,35 @@ begin
 end;
 end;
 
 
 
 
+function tppufile.getint64:int64;
+var
+  i : int64;
+begin
+  if entryidx+8>entry.size then
+   begin
+     error:=true;
+     result:=0;
+     exit;
+   end;
+  readdata(i,8);
+  if change_endian then
+    result:=swapint64(i)
+  else
+    result:=i;
+  inc(entryidx,8);
+end;
+
+
+function tppufile.getaint:aint;
+begin
+{$ifdef cpu64bit}
+  result:=getint64;
+{$else cpu64bit}
+  result:=getlongint;
+{$endif cpu64bit}
+end;
+
+
 function tppufile.getreal:ppureal;
 function tppufile.getreal:ppureal;
 var
 var
   d : ppureal;
   d : ppureal;
@@ -913,6 +950,18 @@ begin
 end;
 end;
 
 
 
 
+procedure tppufile.putint64(i:int64);
+begin
+  putdata(i,8);
+end;
+
+
+procedure tppufile.putaint(i:aint);
+begin
+  putdata(i,sizeof(aint));
+end;
+
+
 procedure tppufile.putreal(d:ppureal);
 procedure tppufile.putreal(d:ppureal);
 begin
 begin
   putdata(d,sizeof(ppureal));
   putdata(d,sizeof(ppureal));
@@ -993,7 +1042,15 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.45  2004-01-30 13:42:03  florian
+  Revision 1.46  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.45  2004/01/30 13:42:03  florian
     * fixed more alignment issues
     * fixed more alignment issues
 
 
   Revision 1.44  2003/11/10 22:02:52  peter
   Revision 1.44  2003/11/10 22:02:52  peter

+ 10 - 2
compiler/procinfo.pas

@@ -122,7 +122,7 @@ implementation
 
 
      uses
      uses
         cutils,systems,
         cutils,systems,
-        tgobj,cgobj,
+        tgobj,cgutils,cgobj,
         paramgr
         paramgr
         ;
         ;
 
 
@@ -181,7 +181,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  2004-02-19 17:07:42  florian
+  Revision 1.13  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.12  2004/02/19 17:07:42  florian
     * fixed arg. area calculation
     * fixed arg. area calculation
 
 
   Revision 1.11  2003/12/26 14:02:30  peter
   Revision 1.11  2003/12/26 14:02:30  peter

+ 9 - 5
compiler/sparc/cpubase.pas

@@ -157,10 +157,6 @@ uses
     type
     type
       TRefOptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
       TRefOptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
 
 
-      { since we have no full 32 bit offsets, we need to be able to specify the high
-        and low bits of the address of a symbol                                      }
-      trefsymaddr = (refs_no,refs_full,refs_hi,refs_lo);
-
       { reference record }
       { reference record }
       preference = ^treference;
       preference = ^treference;
       treference = packed record
       treference = packed record
@@ -552,7 +548,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.61  2004-02-25 14:25:47  mazen
+  Revision 1.62  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.61  2004/02/25 14:25:47  mazen
   * fix compile problem for sparc
   * fix compile problem for sparc
 
 
   Revision 1.60  2004/01/12 22:11:39  peter
   Revision 1.60  2004/01/12 22:11:39  peter

+ 11 - 2
compiler/symconst.pas

@@ -337,7 +337,8 @@ type
     {# procedure contains data which needs to be finalized }
     {# procedure contains data which needs to be finalized }
     pi_needs_implicit_finally,
     pi_needs_implicit_finally,
     {# procedure uses fpu}
     {# procedure uses fpu}
-    pi_uses_fpu
+    pi_uses_fpu,
+    pi_needs_got
   );
   );
   tprocinfoflags=set of tprocinfoflag;
   tprocinfoflags=set of tprocinfoflag;
 
 
@@ -401,7 +402,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.75  2004-02-20 21:54:47  peter
+  Revision 1.76  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.75  2004/02/20 21:54:47  peter
     * use sp_internal flag to silence unused internal variable
     * use sp_internal flag to silence unused internal variable
 
 
   Revision 1.74  2004/01/21 14:22:00  florian
   Revision 1.74  2004/01/21 14:22:00  florian

+ 14 - 6
compiler/systems/t_bsd.pas

@@ -40,7 +40,7 @@ implementation
     symconst,script,
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,symdef,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,symdef,
     import,export,link,i_bsd,
     import,export,link,i_bsd,
-    cgobj;
+    cgutils,cgbase,cgobj;
 
 
   type
   type
     tdarwinimported_item = class(timported_item)
     tdarwinimported_item = class(timported_item)
@@ -223,7 +223,7 @@ implementation
 {$else powerpc}
 {$else powerpc}
                       internalerror(2004010501);
                       internalerror(2004010501);
 {$endif powerpc}
 {$endif powerpc}
-                      
+
                       importsSection.concat(Tai_section.Create(sec_data));
                       importsSection.concat(Tai_section.Create(sec_data));
                       importsSection.concat(Tai_direct.create(strpnew('.section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16')));
                       importsSection.concat(Tai_direct.create(strpnew('.section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16')));
                       importsSection.concat(Tai_align.Create(4));
                       importsSection.concat(Tai_align.Create(4));
@@ -241,9 +241,9 @@ implementation
                        end;
                        end;
 {$EndIf GDB}
 {$EndIf GDB}
 {$ifdef powerpc}
 {$ifdef powerpc}
-                      href.symaddr := refs_ha;
+                      href.refaddr := addr_hi;
                       importsSection.concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
                       importsSection.concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
-                      href.symaddr := refs_l;
+                      href.refaddr := addr_lo;
                       href.base := NR_R11;
                       href.base := NR_R11;
                       importsSection.concat(taicpu.op_reg_ref(A_LWZU,NR_R12,href));
                       importsSection.concat(taicpu.op_reg_ref(A_LWZU,NR_R12,href));
                       importsSection.concat(taicpu.op_reg(A_MTCTR,NR_R12));
                       importsSection.concat(taicpu.op_reg(A_MTCTR,NR_R12));
@@ -256,7 +256,7 @@ implementation
                       importsSection.concat(Tai_symbol.Create(l1,0));
                       importsSection.concat(Tai_symbol.Create(l1,0));
                       importsSection.concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+symname)));
                       importsSection.concat(Tai_direct.create(strpnew((#9+'.indirect_symbol ')+symname)));
                       importsSection.concat(tai_const_symbol.createname(strpnew('dyld_stub_binding_helper')));
                       importsSection.concat(tai_const_symbol.createname(strpnew('dyld_stub_binding_helper')));
-                     
+
                     end
                     end
                    else
                    else
                     begin
                     begin
@@ -760,7 +760,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2004-02-15 16:34:18  marco
+  Revision 1.10  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.9  2004/02/15 16:34:18  marco
    * pthread on -CURRENT related fixes.
    * pthread on -CURRENT related fixes.
 
 
   Revision 1.8  2004/01/21 20:53:51  marco
   Revision 1.8  2004/01/21 20:53:51  marco

+ 12 - 1
compiler/systems/t_win32.pas

@@ -105,6 +105,9 @@ interface
 
 
 implementation
 implementation
 
 
+  uses
+    cgutils;
+
     function DllName(Const Name : string;NdefExt:longint;DefExt:pStr4) : string;
     function DllName(Const Name : string;NdefExt:longint;DefExt:pStr4) : string;
       var n : string;
       var n : string;
           i:longint;
           i:longint;
@@ -1603,7 +1606,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.27  2004-01-09 13:37:17  daniel
+  Revision 1.28  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.27  2004/01/09 13:37:17  daniel
     * Commented out code removed
     * Commented out code removed
 
 
   Revision 1.25  2003/12/09 19:54:59  marco
   Revision 1.25  2003/12/09 19:54:59  marco

+ 77 - 71
compiler/x86/aasmcpu.pas

@@ -759,7 +759,7 @@ implementation
         o.ot:=ppufile.getlongint;
         o.ot:=ppufile.getlongint;
         case o.typ of
         case o.typ of
           top_reg :
           top_reg :
-              ppufile.getdata(o.reg,sizeof(Tregister));
+            ppufile.getdata(o.reg,sizeof(Tregister));
           top_ref :
           top_ref :
             begin
             begin
               new(o.ref);
               new(o.ref);
@@ -767,23 +767,22 @@ implementation
               ppufile.getdata(o.ref^.base,sizeof(Tregister));
               ppufile.getdata(o.ref^.base,sizeof(Tregister));
               ppufile.getdata(o.ref^.index,sizeof(Tregister));
               ppufile.getdata(o.ref^.index,sizeof(Tregister));
               o.ref^.scalefactor:=ppufile.getbyte;
               o.ref^.scalefactor:=ppufile.getbyte;
-              o.ref^.offset:=ppufile.getlongint;
+              o.ref^.offset:=ppufile.getaint;
               o.ref^.symbol:=ppufile.getasmsymbol;
               o.ref^.symbol:=ppufile.getasmsymbol;
+              o.ref^.relsymbol:=ppufile.getasmsymbol;
             end;
             end;
           top_const :
           top_const :
-            o.val:=aword(ppufile.getlongint);
-          top_symbol :
-            begin
-              o.sym:=ppufile.getasmsymbol;
-              o.symofs:=ppufile.getlongint;
-            end;
+            o.val:=aword(ppufile.getaint);
           top_local :
           top_local :
             begin
             begin
-              ppufile.getderef(o.localsymderef);
-              o.localsymofs:=ppufile.getlongint;
-              o.localindexreg:=tregister(ppufile.getlongint);
-              o.localscale:=ppufile.getbyte;
-              o.localgetoffset:=(ppufile.getbyte<>0);
+              with o.localoper^ do
+                begin
+                  ppufile.getderef(localsymderef);
+                  localsymofs:=ppufile.getaint;
+                  localindexreg:=tregister(ppufile.getlongint);
+                  localscale:=ppufile.getbyte;
+                  localgetoffset:=(ppufile.getbyte<>0);
+                end;
             end;
             end;
         end;
         end;
       end;
       end;
@@ -802,23 +801,22 @@ implementation
               ppufile.putdata(o.ref^.base,sizeof(Tregister));
               ppufile.putdata(o.ref^.base,sizeof(Tregister));
               ppufile.putdata(o.ref^.index,sizeof(Tregister));
               ppufile.putdata(o.ref^.index,sizeof(Tregister));
               ppufile.putbyte(o.ref^.scalefactor);
               ppufile.putbyte(o.ref^.scalefactor);
-              ppufile.putlongint(o.ref^.offset);
+              ppufile.putaint(o.ref^.offset);
               ppufile.putasmsymbol(o.ref^.symbol);
               ppufile.putasmsymbol(o.ref^.symbol);
+              ppufile.putasmsymbol(o.ref^.relsymbol);
             end;
             end;
           top_const :
           top_const :
-            ppufile.putlongint(longint(o.val));
-          top_symbol :
-            begin
-              ppufile.putasmsymbol(o.sym);
-              ppufile.putlongint(longint(o.symofs));
-            end;
+            ppufile.putaint(aint(o.val));
           top_local :
           top_local :
             begin
             begin
-              ppufile.putderef(o.localsymderef);
-              ppufile.putlongint(longint(o.localsymofs));
-              ppufile.putlongint(longint(o.localindexreg));
-              ppufile.putbyte(o.localscale);
-              ppufile.putbyte(byte(o.localgetoffset));
+              with o.localoper^ do
+                begin
+                  ppufile.putderef(localsymderef);
+                  ppufile.putaint(aint(localsymofs));
+                  ppufile.putlongint(longint(localindexreg));
+                  ppufile.putbyte(localscale);
+                  ppufile.putbyte(byte(localgetoffset));
+                end;
             end;
             end;
         end;
         end;
       end;
       end;
@@ -828,7 +826,7 @@ implementation
       begin
       begin
         case o.typ of
         case o.typ of
           top_local :
           top_local :
-            o.localsymderef.build(tvarsym(o.localsym));
+            o.localoper^.localsymderef.build(tvarsym(o.localoper^.localsym));
         end;
         end;
       end;
       end;
 
 
@@ -839,12 +837,12 @@ implementation
           top_ref :
           top_ref :
             begin
             begin
               if assigned(o.ref^.symbol) then
               if assigned(o.ref^.symbol) then
-               objectlibrary.derefasmsymbol(o.ref^.symbol);
+                objectlibrary.derefasmsymbol(o.ref^.symbol);
+              if assigned(o.ref^.relsymbol) then
+                objectlibrary.derefasmsymbol(o.ref^.relsymbol);
             end;
             end;
-          top_symbol :
-            objectlibrary.derefasmsymbol(o.sym);
           top_local :
           top_local :
-            o.localsym:=tvarsym(o.localsymderef.resolve);
+            o.localoper^.localsym:=tvarsym(o.localoper^.localsymderef.resolve);
         end;
         end;
       end;
       end;
 
 
@@ -939,19 +937,45 @@ implementation
                 end;
                 end;
               top_ref :
               top_ref :
                 begin
                 begin
-                  { create ot field }
-                  if (ot and OT_SIZE_MASK)=0 then
-                    ot:=OT_MEMORY or opsize_2_type[i,opsize]
-                  else
-                    ot:=OT_MEMORY or (ot and OT_SIZE_MASK);
-                  if (ref^.base=NR_NO) and (ref^.index=NR_NO) then
-                    ot:=ot or OT_MEM_OFFS;
-                  { fix scalefactor }
-                  if (ref^.index=NR_NO) then
-                   ref^.scalefactor:=0
+                  if ref^.refaddr=addr_no then
+                    begin
+                      { create ot field }
+                      if (ot and OT_SIZE_MASK)=0 then
+                        ot:=OT_MEMORY or opsize_2_type[i,opsize]
+                      else
+                        ot:=OT_MEMORY or (ot and OT_SIZE_MASK);
+                      if (ref^.base=NR_NO) and (ref^.index=NR_NO) then
+                        ot:=ot or OT_MEM_OFFS;
+                      { fix scalefactor }
+                      if (ref^.index=NR_NO) then
+                       ref^.scalefactor:=0
+                      else
+                       if (ref^.scalefactor=0) then
+                        ref^.scalefactor:=1;
+                    end
                   else
                   else
-                   if (ref^.scalefactor=0) then
-                    ref^.scalefactor:=1;
+                    begin
+                      l:=ref^.offset;
+                      if assigned(ref^.symbol) then
+                       inc(l,ref^.symbol.address);
+                      { when it is a forward jump we need to compensate the
+                        offset of the instruction since the previous time,
+                        because the symbol address is then still using the
+                        'old-style' addressing.
+                        For backwards jumps this is not required because the
+                        address of the symbol is already adjusted to the
+                        new offset }
+                      if (l>InsOffset) and (LastInsOffset<>-1) then
+                        inc(l,InsOffset-LastInsOffset);
+                      { instruction size will then always become 2 (PFV) }
+                      relsize:=(InsOffset+2)-l;
+                      if (not assigned(ref^.symbol) or
+                          ((ref^.symbol.currbind<>AB_EXTERNAL) and (ref^.symbol.address<>0))) and
+                         (relsize>=-128) and (relsize<=127) then
+                       ot:=OT_IMM32 or OT_SHORT
+                      else
+                       ot:=OT_IMM32 or OT_NEAR;
+                    end;
                 end;
                 end;
               top_local :
               top_local :
                 begin
                 begin
@@ -967,29 +991,8 @@ implementation
                   else
                   else
                     ot:=OT_IMMEDIATE or opsize_2_type[i,opsize];
                     ot:=OT_IMMEDIATE or opsize_2_type[i,opsize];
                 end;
                 end;
-              top_symbol :
-                begin
-                  l:=symofs;
-                  if assigned(sym) then
-                   inc(l,sym.address);
-                  { when it is a forward jump we need to compensate the
-                    offset of the instruction since the previous time,
-                    because the symbol address is then still using the
-                    'old-style' addressing.
-                    For backwards jumps this is not required because the
-                    address of the symbol is already adjusted to the
-                    new offset }
-                  if (l>InsOffset) and (LastInsOffset<>-1) then
-                    inc(l,InsOffset-LastInsOffset);
-                  { instruction size will then always become 2 (PFV) }
-                  relsize:=(InsOffset+2)-l;
-                  if (not assigned(sym) or
-                      ((sym.currbind<>AB_EXTERNAL) and (sym.address<>0))) and
-                     (relsize>=-128) and (relsize<=127) then
-                   ot:=OT_IMM32 or OT_SHORT
-                  else
-                   ot:=OT_IMM32 or OT_NEAR;
-                end;
+              else
+                internalerror(200402261);
             end;
             end;
           end;
           end;
       end;
       end;
@@ -1616,11 +1619,6 @@ implementation
                 currval:=longint(oper[opidx]^.val);
                 currval:=longint(oper[opidx]^.val);
                 currsym:=nil;
                 currsym:=nil;
               end;
               end;
-            top_symbol :
-              begin
-                currval:=oper[opidx]^.symofs;
-                currsym:=oper[opidx]^.sym;
-              end;
             else
             else
               Message(asmw_e_immediate_or_reference_expected);
               Message(asmw_e_immediate_or_reference_expected);
           end;
           end;
@@ -1964,7 +1962,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.51  2004-02-09 22:14:17  peter
+  Revision 1.52  2004-02-27 10:21:05  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.51  2004/02/09 22:14:17  peter
     * more x86_64 parameter fixes
     * more x86_64 parameter fixes
     * tparalocation.lochigh is now used to indicate if registerhigh
     * tparalocation.lochigh is now used to indicate if registerhigh
       is used and what the type is
       is used and what the type is

+ 42 - 29
compiler/x86/agx86att.pas

@@ -50,6 +50,7 @@ interface
       cutils,systems,
       cutils,systems,
       verbose,
       verbose,
       itcpugas,
       itcpugas,
+      cpuinfo,
       cgbase,
       cgbase,
       aasmcpu;
       aasmcpu;
 
 
@@ -111,23 +112,24 @@ interface
           top_reg :
           top_reg :
             AsmWrite(gas_regname(o.reg));
             AsmWrite(gas_regname(o.reg));
           top_ref :
           top_ref :
-            WriteReference(o.ref^);
+            if o.ref^.refaddr=addr_no then
+              WriteReference(o.ref^)
+            else
+              begin
+                AsmWrite('$');
+                if assigned(o.ref^.symbol) then
+                 AsmWrite(o.ref^.symbol.name);
+                if o.ref^.offset>0 then
+                 AsmWrite('+'+tostr(o.ref^.offset))
+                else
+                 if o.ref^.offset<0 then
+                  AsmWrite(tostr(o.ref^.offset))
+                else
+                 if not(assigned(o.ref^.symbol)) then
+                   AsmWrite('0');
+              end;
           top_const :
           top_const :
-            AsmWrite('$'+tostr(longint(o.val)));
-          top_symbol :
-            begin
-              AsmWrite('$');
-              if assigned(o.sym) then
-               AsmWrite(o.sym.name);
-              if o.symofs>0 then
-               AsmWrite('+'+tostr(o.symofs))
-              else
-               if o.symofs<0 then
-                AsmWrite(tostr(o.symofs))
-              else
-               if not(assigned(o.sym)) then
-                 AsmWrite('0');
-            end;
+            AsmWrite('$'+tostr(aint(o.val)));
           else
           else
             internalerror(10001);
             internalerror(10001);
         end;
         end;
@@ -141,20 +143,23 @@ interface
             AsmWrite('*'+gas_regname(o.reg));
             AsmWrite('*'+gas_regname(o.reg));
           top_ref :
           top_ref :
             begin
             begin
-              AsmWrite('*');
-              WriteReference(o.ref^);
-            end;
-          top_const :
-            AsmWrite(tostr(longint(o.val)));
-          top_symbol :
-            begin
-              AsmWrite(o.sym.name);
-              if o.symofs>0 then
-               AsmWrite('+'+tostr(o.symofs))
+              if o.ref^.refaddr=addr_no then
+                begin
+                  AsmWrite('*');
+                  WriteReference(o.ref^);
+                end
               else
               else
-               if o.symofs<0 then
-                AsmWrite(tostr(o.symofs));
+                begin
+                  AsmWrite(o.ref^.symbol.name);
+                  if o.ref^.offset>0 then
+                   AsmWrite('+'+tostr(o.ref^.offset))
+                  else
+                   if o.ref^.offset<0 then
+                    AsmWrite(tostr(o.ref^.offset));
+                end;
             end;
             end;
+          top_const :
+            AsmWrite(tostr(aint(o.val)));
           else
           else
             internalerror(10001);
             internalerror(10001);
         end;
         end;
@@ -293,7 +298,15 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  2003-12-24 00:33:10  florian
+  Revision 1.13  2004-02-27 10:21:06  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.12  2003/12/24 00:33:10  florian
     * x86-64 compilation fixed
     * x86-64 compilation fixed
 
 
   Revision 1.11  2003/11/12 16:05:40  florian
   Revision 1.11  2003/11/12 16:05:40  florian

+ 10 - 1
compiler/x86/cgx86.pas

@@ -167,6 +167,7 @@ unit cgx86;
 
 
     uses
     uses
        globtype,globals,verbose,systems,cutils,
        globtype,globals,verbose,systems,cutils,
+       cgutils,
        symdef,defutil,paramgr,tgobj,procinfo;
        symdef,defutil,paramgr,tgobj,procinfo;
 
 
     const
     const
@@ -1780,7 +1781,15 @@ unit cgx86;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.114  2004-02-22 18:27:21  florian
+  Revision 1.115  2004-02-27 10:21:06  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.114  2004/02/22 18:27:21  florian
     * fixed exception reason size for 64 bit systems
     * fixed exception reason size for 64 bit systems
 
 
   Revision 1.113  2004/02/22 16:48:10  florian
   Revision 1.113  2004/02/22 16:48:10  florian

+ 15 - 5
compiler/x86/cpubase.pas

@@ -226,22 +226,24 @@ uses
 *****************************************************************************}
 *****************************************************************************}
 
 
     type
     type
-      { reference record }
+      { reference record, reordered for best alignment }
       preference = ^treference;
       preference = ^treference;
       treference = record
       treference = record
+         offset      : aint;
+         symbol,
+         relsymbol   : tasmsymbol;
          segment,
          segment,
          base,
          base,
          index       : tregister;
          index       : tregister;
+         refaddr     : trefaddr;
          scalefactor : byte;
          scalefactor : byte;
-         offset      : longint;
-         symbol      : tasmsymbol;
       end;
       end;
 
 
       { reference record }
       { reference record }
       pparareference = ^tparareference;
       pparareference = ^tparareference;
       tparareference = packed record
       tparareference = packed record
          index       : tregister;
          index       : tregister;
-         offset      : longint;
+         offset      : aint;
       end;
       end;
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -507,7 +509,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  2004-02-22 18:27:21  florian
+  Revision 1.42  2004-02-27 10:21:06  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.41  2004/02/22 18:27:21  florian
     * fixed exception reason size for 64 bit systems
     * fixed exception reason size for 64 bit systems
 
 
   Revision 1.40  2004/02/05 18:28:37  peter
   Revision 1.40  2004/02/05 18:28:37  peter

+ 10 - 2
compiler/x86/nx86cnv.pas

@@ -65,7 +65,7 @@ implementation
       cgbase,cga,pass_2,
       cgbase,cga,pass_2,
       ncon,ncal,ncnv,
       ncon,ncal,ncnv,
       cpubase,
       cpubase,
-      cgobj,cgx86,ncgutil,
+      cgutils,cgobj,cgx86,ncgutil,
       tgobj;
       tgobj;
 
 
 
 
@@ -277,7 +277,15 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2004-02-05 01:24:08  florian
+  Revision 1.10  2004-02-27 10:21:06  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.9  2004/02/05 01:24:08  florian
     * several fixes to compile x86-64 system
     * several fixes to compile x86-64 system
 
 
   Revision 1.8  2003/12/26 00:32:22  florian
   Revision 1.8  2003/12/26 00:32:22  florian

+ 10 - 2
compiler/x86/nx86inl.pas

@@ -70,7 +70,7 @@ implementation
       cgbase,pass_2,
       cgbase,pass_2,
       cpuinfo,cpubase,paramgr,
       cpuinfo,cpubase,paramgr,
       nbas,ncon,ncal,ncnv,nld,
       nbas,ncon,ncal,ncnv,nld,
-      cga,cgx86,cgobj;
+      cga,cgutils,cgx86,cgobj;
 
 
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -353,6 +353,14 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2004-02-05 01:24:08  florian
+  Revision 1.2  2004-02-27 10:21:06  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.1  2004/02/05 01:24:08  florian
     * several fixes to compile x86-64 system
     * several fixes to compile x86-64 system
 }
 }

+ 11 - 3
compiler/x86/nx86set.pas

@@ -47,7 +47,7 @@ implementation
       cgbase,pass_2,
       cgbase,pass_2,
       ncon,
       ncon,
       cpubase,cpuinfo,procinfo,
       cpubase,cpuinfo,procinfo,
-      cga,cgobj,ncgutil,
+      cga,cgutils,cgobj,ncgutil,
       cgx86;
       cgx86;
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -495,7 +495,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  2004-02-22 12:04:04  florian
+  Revision 1.2  2004-02-27 10:21:06  florian
+    * top_symbol killed
+    + refaddr to treference added
+    + refsymbol to treference added
+    * top_local stuff moved to an extra record to save memory
+    + aint introduced
+    * tppufile.get/putint64/aint implemented
+
+  Revision 1.1  2004/02/22 12:04:04  florian
     + nx86set added
     + nx86set added
     * some more x86-64 fixes
     * some more x86-64 fixes
- }
+ }