Browse Source

+ stab register indexes for powerpc (moved from gdb to cpubase)
+ tprocessor enumeration moved to cpuinfo
+ linker in target_info is now a class
* many many updates for m68k (will soon start to compile)
- removed some ifdef or correct them for correct cpu

carl 23 năm trước cách đây
mục cha
commit
9da171faf2
67 tập tin đã thay đổi với 1335 bổ sung1434 xóa
  1. 9 1
      compiler/aasmbase.pas
  2. 10 9
      compiler/assemble.pas
  3. 12 1
      compiler/dmisc.pas
  4. 9 73
      compiler/gdb.pas
  5. 9 2
      compiler/globals.pas
  6. 8 47
      compiler/globtype.pas
  7. 9 28
      compiler/i386/ag386att.pas
  8. 9 4
      compiler/i386/ag386int.pas
  9. 9 7
      compiler/i386/ag386nsm.pas
  10. 37 2
      compiler/i386/cpubase.pas
  11. 25 1
      compiler/i386/cpuinfo.pas
  12. 9 2
      compiler/i386/cpuswtch.pas
  13. 9 2
      compiler/i386/n386cal.pas
  14. 9 2
      compiler/i386/n386mat.pas
  15. 9 2
      compiler/i386/n386set.pas
  16. 9 2
      compiler/i386/ra386att.pas
  17. 12 5
      compiler/i_amiga.pas
  18. 10 3
      compiler/i_atari.pas
  19. 12 5
      compiler/i_beos.pas
  20. 19 12
      compiler/i_fbsd.pas
  21. 11 4
      compiler/i_go32v2.pas
  22. 30 23
      compiler/i_linux.pas
  23. 8 55
      compiler/i_macos.pas
  24. 11 4
      compiler/i_nwm.pas
  25. 10 3
      compiler/i_os2.pas
  26. 10 3
      compiler/i_palmos.pas
  27. 12 5
      compiler/i_sunos.pas
  28. 11 4
      compiler/i_wdosx.pas
  29. 10 3
      compiler/i_win32.pas
  30. 17 1
      compiler/ia64/cpuinfo.pas
  31. 30 16
      compiler/link.pas
  32. 91 165
      compiler/m68k/aasmcpu.pas
  33. 69 125
      compiler/m68k/cpubase.pas
  34. 24 1
      compiler/m68k/cpuinfo.pas
  35. 85 0
      compiler/m68k/cpupara.pas
  36. 10 3
      compiler/m68k/rasm.pas
  37. 14 7
      compiler/m68k/rgcpu.pas
  38. 130 123
      compiler/nadd.pas
  39. 10 1
      compiler/ncgcal.pas
  40. 9 6
      compiler/ncgutil.pas
  41. 8 6
      compiler/ogcoff.pas
  42. 8 2
      compiler/ogelf.pas
  43. 103 96
      compiler/oglx.pas
  44. 9 2
      compiler/options.pas
  45. 16 2
      compiler/paramgr.pas
  46. 9 2
      compiler/parser.pas
  47. 12 2
      compiler/pdecl.pas
  48. 9 3
      compiler/powerpc/agppcgas.pas
  49. 72 5
      compiler/powerpc/cpubase.pas
  50. 23 1
      compiler/powerpc/cpuinfo.pas
  51. 0 448
      compiler/powerpc/nppcmem.pas
  52. 0 22
      compiler/ppc.dof
  53. 10 3
      compiler/ppc.dpr
  54. 10 3
      compiler/rautils.pas
  55. 10 9
      compiler/symsym.pas
  56. 76 37
      compiler/systems.pas
  57. 9 2
      compiler/targets/t_beos.pas
  58. 10 3
      compiler/targets/t_fbsd.pas
  59. 11 3
      compiler/targets/t_go32v2.pas
  60. 14 7
      compiler/targets/t_linux.pas
  61. 9 2
      compiler/targets/t_nwm.pas
  62. 9 2
      compiler/targets/t_os2.pas
  63. 9 2
      compiler/targets/t_sunos.pas
  64. 9 2
      compiler/targets/t_wdosx.pas
  65. 10 3
      compiler/targets/t_win32.pas
  66. 8 2
      compiler/x86_64/agx64att.pas
  67. 16 1
      compiler/x86_64/cpuinfo.pas

+ 9 - 1
compiler/aasmbase.pas

@@ -298,6 +298,7 @@ implementation
           inherited create(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_DATA);
         is_set:=false;
         is_addr := false;
+        proclocal := false;
         { write it always }
         refs:=1;
       end;
@@ -839,7 +840,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.5  2002-08-11 14:32:25  peter
+  Revision 1.6  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.5  2002/08/11 14:32:25  peter
     * renamed current_library to objectlibrary
 
   Revision 1.4  2002/08/11 13:24:10  peter

+ 10 - 9
compiler/assemble.pas

@@ -52,7 +52,7 @@ interface
        AsmOutSize=32768;
 
     type
-      TAssembler=class
+      TAssembler=class(TAbstractAssembler)
       public
       {filenames}
         path     : pathstr;
@@ -259,13 +259,7 @@ Implementation
       begin
         DoPipe:=(cs_asm_pipe in aktglobalswitches) and
                 not(cs_asm_leave in aktglobalswitches)
-{$ifdef i386}
-                and ((aktoutputformat=as_i386_as));
-{$endif i386}
-{$ifdef m68k}
-                and ((aktoutputformat=as_m68k_as) or
-                     (aktoutputformat=as_m68k_asbsd));
-{$endif m68k}
+                and ((aktoutputformat=as_gas));
       end;
 
 
@@ -1598,7 +1592,14 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.41  2002-08-11 14:32:26  peter
+  Revision 1.42  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.41  2002/08/11 14:32:26  peter
     * renamed current_library to objectlibrary
 
   Revision 1.40  2002/08/11 13:24:10  peter

+ 12 - 1
compiler/dmisc.pas

@@ -38,6 +38,10 @@ uses
 {$endif}
   sysutils;
 
+{$ifdef VER100}
+   type int64 = longint;
+{$endif}
+
 Const
   Max_Path = 255;
 
@@ -836,7 +840,14 @@ End;
 end.
 {
   $Log$
-  Revision 1.9  2002-05-18 13:34:07  peter
+  Revision 1.10  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.9  2002/05/18 13:34:07  peter
     * readded missing revisions
 
   Revision 1.8  2002/05/16 19:46:36  carl

+ 9 - 73
compiler/gdb.pas

@@ -81,78 +81,7 @@ Const
        DBX_counter : plongint = nil;
        do_count_dbx : boolean = false;
 
-{$ifdef i386}
-           { this is the register order for GDB }
-           { this is indeed the internal order of
-             registers in GDB, but as we use STABS,
-             the values are converted using
-             i386_stab_reg_to_regnum from i386_tdep.c PM }
-           { 0 "eax",   "ecx",    "edx",   "ebx",     \
-             4 "esp",   "ebp",    "esi",   "edi",        \
-             8 "eip",   "eflags", "cs",    "ss",        \
-             12 "ds",    "es",     "fs",    "gs",        \
-             16 "st0",   "st1",    "st2",   "st3",        \
-             20 "st4",   "st5",    "st6",   "st7",        \
-             24 "fctrl", "fstat",  "ftag",  "fiseg",        \
-             28 "fioff", "foseg",  "fooff", "fop",     \
-             32 "xmm0",  "xmm1",   "xmm2",  "xmm3",        \
-             36 "xmm4",  "xmm5",   "xmm6",  "xmm7",        \
-             40 "mxcsr"                                \
-           }
-  { tregister = (R_NO,
-    R_EAX,R_ECX,R_EDX,R_EBX,R_ESP,R_EBP,R_ESI,R_EDI,
-    R_AX,R_CX,R_DX,R_BX,R_SP,R_BP,R_SI,R_DI,
-    R_AL,R_CL,R_DL,R_BL,R_AH,R_CH,R_BH,R_DH,
-    R_CS,R_DS,R_ES,R_SS,R_FS,R_GS,
-    R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7,
-    R_DR0,R_DR1,R_DR2,R_DR3,R_DR6,R_DR7,
-    R_CR0,R_CR2,R_CR3,R_CR4,
-    R_TR3,R_TR4,R_TR5,R_TR6,R_TR7,
-    R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7,
-    R_XMM0,R_XMM1,R_XMM2,R_XMM3,R_XMM4,R_XMM5,R_XMM6,R_XMM7
-  ); }
-
-    { So here we need to use the stabs numbers PM }
-           GDB_i386index : array[tregister] of shortint =(-1,
-          0,1,2,3,4,5,6,7,
-          0,1,2,3,4,5,6,7,
-          0,1,2,3,0,1,2,3,
-          -1,-1,-1,-1,-1,-1,
-          12,12,13,14,15,16,17,18,19,
-          -1,-1,-1,-1,-1,-1,
-          -1,-1,-1,-1,
-          -1,-1,-1,-1,-1,
-          { I think, GDB doesn't know MMX (FK)
-            GDB does not, but stabs does PM }
-          29,30,31,32,33,34,35,36,
-          21,22,23,24,25,26,27,28
-        );
-{$endif i386}
-{$ifdef m68k}
-           { "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
-             "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp",
-             "ps", "pc", "fp0", "fp1", "fp2", "fp3", "fp4" ,
-             "fp5", "fp6", "fp7", "fpcontrol", "fpstatus",
-             "fpiaddr","fpcode","fpflags"
-           }
-        { this is the register order for GDB }
-        GDB_m68kindex : array[tregister] of shortint =
-        (-1,                 { R_NO }
-          0,1,2,3,4,5,6,7,   { R_D0..R_D7 }
-          8,9,10,11,12,13,14,15,  { R_A0..R_A7 }
-          -1,-1,-1,                { R_SPPUSH, R_SPPULL, R_CCR }
-          18,19,20,21,22,23,24,25, { R_FP0..R_FP7    }
-          -1,-1,-1,-1,-1,-1,-1,-1
-        );
-{$endif}
-{$IFDEF SPARC}
-        GDB_SPARC_index:ARRAY[tregister]OF ShortInt=(0,0,0,0,0,0,0,0,0,0,0,0,0,
-          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-          0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
-{$ENDIF SPARC}
+
   implementation
 
 { to use N_EXCL we have to count the character in the stabs for
@@ -304,7 +233,14 @@ end.
 
 {
   $Log$
-  Revision 1.14  2002-07-01 18:46:22  peter
+  Revision 1.15  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.14  2002/07/01 18:46:22  peter
     * internal linker
     * reorganized aasm layer
 

+ 9 - 2
compiler/globals.pas

@@ -1442,7 +1442,7 @@ implementation
         {$IFDEF testvarsets}
          initsetalloc:=0;
         {$ENDIF}
-        initasmmode:=asmmode_m68k_mot;
+        initasmmode:=asmmode_standard;
 {$endif m68k}
 {$ifdef powerpc}
         initoptprocessor:=PPC604;
@@ -1480,7 +1480,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.63  2002-08-10 14:46:29  carl
+  Revision 1.64  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.63  2002/08/10 14:46:29  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 8 - 47
compiler/globtype.pas

@@ -29,52 +29,6 @@ interface
        maxidlen = 64;
 
     type
-       { System independent float names }
-{$ifdef x86}
-       bestreal = extended;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = extended;
-{$endif}
-{$ifdef m68k}
-       bestreal = real;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = extended;
-{$endif}
-{$ifdef alpha}
-       bestreal = extended;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = comp;
-{$endif}
-{$ifdef powerpc}
-       bestreal = double;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       ts64comp = comp;
-{$endif powerpc}
-{$ifdef ia64}
-       bestreal = extended;
-       ts32real = single;
-       ts64real = double;
-       ts80real = extended;
-       { on the ia64 comp will be mapped to int64 }
-       ts64comp = comp;
-{$endif}
-{$ifdef SPARC}
-  bestreal = real;
-  ts32real = single;
-  ts64real = double;
-  ts80real = extended;
-  ts64comp = extended;
-{$endif}
-
-       pbestreal=^bestreal;
 
        { Switches which can be changed locally }
        tlocalswitch = (cs_localnone,
@@ -255,7 +209,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.29  2002-08-06 20:55:20  florian
+  Revision 1.30  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.29  2002/08/06 20:55:20  florian
     * first part of ppc calling conventions fix
 
   Revision 1.28  2002/07/04 20:43:00  florian

+ 9 - 28
compiler/i386/ag386att.pas

@@ -251,14 +251,13 @@ interface
     const
        as_i386_as_info : tasminfo =
           (
-            id     : as_i386_as;
+            id     : as_gas;
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
             supported_target : system_any;
             outputbinary: false;
             allowdirect : true;
-            externals : false;
             needar : true;
             labelprefix_only_inside_procedure : false;
             labelprefix : '.L';
@@ -278,7 +277,6 @@ interface
             supported_target : system_i386_os2;
             outputbinary: false;
             allowdirect : true;
-            externals : false;
             needar : true;
             labelprefix_only_inside_procedure : false;
             labelprefix : 'L';
@@ -298,7 +296,6 @@ interface
             supported_target : system_i386_win32;
             outputbinary: false;
             allowdirect : true;
-            externals : false;
             needar : true;
             labelprefix_only_inside_procedure : false;
             labelprefix : '.L';
@@ -310,37 +307,21 @@ interface
               '.stab','.stabstr','COMMON')
           );
 
-       as_i386_aswwdosx_info : tasminfo =
-          (
-            id           : as_i386_aswdosx;
-            idtxt  : 'ASWDOSX';
-            asmbin : 'asw';
-            asmcmd : '-o $OBJ $ASM';
-            supported_target : system_i386_wdosx;
-            outputbinary: false;
-            allowdirect : true;
-            externals : false;
-            needar : true;
-            labelprefix_only_inside_procedure : false;
-            labelprefix : '.L';
-            comment : '# ';
-            secnames : ('',
-              '.text','.data','.section .bss',
-              '.section .idata$2','.section .idata$4','.section .idata$5',
-                '.section .idata$6','.section .idata$7','.section .edata',
-              '.stab','.stabstr','COMMON')
-          );
-
-
 initialization
   RegisterAssembler(as_i386_as_info,T386ATTAssembler);
   RegisterAssembler(as_i386_as_aout_info,T386ATTAssembler);
   RegisterAssembler(as_i386_asw_info,T386ATTAssembler);
-  RegisterAssembler(as_i386_aswwdosx_info,T386ATTAssembler);
 end.
 {
   $Log$
-  Revision 1.25  2002-07-26 21:15:42  florian
+  Revision 1.26  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.25  2002/07/26 21:15:42  florian
     * rewrote the system handling
 
   Revision 1.24  2002/07/07 09:52:33  florian

+ 9 - 4
compiler/i386/ag386int.pas

@@ -46,7 +46,7 @@ interface
       sysutils,
 {$endif}
       cutils,globtype,globals,systems,cclasses,
-      verbose,cpubase,finput,fmodule,script
+      verbose,cpubase,finput,fmodule,script,cpuinfo
       ;
 
     const
@@ -786,7 +786,6 @@ ait_stab_function_name : ;
             supported_target : system_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure : true;
             labelprefix : '@@';
@@ -806,7 +805,6 @@ ait_stab_function_name : ;
             supported_target : system_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure : false;
             labelprefix : '@@';
@@ -823,7 +821,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.25  2002-08-11 14:32:29  peter
+  Revision 1.26  2002-08-12 15:08:41  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.25  2002/08/11 14:32:29  peter
     * renamed current_library to objectlibrary
 
   Revision 1.24  2002/08/11 13:24:16  peter

+ 9 - 7
compiler/i386/ag386nsm.pas

@@ -45,7 +45,7 @@ interface
       sysutils,
 {$endif}
       cutils,globtype,globals,systems,cclasses,
-      fmodule,finput,verbose,cpubase
+      fmodule,finput,verbose,cpubase,cpuinfo
       ;
 
     const
@@ -796,7 +796,6 @@ interface
             supported_target : system_i386_go32v2;
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure: false;
             labelprefix : '..@';
@@ -816,7 +815,6 @@ interface
             supported_target : system_i386_win32;
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure: false;
             labelprefix : '..@';
@@ -836,7 +834,6 @@ interface
             supported_target : system_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure: false;
             labelprefix : '..@';
@@ -856,7 +853,6 @@ interface
             supported_target : system_i386_wdosx;
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure: false;
             labelprefix : '..@';
@@ -877,7 +873,6 @@ interface
             supported_target : system_i386_linux;
             outputbinary: false;
             allowdirect : true;
-            externals : true;
             needar : true;
             labelprefix_only_inside_procedure: false;
             labelprefix : '..@';
@@ -898,7 +893,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.24  2002-08-11 14:32:29  peter
+  Revision 1.25  2002-08-12 15:08:41  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.24  2002/08/11 14:32:29  peter
     * renamed current_library to objectlibrary
 
   Revision 1.23  2002/08/11 13:24:16  peter

+ 37 - 2
compiler/i386/cpubase.pas

@@ -381,6 +381,32 @@ uses
       max_scratch_regs = 1;
       scratch_regs : array[1..max_scratch_regs] of tregister = (R_EDI);
 
+
+{*****************************************************************************
+                               GDB Information
+*****************************************************************************}
+
+      {# Register indexes for stabs information, when some
+         parameters or variables are stored in registers.
+         
+         Taken from i386.c (dbx_register_map) and i386.h
+          (FIXED_REGISTERS) from GCC 3.x source code
+         
+      }   
+          stab_regindex : array[tregister] of shortint =
+          (-1,
+          0,1,2,3,4,5,6,7,
+          0,1,2,3,4,5,6,7,
+          0,1,2,3,0,1,2,3,
+          -1,-1,-1,-1,-1,-1,
+          12,12,13,14,15,16,17,18,19,
+          -1,-1,-1,-1,-1,-1,
+          -1,-1,-1,-1,
+          -1,-1,-1,-1,-1,
+          29,30,31,32,33,34,35,36,
+          21,22,23,24,25,26,27,28
+        );
+
 {*****************************************************************************
                           Default generic sizes
 *****************************************************************************}
@@ -406,7 +432,9 @@ uses
          object or class. }
       self_pointer_reg  = R_ESI;
       {# Register for addressing absolute data in a position independant way,
-         such as in PIC code. The exact meaning is ABI specific }
+         such as in PIC code. The exact meaning is ABI specific. For
+         further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
+      }
       pic_offset_reg = R_EBX;
       {# Results are returned in this register (32-bit values) }
       accumulator   = R_EAX;
@@ -490,7 +518,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.28  2002-08-06 20:55:23  florian
+  Revision 1.29  2002-08-12 15:08:41  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.28  2002/08/06 20:55:23  florian
     * first part of ppc calling conventions fix
 
   Revision 1.27  2002/07/25 18:01:29  carl

+ 25 - 1
compiler/i386/cpuinfo.pas

@@ -37,6 +37,23 @@ Type
    { $fffffffffffffff on a 32bit machine if the compiler uses     }
    { int64 constants internally (JM)                              }
    TConstPtrUInt = cardinal;
+   
+   bestreal = extended;
+   ts32real = single;
+   ts64real = double;
+   ts80real = extended;
+   ts64comp = extended;
+   
+   pbestreal=^bestreal;
+   
+   { possible supported processors for this target }
+   tprocessors = 
+      (no_processor,
+       Class386,
+       ClassP5,
+       ClassP6
+      ); 
+   
 
 Const
    {# Size of native extended floating point type }
@@ -55,7 +72,14 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.11  2002-08-10 14:47:50  carl
+  Revision 1.12  2002-08-12 15:08:41  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.11  2002/08/10 14:47:50  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 9 - 2
compiler/i386/cpuswtch.pas

@@ -37,7 +37,7 @@ type
 implementation
 
 uses
-  cutils,globtype,systems,globals;
+  cutils,globtype,systems,globals,cpuinfo;
 
 procedure toption386.interpret_proc_specific_options(const opt:string);
 var
@@ -129,7 +129,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.8  2002-08-10 14:47:50  carl
+  Revision 1.9  2002-08-12 15:08:42  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.8  2002/08/10 14:47:50  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 9 - 2
compiler/i386/n386cal.pas

@@ -64,7 +64,7 @@ implementation
       cpubase,paramgr,
       aasmbase,aasmtai,aasmcpu,
       nmem,nld,ncnv,
-      ncgutil,cga,cgobj,tgobj,regvars,rgobj,rgcpu,cg64f32,cgcpu;
+      ncgutil,cga,cgobj,tgobj,regvars,rgobj,rgcpu,cg64f32,cgcpu,cpuinfo;
 
 {*****************************************************************************
                              TI386CALLPARANODE
@@ -1481,7 +1481,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.62  2002-08-11 14:32:30  peter
+  Revision 1.63  2002-08-12 15:08:42  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.62  2002/08/11 14:32:30  peter
     * renamed current_library to objectlibrary
 
   Revision 1.61  2002/08/11 13:24:16  peter

+ 9 - 2
compiler/i386/n386mat.pas

@@ -55,7 +55,7 @@ implementation
       symconst,symdef,aasmbase,aasmtai,aasmcpu,defbase,
       cginfo,cgbase,pass_1,pass_2,
       ncon,
-      cpubase,
+      cpubase,cpuinfo,
       cga,tgobj,ncgutil,cgobj,rgobj,rgcpu;
 
 {*****************************************************************************
@@ -830,7 +830,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.36  2002-08-11 14:32:30  peter
+  Revision 1.37  2002-08-12 15:08:42  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.36  2002/08/11 14:32:30  peter
     * renamed current_library to objectlibrary
 
   Revision 1.35  2002/08/11 13:24:17  peter

+ 9 - 2
compiler/i386/n386set.pas

@@ -48,7 +48,7 @@ implementation
       aasmbase,aasmtai,aasmcpu,
       cginfo,cgbase,pass_2,
       ncon,
-      cpubase,
+      cpubase,cpuinfo,
       cga,cgobj,tgobj,ncgutil,regvars,rgobj;
 
      const
@@ -1023,7 +1023,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.38  2002-08-11 14:32:30  peter
+  Revision 1.39  2002-08-12 15:08:42  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.38  2002/08/11 14:32:30  peter
     * renamed current_library to objectlibrary
 
   Revision 1.37  2002/08/11 13:24:17  peter

+ 9 - 2
compiler/i386/ra386att.pas

@@ -41,7 +41,7 @@ Implementation
        globtype,globals,verbose,
        systems,
        { aasm }
-       cpubase,aasmbase,aasmtai,aasmcpu,
+       cpubase,cpuinfo,aasmbase,aasmtai,aasmcpu,
        { symtable }
        symconst,symbase,symtype,symsym,symtable,
        { pass 1 }
@@ -2129,7 +2129,14 @@ finalization
 end.
 {
   $Log$
-  Revision 1.28  2002-08-11 14:32:31  peter
+  Revision 1.29  2002-08-12 15:08:42  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.28  2002/08/11 14:32:31  peter
     * renamed current_library to objectlibrary
 
   Revision 1.27  2002/08/11 13:24:17  peter

+ 12 - 5
compiler/i_amiga.pas

@@ -58,10 +58,10 @@ unit i_amiga;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_amiga;
-            linkextern   : ld_m68k_amiga;
+            assem        : as_none;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_m68k_ar;
             res          : res_none;
             script       : script_amiga;
@@ -85,6 +85,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 10 - 3
compiler/i_atari.pas

@@ -58,8 +58,8 @@ unit i_atari;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
+            assem        : as_none;
+            assemextern  : as_gas;
             link         : ld_m68k_atari;
             linkextern   : ld_m68k_atari;
             ar           : ar_m68k_ar;
@@ -85,6 +85,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 12 - 5
compiler/i_beos.pas

@@ -61,10 +61,10 @@ unit i_beos;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_i386_as;
-            assemextern  : as_i386_as;
-            link         : ld_i386_beos;
-            linkextern   : ld_i386_beos;
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -103,6 +103,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 19 - 12
compiler/i_fbsd.pas

@@ -62,9 +62,9 @@ unit i_fbsd;
             dirsep       : '/';
             files_case_relevent : true;
             assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_freebsd;
-            linkextern   : ld_i386_freebsd;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -125,10 +125,10 @@ unit i_fbsd;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_i386_as;
-            assemextern  : as_i386_as;
-            link         : ld_i386_freebsd;
-            linkextern   : ld_i386_freebsd;
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -189,10 +189,10 @@ unit i_fbsd;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_freebsd;
-            linkextern   : ld_m68k_freebsd;
+            assem        : as_none;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -239,6 +239,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 11 - 4
compiler/i_go32v2.pas

@@ -62,9 +62,9 @@ unit i_go32v2;
             dirsep       : '\';
             files_case_relevent : false;
             assem        : as_i386_coff;
-            assemextern  : as_i386_as;
-            link         : ld_i386_coff;
-            linkextern   : ld_i386_go32v2;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_dos;
@@ -103,6 +103,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 30 - 23
compiler/i_linux.pas

@@ -62,9 +62,9 @@ unit i_linux;
             dirsep       : '/';
             files_case_relevent : true;
             assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_linux;
-            linkextern   : ld_i386_linux;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -125,10 +125,10 @@ unit i_linux;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_linux;
-            linkextern   : ld_m68k_linux;
+            assem        : as_none;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -189,10 +189,10 @@ unit i_linux;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_powerpc_as;
-            assemextern  : as_powerpc_as;
-            link         : ld_powerpc_linux;
-            linkextern   : ld_powerpc_linux;
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -253,10 +253,10 @@ unit i_linux;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_alpha_as;
-            assemextern  : as_alpha_as;
-            link         : ld_alpha_linux;
-            linkextern   : ld_alpha_linux;
+            assem        : as_none;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -318,9 +318,9 @@ unit i_linux;
             dirsep       : '/';
             files_case_relevent : true;
             assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_linux;
-            linkextern   : ld_i386_linux;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -381,10 +381,10 @@ unit i_linux;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_SPARC_elf32;
-            assemextern  : as_SPARC_as;
-            link         : ld_SPARC_linux;
-            linkextern   : ld_SPARC_linux;
+            assem        : as_none;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -446,6 +446,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 8 - 55
compiler/i_macos.pas

@@ -26,55 +26,6 @@ unit i_macos;
 
     uses
        systems;
-
-    const
-       system_m68k_macos_info : tsysteminfo =
-          (
-            system       : system_m68k_Mac;
-            name         : 'Macintosh m68k';
-            shortname    : 'mac';
-            flags        : [];
-            cpu          : cpu_m68k;
-            short_name   : 'MACOS';
-            unit_env     : '';
-            extradefines : '';
-            sharedlibext : 'Lib';
-            staticlibext : 'Lib';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '';
-            smartext     : '.sl';
-            unitext      : '.ppt';
-            unitlibext   : '.ppl';
-            asmext       : '.a';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            Cprefix      : '_';
-            newline      : #13;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_mpw;
-            assemextern  : as_m68k_mpw;
-            link         : ld_m68k_mac;
-            linkextern   : ld_m68k_mac;
-            ar           : ar_m68k_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            stackalignment : 2;
-            maxCrecordalignment : 4;
-            size_of_longint : 4;
-            heapsize     : 128*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : false
-          );
-
      const
        system_powerpc_macos_info : tsysteminfo =
           (
@@ -124,11 +75,6 @@ unit i_macos;
   implementation
 
 initialization
-{$ifdef cpu68}
-  {$ifdef macos}
-    set_source_info(system_m68k_macos_info);
-  {$endif macos}
-{$endif cpu68}
 {$ifdef cpupowerpc}
   {$ifdef macos}
     set_source_info(system_powerpc_macos_info);
@@ -137,6 +83,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 11 - 4
compiler/i_nwm.pas

@@ -62,9 +62,9 @@ unit i_nwm;
             dirsep       : '\';
             files_case_relevent : false;
             assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_netware;
-            linkextern   : ld_i386_netware;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -103,6 +103,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 10 - 3
compiler/i_os2.pas

@@ -71,8 +71,8 @@ unit i_os2;
             files_case_relevent : false;
             assem        : as_i386_as_aout;
             assemextern  : as_i386_as_aout;
-            link         : ld_i386_os2;
-            linkextern   : ld_i386_os2;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_emxbind;
             script       : script_dos;
@@ -115,6 +115,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 10 - 3
compiler/i_palmos.pas

@@ -58,8 +58,8 @@ unit i_palmos;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
+            assem        : as_none;
+            assemextern  : as_gas;
             link         : ld_m68k_palmos;
             linkextern   : ld_m68k_palmos;
             ar           : ar_m68k_ar;
@@ -85,6 +85,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 12 - 5
compiler/i_sunos.pas

@@ -61,10 +61,10 @@ unit i_sunos;
             newline      : #10;
             dirsep       : '/';
             files_case_relevent : true;
-            assem        : as_i386_as;
-            assemextern  : as_i386_as;
-            link         : ld_i386_sunos;
-            linkextern   : ld_i386_sunos;
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_ar;
             res          : res_none;
             script       : script_unix;
@@ -104,6 +104,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 11 - 4
compiler/i_wdosx.pas

@@ -62,9 +62,9 @@ unit i_wdosx;
             dirsep       : '\';
             files_case_relevent : false;
             assem        : as_i386_pecoffwdosx;
-            assemextern  : as_i386_aswdosx;
-            link         : ld_i386_wdosx;
-            linkextern   : ld_i386_wdosx;
+            assemextern  : as_i386_asw;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_arw;
             res          : res_gnu_windres;
             script       : script_dos;
@@ -105,6 +105,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 10 - 3
compiler/i_win32.pas

@@ -78,8 +78,8 @@ unit i_win32;
             files_case_relevent : false;
             assem        : as_i386_pecoff;
             assemextern  : as_i386_asw;
-            link         : ld_i386_win32;
-            linkextern   : ld_i386_win32;
+            link         : nil;
+            linkextern   : nil;
             ar           : ar_gnu_arw;
             res          : res_gnu_windres;
             script       : script_dos;
@@ -120,6 +120,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-07-26 21:15:38  florian
+  Revision 1.2  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/26 21:15:38  florian
     * rewrote the system handling
 }

+ 17 - 1
compiler/ia64/cpuinfo.pas

@@ -34,6 +34,15 @@ Type
    { tconstsym.value                                              }
    TPointerOrd = longint;
 
+   bestreal = extended;
+   ts32real = single;
+   ts64real = double;
+   ts80real = extended;
+   { on the ia64 comp will be mapped to int64 }
+   ts64comp = comp;
+   
+   pbestreal=^bestreal;
+   
 
 Const
    { Size of native extended type }
@@ -52,7 +61,14 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.5  2002-08-10 14:48:09  carl
+  Revision 1.6  2002-08-12 15:08:42  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.5  2002/08/10 14:48:09  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 30 - 16
compiler/link.pas

@@ -47,7 +47,7 @@ Type
       DynamicLinker : string[100];
     end;
 
-    TLinker = class
+    TLinker = class(TAbstractLinker)
     public
        ObjectFiles,
        SharedLibFiles,
@@ -85,16 +85,13 @@ Type
        Function  MakeExecutable:boolean;override;
      end;
 
-     TLinkerClass = class of TLinker;
 
 var
-  CLinker : array[tld] of TLinkerClass;
   Linker  : TLinker;
 
 function FindObjectFile(s : string;const unitpath:string) : string;
 function FindLibraryFile(s:string;const prefix,ext:string;var foundfile : string) : boolean;
 
-procedure RegisterLinker(t:tld;c:TLinkerClass);
 procedure InitLinker;
 procedure DoneLinker;
 
@@ -112,6 +109,8 @@ uses
   aasmbase,aasmtai,aasmcpu,
   ogbase,ogmap;
 
+type
+ TLinkerClass = class of Tlinker;
 
 {*****************************************************************************
                                    Helpers
@@ -211,6 +210,7 @@ end;
 
 Constructor TLinker.Create;
 begin
+  Inherited Create;
   ObjectFiles:=TStringList.Create_no_double;
   SharedLibFiles:=TStringList.Create_no_double;
   StaticLibFiles:=TStringList.Create_no_double;
@@ -289,7 +289,9 @@ begin
          end;
         { unit files }
         while not linkunitofiles.empty do
-         AddObject(linkunitofiles.getusemask(mask),path^);
+        begin
+          AddObject(linkunitofiles.getusemask(mask),path^);
+        end;
         while not linkunitstaticlibs.empty do
          AddStaticLibrary(linkunitstaticlibs.getusemask(mask));
         while not linkunitsharedlibs.empty do
@@ -611,21 +613,26 @@ end;
                                  Init/Done
 *****************************************************************************}
 
-procedure RegisterLinker(t:tld;c:TLinkerClass);
-begin
-  CLinker[t]:=c;
-end;
-
-
 procedure InitLinker;
+var 
+ lk : TlinkerClass;
 begin
   if (cs_link_internal in aktglobalswitches) and
-     assigned(CLinker[target_info.link]) then
-   linker:=CLinker[target_info.link].Create
-  else if assigned(CLinker[target_info.linkextern]) then
-   linker:=CLinker[target_info.linkextern].Create
+     assigned(target_info.link) then
+   begin  
+     lk:=TLinkerClass(target_info.link);
+     linker:=lk.Create;
+   end
+  else if assigned(target_info.linkextern) then
+   begin
+     lk:=TlinkerClass(target_info.linkextern);
+     linker:=lk.Create;
+   end
   else
+  begin
+   WriteLn('Hello!');
    linker:=Tlinker.Create;
+  end;
 end;
 
 
@@ -653,7 +660,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.29  2002-07-01 18:46:22  peter
+  Revision 1.30  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.29  2002/07/01 18:46:22  peter
     * internal linker
     * reorganized aasm layer
 

+ 91 - 165
compiler/m68k/aasmcpu.pas

@@ -40,62 +40,47 @@ type
 
      constructor op_reg(op : tasmop;_size : topsize;_op1 : tregister);
      constructor op_const(op : tasmop;_size : topsize;_op1 : longint);
-     constructor op_ref(op : tasmop;_size : topsize;_op1 : preference);
+     constructor op_ref(op : tasmop;_size : topsize;_op1 : treference);
 
      constructor op_reg_reg(op : tasmop;_size : topsize;_op1,_op2 : tregister);
-     constructor op_reg_ref(op : tasmop;_size : topsize;_op1 : tregister;_op2 : preference);
+     constructor op_reg_ref(op : tasmop;_size : topsize;_op1 : tregister;_op2 : treference);
      constructor op_reg_const(op:tasmop; _size: topsize; _op1: tregister; _op2: longint);
 
      constructor op_const_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister);
      constructor op_const_const(op : tasmop;_size : topsize;_op1,_op2 : longint);
-     constructor op_const_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : preference);
+     constructor op_const_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : treference);
 
-     constructor op_ref_reg(op : tasmop;_size : topsize;_op1 : preference;_op2 : tregister);
+     constructor op_ref_reg(op : tasmop;_size : topsize;_op1 : treference;_op2 : tregister);
      { this is only allowed if _op1 is an int value (_op1^.isintvalue=true) }
-     constructor op_ref_ref(op : tasmop;_size : topsize;_op1,_op2 : preference);
+     constructor op_ref_ref(op : tasmop;_size : topsize;_op1,_op2 : treference);
 
      constructor op_reg_reg_reg(op : tasmop;_size : topsize;_op1,_op2,_op3 : tregister);
      constructor op_const_reg_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : tregister);
-     constructor op_const_ref_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : preference;_op3 : tregister);
-     constructor op_reg_reg_ref(op : tasmop;_size : topsize;_op1,_op2 : tregister; _op3 : preference);
-     constructor op_const_reg_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : preference);
+     constructor op_const_ref_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : treference;_op3 : tregister);
+     constructor op_reg_reg_ref(op : tasmop;_size : topsize;_op1,_op2 : tregister; _op3 : treference);
+     constructor op_const_reg_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : treference);
 
      constructor op_reg_reglist(op: tasmop; _size : topsize; _op1: tregister;_op2: tregisterlist);
      constructor op_reglist_reg(op: tasmop; _size : topsize; _op1: tregisterlist; _op2: tregister);
 
-     constructor op_ref_reglist(op: tasmop; _size : topsize; _op1: preference;_op2: tregisterlist);
-     constructor op_reglist_ref(op: tasmop; _size : topsize; _op1: tregisterlist; _op2: preference);
+     constructor op_ref_reglist(op: tasmop; _size : topsize; _op1: treference;_op2: tregisterlist);
+     constructor op_reglist_ref(op: tasmop; _size : topsize; _op1: tregisterlist; _op2: treference);
 
      { this is for Jmp instructions }
      constructor op_cond_sym(op : tasmop;cond:TAsmCond;_size : topsize;_op1 : tasmsymbol);
 
      constructor op_sym(op : tasmop;_size : topsize;_op1 : tasmsymbol);
+     { for DBxx opcodes }
+     constructor op_sym_reg(op: tasmop; _size : topsize; _op1 :tasmsymbol; _op2: tregister);
      constructor op_sym_ofs_reg(op : tasmop;_size : topsize;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
 
-     procedure loadreglist(opidx:longint;r:pregisterlist);
 
-     destructor destroy;
   private
-     procedure init(op : tasmop;_size : topsize); { this need to be called by all constructor }
+     procedure loadreglist(opidx:longint;r:tregisterlist);
+     procedure init(_size : topsize); { this need to be called by all constructor }
   end;
 
 
-{*****************************************************************************
-                                Labeled instruction
-*****************************************************************************}
-
-    pai_labeled = ^tai_labeled;
-    tai_labeled = object(tai)
-      opcode : tasmop;
-      register : tregister;
-      lab : pasmlabel;
-      sym : tasmsymbol;
-      constructor init(op : tasmop; l : pasmlabel);
-      constructor init_sym(op : tasmop; asym : tasmsymbol);
-      constructor init_reg(op: tasmop; l : pasmlabel; reg: tregister);
-      constructor init_reg_sym(op : tasmop; asym: tasmsymbol; reg :tregister);
-      destructor done;virtual;
-    end;
 
 
 implementation
@@ -107,14 +92,12 @@ implementation
 
 
 
-   procedure taicpu.loadreglist(opidx:longint;r:pregisterlist);
+   procedure taicpu.loadreglist(opidx:longint;r:tregisterlist);
       begin
         if opidx>=ops then
          ops:=opidx+1;
         with oper[opidx] do
          begin
-           if typ=top_ref then
-            disposereference(ref);
            registerlist:=r;
            typ:=top_reglist;
          end;
@@ -125,7 +108,6 @@ implementation
       begin
          typ:=ait_instruction;
          is_jmp:=false;
-         opcode:=op;
          opsize:=_size;
          ops:=0;
       end;
@@ -133,15 +115,15 @@ implementation
 
     constructor taicpu.op_none(op : tasmop;_size : topsize);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
       end;
 
 
     constructor taicpu.op_reg(op : tasmop;_size : topsize;_op1 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=1;
          loadreg(0,_op1);
       end;
@@ -149,17 +131,17 @@ implementation
 
     constructor taicpu.op_const(op : tasmop;_size : topsize;_op1 : longint);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=1;
          loadconst(0,_op1);
       end;
 
 
-    constructor taicpu.op_ref(op : tasmop;_size : topsize;_op1 : preference);
+    constructor taicpu.op_ref(op : tasmop;_size : topsize;_op1 : treference);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=1;
          loadref(0,_op1);
       end;
@@ -167,8 +149,8 @@ implementation
 
     constructor taicpu.op_reg_reg(op : tasmop;_size : topsize;_op1,_op2 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadreg(0,_op1);
          loadreg(1,_op2);
@@ -177,18 +159,18 @@ implementation
 
     constructor taicpu.op_reg_const(op:tasmop; _size: topsize; _op1: tregister; _op2: longint);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadreg(0,_op1);
          loadconst(1,_op2);
       end;
 
 
-    constructor taicpu.op_reg_ref(op : tasmop;_size : topsize;_op1 : tregister;_op2 : preference);
+    constructor taicpu.op_reg_ref(op : tasmop;_size : topsize;_op1 : tregister;_op2 : treference);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadreg(0,_op1);
          loadref(1,_op2);
@@ -197,8 +179,8 @@ implementation
 
     constructor taicpu.op_const_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadconst(0,_op1);
          loadreg(1,_op2);
@@ -207,38 +189,38 @@ implementation
 
     constructor taicpu.op_const_const(op : tasmop;_size : topsize;_op1,_op2 : longint);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadconst(0,_op1);
          loadconst(1,_op2);
       end;
 
 
-    constructor taicpu.op_const_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : preference);
+    constructor taicpu.op_const_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : treference);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadconst(0,_op1);
          loadref(1,_op2);
       end;
 
 
-    constructor taicpu.op_ref_reg(op : tasmop;_size : topsize;_op1 : preference;_op2 : tregister);
+    constructor taicpu.op_ref_reg(op : tasmop;_size : topsize;_op1 : treference;_op2 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadref(0,_op1);
          loadreg(1,_op2);
       end;
 
 
-    constructor taicpu.op_ref_ref(op : tasmop;_size : topsize;_op1,_op2 : preference);
+    constructor taicpu.op_ref_ref(op : tasmop;_size : topsize;_op1,_op2 : treference);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          loadref(0,_op1);
          loadref(1,_op2);
@@ -247,8 +229,8 @@ implementation
 
     constructor taicpu.op_reg_reg_reg(op : tasmop;_size : topsize;_op1,_op2,_op3 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=3;
          loadreg(0,_op1);
          loadreg(1,_op2);
@@ -257,18 +239,18 @@ implementation
 
     constructor taicpu.op_const_reg_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=3;
          loadconst(0,_op1);
          loadreg(1,_op2);
          loadreg(2,_op3);
       end;
 
-    constructor taicpu.op_reg_reg_ref(op : tasmop;_size : topsize;_op1,_op2 : tregister;_op3 : preference);
+    constructor taicpu.op_reg_reg_ref(op : tasmop;_size : topsize;_op1,_op2 : tregister;_op3 : treference);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=3;
          loadreg(0,_op1);
          loadreg(1,_op2);
@@ -276,10 +258,10 @@ implementation
       end;
 
 
-    constructor taicpu.op_const_ref_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : preference;_op3 : tregister);
+    constructor taicpu.op_const_ref_reg(op : tasmop;_size : topsize;_op1 : longint;_op2 : treference;_op3 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=3;
          loadconst(0,_op1);
          loadref(1,_op2);
@@ -287,10 +269,10 @@ implementation
       end;
 
 
-    constructor taicpu.op_const_reg_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : preference);
+    constructor taicpu.op_const_reg_ref(op : tasmop;_size : topsize;_op1 : longint;_op2 : tregister;_op3 : treference);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=3;
          loadconst(0,_op1);
          loadreg(1,_op2);
@@ -298,21 +280,21 @@ implementation
       end;
 
 
-   constructor taicpu.op_ref_reglist(op: tasmop; _size : topsize; _op1: preference;_op2: tregisterlist);
+   constructor taicpu.op_ref_reglist(op: tasmop; _size : topsize; _op1: treference;_op2: tregisterlist);
      Begin
-        inherited init;
-        init(op,_size);
+        inherited create(op);;
+        init(_size);
         ops:=2;
         loadref(0,_op1);
-        loadreglist(1,newreglist(_op2));
+        loadreglist(1,_op2);
      end;
 
-   constructor taicpu.op_reglist_ref(op: tasmop; _size : topsize; _op1: tregisterlist; _op2: preference);
+   constructor taicpu.op_reglist_ref(op: tasmop; _size : topsize; _op1: tregisterlist; _op2: treference);
      Begin
-        inherited init;
-        init(op,_size);
+        inherited create(op);;
+        init(_size);
         ops:=2;
-        loadreglist(0,newreglist(_op1));
+        loadreglist(0,_op1);
         loadref(1,_op2);
      End;
 
@@ -320,20 +302,20 @@ implementation
 
    constructor taicpu.op_reg_reglist(op: tasmop; _size : topsize; _op1: tregister;_op2: tregisterlist);
      Begin
-        inherited init;
-        init(op,_size);
+        inherited create(op);;
+        init(_size);
         ops:=2;
         loadreg(0,_op1);
-        loadreglist(1,newreglist(_op2));
+        loadreglist(1,_op2);
      end;
 
 
    constructor taicpu.op_reglist_reg(op: tasmop; _size : topsize; _op1: tregisterlist; _op2: tregister);
      Begin
-        inherited init;
-        init(op,_size);
+        inherited create(op);;
+        init(_size);
         ops:=2;
-        loadreglist(0,newreglist(_op1));
+        loadreglist(0,_op1);
         loadreg(1,_op2);
      End;
 
@@ -342,19 +324,27 @@ implementation
 
     constructor taicpu.op_sym(op : tasmop;_size : topsize;_op1 : tasmsymbol);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=1;
          loadsymbol(0,_op1,0);
       end;
 
 
+     constructor taicpu.op_sym_reg(op: tasmop; _size : topsize; _op1 :tasmsymbol; _op2: tregister);
+      begin
+         inherited create(op);
+         init(_size);
+         ops:=2;
+         loadsymbol(0,_op1,0);
+         loadreg(1,_op2);
+      end;
 
 
     constructor taicpu.op_sym_ofs_reg(op : tasmop;_size : topsize;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
       begin
-         inherited init;
-         init(op,_size);
+         inherited create(op);;
+         init(_size);
          ops:=2;
          if ((op >= A_DBCC) and (op <= A_DBF))
           or ((op >= A_FDBEQ) and (op <= A_FBDNGLE)) then
@@ -380,77 +370,6 @@ implementation
       end;
 
 
-    destructor taicpu.destroy;
-      var
-        i : longint;
-      begin
-          for i:=ops-1 downto 0 do
-            if (oper[i].typ=top_ref) then
-              dispose(oper[i].ref);
-        inherited destroy;
-      end;
-
-
-
-{****************************************************************************
-                              TAI_LABELED
- ****************************************************************************}
-
-    constructor tai_labeled.init(op : tasmop; l : pasmlabel);
-
-      begin
-         inherited init;
-         sym := nil;
-         opcode := op;
-         lab := l;
-         register := R_NO;
-         typ:=ait_labeled_instruction;
-         inc(lab^.refs);
-      end;
-
-
-    constructor tai_labeled.init_sym(op : tasmop; asym: tasmsymbol);
-      begin
-         inherited init;
-         sym:= asym;
-         lab := nil;
-         opcode := op;
-         register := R_NO;
-         typ:=ait_labeled_instruction;
-{         inc(lab^.refs);}
-      end;
-
-    constructor tai_labeled.init_reg_sym(op : tasmop; asym: tasmsymbol; reg :tregister);
-      begin
-         inherited init;
-         sym:= asym;
-         lab := nil;
-         opcode := op;
-         register := reg;
-         typ:=ait_labeled_instruction;
-{         inc(lab^.refs);}
-      end;
-
-    constructor tai_labeled.init_reg(op : tasmop; l : pasmlabel; reg: tregister);
-
-      begin
-         inherited init;
-         sym := nil;
-         lab := l;
-         opcode := op;
-         register := reg;
-         typ:=ait_labeled_instruction;
-         inc(lab^.refs);
-      end;
-
-    destructor tai_labeled.done;
-
-      begin
-         if assigned(lab) then
-           dec(lab^.refs);
-         inherited done;
-      end;
-
 
     procedure InitAsm;
       begin
@@ -464,7 +383,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.1  2002-07-29 17:51:32  carl
+  Revision 1.2  2002-08-12 15:08:43  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/07/29 17:51:32  carl
     + restart m68k support
 
 

+ 69 - 125
compiler/m68k/cpubase.pas

@@ -86,7 +86,7 @@ uses
          { (this may include 68040 mmu instructions)          }
          a_frestore,a_fsave,a_pflush,a_pflusha,a_pload,a_pmove,a_ptest,
          { useful for assembly langage output }
-         a_label,a_none);
+         a_label,a_none,a_dbxx,a_setxx,a_bxx,a_fbxx);
 
       {# This should define the array of instructions as string }
       op2strtable=array[tasmop] of string[8];
@@ -109,9 +109,7 @@ uses
          R_SPPUSH,R_SPPULL,
          { misc. }
          R_CCR,R_FP0,R_FP1,R_FP2,R_FP3,R_FP4,R_FP5,R_FP6,
-         R_FP7,R_FPCR,R_SR,R_SSP,R_DFC,R_SFC,R_VBR,R_FPSR,
-         { other - not used in reg2str }
-         R_DEFAULT_SEG);
+         R_FP7,R_FPCR,R_SR,R_SSP,R_DFC,R_SFC,R_VBR,R_FPSR);
 
       {# Set type definition for registers }
       tregisterset = set of tregister;
@@ -150,88 +148,36 @@ uses
        'fp6','fp7','fpcr','sr','ssp','dfc',
        'sfc','vbr','fpsr');
        
-     mit_reg2str : reg2strtable =
-      ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
-       'a0','a1','a2','a3','a4','a5','a6','sp',
-       'sp@-','sp@+',
-       'ccr','fp0','fp1','fp2','fp3','fp4','fp5',
-       'fp6','fp7','fpcr','sr','ssp','dfc',
-       'sfc','vbr','fpsr');
-       
-
 {*****************************************************************************
                                 Conditions
 *****************************************************************************}
 
-    type
-      TAsmCondFlag = (C_None { unconditional jumps },
-        { conditions when not using ctr decrement etc }
-        C_LT,C_LE,C_EQ,C_GE,C_GT,C_NL,C_NE,C_NG,C_SO,C_NS,C_UN,C_NU,
-        { conditions when using ctr decrement etc }
-        C_T,C_F,C_DNZ,C_DNZT,C_DNZF,C_DZ,C_DZT,C_DZF);
-
-    const
-      { these are in the XER, but when moved to CR_x they correspond with the }
-      { bits below (still needs to be verified!!!)                            }
-      C_OV = C_EQ;
-      C_CA = C_GT;
+{*****************************************************************************
+                                Conditions
+*****************************************************************************}
 
     type
-      TAsmCond = packed record
-                   case simple: boolean of
-                     false: (BO, BI: byte);
-                     true: (
-                       cond: TAsmCondFlag;
-                       case byte of
-                         0: ();
-                         { specifies in which part of the cr the bit has to be }
-                         { tested for blt,bgt,beq,..,bnu                       }
-                         1: (cr: R_CR0..R_CR7);
-                         { specifies the bit to test for bt,bf,bdz,..,bdzf }
-                         2: (crbit: byte)
-                       );
-                 end;
-
-    const
-      AsmCondFlag2BO: Array[C_T..C_DZF] of Byte =
-        (12,4,16,8,0,18,10,2);
-
-      AsmCondFlag2BI: Array[C_LT..C_NU] of Byte =
-        (0,1,2,0,1,0,2,1,3,3,3,3);
-
-      AsmCondFlagTF: Array[TAsmCondFlag] of Boolean =
-        (false,true,false,true,false,true,false,false,false,true,false,true,false,
-         true,false,false,true,false,false,true,false);
-
-      AsmCondFlag2Str: Array[TAsmCondFlag] of string[4] = ({cf_none}'',
-        { conditions when not using ctr decrement etc}
-        'lt','le','eq','ge','gt','nl','ne','ng','so','ns','un','nu',
-        't','f','dnz','dzt','dnzf','dz','dzt','dzf');
+      TAsmCond=(C_None,
+         C_CC,C_LS,C_CS,C_LT,C_EQ,C_MI,C_F,C_NE,
+         C_GE,C_PL,C_GT,C_T,C_HI,C_VC,C_LE,C_VS
+      );   
+        
 
     const
-      CondAsmOps=3;
-      CondAsmOp:array[0..CondAsmOps-1] of TasmOp=(
-         A_BC, A_TW, A_TWI
+      cond2str:array[TAsmCond] of string[3]=('',
+        'cc','ls','cs','lt','eq','mi','f','ne',
+        'ge','pl','gt','t','hi','vc','le','vs'
       );
 
+
 {*****************************************************************************
                                    Flags
 *****************************************************************************}
 
     type
-      TResFlagsEnum = (F_EQ,F_NE,F_LT,F_LE,F_GT,F_GE,F_SO,F_FX,F_FEX,F_VX,F_OX);
-      TResFlags = record
-        cr: R_CR0..R_CR7;
-        flag: TResFlagsEnum;
-      end;
-
-    (*
-    const
-      { arrays for boolean location conversions }
-
-      flag_2_cond : array[TResFlags] of TAsmCond =
-         (C_E,C_NE,C_LT,C_LE,C_GT,C_GE,???????????????);
-    *)
+      TResFlags = (
+          F_E,F_NE,
+          F_G,F_L,F_GE,F_LE,F_C,F_NC,F_A,F_AE,F_B,F_BE);
 
 {*****************************************************************************
                                 Reference
@@ -244,11 +190,9 @@ uses
       {              (An)     (An)+   -(An)  }
       tdirection = (dir_none,dir_inc,dir_dec);
       
-
       { reference record }
       preference = ^treference;
       treference = packed record
-         segment,
          base,
          index       : tregister;
          scalefactor : byte;
@@ -265,15 +209,19 @@ uses
       pparareference = ^tparareference;
       tparareference = packed record
          index       : tregister;
-         offset      : aword;
+         offset      : longint;
       end;
+      
 
+      
 {*****************************************************************************
                                 Operands
 *****************************************************************************}
 
       { Types of operand }
-      toptype=(top_none,top_reg,top_ref,top_const,top_symbol);
+      toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_reglist);
+
+      tregisterlist = set of tregister;
 
       toper=record
         ot  : longint;
@@ -283,6 +231,8 @@ uses
          top_ref    : (ref:preference);
          top_const  : (val:aword);
          top_symbol : (sym:tasmsymbol;symofs:longint);
+         { used for pushing/popping multiple registers }
+         top_reglist : (registerlist : tregisterlist);
       end;
 
 {*****************************************************************************
@@ -300,9 +250,7 @@ uses
         LOC_REGISTER,     { in a processor register }
         LOC_CREGISTER,    { Constant register which shouldn't be modified }
         LOC_FPUREGISTER,  { FPU stack }
-        LOC_CFPUREGISTER, { if it is a FPU register variable on the fpu stack }
-        LOC_MMXREGISTER,  { MMX register }
-        LOC_CMMXREGISTER, { MMX register variable }
+        LOC_CFPUREGISTER  { if it is a FPU register variable on the fpu stack }
       );
 
       { tparamlocation describes where a parameter for a procedure is stored.
@@ -324,8 +272,6 @@ uses
                 3 : (reg64 : tregister64);
                 4 : (register64 : tregister64);
               );
-            { it's only for better handling }
-            LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
       end;
 
       tlocation = packed record
@@ -352,27 +298,8 @@ uses
                 3 : (reg64 : tregister64);
                 4 : (register64 : tregister64);
               );
-            { it's only for better handling }
-            LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
       end;
 
-{*****************************************************************************
-                                Operand
-*****************************************************************************}
-
-    type
-      toptype=(top_none,top_reg,top_ref,top_const,top_symbol,top_bool);
-
-      toper=record
-        ot  : longint;
-        case typ : toptype of
-         top_none   : ();
-         top_reg    : (reg:tregister);
-         top_ref    : (ref:^treference);
-         top_const  : (val:aword);
-         top_symbol : (sym:tasmsymbol;symofs:longint);
-         top_bool  :  (b: boolean);
-      end;
 
 {*****************************************************************************
                                 Operand Sizes
@@ -393,10 +320,10 @@ uses
 *****************************************************************************}
 
     const
-      max_operands = 5;
+      {# maximum number of operands in assembler instruction }
+      max_operands = 4;
 
-      lvaluelocations = [LOC_REFERENCE, LOC_CREGISTER, LOC_CFPUREGISTER,
-                         LOC_CMMREGISTER];
+      lvaluelocations = [LOC_REFERENCE,LOC_CFPUREGISTER,LOC_CREGISTER];
 
       {# Constant defining possibly all registers which might require saving }
       ALL_REGISTERS = [R_D1..R_FPCR];
@@ -411,7 +338,7 @@ uses
       {# low and high of every possible width general purpose register (same as }
       { above on most architctures apart from the 80x86)                        }
       LoReg = LoGPReg;
-      HiReg = HighGPReg;
+      HiReg = HiGPReg;
 
       { Table of registers which can be allocated by the code generator
          internally, when generating the code.
@@ -522,6 +449,28 @@ uses
       {# the size of a vector register for a processor     }
       OS_VECTOR = OS_M128;
 
+
+{*****************************************************************************
+                               GDB Information
+*****************************************************************************}
+
+      {# Register indexes for stabs information, when some
+         parameters or variables are stored in registers.
+         
+         Taken from m68kelf.h (DBX_REGISTER_NUMBER)
+         from GCC 3.x source code. 
+         
+         This is not compatible with the m68k-sun 
+         implementation.
+      }   
+          stab_regindex : array[tregister] of shortint =
+        (-1,                 { R_NO }
+          0,1,2,3,4,5,6,7,   { R_D0..R_D7 }
+          8,9,10,11,12,13,14,15,  { R_A0..R_A7 }
+          -1,-1,-1,                { R_SPPUSH, R_SPPULL, R_CCR }
+          18,19,20,21,22,23,24,25, { R_FP0..R_FP7    }
+          -1,-1,-1,-1,-1,-1,-1);
+
 {*****************************************************************************
                           Generic Register names
 *****************************************************************************}
@@ -534,15 +483,17 @@ uses
          object or class. }
       self_pointer_reg  = R_A5;
       {# Register for addressing absolute data in a position independant way,
-         such as in PIC code. The exact meaning is ABI specific }
+         such as in PIC code. The exact meaning is ABI specific. For
+         further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
+      }
       pic_offset_reg = R_A5;
       {# Results are returned in this register (32-bit values) }
       accumulator   = R_D0;
       {# Hi-Results are returned in this register (64-bit value high register) }
       accumulatorhigh = R_D1;
-      { Floating point results will be placed into this register }
+      {# Floating point results will be placed into this register }
       FPU_RESULT_REG = R_FP0;
-      mmresultreg = R_N0;
+      mmresultreg = R_NO;
 
 {*****************************************************************************
                        GCC /ABI linking information
@@ -577,10 +528,7 @@ uses
     function  is_calljmp(o:tasmop):boolean;
 
     procedure inverse_flags(var r : TResFlags);
-    procedure inverse_cond(const c: TAsmCond;var r : TAsmCond);
     function  flags_to_cond(const f: TResFlags) : TAsmCond;
-    procedure create_cond_imm(BO,BI:byte;var r : TAsmCond);
-    procedure create_cond_norm(cond: TAsmCondFlag; cr: byte;var r : TasmCond);
 
 
 implementation
@@ -594,37 +542,33 @@ implementation
 
     function is_calljmp(o:tasmop):boolean;
       begin
+        is_calljmp := false;
+        if o in [A_BXX,A_FBXX,A_DBXX,A_BCC..A_BVS,A_DBCC..A_DBVS,A_FBEQ..A_FSNGLE,
+          A_JSR,A_BSR,A_JMP] then
+           is_calljmp := true;
       end;
 
-
     procedure inverse_flags(var r: TResFlags);
       begin
       end;
 
 
-    procedure inverse_cond(const c: TAsmCond;var r : TAsmCond);
-      begin
-      end;
-
 
     function flags_to_cond(const f: TResFlags) : TAsmCond;
       begin
       end;
 
-
-    procedure create_cond_imm(BO,BI:byte;var r : TAsmCond);
-      begin
-      end;
-
-
-    procedure create_cond_norm(cond: TAsmCondFlag; cr: byte;var r : TasmCond);
-      begin
-      end;
-
 end.
 {
   $Log$
-  Revision 1.3  2002-07-29 17:51:32  carl
+  Revision 1.4  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.3  2002/07/29 17:51:32  carl
     + restart m68k support
 
 

+ 24 - 1
compiler/m68k/cpuinfo.pas

@@ -31,6 +31,22 @@ Type
    { int64 constants internally (JM)                              }
    TConstPtrUInt = Cardinal;
 
+   bestreal = real;
+   ts32real = single;
+   ts64real = double;
+   ts80real = extended;
+   ts64comp = extended;
+   
+   pbestreal=^bestreal;
+   
+   { possible supported processors for this target }
+   tprocessors = 
+      (no_processor,
+       MC68000,
+       MC68020,
+       Coldfire
+      ); 
+
 Const
    {# Size of native extended floating point type }
    extended_size = 8;
@@ -47,7 +63,14 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.1  2002-08-11 08:06:09  carl
+  Revision 1.2  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/08/11 08:06:09  carl
     + try to commit this ** file again
 
   Revision 1.7  2002/05/18 13:34:26  peter

+ 85 - 0
compiler/m68k/cpupara.pas

@@ -0,0 +1,85 @@
+{
+    $Id$
+    Copyright (c) 2002 by Florian Klaempfl
+
+    Generates the argument location information for 680x0
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published bymethodpointer
+    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.
+
+ ****************************************************************************
+}
+{ Generates the argument location information for 680x0.
+}
+unit cpupara;
+
+{$i fpcdefs.inc}
+
+  interface
+
+    uses
+       cpubase,
+       symdef,paramgr;
+
+    type
+       { Returns the location for the nr-st 32 Bit int parameter
+         if every parameter before is an 32 Bit int parameter as well
+         and if the calling conventions for the helper routines of the
+         rtl are used.
+       }
+       tm68kparamanager = class(tparamanager)
+          function getintparaloc(nr : longint) : tparalocation;override;
+          procedure create_param_loc_info(p : tabstractprocdef);override;
+          function getselflocation(p : tabstractprocdef) : tparalocation;override;
+       end;
+
+  implementation
+
+    uses
+       verbose;
+
+    function tm68kparamanager.getintparaloc(nr : longint) : tparalocation;
+      begin
+      end;
+
+    procedure tm68kparamanager.create_param_loc_info(p : tabstractprocdef);
+      begin
+         { set default para_alignment to target_info.stackalignment }
+         { if para_alignment=0 then
+           para_alignment:=aktalignment.paraalign;
+         }
+      end;
+
+    function tm68kparamanager.getselflocation(p : tabstractprocdef) : tparalocation;
+      begin
+         getselflocation.loc:=LOC_REFERENCE;
+         getselflocation.reference.index:=R_SP;
+         getselflocation.reference.offset:=4;
+      end;
+
+begin
+   paramanager:=tm68kparamanager.create;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+
+}

+ 10 - 3
compiler/m68k/rasm.pas

@@ -47,7 +47,7 @@ Interface
 Uses
   globtype,cpubase,tree;
 
-   function assemble: ptree;
+   function assemble: tnode;
 
 const
  { this variable is TRUE if the lookup tables have already been setup  }
@@ -636,7 +636,7 @@ var
         end;
         operands[operandnum]^.opr.ref.direction := dir_none;
         operands[operandnum]^.opr.typ := OPR_REFERENCE;
-        operands[operandnum]^.opr.ref.segment := R_DEFAULT_SEG;
+        operands[operandnum]^.opr.ref.segment := R_NO;
      end;
    end;
 
@@ -2218,7 +2218,14 @@ Begin
 end.
 {
   $Log$
-  Revision 1.3  2002-08-11 14:32:32  peter
+  Revision 1.4  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.3  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.2  2002/08/11 13:24:18  peter

+ 14 - 7
compiler/m68k/rgcpu.pas

@@ -52,7 +52,7 @@ unit rgcpu;
   implementation
 
     uses
-      cgobj;
+      cgobj,tgobj,cpuinfo;
 
      procedure trgcpu.ungetaddressregister(list: taasmoutput; r: tregister);
        begin
@@ -74,7 +74,7 @@ unit rgcpu;
        end;
        
        
-    procedure trgobj.resetusableregisters;
+    procedure trgcpu.resetusableregisters;
 
       begin
         inherited resetusableregisters;
@@ -84,13 +84,13 @@ unit rgcpu;
       end;
        
        
-    procedure trgobj.restoreusedregisters(list : taasmoutput;
+    procedure trgcpu.restoreusedregisters(list : taasmoutput;
         const saved : tpushedsaved);
       var
          r : tregister;
          hr : treference;
      begin
-        inherited restoreusedregister(list, saved, s);
+        inherited restoreusedregisters(list, saved);
 
         for r:=lastsaveaddrreg downto firstsaveaddrreg do
           begin
@@ -111,11 +111,11 @@ unit rgcpu;
                   end;
                 tg.ungetpersistanttemp(list,hr.offset);
               end;
-        
+          end;
      end;
 
 
-     procedure trgobj.saveusedregisters(list: taasmoutput;
+     procedure trgcpu.saveusedregisters(list: taasmoutput;
         var saved : tpushedsaved; const s: tregisterset);
       var
          r : tregister;
@@ -151,7 +151,14 @@ end.
 
 {
   $Log$
-  Revision 1.1  2002-08-05 17:26:09  carl
+  Revision 1.2  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.1  2002/08/05 17:26:09  carl
     + updated m68k
 
 }

+ 130 - 123
compiler/nadd.pas

@@ -34,9 +34,9 @@ interface
           constructor create(tt : tnodetype;l,r : tnode);override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
-	{$ifdef state_tracking}
-	  function track_state_pass(exec_known:boolean):boolean;override;
-	{$endif}
+    {$ifdef state_tracking}
+      function track_state_pass(exec_known:boolean):boolean;override;
+    {$endif}
          protected
           { override the following if you want to implement }
           { parts explicitely in the code generator (JM)    }
@@ -67,7 +67,7 @@ implementation
       {$ifdef state_tracking}
       nstate,
       {$endif}
-      cpubase;
+      cpubase,cpuinfo;
 
 
 {*****************************************************************************
@@ -101,8 +101,8 @@ implementation
          rv,lv   : tconstexprint;
          rvd,lvd : bestreal;
 {$ifdef state_tracking}
-	 factval : Tnode;
-	 change  : boolean;
+     factval : Tnode;
+     change  : boolean;
 {$endif}
 
       begin
@@ -486,120 +486,120 @@ implementation
                  exit;
                end;
 {$ifdef oldset}
-	      case nodetype of
-		addn :
-		   begin
-		      for i:=0 to 31 do
-		        resultset[i]:=tsetconstnode(right).value_set^[i] or tsetconstnode(left).value_set^[i];
-		      t:=csetconstnode.create(@resultset,left.resulttype);
-		   end;
-		muln :
-		   begin
-		      for i:=0 to 31 do
-		        resultset[i]:=tsetconstnode(right).value_set^[i] and tsetconstnode(left).value_set^[i];
-		      t:=csetconstnode.create(@resultset,left.resulttype);
-		   end;
-		subn :
-		   begin
-		      for i:=0 to 31 do
-		        resultset[i]:=tsetconstnode(left).value_set^[i] and not(tsetconstnode(right).value_set^[i]);
-		      t:=csetconstnode.create(@resultset,left.resulttype);
-		   end;
-		symdifn :
-		   begin
-		      for i:=0 to 31 do
-		        resultset[i]:=tsetconstnode(left).value_set^[i] xor tsetconstnode(right).value_set^[i];
-		      t:=csetconstnode.create(@resultset,left.resulttype);
-		   end;
-		unequaln :
-		   begin
-		      b:=true;
-		      for i:=0 to 31 do
-		       if tsetconstnode(right).value_set^[i]=tsetconstnode(left).value_set^[i] then
-		        begin
-		          b:=false;
-		          break;
-		        end;
-		      t:=cordconstnode.create(ord(b),booltype);
-		   end;
-		equaln :
-		   begin
-		      b:=true;
-		      for i:=0 to 31 do
-		       if tsetconstnode(right).value_set^[i]<>tsetconstnode(left).value_set^[i] then
-		        begin
-		          b:=false;
-		          break;
-	    		end;
-		      t:=cordconstnode.create(ord(b),booltype);
-		   end;
-		lten :
-		   begin
-		     b := true;
-		     for i := 0 to 31 Do
-		       if (tsetconstnode(right).value_set^[i] And tsetconstnode(left).value_set^[i]) <>
-		           tsetconstnode(left).value_set^[i] Then
-		         begin
-		           b := false;
-		           break
-		         end;
-		     t := cordconstnode.create(ord(b),booltype);
-		   end;
-	        gten :
+          case nodetype of
+        addn :
+           begin
+              for i:=0 to 31 do
+                resultset[i]:=tsetconstnode(right).value_set^[i] or tsetconstnode(left).value_set^[i];
+              t:=csetconstnode.create(@resultset,left.resulttype);
+           end;
+        muln :
+           begin
+              for i:=0 to 31 do
+                resultset[i]:=tsetconstnode(right).value_set^[i] and tsetconstnode(left).value_set^[i];
+              t:=csetconstnode.create(@resultset,left.resulttype);
+           end;
+        subn :
+           begin
+              for i:=0 to 31 do
+                resultset[i]:=tsetconstnode(left).value_set^[i] and not(tsetconstnode(right).value_set^[i]);
+              t:=csetconstnode.create(@resultset,left.resulttype);
+           end;
+        symdifn :
+           begin
+              for i:=0 to 31 do
+                resultset[i]:=tsetconstnode(left).value_set^[i] xor tsetconstnode(right).value_set^[i];
+              t:=csetconstnode.create(@resultset,left.resulttype);
+           end;
+        unequaln :
+           begin
+              b:=true;
+              for i:=0 to 31 do
+               if tsetconstnode(right).value_set^[i]=tsetconstnode(left).value_set^[i] then
+                begin
+                  b:=false;
+                  break;
+                end;
+              t:=cordconstnode.create(ord(b),booltype);
+           end;
+        equaln :
+           begin
+              b:=true;
+              for i:=0 to 31 do
+               if tsetconstnode(right).value_set^[i]<>tsetconstnode(left).value_set^[i] then
+                begin
+                  b:=false;
+                  break;
+                end;
+              t:=cordconstnode.create(ord(b),booltype);
+           end;
+        lten :
+           begin
+             b := true;
+             for i := 0 to 31 Do
+               if (tsetconstnode(right).value_set^[i] And tsetconstnode(left).value_set^[i]) <>
+                   tsetconstnode(left).value_set^[i] Then
+                 begin
+                   b := false;
+                   break
+                 end;
+             t := cordconstnode.create(ord(b),booltype);
+           end;
+            gten :
                    begin
-	             b := true;
-    		     for i := 0 to 31 Do
-            	       If (tsetconstnode(left).value_set^[i] And tsetconstnode(right).value_set^[i]) <>
-                	   tsetconstnode(right).value_set^[i] Then
+                 b := true;
+                 for i := 0 to 31 Do
+                       If (tsetconstnode(left).value_set^[i] And tsetconstnode(right).value_set^[i]) <>
+                       tsetconstnode(right).value_set^[i] Then
                          begin
-	                   b := false;
-    		           break
-    	                 end;
-            	     t := cordconstnode.create(ord(b),booltype);
-            	   end;
+                       b := false;
+                       break
+                         end;
+                     t := cordconstnode.create(ord(b),booltype);
+                   end;
               end;
 
 {$else}
               case nodetype of
                  addn :
-		    begin
-			resultset:=tsetconstnode(right).value_set^ + tsetconstnode(left).value_set^;
+            begin
+            resultset:=tsetconstnode(right).value_set^ + tsetconstnode(left).value_set^;
                         t:=csetconstnode.create(@resultset,left.resulttype);
-		    end;
+            end;
                  muln :
-		    begin
-			resultset:=tsetconstnode(right).value_set^ * tsetconstnode(left).value_set^;
+            begin
+            resultset:=tsetconstnode(right).value_set^ * tsetconstnode(left).value_set^;
                         t:=csetconstnode.create(@resultset,left.resulttype);
-		    end;
+            end;
                  subn :
-		    begin
-			resultset:=tsetconstnode(left).value_set^ - tsetconstnode(right).value_set^;
+            begin
+            resultset:=tsetconstnode(left).value_set^ - tsetconstnode(right).value_set^;
                         t:=csetconstnode.create(@resultset,left.resulttype);
-		    end;
+            end;
                  symdifn :
                     begin
-			resultset:=tsetconstnode(right).value_set^ >< tsetconstnode(left).value_set^;
-            		t:=csetconstnode.create(@resultset,left.resulttype);
+            resultset:=tsetconstnode(right).value_set^ >< tsetconstnode(left).value_set^;
+                    t:=csetconstnode.create(@resultset,left.resulttype);
                     end;
                  unequaln :
                     begin
-			b:=tsetconstnode(right).value_set^ <> tsetconstnode(left).value_set^;
-            		t:=cordconstnode.create(byte(b),booltype);
+            b:=tsetconstnode(right).value_set^ <> tsetconstnode(left).value_set^;
+                    t:=cordconstnode.create(byte(b),booltype);
                     end;
                  equaln :
                     begin
-			b:=tsetconstnode(right).value_set^ = tsetconstnode(left).value_set^;
-            		t:=cordconstnode.create(byte(b),booltype);
+            b:=tsetconstnode(right).value_set^ = tsetconstnode(left).value_set^;
+                    t:=cordconstnode.create(byte(b),booltype);
                     end;
                  lten :
                     begin
-			b:=tsetconstnode(left).value_set^ <= tsetconstnode(right).value_set^;
-            		t:=cordconstnode.create(byte(b),booltype);
+            b:=tsetconstnode(left).value_set^ <= tsetconstnode(right).value_set^;
+                    t:=cordconstnode.create(byte(b),booltype);
                     end;
                  gten :
                     begin
-			b:=tsetconstnode(left).value_set^ >= tsetconstnode(right).value_set^;
-            		t:=cordconstnode.create(byte(b),booltype);
+            b:=tsetconstnode(left).value_set^ >= tsetconstnode(right).value_set^;
+                    t:=cordconstnode.create(byte(b),booltype);
                     end;
               end;
 {$endif}
@@ -1426,7 +1426,7 @@ implementation
          { first do the two subtrees }
          firstpass(left);
          firstpass(right);
-	
+    
          if codegenerror then
            exit;
 
@@ -1709,33 +1709,33 @@ implementation
     var factval:Tnode;
 
     begin
-	track_state_pass:=false;
-	if left.track_state_pass(exec_known) then
-	    begin
-		track_state_pass:=true;
-		left.resulttype.def:=nil;
-		do_resulttypepass(left);
-	    end;
-	factval:=aktstate.find_fact(left);
-	if factval<>nil then
-	    begin
-		track_state_pass:=true;
-	        left.destroy;
-	        left:=factval.getcopy;
-	    end;
-	if right.track_state_pass(exec_known) then
-	    begin
-		track_state_pass:=true;
-		right.resulttype.def:=nil;
-		do_resulttypepass(right);
-	    end;
-	factval:=aktstate.find_fact(right);
-	if factval<>nil then
-	    begin
-		track_state_pass:=true;
-	        right.destroy;
-	        right:=factval.getcopy;
-	    end;
+    track_state_pass:=false;
+    if left.track_state_pass(exec_known) then
+        begin
+        track_state_pass:=true;
+        left.resulttype.def:=nil;
+        do_resulttypepass(left);
+        end;
+    factval:=aktstate.find_fact(left);
+    if factval<>nil then
+        begin
+        track_state_pass:=true;
+            left.destroy;
+            left:=factval.getcopy;
+        end;
+    if right.track_state_pass(exec_known) then
+        begin
+        track_state_pass:=true;
+        right.resulttype.def:=nil;
+        do_resulttypepass(right);
+        end;
+    factval:=aktstate.find_fact(right);
+    if factval<>nil then
+        begin
+        track_state_pass:=true;
+            right.destroy;
+            right:=factval.getcopy;
+        end;
     end;
 {$endif}
 
@@ -1744,7 +1744,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.59  2002-08-02 07:44:30  jonas
+  Revision 1.60  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.59  2002/08/02 07:44:30  jonas
     * made assigned() handling generic
     * add nodes now can also evaluate constant expressions at compile time
       that contain nil nodes

+ 10 - 1
compiler/ncgcal.pas

@@ -1086,7 +1086,9 @@ implementation
                 { but the registers must be different!        }
                 else if (pushedparasize=8) and
                   not(cs_littlesize in aktglobalswitches) and
+{$ifdef i386}                  
                   (aktoptprocessor=ClassP5) and
+{$endif}                  
                   (procinfo^._class=nil) then
                     begin
                        rg.getexplicitregisterint(exprasmlist,R_EDI);
@@ -1500,7 +1502,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.6  2002-08-11 14:32:26  peter
+  Revision 1.7  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.6  2002/08/11 14:32:26  peter
     * renamed current_library to objectlibrary
 
   Revision 1.5  2002/08/11 13:24:11  peter

+ 9 - 6
compiler/ncgutil.pas

@@ -1598,13 +1598,9 @@ implementation
                     st:='*'
                   else
                     st:='';
-{$ifdef i386}
                   list.concat(Tai_stabs.Create(strpnew(
                    '"$t:r'+st+procinfo^._class.numberstring+'",'+
-                   tostr(N_RSYM)+',0,0,'+tostr(GDB_i386index[SELF_POINTER_REG]))));
-{$else}
-{$warning Missing stabs for classes!}
-{$endif}
+                   tostr(N_RSYM)+',0,0,'+tostr(stab_regindex[SELF_POINTER_REG]))));
                 end;
 
             { define calling EBP as pseudo local var PM }
@@ -1705,7 +1701,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.33  2002-08-11 14:32:27  peter
+  Revision 1.34  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.33  2002/08/11 14:32:27  peter
     * renamed current_library to objectlibrary
 
   Revision 1.32  2002/08/11 13:24:12  peter

+ 8 - 6
compiler/ogcoff.pas

@@ -1677,7 +1677,6 @@ const go32v2stub : array[0..2047] of byte=(
             supported_target : system_i386_go32v2;
             outputbinary : true;
             allowdirect : false;
-            externals : true;
             needar : false;
             labelprefix_only_inside_procedure: false;
             labelprefix : '.L';
@@ -1698,7 +1697,6 @@ const go32v2stub : array[0..2047] of byte=(
             supported_target : system_i386_win32;
             outputbinary : true;
             allowdirect : false;
-            externals : true;
             needar : false;
             labelprefix_only_inside_procedure: false;
             labelprefix : '.L';
@@ -1718,7 +1716,6 @@ const go32v2stub : array[0..2047] of byte=(
             supported_target : system_i386_wdosx;
             outputbinary : true;
             allowdirect : false;
-            externals : true;
             needar : false;
             labelprefix_only_inside_procedure: false;
             labelprefix : '.L';
@@ -1734,12 +1731,17 @@ initialization
   RegisterAssembler(as_i386_coff_info,TCoffAssembler);
   RegisterAssembler(as_i386_pecoff_info,TPECoffAssembler);
   RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler);
-
-  RegisterLinker(ld_i386_coff,TCoffLinker);
 end.
 {
   $Log$
-  Revision 1.23  2002-07-26 21:15:38  florian
+  Revision 1.24  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.23  2002/07/26 21:15:38  florian
     * rewrote the system handling
 
   Revision 1.22  2002/07/01 18:46:24  peter

+ 8 - 2
compiler/ogelf.pas

@@ -836,7 +836,6 @@ implementation
             supported_target : system_any;  //target_i386_linux;
             outputbinary : true;
             allowdirect : false;
-            externals : true;
             needar : false;
             labelprefix_only_inside_procedure: false;
             labelprefix : '.L';
@@ -853,7 +852,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.17  2002-07-26 21:15:39  florian
+  Revision 1.18  2002-08-12 15:08:39  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.17  2002/07/26 21:15:39  florian
     * rewrote the system handling
 
   Revision 1.16  2002/07/01 18:46:24  peter

+ 103 - 96
compiler/oglx.pas

@@ -57,82 +57,82 @@ uses
 { For the operating system the object numbers have no special meaning.
   However, for Free Pascal generated executables, I define: (DM)}
 
-const	code_object	= 0;
-	data_object	= 1;
-	bss_object	= 2;
-	stack_object	= 3;
-	heap_object	= 4;
+const   code_object = 0;
+    data_object = 1;
+    bss_object  = 2;
+    stack_object    = 3;
+    heap_object = 4;
 
 type    Tlxheader = packed record
-	    magic:word;				{'LX'}
-	    byteorder:byte;			{0 = little 1 = big endian.}
-	    wordorder:byte;			{0 = little 1 = big endian.}
-	    format_level:cardinal;		{Nothing else than LX level
-						 0 has ever been defined.}
-	    cpu_type:word;			{1 = 286, 2 = 386, 3 = 486,
-						 4 = pentium.}
-	    os_type:word;			{1 = OS/2, 2 = Windows,
-						 3 = Siemens MS-Dos 4.0,
-						 4 = Windows 386.}
-	    module_version:cardinal;		{Version of executable,
-						 defined by user.}
-	    module_flags:cardinal;		{Flags.}
-	    module_page_count:cardinal;		{Amount of pages in module.}
-	    eip_object,eip:cardinal;		{Initial EIP, object nr and
-						 offset within object.}
-	    esp_object,esp:cardinal;		{Initial ESP, object nr and
-						 offset within object.}
-	    page_size,page_shift:cardinal;	{Page size, in bytes and
-						 1 << pageshift.}
-	    fixup_sect_size:cardinal;
-	    fixup_sect_checksum:cardinal;
-	    loader_sect_size:cardinal;
-	    loader_sect_chksum:cardinal;
-	    object_table_offset:cardinal;	{Location of object table.}
-	    object_count:cardinal;		{Amount of objects in module.}
-	    object_pagetable_ofs:cardinal;	{Location of object page
-						 table.}
-	    object_iterpages_ofs:cardinal;
-	    resource_table_ofs:cardinal;	{Location of resource table.}
-	    resource_count:cardinal;		{Amount of resources in
-						 resource table.}
-	    resid_name_tbl_ofs:cardinal;
-	    entry_table_offset:cardinal;
-	    module_dir_offset:cardinal;
-	    module_dir_count:cardinal;
-	    fixup_pagetab_ofs:cardinal;
-	    fixup_recrab_ofs:cardinal;
-	    import_modtab_ofs:cardinal;
-	    import_modtab_count:cardinal;
-	    data_pages_offset:cardinal;
-	    preload_page_count:cardinal;
-	    nonresid_table_ofs:cardinal;
-	    nonresid_table_len:cardinal;
-	    nonresid_tbl_chksum:cardinal;
-	    auto_ds_object_no:cardinal;		{Not used by OS/2.}
-	    debug_info_offset:cardinal;
-	    inst_preload_count:cardinal;
-	    inst_demand_count:cardinal;
-	    heapsize:cardinal;			{Only used for 16-bit programs.}
-	end;
-	
-	Tlxobject_flags = (ofreadable,ofwriteable,ofexecutable,ofresource,
-			   ofdiscardable,ofshared,ofpreload,ofinvalid,
-			   ofzerofilled);
-	Tlxobject_flag_set = set of Tlxobject_flags;
-	
-	Tlxobject_table_entry = packed record
-	    virtual_size:cardinal;
-	    reloc_base_addr:cardinal;
-	    object_flags:Tlxobject_flag_set;
-	    page_table_index:cardinal;
-	    page_count:cardinal;
-	    reserved:cardinal;
-	end;
-
-	Tlxexeoutput = class(texeoutput)
-	private
-{       	FCoffsyms,
+        magic:word;             {'LX'}
+        byteorder:byte;         {0 = little 1 = big endian.}
+        wordorder:byte;         {0 = little 1 = big endian.}
+        format_level:cardinal;      {Nothing else than LX level
+                         0 has ever been defined.}
+        cpu_type:word;          {1 = 286, 2 = 386, 3 = 486,
+                         4 = pentium.}
+        os_type:word;           {1 = OS/2, 2 = Windows,
+                         3 = Siemens MS-Dos 4.0,
+                         4 = Windows 386.}
+        module_version:cardinal;        {Version of executable,
+                         defined by user.}
+        module_flags:cardinal;      {Flags.}
+        module_page_count:cardinal;     {Amount of pages in module.}
+        eip_object,eip:cardinal;        {Initial EIP, object nr and
+                         offset within object.}
+        esp_object,esp:cardinal;        {Initial ESP, object nr and
+                         offset within object.}
+        page_size,page_shift:cardinal;  {Page size, in bytes and
+                         1 << pageshift.}
+        fixup_sect_size:cardinal;
+        fixup_sect_checksum:cardinal;
+        loader_sect_size:cardinal;
+        loader_sect_chksum:cardinal;
+        object_table_offset:cardinal;   {Location of object table.}
+        object_count:cardinal;      {Amount of objects in module.}
+        object_pagetable_ofs:cardinal;  {Location of object page
+                         table.}
+        object_iterpages_ofs:cardinal;
+        resource_table_ofs:cardinal;    {Location of resource table.}
+        resource_count:cardinal;        {Amount of resources in
+                         resource table.}
+        resid_name_tbl_ofs:cardinal;
+        entry_table_offset:cardinal;
+        module_dir_offset:cardinal;
+        module_dir_count:cardinal;
+        fixup_pagetab_ofs:cardinal;
+        fixup_recrab_ofs:cardinal;
+        import_modtab_ofs:cardinal;
+        import_modtab_count:cardinal;
+        data_pages_offset:cardinal;
+        preload_page_count:cardinal;
+        nonresid_table_ofs:cardinal;
+        nonresid_table_len:cardinal;
+        nonresid_tbl_chksum:cardinal;
+        auto_ds_object_no:cardinal;     {Not used by OS/2.}
+        debug_info_offset:cardinal;
+        inst_preload_count:cardinal;
+        inst_demand_count:cardinal;
+        heapsize:cardinal;          {Only used for 16-bit programs.}
+    end;
+    
+    Tlxobject_flags = (ofreadable,ofwriteable,ofexecutable,ofresource,
+               ofdiscardable,ofshared,ofpreload,ofinvalid,
+               ofzerofilled);
+    Tlxobject_flag_set = set of Tlxobject_flags;
+    
+    Tlxobject_table_entry = packed record
+        virtual_size:cardinal;
+        reloc_base_addr:cardinal;
+        object_flags:Tlxobject_flag_set;
+        page_table_index:cardinal;
+        page_count:cardinal;
+        reserved:cardinal;
+    end;
+
+    Tlxexeoutput = class(texeoutput)
+    private
+{           FCoffsyms,
          FCoffStrs : tdynamicarray;
          win32   : boolean;}
          nsects,
@@ -308,12 +308,12 @@ uses
       end;
 
 function gen_section_header(sec:Tsection;obj:cardinal):Tlxobject_table_entry;
-	    virtual_size:cardinal;
-	    reloc_base_addr:cardinal;
-	    object_flags:Tlxobject_flag_set;
-	    page_table_index:cardinal;
-	    page_count:cardinal;
-	    reserved:cardinal;
+        virtual_size:cardinal;
+        reloc_base_addr:cardinal;
+        object_flags:Tlxobject_flag_set;
+        page_table_index:cardinal;
+        page_count:cardinal;
+        reserved:cardinal;
 
 begin
     gen_section_header.virtual_size:=sections[sec.memsize];
@@ -331,29 +331,29 @@ var header:Tlxheader;
 begin
     result:=false;
     fillchar(header,sizeof(header),0);
-    header.magic:=$584c;		{'LX'}
-    header.cpu_type:=2;			{Intel 386}
-    header.os_type:=1;			{OS/2}
+    header.magic:=$584c;        {'LX'}
+    header.cpu_type:=2;         {Intel 386}
+    header.os_type:=1;          {OS/2}
     {Set the initial EIP.}
     header.eip_object:=code_object;
     hsym:=tasmsymbol(globalsyms.search('start'));
     if not assigned(hsym) then
-	begin
-	    comment(V_Error,'Entrypoint "start" not defined');
-	    exit;
-	end;
+    begin
+        comment(V_Error,'Entrypoint "start" not defined');
+        exit;
+    end;
     header.eip:=hsym.address-sections[sec_code].mempos;
     {Set the initial ESP.}
     header.esp_object:=stack_object;
     header.esp:=stacksize;
     Fwriter.write(header,sizeof(header));
     for sec:=low(Tsection) to high(Tsection) do
-	if sections[sec].available then
-	    if not(sec in [sec_code,sec_data,sec_bss,sec_stab,sec_stabstr]) then
-	        begin
-		    result:=false;
-		    exit;
-		end;
+    if sections[sec].available then
+        if not(sec in [sec_code,sec_data,sec_bss,sec_stab,sec_stabstr]) then
+            begin
+            result:=false;
+            exit;
+        end;
     code_object_header:=gen_section_header(sec_code,code_object);
     data_object_header:=gen_section_header(sec_data,data_object);
     bss_object_header:=gen_section_header(sec_bss,bss_object);
@@ -393,13 +393,20 @@ end;
 begin
 {  RegisterAssembler(as_i386_coff_info,TCoffAssembler);
   RegisterAssembler(as_i386_pecoff_info,TPECoffAssembler);
-  RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler);}
+  RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler);
 
-  RegisterLinker(ld_i386_coff,Tlxlinker);
+  RegisterLinker(ld_i386_coff,Tlxlinker);}
 end.
 {
   $Log$
-  Revision 1.3  2002-07-14 18:00:44  daniel
+  Revision 1.4  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.3  2002/07/14 18:00:44  daniel
   + Added the beginning of a state tracker. This will track the values of
     variables through procedures and optimize things away.
 

+ 9 - 2
compiler/options.pas

@@ -1546,7 +1546,7 @@ begin
   { Disable fpu emulation for linux and netbsd on m68k machines }
   { FIXME: this overrides possible explicit command line emulation setting,
     but this isn't supported yet anyhow PM }
-  if (target_info.target in [target_m68k_netbsd,target_m68k_linux]) then
+  if (target_info.system in [system_m68k_netbsd,system_m68k_linux]) then
    exclude(initmoduleswitches,cs_fp_emulation)
   else
    def_symbol('M68K_FPU_EMULATED');
@@ -1677,7 +1677,14 @@ finalization
 end.
 {
   $Log$
-  Revision 1.81  2002-08-10 14:46:29  carl
+  Revision 1.82  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.81  2002/08/10 14:46:29  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 16 - 2
compiler/paramgr.pas

@@ -157,7 +157,12 @@ unit paramgr;
          hp:=tparaitem(p.para.first);
          while assigned(hp) do
            begin
-              if (hp.paraloc.loc in [LOC_REGISTER,LOC_FPUREGISTER,LOC_MMREGISTER]) and
+{$ifdef SUPPORT_MMX}           
+              if (hp.paraloc.loc in [LOC_REGISTER,LOC_FPUREGISTER,
+                 LOC_MMREGISTER]) and
+{$else}
+              if (hp.paraloc.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
+{$endif}
               { if the parameter isn't regable, we've to work with the local copy }
                 ((vo_regable in tvarsym(hp.parasym).varoptions) or
                  (vo_fpuregable in tvarsym(hp.parasym).varoptions)) then
@@ -167,8 +172,10 @@ unit paramgr;
                        hp.paraloc.loc := LOC_CREGISTER;
                      LOC_FPUREGISTER:
                        hp.paraloc.loc := LOC_CFPUREGISTER;
+{$ifdef SUPPORT_MMX}                       
                      LOC_MMREGISTER:
                        hp.paraloc.loc := LOC_CMMREGISTER;
+{$endif}                       
                    end;
                    tvarsym(hp.parasym).reg:=hp.paraloc.register;
                    rg.regvar_loaded[hp.paraloc.register]:=true;
@@ -183,7 +190,14 @@ end.
 
 {
    $Log$
-   Revision 1.10  2002-08-10 17:15:20  jonas
+   Revision 1.11  2002-08-12 15:08:40  carl
+     + stab register indexes for powerpc (moved from gdb to cpubase)
+     + tprocessor enumeration moved to cpuinfo
+     + linker in target_info is now a class
+     * many many updates for m68k (will soon start to compile)
+     - removed some ifdef or correct them for correct cpu
+
+   Revision 1.10  2002/08/10 17:15:20  jonas
      * register parameters are now LOC_CREGISTER instead of LOC_REGISTER
 
    Revision 1.9  2002/08/09 07:33:02  florian

+ 9 - 2
compiler/parser.pas

@@ -54,7 +54,7 @@ implementation
 {$endif GDB}
       comphook,
       scanner,scandir,
-      pbase,ptype,pmodules,cresstr;
+      pbase,ptype,pmodules,cresstr,cpuinfo;
 
 
     procedure initparser;
@@ -611,7 +611,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.38  2002-08-11 14:28:19  peter
+  Revision 1.39  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.38  2002/08/11 14:28:19  peter
     * TScannerFile.SetInvalid added that will also reset inputfile
 
   Revision 1.37  2002/08/11 13:24:12  peter

+ 12 - 2
compiler/pdecl.pas

@@ -59,7 +59,10 @@ implementation
        nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,nobj,
        { parser }
        scanner,
-       pbase,pexpr,ptype,ptconst,pdecsub,pdecvar,pdecobj;
+       pbase,pexpr,ptype,ptconst,pdecsub,pdecvar,pdecobj,
+       { cpu-information }
+       cpuinfo
+       ;
 
 
     function readconstant(const orgname:string;const filepos:tfileposinfo):tconstsym;
@@ -613,7 +616,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.51  2002-08-11 14:32:27  peter
+  Revision 1.52  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.51  2002/08/11 14:32:27  peter
     * renamed current_library to objectlibrary
 
   Revision 1.50  2002/08/11 13:24:12  peter

+ 9 - 3
compiler/powerpc/agppcgas.pas

@@ -50,14 +50,13 @@ unit agppcgas;
     const
        as_ppc_gas_info : tasminfo =
           (
-            id     : as_powerpc_as;
+            id     : as_gas;
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
             supported_target : system_any;
             outputbinary: false;
             allowdirect : true;
-            externals : false;
             needar : true;
             labelprefix_only_inside_procedure : false;
             labelprefix : '.L';
@@ -340,7 +339,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.9  2002-07-27 19:57:18  jonas
+  Revision 1.10  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.9  2002/07/27 19:57:18  jonas
     * some typo corrections in the instruction tables
     * renamed the m* registers to v*
 

+ 72 - 5
compiler/powerpc/cpubase.pas

@@ -498,6 +498,63 @@ uses
       {# the size of a vector register for a processor     }
       OS_VECTOR = OS_M128;
 
+{*****************************************************************************
+                               GDB Information
+*****************************************************************************}
+
+      {# Register indexes for stabs information, when some
+         parameters or variables are stored in registers.
+         
+         Taken from rs6000.h (DBX_REGISTER_NUMBER)
+         from GCC 3.x source code. PowerPC has 1:1 mapping
+         according to the order of the registers defined
+         in GCC
+         
+      }   
+      
+          stab_regindex : array[tregister] of shortint =
+          (
+           { R_NO }
+           -1,
+           { R0..R7 }
+           0,1,2,3,4,5,6,7, 
+           { R8..R15 }
+           8,9,10,11,12,13,14,15,
+           { R16..R23 }
+           16,17,18,19,20,21,22,23,
+           { R24..R32 }
+           24,25,26,27,28,29,30,31,
+           { F0..F7 }
+           32,33,34,35,36,37,38,39,
+           { F8..F15 }
+           40,41,42,43,44,45,46,47,
+           { F16..F23 }
+           48,49,50,51,52,53,54,55,
+           { F24..F31 }
+           56,57,58,59,60,61,62,63,
+           { M0..M7 Multimedia registers are not supported by GCC }
+           -1,-1,-1,-1,-1,-1,-1,-1,
+           { M8..M15 }
+           -1,-1,-1,-1,-1,-1,-1,-1,
+           { M16..M23 }
+           -1,-1,-1,-1,-1,-1,-1,-1,
+           { M24..M31 }
+           -1,-1,-1,-1,-1,-1,-1,-1,
+           { CR }
+           -1,
+           { CR0..CR7 }
+           68,69,70,71,72,73,74,75,
+           { XER }
+           76,
+           { LR }
+           65,
+           { CTR }
+           66,
+           { FPSCR }
+           -1
+        );
+
+
 {*****************************************************************************
                           Generic Register names
 *****************************************************************************}
@@ -510,16 +567,19 @@ uses
          object or class. }
       self_pointer_reg  = R_9;
       {# Register for addressing absolute data in a position independant way,
-         such as in PIC code. The exact meaning is ABI specific }
-{$warning Needs checking, this is just a dummy (PFV) }
-      pic_offset_reg = R_8;
+         such as in PIC code. The exact meaning is ABI specific. For
+         further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
+         
+         Taken from GCC rs6000.h
+      }
+{$warning As indicated in rs6000.h, but can't find it anywhere else!}      
+      pic_offset_reg = R_30;
       {# Results are returned in this register (32-bit values) }
       accumulator   = R_3;
       {# Hi-Results are returned in this register (64-bit value high register) }
       accumulatorhigh = R_4;
       { WARNING: don't change to R_ST0!! See comments above implementation of }
       { a_loadfpu* methods in rgcpu (JM)                                      }
-{$warning I don't know the exact values, please check (PFV) }
       fpu_result_reg = R_F1;
       mmresultreg = R_M0;
 
@@ -646,7 +706,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.25  2002-08-10 17:15:06  jonas
+  Revision 1.26  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.25  2002/08/10 17:15:06  jonas
     * endianess fix
 
   Revision 1.24  2002/08/06 20:55:24  florian

+ 23 - 1
compiler/powerpc/cpuinfo.pas

@@ -31,6 +31,21 @@ Type
    { int64 constants internally (JM)                              }
    TConstPtrUInt = Cardinal;
 
+   bestreal = double;
+   ts32real = single;
+   ts64real = double;
+   ts80real = extended;
+   ts64comp = comp;
+
+   pbestreal=^bestreal;
+   
+   { possible supported processors for this target }
+   tprocessors = 
+      (no_processor,
+       ppc601,
+       ppc604
+      );
+
 Const
    {# Size of native extended floating point type }
    extended_size = 8;
@@ -46,7 +61,14 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.8  2002-08-10 14:52:52  carl
+  Revision 1.9  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.8  2002/08/10 14:52:52  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 0 - 448
compiler/powerpc/nppcmem.pas

@@ -1,448 +0,0 @@
-{
-    $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Jonas Maebe
-
-    Generate PowerPC assembler for in memory related nodes
-
-    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.
-
- ****************************************************************************
-}
-unit nppcmem;
-
-{$i fpcdefs.inc}
-
-interface
-
-    uses
-      node,nmem,ncgmem;
-
-    type
-       tppcvecnode = class(tcgvecnode)
-          procedure pass_2;override;
-       end;
-
-implementation
-
-    uses
-{$ifdef delphi}
-      sysutils,
-{$endif}
-      globtype,systems,
-      cutils,verbose,globals,
-      symconst,symtype,symdef,symsym,symtable,defbase,paramgr,
-      aasmbase,aasmtai,aasmcpu,
-      cginfo,cgbase,pass_2,
-      pass_1,nld,ncon,nadd,
-      cpubase,
-      cgobj,tgobj,rgobj,ncgutil;
-
-{*****************************************************************************
-                             TPPCVECNODE
-*****************************************************************************}
-
-    procedure tppcvecnode.pass_2;
-
-      var
-         extraoffset : longint;
-         { rl stores the resulttype.def of the left node, this is necessary }
-         { to detect if it is an ansistring                          }
-         { because in constant nodes which constant index              }
-         { the left tree is removed                                  }
-         t   : tnode;
-         href : treference;
-         srsym : tsym;
-         pushed : tpushedsaved;
-         hightree : tnode;
-         isjump  : boolean;
-         otl,ofl : tasmlabel;
-         newsize : tcgsize;
-         pushedregs : tmaybesave;
-      begin
-         newsize:=def_cgsize(resulttype.def);
-         location_reset(location,LOC_REFERENCE,newsize);
-
-         secondpass(left);
-         { we load the array reference to location }
-
-         { an ansistring needs to be dereferenced }
-         if is_ansistring(left.resulttype.def) or
-            is_widestring(left.resulttype.def) then
-           begin
-              if nf_callunique in flags then
-                begin
-                   if left.location.loc<>LOC_REFERENCE then
-                     begin
-                        CGMessage(cg_e_illegal_expression);
-                        exit;
-                     end;
-                   rg.saveusedregisters(exprasmlist,pushed,all_registers);
-                   cg.a_paramaddr_ref(exprasmlist,left.location.reference,paramanager.getintparaloc(1));
-                   rg.saveregvars(exprasmlist,all_registers);
-                   cg.a_call_name(exprasmlist,'FPC_'+Upper(tstringdef(left.resulttype.def).stringtypname)+'_UNIQUE');
-                   cg.g_maybe_loadself(exprasmlist);
-                   rg.restoreusedregisters(exprasmlist,pushed);
-                end;
-
-              case left.location.loc of
-                LOC_REGISTER,
-                LOC_CREGISTER :
-                  location.reference.base:=left.location.register;
-                LOC_CREFERENCE,
-                LOC_REFERENCE :
-                  begin
-                    location_release(exprasmlist,left.location);
-                    location.reference.base:=rg.getregisterint(exprasmlist);
-                    cg.a_load_ref_reg(exprasmlist,OS_ADDR,left.location.reference,location.reference.base);
-                  end;
-                else
-                  internalerror(2002032218);
-              end;
-
-              { check for a zero length string,
-                we can use the ansistring routine here }
-              if (cs_check_range in aktlocalswitches) then
-                begin
-                   rg.saveusedregisters(exprasmlist,pushed,all_registers);
-                   cg.a_param_reg(exprasmlist,OS_ADDR,location.reference.base,paramanager.getintparaloc(1));
-                   rg.saveregvars(exprasmlist,all_registers);
-                   cg.a_call_name(exprasmlist,'FPC_'+Upper(tstringdef(left.resulttype.def).stringtypname)+'_CHECKZERO');
-                   cg.g_maybe_loadself(exprasmlist);
-                   rg.restoreusedregisters(exprasmlist,pushed);
-                end;
-
-              { in ansistrings/widestrings S[1] is p<w>char(S)[0] !! }
-              if is_ansistring(left.resulttype.def) then
-                dec(location.reference.offset)
-              else
-                dec(location.reference.offset,2);
-
-              { we've also to keep left up-to-date, because it is used   }
-              { if a constant array index occurs, subject to change (FK) }
-              location_copy(left.location,location);
-           end
-         else if is_dynamic_array(left.resulttype.def) then
-         { ... also a dynamic string }
-           begin
-              case left.location.loc of
-                LOC_REGISTER,
-                LOC_CREGISTER :
-                  location.reference.base:=left.location.register;
-                LOC_REFERENCE,
-                LOC_CREFERENCE :
-                  begin
-                     location_release(exprasmlist,left.location);
-                     location.reference.base:=rg.getaddressregister(exprasmlist);
-                     cg.a_load_ref_reg(exprasmlist,OS_ADDR,
-                      left.location.reference,location.reference.base);
-                  end;
-                else
-                  internalerror(2002032219);
-              end;
-
-{$warning FIXME}
-              { check for a zero length string,
-                we can use the ansistring routine here }
-              if (cs_check_range in aktlocalswitches) then
-                begin
-                   rg.saveusedregisters(exprasmlist,pushed,all_registers);
-                   cg.a_param_reg(exprasmlist,OS_ADDR,location.reference.base,paramanager.getintparaloc(1));
-                   rg.saveregvars(exprasmlist,all_registers);
-                   cg.a_call_name(exprasmlist,'FPC_ANSISTR_CHECKZERO');
-                   cg.g_maybe_loadself(exprasmlist);
-                   rg.restoreusedregisters(exprasmlist,pushed);
-                end;
-
-              { we've also to keep left up-to-date, because it is used   }
-              { if a constant array index occurs, subject to change (FK) }
-              location_copy(left.location,location);
-           end
-         else
-           location_copy(location,left.location);
-
-         { offset can only differ from 0 if arraydef }
-         if (left.resulttype.def.deftype=arraydef) and
-           not(is_dynamic_array(left.resulttype.def)) then
-           dec(location.reference.offset,
-               get_mul_size*tarraydef(left.resulttype.def).lowrange);
-         if right.nodetype=ordconstn then
-           begin
-              { offset can only differ from 0 if arraydef }
-              if (left.resulttype.def.deftype=arraydef) then
-                begin
-                   if not(is_open_array(left.resulttype.def)) and
-                      not(is_array_of_const(left.resulttype.def)) and
-                      not(is_dynamic_array(left.resulttype.def)) then
-                     begin
-                        if (tordconstnode(right).value>tarraydef(left.resulttype.def).highrange) or
-                           (tordconstnode(right).value<tarraydef(left.resulttype.def).lowrange) then
-                           begin
-                          { this should be caught in the resulttypepass! (JM) }
-                              if (cs_check_range in aktlocalswitches) then
-                                CGMessage(parser_e_range_check_error)
-                              else
-                                CGMessage(parser_w_range_check_error);
-                           end;
-                        dec(left.location.reference.offset,
-                            get_mul_size*tarraydef(left.resulttype.def).lowrange);
-                     end
-                   else
-                     begin
-                        { range checking for open and dynamic arrays !!!! }
-{$warning FIXME}
-                        {!!!!!!!!!!!!!!!!!}
-                     end;
-                end
-              else if (left.resulttype.def.deftype=stringdef) then
-                begin
-                   if (tordconstnode(right).value=0) and
-                      not(is_shortstring(left.resulttype.def)) then
-                    { this should be caught in the resulttypepass! (JM) }
-                     CGMessage(cg_e_can_access_element_zero);
-
-                   if (cs_check_range in aktlocalswitches) then
-                    begin
-                      case tstringdef(left.resulttype.def).string_typ of
-                        { it's the same for ansi- and wide strings }
-                        st_widestring,
-                        st_ansistring:
-                          begin
-                             rg.saveusedregisters(exprasmlist,pushed,all_registers);
-                             cg.a_param_const(exprasmlist,OS_INT,tordconstnode(right).value,paramanager.getintparaloc(2));
-                             href:=location.reference;
-                             dec(href.offset,7);
-                             cg.a_param_ref(exprasmlist,OS_INT,href,paramanager.getintparaloc(1));
-                             rg.saveregvars(exprasmlist,all_registers);
-                             cg.a_call_name(exprasmlist,'FPC_'+Upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
-                             rg.restoreusedregisters(exprasmlist,pushed);
-                             cg.g_maybe_loadself(exprasmlist);
-                          end;
-
-                        st_shortstring:
-                          begin
-                             {!!!!!!!!!!!!!!!!!}
-                          end;
-
-                        st_longstring:
-                          begin
-                             {!!!!!!!!!!!!!!!!!}
-                          end;
-                      end;
-                    end;
-                end;
-              inc(left.location.reference.offset,
-                  get_mul_size*tordconstnode(right).value);
-
-              location_copy(location,left.location);
-           end
-         else
-         { not nodetype=ordconstn }
-           begin
-              if (cs_regalloc in aktglobalswitches) and
-                 { if we do range checking, we don't }
-                 { need that fancy code (it would be }
-                 { buggy)                            }
-                 not(cs_check_range in aktlocalswitches) and
-                 (left.resulttype.def.deftype=arraydef) then
-                begin
-                   extraoffset:=0;
-                   if (right.nodetype=addn) then
-                     begin
-                        if taddnode(right).right.nodetype=ordconstn then
-                          begin
-                             extraoffset:=tordconstnode(taddnode(right).right).value;
-                             t:=taddnode(right).left;
-                             { First pass processed this with the assumption   }
-                             { that there was an add node which may require an }
-                             { extra register. Fake it or die with IE10 (JM)   }
-                             t.registers32 := taddnode(right).registers32;
-                             taddnode(right).left:=nil;
-                             right.free;
-                             right:=t;
-                          end
-                        else if taddnode(right).left.nodetype=ordconstn then
-                          begin
-                             extraoffset:=tordconstnode(taddnode(right).left).value;
-                             t:=taddnode(right).right;
-                             t.registers32 :=  right.registers32;
-                             taddnode(right).right:=nil;
-                             right.free;
-                             right:=t;
-                          end;
-                     end
-                   else if (right.nodetype=subn) then
-                     begin
-                        if taddnode(right).right.nodetype=ordconstn then
-                          begin
-{ this was "extraoffset:=right.right.value;" Looks a bit like
-  copy-paste bug :) (JM) }
-                             extraoffset:=-tordconstnode(taddnode(right).right).value;
-                             t:=taddnode(right).left;
-                             t.registers32 :=  right.registers32;
-                             taddnode(right).left:=nil;
-                             right.free;
-                             right:=t;
-                          end
-{ You also have to negate right.right in this case! I can't add an
-  unaryminusn without causing a crash, so I've disabled it (JM)
-                        else if right.left.nodetype=ordconstn then
-                          begin
-                             extraoffset:=right.left.value;
-                             t:=right.right;
-                             t^.registers32 :=  right.registers32;
-                             putnode(right);
-                             putnode(right.left);
-                             right:=t;
-                         end;}
-                     end;
-                   inc(location.reference.offset,
-                       get_mul_size*extraoffset);
-                end;
-              { calculate from left to right }
-              if not(location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
-                { should be internalerror! (JM) }
-                CGMessage(cg_e_illegal_expression);
-              isjump:=(right.location.loc=LOC_JUMP);
-              if isjump then
-               begin
-                 otl:=truelabel;
-                 getlabel(truelabel);
-                 ofl:=falselabel;
-                 getlabel(falselabel);
-               end;
-              maybe_save(exprasmlist,right.registers32,location,pushedregs);
-              secondpass(right);
-              maybe_restore(exprasmlist,location,pushedregs);
-              { here we change the location of right
-                and the update was forgotten so it
-                led to wrong code in emitrangecheck later PM
-                so make range check before }
-
-              if cs_check_range in aktlocalswitches then
-               begin
-                 if left.resulttype.def.deftype=arraydef then
-                   begin
-                     if is_open_array(left.resulttype.def) or
-                        is_array_of_const(left.resulttype.def) then
-                      begin
-                        tarraydef(left.resulttype.def).genrangecheck;
-                        srsym:=searchsymonlyin(tloadnode(left).symtable,
-                          'high'+tvarsym(tloadnode(left).symtableentry).name);
-                        hightree:=cloadnode.create(tvarsym(srsym),tloadnode(left).symtable);
-                        firstpass(hightree);
-                        secondpass(hightree);
-                        location_release(exprasmlist,hightree.location);
-                        reference_reset_symbol(href,newasmsymbol(tarraydef(left.resulttype.def).getrangecheckstring),4);
-                        cg.a_load_loc_ref(exprasmlist,hightree.location,href);
-                        hightree.free;
-                        hightree:=nil;
-                      end;
-                     cg.g_rangecheck(exprasmlist,right,left.resulttype.def);
-                   end;
-               end;
-
-              location_force_reg(exprasmlist,right.location,OS_32,false);
-
-              if isjump then
-               begin
-                 truelabel:=otl;
-                 falselabel:=ofl;
-               end;
-
-            { produce possible range check code: }
-              if cs_check_range in aktlocalswitches then
-               begin
-                 if left.resulttype.def.deftype=arraydef then
-                   begin
-                     { done defore (PM) }
-                   end
-                 else if (left.resulttype.def.deftype=stringdef) then
-                   begin
-                      case tstringdef(left.resulttype.def).string_typ of
-                         { it's the same for ansi- and wide strings }
-                         st_widestring,
-                         st_ansistring:
-                           begin
-                              rg.saveusedregisters(exprasmlist,pushed,all_registers);
-                              cg.a_param_reg(exprasmlist,OS_INT,right.location.register,paramanager.getintparaloc(1));
-                              href:=location.reference;
-                              dec(href.offset,7);
-                              cg.a_param_ref(exprasmlist,OS_INT,href,paramanager.getintparaloc(1));
-                              rg.saveregvars(exprasmlist,all_registers);
-                              cg.a_call_name(exprasmlist,'FPC_'+Upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
-                              rg.restoreusedregisters(exprasmlist,pushed);
-                              cg.g_maybe_loadself(exprasmlist);
-                           end;
-                         st_shortstring:
-                           begin
-                              {!!!!!!!!!!!!!!!!!}
-                           end;
-                         st_longstring:
-                           begin
-                              {!!!!!!!!!!!!!!!!!}
-                           end;
-                      end;
-                   end;
-               end;
-
-              if location.reference.base=R_NO then
-               begin
-                 location.reference.base:=right.location.register;
-                 cg.a_op_const_reg(exprasmlist,OP_IMUL,get_mul_size,
-                   right.location.register);
-               end
-              else
-               begin
-                 if location.reference.index=R_NO then
-                   begin
-                     location.reference.index:=right.location.register;
-                     cg.a_op_const_reg(exprasmlist,OP_IMUL,get_mul_size,
-                       right.location.register);
-                   end
-                 else
-                  begin
-                    cg.a_loadaddr_ref_reg(exprasmlist,location.reference,
-                      location.reference.base);
-                    rg.ungetregisterint(exprasmlist,location.reference.index);
-                    { the symbol offset is loaded,             }
-                    { so release the symbol name and set symbol  }
-                    { to nil                                 }
-                    location.reference.symbol:=nil;
-                    location.reference.offset:=0;
-                    cg.a_op_const_reg(exprasmlist,OP_IMUL,
-                      get_mul_size,right.location.register);
-                    location.reference.index:=right.location.register;
-                  end;
-               end;
-
-           end;
-
-        location.size:=newsize;
-      end;
-
-
-begin
-   cvecnode:=tppcvecnode;
-end.
-{
-  $Log$
-  Revision 1.2  2002-08-10 17:15:31  jonas
-    * various fixes and optimizations
-
-  Revision 1.1  2002/07/29 09:21:30  jonas
-    + tppcvecnode, almost straight copy of the i386 code, can most likely
-      be made generic if all treference type allow a base, index and offset
-
-}

+ 0 - 22
compiler/ppc.dof

@@ -28,38 +28,26 @@ Z=1
 ShowHints=1
 ShowWarnings=1
 UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-
 [Linker]
 MapFile=0
 OutputObjs=0
 ConsoleApp=0
 DebugInfo=0
-RemoteSymbols=0
 MinStackSize=16384
 MaxStackSize=1048576
 ImageBase=4194304
 ExeDescription=
-
 [Directories]
 OutputDir=
 UnitOutputDir=
-PackageDLLOutputDir=
-PackageDCPOutputDir=
 SearchPath=
 Packages=VCL50;VCLX50;VCLSMP50;VCLDB50;VCLADO50;ibevnt50;VCLBDE50;VCLDBX50;QRPT50;TEEUI50;TEEDB50;TEE50;DSS50;TEEQR50;VCLIB50;VCLMID50;VCLIE50;INETDB50;INET50;NMFAST50;WEBMID50;dclocx50;dclaxserver50
 Conditionals=delphi i386 gdb support_mmx
 DebugSourceDirs=
 UsePackages=0
-
 [Parameters]
 RunParams=
 HostApplication=
-
-[Language]
-ActiveLang=
-ProjectLang=$00000413
-RootDir=
-
 [Version Info]
 IncludeVerInfo=0
 AutoIncBuild=0
@@ -74,7 +62,6 @@ Private=0
 DLL=0
 Locale=1043
 CodePage=1252
-
 [Version Info Keys]
 CompanyName=
 FileDescription=
@@ -86,12 +73,3 @@ OriginalFilename=
 ProductName=
 ProductVersion=1.0.0.0
 Comments=
-
-[HistoryLists\hlConditionals]
-Count=2
-Item0=delphi i386 gdb support_mmx
-Item1=delphi
-
-[HistoryLists\hlUnitAliases]
-Count=1
-Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;

+ 10 - 3
compiler/ppc.dpr

@@ -20,7 +20,7 @@
 
  ****************************************************************************
 }
-program pp;
+program ppc;
 
 {$MINSTACKSIZE $00004000}
 {$MAXSTACKSIZE $00100000}
@@ -62,7 +62,7 @@ program pp;
   GDB;M68k;TP
 }
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 {$ifdef FPC}
    {$ifndef GDB}
@@ -158,7 +158,14 @@ begin
 end.
 {
   $Log$
-  Revision 1.3  2000-11-13 15:43:07  marco
+  Revision 1.4  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.3  2000/11/13 15:43:07  marco
    * Renamefest
 
   Revision 1.2  2000/09/24 15:06:24  peter

+ 10 - 3
compiler/rautils.pas

@@ -28,7 +28,7 @@ Interface
 
 Uses
   cutils,cclasses,
-  globtype,aasmbase,aasmtai,cpubase,
+  globtype,aasmbase,aasmtai,cpubase,cpuinfo,
   symconst,symbase,symtype,symdef;
 
 Const
@@ -219,7 +219,7 @@ uses
   defbase,systems,verbose,globals,
   symsym,symtable,paramgr,
   aasmcpu,
-  cpuinfo,cgbase;
+  cgbase;
 
 {*************************************************************************
                               TExprParse
@@ -1592,7 +1592,14 @@ end;
 end.
 {
   $Log$
-  Revision 1.40  2002-08-11 14:32:27  peter
+  Revision 1.41  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.40  2002/08/11 14:32:27  peter
     * renamed current_library to objectlibrary
 
   Revision 1.39  2002/08/11 13:24:13  peter

+ 10 - 9
compiler/symsym.pas

@@ -1812,17 +1812,15 @@ implementation
                   so some optimizing will make things harder to debug }
          end
        else if (owner.symtabletype in [localsymtable,inlinelocalsymtable]) then
-   {$ifdef i386}
          if reg<>R_NO then
            begin
               { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
               { this is the register order for GDB}
               stabstring:=strpnew('"'+name+':r'+st+'",'+
                         tostr(N_RSYM)+',0,'+
-                        tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
+                        tostr(fileinfo.line)+','+tostr(stab_regindex[reg]));
            end
          else
-   {$endif i386}
            { I don't know if this will work (PM) }
            if (vo_is_C_var in varoptions) then
             stabstring := strpnew('"'+name+':S'+st+'",'+
@@ -1835,12 +1833,9 @@ implementation
   end;
 
     procedure tvarsym.concatstabto(asmlist : taasmoutput);
-{$ifdef i386}
       var stab_str : pchar;
-{$endif i386}
       begin
          inherited concatstabto(asmlist);
-{$ifdef i386}
       if (owner.symtabletype=parasymtable) and
          (reg<>R_NO) then
            begin
@@ -1849,10 +1844,9 @@ implementation
               stab_str:=strpnew('"'+name+':r'
                      +tstoreddef(vartype.def).numberstring+'",'+
                      tostr(N_RSYM)+',0,'+
-                     tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
+                     tostr(fileinfo.line)+','+tostr(stab_regindex[reg]));
               asmList.concat(Tai_stabs.Create(stab_str));
            end;
-{$endif i386}
       end;
 {$endif GDB}
 
@@ -2672,7 +2666,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.48  2002-08-11 14:32:28  peter
+  Revision 1.49  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.48  2002/08/11 14:32:28  peter
     * renamed current_library to objectlibrary
 
   Revision 1.47  2002/08/11 13:24:14  peter

+ 76 - 37
compiler/systems.pas

@@ -27,17 +27,18 @@ unit systems;
 
 interface
 
+
    type
        tendian = (endian_little,endian_big);
 
-     {
+     (*
        IMPORTANT NOTE:
        The value of this enumeration is stored in PPU files.
        Therefore adding new CPU targets should not change the
        values of the pre-existing targets. (CEC)
        FURTHERMORE : Make sure that this branch values, are
        consistant with the main branch version always.
-     }
+     *)
        tsystemcpu=
        (
              cpu_no,                       { 0 }
@@ -53,11 +54,6 @@ interface
              cpu_arm                       { 10 }
        );
 
-       tprocessors = (no_processor
-            ,Class386,ClassP5,ClassP6
-            ,MC68000,MC68100,MC68020
-            ,PPC601,PPC604
-       );
 
        TSection=(sec_none,
          sec_code,sec_data,sec_bss,
@@ -74,13 +70,13 @@ interface
             ,asmmode_i386_intel
        );
 
-     { IMPORTANT NOTE:
+     (* IMPORTANT NOTE:
        the integer value of this enum is stored in PPU
        files to recognize the target, so if you add new targets
        allways add them at end PM
        FURTHERMORE : Make sure that this branch values are
        consistant with the main branch version always. (CEC)
-       }
+       *)
      type
        tsystem =
        (
@@ -112,29 +108,22 @@ interface
        );
 
        tasm = (as_none
-             ,as_i386_as,as_i386_as_aout,as_i386_asw,as_i386_aswdosx,
-              as_i386_nasmcoff,as_i386_nasmwin32,as_i386_nasmwdosx,
-              as_i386_nasmelf,as_i386_nasmobj,
-              as_i386_tasm,as_i386_masm,
-              as_i386_dbg,as_i386_coff,as_i386_pecoff,as_i386_elf32,as_i386_pecoffwdosx
-            ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,
-              as_m68k_mpw,as_m68k_palm
-            ,as_alpha_as
-            ,as_powerpc_as,as_powerpc_mpw,
-            as_SPARC_as,as_SPARC_elf32
-       );
-
-       tld = (ld_none,
-            ld_i386_GO32V1,ld_i386_GO32V2,ld_i386_linux,
-              ld_i386_OS2,ld_i386_Win32,ld_i386_freebsd,
-              ld_i386_Netware,ld_i386_sunos,ld_i386_beos,
-              ld_i386_coff,ld_i386_pecoff,ld_i386_Wdosx,
-            ld_m68k_Amiga,ld_m68k_Atari,ld_m68k_Mac,
-              ld_m68k_linux,ld_m68k_PalmOS,ld_m68k_freebsd,
-            ld_alpha_linux,
-            ld_x86_64_linux,
-            ld_powerpc_linux,ld_powerpc_macos,
-            ld_SPARC_SunOs,ld_SPARC_linux
+             ,as_gas                   { standard gnu assembler }
+             ,as_i386_as_aout
+             ,as_i386_asw
+             ,as_i386_nasmcoff
+             ,as_i386_nasmwin32
+             ,as_i386_nasmwdosx
+             ,as_i386_nasmelf
+             ,as_i386_nasmobj
+             ,as_i386_tasm
+             ,as_i386_masm
+             ,as_i386_coff
+             ,as_i386_pecoff
+             ,as_i386_elf32
+             ,as_i386_pecoffwdosx
+             ,as_m68k_mit
+             ,as_powerpc_mpw
        );
 
        tar = (ar_none
@@ -155,6 +144,22 @@ interface
 *****************************************************************************}
 
      type
+       { Abstract linker class which is implemented in link module }
+       TAbstractLinker = class
+       end;
+     
+     
+       TAbstractLinkerClass = class of TABstractLinker;
+       
+       
+       { Abstract assembler class which is implemented in assemble module }
+       TAbstractAssembler = class
+       end;
+       
+       TAbstractAssemblerClass = class of TAbstractAssembler;
+       
+       
+       
        palignmentinfo = ^talignmentinfo;
        talignmentinfo = packed record
          procalign,
@@ -181,7 +186,6 @@ interface
           supported_target : tsystem;
           outputbinary,
           allowdirect,
-          externals,
           needar,
           labelprefix_only_inside_procedure : boolean;
           labelprefix : string[3];
@@ -243,8 +247,8 @@ interface
           files_case_relevent : boolean;
           assem        : tasm;
           assemextern  : tasm; { external assembler, used by -a }
-          link         : tld;
-          linkextern   : tld;  { external linker, used by -s }
+          link         : tabstractlinkerclass;
+          linkextern   : tabstractlinkerclass;  { external linker, used by -s }
           ar           : tar;
           res          : tres;
           script       : tscripttype;
@@ -305,6 +309,19 @@ interface
     procedure RegisterAsmMode(const r:tasmmodeinfo);
     procedure RegisterRes(const r:tresinfo);
     procedure RegisterAr(const r:tarinfo);
+    { Register the external linker. This routine is called to setup the
+      class to use for the linker. It returns the tsysteminfo structure
+      updated with the correct linker class for external linking.
+    }  
+    procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
+    { Register the internal linker. This routine is called to setup the
+      class to use for the linker. It returns the tsysteminfo structure
+      updated with the correct linker class for internal linking.
+      
+      If internal linking is not supported, this class can be set
+      to nil.
+    }  
+    procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
 
     procedure InitSystems;
 
@@ -314,6 +331,8 @@ implementation
     uses
       cutils;
 
+      
+
 {****************************************************************************
                               Target setting
 ****************************************************************************}
@@ -359,6 +378,8 @@ begin
 end;
 
 
+
+
 function set_target_res(t:tres):boolean;
 begin
   set_target_res:=false;
@@ -522,6 +543,17 @@ begin
   arinfos[t]^:=r;
 end;
 
+procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
+begin
+  system_info.linkextern := c;
+end;
+
+procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
+begin
+  system_info.link := c;
+end;
+
+
 
 procedure DeregisterInfos;
 var
@@ -608,7 +640,7 @@ begin
   {$ifdef cpu68}
     default_target(source_info.target);
   {$else cpu68}
-    default_target(target_m68k_linux);
+    default_target(system_m68k_linux);
   {$endif cpu68}
 {$endif m68k}
 {$ifdef alpha}
@@ -638,7 +670,14 @@ finalization
 end.
 {
   $Log$
-  Revision 1.50  2002-08-10 14:46:31  carl
+  Revision 1.51  2002-08-12 15:08:40  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.50  2002/08/10 14:46:31  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's

+ 9 - 2
compiler/targets/t_beos.pas

@@ -457,7 +457,7 @@ end;
 
 initialization
 {$ifdef i386}
-  RegisterLinker(ld_i386_beos,TLinkerbeos);
+  RegisterExternalLinker(system_i386_beos_info,TLinkerbeos);
   RegisterImport(system_i386_beos,timportlibbeos);
   RegisterExport(system_i386_beos,texportlibbeos);
   RegisterTarget(system_i386_beos_info);
@@ -465,7 +465,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.22  2002-08-11 14:32:32  peter
+  Revision 1.23  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.22  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.21  2002/08/11 13:24:19  peter

+ 10 - 3
compiler/targets/t_fbsd.pas

@@ -497,7 +497,7 @@ end;
 
 initialization
 {$ifdef i386}
-  RegisterLinker(ld_i386_freebsd,TLinkerFreeBSD);
+  RegisterExternalLinker(system_i386_FreeBSD_info,TLinkerFreeBSD);
   RegisterImport(system_i386_freebsd,timportlibfreebsd);
   RegisterExport(system_i386_freebsd,texportlibfreebsd);
   RegisterTarget(system_i386_freebsd_info);
@@ -506,7 +506,7 @@ initialization
   RegisterTarget(system_i386_netbsd_info);
 {$endif i386}
 {$ifdef m68k}
-  RegisterLinker(ld_m68k_freebsd,TLinkerFreeBSD);
+  RegisterExternalLinker(system_m68k_FreeBSD_info,TLinkerFreeBSD);
   RegisterImport(system_m68k_netbsd,timportlibfreebsd);
   RegisterExport(system_m68k_netbsd,texportlibfreebsd);
   RegisterTarget(system_m68k_netbsd_info);
@@ -514,7 +514,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.27  2002-08-11 14:32:32  peter
+  Revision 1.28  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.27  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.26  2002/08/11 13:24:19  peter

+ 11 - 3
compiler/targets/t_go32v2.pas

@@ -33,7 +33,7 @@ implementation
     uses
        link,
        cutils,cclasses,
-       globtype,globals,systems,verbose,script,fmodule,i_go32v2;
+       globtype,globals,systems,verbose,script,fmodule,i_go32v2,ogcoff;
 
   type
     tlinkergo32v2=class(texternallinker)
@@ -356,12 +356,20 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterLinker(ld_i386_go32v2,TLinkerGo32v2);
+  RegisterExternalLinker(system_i386_go32v2_info,TLinkerGo32v2);
+  RegisterInternalLinker(system_i386_go32v2_info,TCoffLinker);
   RegisterTarget(system_i386_go32v2_info);
 end.
 {
   $Log$
-  Revision 1.24  2002-07-26 21:15:46  florian
+  Revision 1.25  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.24  2002/07/26 21:15:46  florian
     * rewrote the system handling
 
   Revision 1.23  2002/07/01 18:46:35  peter

+ 14 - 7
compiler/targets/t_linux.pas

@@ -485,37 +485,37 @@ end;
 
 initialization
 {$ifdef i386}
-  RegisterLinker(ld_i386_linux,TLinkerLinux);
+  RegisterExternalLinker(system_i386_linux_info,TLinkerLinux);
   RegisterImport(system_i386_linux,timportliblinux);
   RegisterExport(system_i386_linux,texportliblinux);
   RegisterTarget(system_i386_linux_info);
 {$endif i386}
 {$ifdef m68k}
-  RegisterLinker(ld_m68k_linux,TLinkerLinux);
+  RegisterExternalLinker(system_m68k_linux_info,TLinkerLinux);
   RegisterImport(system_m68k_linux,timportliblinux);
   RegisterExport(system_m68k_linux,texportliblinux);
   RegisterTarget(system_m68k_linux_info);
 {$endif m68k}
 {$ifdef powerpc}
-  RegisterLinker(ld_powerpc_linux,TLinkerLinux);
+  RegisterExternalLinker(system_powerpc_linux_info,TLinkerLinux);
   RegisterImport(system_powerpc_linux,timportliblinux);
   RegisterExport(system_powerpc_linux,texportliblinux);
   RegisterTarget(system_powerpc_linux_info);
 {$endif powerpc}
 {$ifdef alpha}
-  RegisterLinker(ld_alpha_linux,TLinkerLinux);
+  RegisterExternalLinker(system_alpha_linux_info,TLinkerLinux);
   RegisterImport(system_alpha_linux,timportliblinux);
   RegisterExport(system_alpha_linux,texportliblinux);
   RegisterTarget(system_alpha_linux_info);
 {$endif alpha}
 {$ifdef x86_64}
-  RegisterLinker(ld_x86_64_linux,TLinkerLinux);
+  RegisterExternalLinker(system_x86_64_linux_info,TLinkerLinux);
   RegisterImport(system_x86_64_linux,timportliblinux);
   RegisterExport(system_x86_64_linux,texportliblinux);
   RegisterTarget(system_x86_64_linux_info);
 {$endif x86_64}
 {$ifdef SPARC}
-  RegisterLinker(ld_SPARC_linux,TLinkerLinux);
+  RegisterExternalLinker(system_sparc_linux_info,TLinkerLinux);
   RegisterImport(system_SPARC_linux,timportliblinux);
   RegisterExport(system_SPARC_linux,texportliblinux);
   RegisterTarget(system_SPARC_linux_info);
@@ -524,7 +524,14 @@ end.
 
 {
   $Log$
-  Revision 1.31  2002-08-11 14:32:32  peter
+  Revision 1.32  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.31  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.30  2002/08/11 13:24:19  peter

+ 9 - 2
compiler/targets/t_nwm.pas

@@ -477,14 +477,21 @@ end;
 
 
 initialization
-  RegisterLinker(ld_i386_netware,TLinkerNetware);
+  RegisterExternalLinker(system_i386_netware_info,TLinkerNetware);
   RegisterImport(system_i386_netware,TImportLibNetware);
   RegisterExport(system_i386_netware,TExportLibNetware);
   RegisterTarget(system_i386_netware_info);
 end.
 {
   $Log$
-  Revision 1.28  2002-08-11 14:32:32  peter
+  Revision 1.29  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.28  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.27  2002/08/11 13:24:20  peter

+ 9 - 2
compiler/targets/t_os2.pas

@@ -509,14 +509,21 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterLinker(ld_i386_os2,TLinkerOS2);
+  RegisterExternalLinker(system_i386_os2_info,TLinkerOS2);
   RegisterImport(system_i386_os2,TImportLibOS2);
   RegisterRes(res_emxbind_info);
   RegisterTarget(system_i386_os2_info);
 end.
 {
   $Log$
-  Revision 1.23  2002-07-26 21:15:46  florian
+  Revision 1.24  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.23  2002/07/26 21:15:46  florian
     * rewrote the system handling
 
   Revision 1.22  2002/07/01 18:46:35  peter

+ 9 - 2
compiler/targets/t_sunos.pas

@@ -479,14 +479,21 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterLinker(ld_i386_sunos,TLinkerSunos);
+  RegisterExternalLinker(system_i386_sunos_info,TLinkerSunos);
   RegisterImport(system_i386_sunos,TImportLibSunos);
   RegisterExport(system_i386_sunos,TExportLibSunos);
   RegisterTarget(system_i386_sunos_info);
 end.
 {
   $Log$
-  Revision 1.27  2002-08-11 14:32:32  peter
+  Revision 1.28  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.27  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.26  2002/08/11 13:24:20  peter

+ 9 - 2
compiler/targets/t_wdosx.pas

@@ -88,7 +88,7 @@ end;
 *****************************************************************************}
 
 initialization
-  RegisterLinker(ld_i386_wdosx,TLinkerWdosx);
+  RegisterExternalLinker(system_i386_wdosx_info,TLinkerWdosx);
   RegisterImport(system_i386_wdosx,TImportLibWdosx);
   RegisterExport(system_i386_wdosx,TExportLibWdosx);
   RegisterDLLScanner(system_i386_wdosx,TDLLScannerWdosx);
@@ -99,7 +99,14 @@ end.
 
 {
   $Log$
-  Revision 1.9  2002-07-26 21:15:46  florian
+  Revision 1.10  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.9  2002/07/26 21:15:46  florian
     * rewrote the system handling
 
   Revision 1.8  2002/05/18 13:34:27  peter

+ 10 - 3
compiler/targets/t_win32.pas

@@ -227,7 +227,7 @@ const
 
 
     const
-     MainAsmFormats=[as_i386_asw,as_i386_aswdosx,as_i386_pecoff,as_i386_pecoffwdosx];
+     MainAsmFormats=[as_i386_asw,as_i386_pecoff,as_i386_pecoffwdosx];
     procedure timportlibwin32.generatesmartlib;
       var
          hp1 : timportlist;
@@ -1542,7 +1542,7 @@ function tDLLScannerWin32.scan(const binname:string):longbool;
 
 initialization
 {$ifdef i386}
-  RegisterLinker(ld_i386_win32,TLinkerWin32);
+  RegisterExternalLinker(system_i386_win32_info,TLinkerWin32);
   RegisterImport(system_i386_win32,TImportLibWin32);
   RegisterExport(system_i386_win32,TExportLibWin32);
   RegisterDLLScanner(system_i386_win32,TDLLScannerWin32);
@@ -1553,7 +1553,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.38  2002-08-11 14:32:32  peter
+  Revision 1.39  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.38  2002/08/11 14:32:32  peter
     * renamed current_library to objectlibrary
 
   Revision 1.37  2002/08/11 13:24:20  peter

+ 8 - 2
compiler/x86_64/agx64att.pas

@@ -265,7 +265,6 @@ interface
             supported_target : target_any;
             outputbinary: false;
             allowdirect : true;
-            externals : false;
             needar : true;
             labelprefix_only_inside_procedure : false;
             labelprefix : '.L';
@@ -282,7 +281,14 @@ initialization
 end.
 {
   $Log$
-  Revision 1.2  2002-07-25 22:55:33  florian
+  Revision 1.3  2002-08-12 15:08:44  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.2  2002/07/25 22:55:33  florian
     * several fixes, small test units can be compiled
 
   Revision 1.1  2002/07/24 22:38:15  florian

+ 16 - 1
compiler/x86_64/cpuinfo.pas

@@ -41,6 +41,14 @@ Type
    { $fffffffffffffff on a 32bit machine if the compiler uses     }
    { int64 constants internally (JM)                              }
    TConstPtrUInt = qword;
+   
+   bestreal = extended;
+   ts32real = single;
+   ts64real = double;
+   ts80real = extended;
+   ts64comp = extended;
+   
+   pbestreal=^bestreal;
 
 Const
    { Size of native extended type }
@@ -58,7 +66,14 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.3  2002-08-10 14:53:38  carl
+  Revision 1.4  2002-08-12 15:08:45  carl
+    + stab register indexes for powerpc (moved from gdb to cpubase)
+    + tprocessor enumeration moved to cpuinfo
+    + linker in target_info is now a class
+    * many many updates for m68k (will soon start to compile)
+    - removed some ifdef or correct them for correct cpu
+
+  Revision 1.3  2002/08/10 14:53:38  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's