فهرست منبع

* x86-64 compiles
+ very basic support for float128 type (x86-64 only)

florian 22 سال پیش
والد
کامیت
b59b436130

+ 7 - 1
compiler/aasmtai.pas

@@ -63,6 +63,7 @@ interface
           ait_real_64bit,
           ait_real_80bit,
           ait_comp_64bit,
+          ait_real_128bit,
 {$ifdef GDB}
           ait_stabn,
           ait_stabs,
@@ -112,6 +113,7 @@ interface
           'real_64bit',
           'real_80bit',
           'comp_64bit',
+          'real_128bit',
 {$ifdef GDB}
           'stabn',
           'stabs',
@@ -1709,7 +1711,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.14  2002-12-06 17:50:21  peter
+  Revision 1.15  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.14  2002/12/06 17:50:21  peter
     * symbol count fix merged
 
   Revision 1.13  2002/11/17 16:31:55  carl

+ 6 - 2
compiler/cg64f32.pas

@@ -65,10 +65,10 @@ unit cg64f32;
         procedure a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
         procedure a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
 
+        procedure a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reg : tregister64);override;
         procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;value : qword;const l: tlocation);override;
         procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);override;
         procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg : tregister64);override;
-        procedure a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reg : tregister64);override;
         procedure a_op64_const_ref(list : taasmoutput;op:TOpCG;value : qword;const ref : treference);override;
 
         procedure a_param64_reg(list : taasmoutput;reg : tregister64;const locpara : tparalocation);override;
@@ -748,7 +748,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.32  2002-11-25 17:43:16  peter
+  Revision 1.33  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.32  2002/11/25 17:43:16  peter
     * splitted defbase in defutil,symutil,defcmp
     * merged isconvertable and is_equal into compare_defs(_ext)
     * made operator search faster by walking the list only once

+ 73 - 40
compiler/cg64f64.pas

@@ -32,7 +32,7 @@ unit cg64f64;
   interface
 
     uses
-       aasm,
+       aasmbase,aasmtai,aasmcpu,
        cpuinfo, cpubase,
        cginfo, cgobj,
        node,symtype;
@@ -41,16 +41,18 @@ unit cg64f64;
       {# Defines all the methods required on 32-bit processors
          to handle 64-bit integers.
       }
-      tcg64f32 = class(tcg64)
-        procedure a_load64_const_ref(list : taasmoutput;valuelo, valuehi : AWord;const ref : treference);override;
-        procedure a_load64_reg_ref(list : taasmoutput;reglo, reghi : tregister;const ref : treference);override;
-        procedure a_load64_ref_reg(list : taasmoutput;const ref : treference;reglo,reghi : tregister);override;
-        procedure a_load64_reg_reg(list : taasmoutput;reglosrc,reghisrc,reglodst,reghidst : tregister);override;
-        procedure a_load64_const_reg(list : taasmoutput;valuelosrc,valuehisrc:AWord;reglodst,reghidst : tregister);override;
-        procedure a_load64_loc_reg(list : taasmoutput;const l : tlocation;reglo,reghi : tregister);override;
+      tcg64f64 = class(tcg64)
+        procedure a_reg_alloc(list : taasmoutput;r : tregister64);override;
+        procedure a_reg_dealloc(list : taasmoutput;r : tregister64);override;
+        procedure a_load64_const_ref(list : taasmoutput;value : AWord;const ref : treference);override;
+        procedure a_load64_reg_ref(list : taasmoutput;reg : tregister64;const ref : treference);override;
+        procedure a_load64_ref_reg(list : taasmoutput;const ref : treference;reg : tregister64);override;
+        procedure a_load64_reg_reg(list : taasmoutput;regsrc,regdst : tregister64);override;
+        procedure a_load64_const_reg(list : taasmoutput;value: qword;reg : tregister64);override;
+        procedure a_load64_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister64);override;
         procedure a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);override;
-        procedure a_load64_const_loc(list : taasmoutput;valuelo, valuehi : AWord;const l : tlocation);override;
-        procedure a_load64_reg_loc(list : taasmoutput;reglo, reghi : tregister;const l : tlocation);override;
+        procedure a_load64_const_loc(list : taasmoutput;value : qword;const l : tlocation);override;
+        procedure a_load64_reg_loc(list : taasmoutput;reg : tregister64;const l : tlocation);override;
 
         procedure a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);override;
         procedure a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);override;
@@ -59,17 +61,23 @@ unit cg64f64;
         procedure a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
         procedure a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
 
-        procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;valuelosrc,valuehisrc:aword;const l: tlocation);override;
-        procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reglo,reghi : tregister;const l : tlocation);override;
-        procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reglo,reghi : tregister);override;
+        procedure a_op64_reg_ref(list : taasmoutput;op:TOpCG;regsrc : tregister64;const ref : treference);override;
+        procedure a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reg : tregister64);override;
+        procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;value:qword;const l: tlocation);override;
+        procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);override;
+        procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg : tregister64);override;
+        procedure a_op64_const_reg(list : taasmoutput;op:TOpCG;value : qword;regdst : tregister64);override;
+        procedure a_op64_const_ref(list : taasmoutput;op:TOpCG;value : qword;const ref : treference);override;
 
-        procedure a_param64_reg(list : taasmoutput;reglo,reghi : tregister;nr : longint);override;
-        procedure a_param64_const(list : taasmoutput;valuelo,valuehi : aword;nr : longint);override;
-        procedure a_param64_ref(list : taasmoutput;const r : treference;nr : longint);override;
-        procedure a_param64_loc(list : taasmoutput;const l : tlocation;nr : longint);override;
+        procedure a_param64_reg(list : taasmoutput;reg : tregister64;const locpara : tparalocation);override;
+        procedure a_param64_const(list : taasmoutput;value : qword;const locpara : tparalocation);override;
+        procedure a_param64_ref(list : taasmoutput;const r : treference;const locpara : tparalocation);override;
+        procedure a_param64_loc(list : taasmoutput;const l : tlocation;const locpara : tparalocation);override;
+
+        function optimize64_op_const_reg(list: taasmoutput; var op: topcg; var a : qword; var reg: tregister64): boolean;override;
 
         { override to catch 64bit rangechecks }
-        procedure g_rangecheck(list: taasmoutput; const p: tnode;
+        procedure g_rangecheck64(list: taasmoutput; const p: tnode;
           const todef: tdef); override;
       end;
 
@@ -82,17 +90,17 @@ unit cg64f64;
 
     procedure tcg64f64.a_load64_reg_ref(list : taasmoutput;reg : tregister64;const ref : treference);
       begin
-         cg.a_load_const_ref(list,OS_64,reg,ref);
+         cg.a_load_reg_ref(list,OS_64,reg,ref);
       end;
 
     procedure tcg64f64.a_load64_ref_reg(list : taasmoutput;const ref : treference;reg : tregister64);
       begin
-         cg.a_load_ref_ref(list,OS_64,ref,reg);
+         cg.a_load_ref_reg(list,OS_64,ref,reg);
       end;
 
     procedure tcg64f64.a_load64_reg_reg(list : taasmoutput;regsrc,regdst : tregister64);
       begin
-         cg.a_load_reg_reg(list,OS_64,regsrc,regdst);
+         cg.a_load_reg_reg(list,OS_64,OS_64,regsrc,regdst);
       end;
 
     procedure tcg64f64.a_load64_const_reg(list : taasmoutput;value : qword;reg : tregister64);
@@ -107,7 +115,7 @@ unit cg64f64;
 
     procedure tcg64f64.a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);
       begin
-         cg.a_load_loc_ref(list,OS_64,l,ref);
+         cg.a_load_loc_ref(list,l,ref);
       end;
 
     procedure tcg64f64.a_load64_const_loc(list : taasmoutput;value : qword;const l : tlocation);
@@ -117,59 +125,80 @@ unit cg64f64;
 
     procedure tcg64f64.a_load64_reg_loc(list : taasmoutput;reg : tregister64;const l : tlocation);
       begin
-         cg.a_load_reg_loc(list,reg,l);
+         cg.a_load_reg_loc(list,OS_64,reg,l);
+      end;
+
+    procedure tcg64f64.a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
+      begin
+      end;
+
+    procedure tcg64f64.a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
+      begin
+      end;
+
+    procedure tcg64f64.a_load64high_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
+      begin
       end;
 
-    procedure a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reglo,reg : tregister64);
+    procedure tcg64f64.a_load64low_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
       begin
-         cg.a_op_ref_reg(list,
       end;
 
-    procedure a_op64_reg_reg(list : taasmoutput;op:TOpCG;regsrc,regdst : tregister64);
+    procedure tcg64f64.a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
       begin
       end;
 
-    procedure a_op64_reg_ref(list : taasmoutput;op:TOpCG;regsrc : tregister64;const ref : treference);
+    procedure tcg64f64.a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
+      begin
+      end;
+
+
+    procedure tcg64f64.a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reg : tregister64);
       begin
+         cg.a_op_ref_reg(list,op,OS_64,ref,reg);
       end;
 
-    procedure a_op64_const_reg(list : taasmoutput;op:TOpCG;value : qword;regdst : tregister64);
+    procedure tcg64f64.a_op64_reg_ref(list : taasmoutput;op:TOpCG;regsrc : tregister64;const ref : treference);
       begin
       end;
 
-    procedure a_op64_const_ref(list : taasmoutput;op:TOpCG;value : qword;const ref : treference);
+    procedure tcg64f64.a_op64_const_reg(list : taasmoutput;op:TOpCG;value : qword;regdst : tregister64);
       begin
       end;
 
-    procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;value : qword;const l: tlocation);
+    procedure tcg64f64.a_op64_const_ref(list : taasmoutput;op:TOpCG;value : qword;const ref : treference);
       begin
       end;
 
-    procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);
+    procedure tcg64f64.a_op64_const_loc(list : taasmoutput;op:TOpCG;value : qword;const l: tlocation);
       begin
       end;
 
-    procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg64 : tregister64);
+    procedure tcg64f64.a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);
       begin
       end;
 
-    procedure a_param64_reg(list : taasmoutput;reg64 : tregister;nr : longint);
+    procedure tcg64f64.a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg : tregister64);
       begin
       end;
 
-    procedure a_param64_const(list : taasmoutput;value : qword;nr : longint);
+    procedure tcg64f64.a_param64_reg(list : taasmoutput;reg64 : tregister;const locpara : tparalocation);
       begin
       end;
 
-    procedure a_param64_ref(list : taasmoutput;const r : treference;nr : longint);
+    procedure tcg64f64.a_param64_const(list : taasmoutput;value : qword;const locpara : tparalocation);
       begin
       end;
 
-    procedure a_param64_loc(list : taasmoutput;const l : tlocation;nr : longint);
+    procedure tcg64f64.a_param64_ref(list : taasmoutput;const r : treference;const locpara : tparalocation);
       begin
       end;
 
-    procedure g_rangecheck64(list: taasmoutput; const p: tnode;
+    procedure tcg64f64.a_param64_loc(list : taasmoutput;const l : tlocation;const locpara : tparalocation);
+      begin
+      end;
+
+    procedure tcg64f64.g_rangecheck64(list: taasmoutput; const p: tnode;
       const todef: tdef);
       begin
       end;
@@ -180,13 +209,13 @@ unit cg64f64;
      end;
 
 
-    procedure tcg.a_reg_alloc(list : taasmoutput;r : tregister64);
+    procedure tcg64f64.a_reg_alloc(list : taasmoutput;r : tregister64);
 
       begin
          list.concat(tai_regalloc.alloc(r));
       end;
 
-    procedure tcg.a_reg_dealloc(list : taasmoutput;r : tregister64);
+    procedure tcg64f64.a_reg_dealloc(list : taasmoutput;r : tregister64);
 
       begin
          list.concat(tai_regalloc.dealloc(r));
@@ -196,7 +225,11 @@ unit cg64f64;
 end.
 {
   $Log$
-  Revision 1.5  2002-09-07 15:25:00  peter
+  Revision 1.6  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.5  2002/09/07 15:25:00  peter
     * old logs removed and tabs fixed
 
   Revision 1.4  2002/08/19 18:17:48  carl

+ 9 - 5
compiler/cginfo.pas

@@ -73,7 +73,7 @@ interface
                  { integer registers }
                   OS_8,OS_16,OS_32,OS_64,OS_S8,OS_S16,OS_S32,OS_S64,
                  { single,double,extended,comp }
-                  OS_F32,OS_F64,OS_F80,OS_C64,
+                  OS_F32,OS_F64,OS_F80,OS_C64,OS_F128,
                  { multi-media sizes: split in byte, word, dword, ... }
                  { entities, then the signed counterparts             }
                   OS_M8,OS_M16,OS_M32,OS_M64,OS_M128,OS_MS8,OS_MS16,OS_MS32,
@@ -84,12 +84,12 @@ interface
          { integer values }
         (0,1,2,4,8,1,2,4,8,
          { floating point values }
-         4,8,EXTENDED_SIZE,8,
+         4,8,EXTENDED_SIZE,8,16,
          { multimedia values }
          1,2,4,8,16,1,2,4,8,16);
 
        tfloat2tcgsize: array[tfloattype] of tcgsize =
-         (OS_F32,OS_F64,OS_F80,OS_C64,OS_C64);
+         (OS_F32,OS_F64,OS_F80,OS_C64,OS_C64,OS_F128);
 
        tcgsize2tfloat: array[OS_F32..OS_C64] of tfloattype =
          (s32real,s64real,s80real,s64comp);
@@ -98,7 +98,7 @@ interface
          unsigned types }
        tcgsize2unsigned : array[tcgsize] of tcgsize = (OS_NO,
           OS_8,OS_16,OS_32,OS_64,OS_8,OS_16,OS_32,OS_64,
-          OS_F32,OS_F64,OS_F80,OS_C64,
+          OS_F32,OS_F64,OS_F80,OS_C64,OS_F128,
           OS_M8,OS_M16,OS_M32,OS_M64,OS_M128,OS_M8,OS_M16,OS_M32,
           OS_M64,OS_M128);
 
@@ -107,7 +107,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.16  2002-09-07 15:25:01  peter
+  Revision 1.17  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.16  2002/09/07 15:25:01  peter
     * old logs removed and tabs fixed
 
   Revision 1.15  2002/08/05 18:27:48  carl

+ 8 - 4
compiler/i386/aasmcpu.pas

@@ -276,19 +276,19 @@ implementation
          (OT_NONE,
           OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS16,OT_BITS32,OT_BITS32,
           OT_BITS16,OT_BITS32,OT_BITS64,
-          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,OT_NONE,
           OT_NEAR,OT_FAR,OT_SHORT
          ),
          (OT_NONE,
           OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS8,OT_BITS8,OT_BITS16,
           OT_BITS16,OT_BITS32,OT_BITS64,
-          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,OT_NONE,
           OT_NEAR,OT_FAR,OT_SHORT
          ),
          (OT_NONE,
           OT_BITS8,OT_BITS16,OT_BITS32,OT_NONE,OT_NONE,OT_NONE,
           OT_BITS16,OT_BITS32,OT_BITS64,
-          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,OT_NONE,
           OT_NEAR,OT_FAR,OT_SHORT
          )
        );
@@ -1875,7 +1875,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.8  2002-11-17 16:31:58  carl
+  Revision 1.9  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.8  2002/11/17 16:31:58  carl
     * memory optimization (3-4%) : cleanup of tai fields,
        cleanup of tdef and tsym fields.
     * make it work for m68k

+ 6 - 2
compiler/i386/ag386att.pas

@@ -65,7 +65,7 @@ interface
      gas_opsize2str : array[topsize] of string[2] = ('',
        'b','w','l','bw','bl','wl',
        's','l','q',
-       's','l','t','d','q','v',
+       's','l','t','d','q','v','',
        '','',''
      );
 
@@ -303,7 +303,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.27  2002-12-24 18:10:34  peter
+  Revision 1.28  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.27  2002/12/24 18:10:34  peter
     * Long symbol names support
 
   Revision 1.26  2002/08/12 15:08:40  carl

+ 6 - 2
compiler/i386/cpubase.pas

@@ -70,7 +70,7 @@ uses
       topsize = (S_NO,
         S_B,S_W,S_L,S_BW,S_BL,S_WL,
         S_IS,S_IL,S_IQ,
-        S_FS,S_FL,S_FX,S_D,S_Q,S_FV,
+        S_FS,S_FL,S_FX,S_D,S_Q,S_FV,S_FXX,
         S_NEAR,S_FAR,S_SHORT
       );
 
@@ -533,7 +533,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.34  2002-11-17 18:26:16  mazen
+  Revision 1.35  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.34  2002/11/17 18:26:16  mazen
   * fixed a compilation bug accmulator-->accumulator, in definition of return_result_reg
 
   Revision 1.33  2002/11/17 17:49:08  mazen

+ 8 - 0
compiler/i386/i386ins.dat

@@ -3317,3 +3317,11 @@ xmmreg,mem              \301\3\x66\x0F\x14\110          WILLAMETTE,SSE2,SM
 (Ch_All, Ch_None, Ch_None)
 xmmreg,xmmreg           \3\x66\x0F\x57\110              WILLAMETTE,SSE2
 xmmreg,mem              \301\3\x66\x0F\x57\110          WILLAMETTE,SSE2,SM
+
+;
+; $Log$
+; Revision 1.7  2003-01-05 13:36:53  florian
+;   * x86-64 compiles
+;   + very basic support for float128 type (x86-64 only)
+;
+;

+ 6 - 2
compiler/m68k/cgcpu.pas

@@ -98,7 +98,7 @@ unit cgcpu;
 const
       TCGSize2OpSize: Array[tcgsize] of topsize =
         (S_NO,S_B,S_W,S_L,S_L,S_B,S_W,S_L,S_L,
-         S_FS,S_FD,S_FX,S_NO,
+         S_FS,S_FD,S_FX,S_NO,S_NO,
          S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO);
 
 
@@ -1250,7 +1250,11 @@ end.
 
 {
   $Log$
-  Revision 1.13  2002-12-01 22:12:36  carl
+  Revision 1.14  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.13  2002/12/01 22:12:36  carl
     * rename an error message
 
   Revision 1.12  2002/11/25 17:43:27  peter

+ 6 - 2
compiler/ncgcon.pas

@@ -83,7 +83,7 @@ implementation
       { constants are actually supported by the target processor? (JM) }
       const
         floattype2ait:array[tfloattype] of taitype=
-          (ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_comp_64bit);
+          (ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_comp_64bit,ait_real_128bit);
       var
          hp1 : tai;
          lastlabel : tasmlabel;
@@ -533,7 +533,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.25  2002-12-29 16:58:11  peter
+  Revision 1.26  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.25  2002/12/29 16:58:11  peter
     * write terminating 0 for widestring constants
 
   Revision 1.24  2002/12/07 14:10:21  carl

+ 6 - 2
compiler/pmodules.pas

@@ -358,7 +358,7 @@ implementation
           not output a pointer }
          case target_info.system of
 {$ifdef x86_64}
-            target_x86_64_linux:
+            system_x86_64_linux:
               ;
 {$endif x86_64}
 {$ifdef i386}
@@ -1437,7 +1437,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.90  2002-12-29 18:17:23  peter
+  Revision 1.91  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.90  2002/12/29 18:17:23  peter
     * insert unitsym with the name as specified in the uses list
 
   Revision 1.89  2002/12/29 14:57:50  peter

+ 7 - 2
compiler/sparc/cgcpu.pas

@@ -100,7 +100,8 @@ specific processor ABI. It is overriden for each CPU target.
 CONST
   TOpCG2AsmOp:ARRAY[topcg]OF TAsmOp=(A_NONE,A_ADD,A_AND,A_UDIV,A_SDIV,A_UMUL, A_SMUL, A_NEG,A_NOT,A_OR,A_not,A_not,A_not,A_SUB,A_XOR);
   TOpCmp2AsmCond:ARRAY[topcmp]OF TAsmCond=(C_NONE,C_E,C_G,C_L,C_GE,C_LE,C_NE,C_BE,C_B,C_AE,C_A);
-  TCGSize2OpSize:ARRAY[tcgsize]OF TOpSize=(S_NO,S_B,S_W,S_SW,S_SW,S_B,S_W,S_SW,S_SW,S_FS,S_FD,S_FQ,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO);
+  TCGSize2OpSize:ARRAY[tcgsize]OF TOpSize=(S_NO,S_B,S_W,S_SW,S_SW,S_B,S_W,S_SW,S_SW,S_FS,S_FD,S_FQ,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO);
+
 IMPLEMENTATION
 USES
   globtype,globals,verbose,systems,cutils,
@@ -1334,7 +1335,11 @@ BEGIN
 END.
 {
   $Log$
-  Revision 1.29  2002-12-25 20:59:49  mazen
+  Revision 1.30  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.29  2002/12/25 20:59:49  mazen
   - many emitXXX removed from cga.pas in order to remove that file.
 
   Revision 1.28  2002/12/22 19:26:31  mazen

+ 7 - 2
compiler/symconst.pas

@@ -68,6 +68,7 @@ const
   ftExtended = 2;
   ftComp     = 3;
   ftCurr     = 4;
+  ftFloat128 = 5;
 
   mkProcedure= 0;
   mkFunction = 1;
@@ -149,7 +150,7 @@ type
   { float types }
   tfloattype = (
     s32real,s64real,s80real,
-    s64comp,s64currency
+    s64comp,s64currency,s128real
   );
 
   { string types }
@@ -339,7 +340,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.41  2003-01-01 22:51:03  peter
+  Revision 1.42  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.41  2003/01/01 22:51:03  peter
     * high value insertion changed so it works also when 2 parameters
       are passed
 

+ 11 - 4
compiler/symdef.pas

@@ -686,6 +686,9 @@ interface
 {$ifdef i386}
        pbestrealtype : ^ttype = @s80floattype;
 {$endif}
+{$ifdef x86_64}
+       pbestrealtype : ^ttype = @s80floattype;
+{$endif}
 {$ifdef m68k}
        pbestrealtype : ^ttype = @s64floattype;
 {$endif}
@@ -1914,9 +1917,9 @@ implementation
 
     procedure tfloatdef.write_rtti_data(rt:trttitype);
       const
-         {tfloattype = (s32real,s64real,s80real,s64bit);}
+         {tfloattype = (s32real,s64real,s80real,s64bit,s128bit);}
          translate : array[tfloattype] of byte =
-           (ftSingle,ftDouble,ftExtended,ftComp,ftCurr);
+           (ftSingle,ftDouble,ftExtended,ftComp,ftCurr,ftFloat128);
       begin
          rttiList.concat(Tai_const.Create_8bit(tkFloat));
          write_rtti_name;
@@ -1933,7 +1936,7 @@ implementation
 
       const
         names : array[tfloattype] of string[20] = (
-          'Single','Double','Extended','Comp','Currency');
+          'Single','Double','Extended','Comp','Currency','Float128');
 
       begin
          gettypename:=names[typ];
@@ -5557,7 +5560,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.120  2003-01-02 19:49:00  peter
+  Revision 1.121  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.120  2003/01/02 19:49:00  peter
     * update self parameter only for methodpointer and methods
 
   Revision 1.119  2002/12/29 18:25:59  peter

+ 6 - 1
compiler/systems.pas

@@ -129,6 +129,7 @@ interface
              ,as_i386_pecoffwdosx
              ,as_m68k_mit
              ,as_powerpc_mpw
+             ,as_x86_64_as
        );
 
        tar = (ar_none
@@ -675,7 +676,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.57  2002-10-05 12:43:29  carl
+  Revision 1.58  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.57  2002/10/05 12:43:29  carl
     * fixes for Delphi 6 compilation
      (warning : Some features do not work under Delphi)
 

+ 6 - 1
compiler/systems/t_win32.pas

@@ -102,6 +102,7 @@ interface
       function GetEdata(HeaderEntry:cardinal):longbool;override;
       function Scan(const binname:string):longbool;override;
     end;
+
 implementation
 
     function DllName(Const Name : string;NdefExt:longint;DefExt:pStr4) : string;
@@ -1625,7 +1626,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.9  2002-12-24 15:55:51  peter
+  Revision 1.10  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.9  2002/12/24 15:55:51  peter
     * Use maybequote instead of getshortname
 
   Revision 1.8  2002/12/01 18:57:34  carl

+ 6 - 2
compiler/x86/cgx86.pas

@@ -140,7 +140,7 @@ unit cgx86;
    const
       TCGSize2OpSize: Array[tcgsize] of topsize =
         (S_NO,S_B,S_W,S_L,S_L,S_B,S_W,S_L,S_L,
-         S_FS,S_FL,S_FX,S_IQ,
+         S_FS,S_FL,S_FX,S_IQ,S_FXX,
          S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO);
 
 
@@ -1682,7 +1682,11 @@ unit cgx86;
 end.
 {
   $Log$
-  Revision 1.25  2003-01-02 16:17:50  peter
+  Revision 1.26  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.25  2003/01/02 16:17:50  peter
     * align stack on 4 bytes in copyvalueopenarray
 
   Revision 1.24  2002/12/24 15:56:50  peter

+ 15 - 6
compiler/x86_64/aasmcpu.pas

@@ -113,7 +113,7 @@ interface
       OT_UNITY     = $00802000;  { for shift/rotate instructions  }
 
       { Size of the instruction table converted by nasmconv.pas }
-      instabentries = {$i i386nop.inc}
+      instabentries = {$i x86_64no.inc}
       maxinfolen    = 8;
 
     type
@@ -137,6 +137,7 @@ interface
       end;
 
       taicpu = class(taicpu_abstract)
+         segprefix : tregister;
          opsize    : topsize;
          constructor op_none(op : tasmop;_size : topsize);
 
@@ -235,6 +236,8 @@ implementation
        IF_MMX    = $00004000;  { it's an MMX instruction  }
        IF_3DNOW  = $00008000;  { it's a 3DNow! instruction  }
        IF_SSE    = $00010000;  { it's a SSE (KNI, MMX2) instruction  }
+       { SSE2 instructions  }
+       IF_SSE2   = $00020000;
        IF_PMASK  = longint($FF000000);  { the mask for processor types  }
        IF_PFMASK = longint($F001FF00);  { the mask for disassembly "prefer"  }
        IF_8086   = $00000000;  { 8086 instruction  }
@@ -245,6 +248,8 @@ implementation
        IF_PENT   = $05000000;  { Pentium instruction  }
        IF_P6     = $06000000;  { P6 instruction  }
        IF_KATMAI = $07000000;  { Katmai instructions  }
+       { Willamette instructions }
+       IF_WILLAMETTE = $08000000;
        IF_CYRIX  = $10000000;  { Cyrix-specific instruction  }
        IF_AMD    = $20000000;  { AMD-specific instruction  }
        { added flags }
@@ -267,19 +272,19 @@ implementation
          (OT_NONE,
           OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS16,OT_BITS32,OT_BITS32,OT_BITS64,OT_BITS64,OT_BITS64,
           OT_BITS16,OT_BITS32,OT_BITS64,
-          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,OT_NONE,
           OT_NEAR,OT_FAR,OT_SHORT
          ),
          (OT_NONE,
           OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS8,OT_BITS8,OT_BITS16,OT_BITS8,OT_BITS16,OT_BITS32,
           OT_BITS16,OT_BITS32,OT_BITS64,
-          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,OT_NONE,
           OT_NEAR,OT_FAR,OT_SHORT
          ),
          (OT_NONE,
           OT_BITS8,OT_BITS16,OT_BITS32,OT_NONE,OT_NONE,OT_NONE,OT_NONE,OT_NONE,OT_NONE,
           OT_BITS16,OT_BITS32,OT_BITS64,
-          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+          OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,OT_NONE,
           OT_NEAR,OT_FAR,OT_SHORT
          )
        );
@@ -989,7 +994,7 @@ implementation
         i:=instabcache^[opcode];
         if i=-1 then
          begin
-           Message1(asmw_e_opcode_not_in_table,att_op2str[opcode]);
+           Message1(asmw_e_opcode_not_in_table,gas_op2str[opcode]);
            exit;
          end;
         insentry:=@instab[i];
@@ -1800,7 +1805,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.4  2002-11-17 16:32:04  carl
+  Revision 1.5  2003-01-05 13:36:53  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.4  2002/11/17 16:32:04  carl
     * memory optimization (3-4%) : cleanup of tai fields,
        cleanup of tdef and tsym fields.
     * make it work for m68k

+ 20 - 16
compiler/x86_64/agx64att.pas

@@ -42,10 +42,10 @@ interface
     TAttSuffix = (AttSufNONE,AttSufINT,AttSufFPU,AttSufFPUint);
 
     const
-      att_op2str:op2strtable={$i x64att.inc}
-      att_needsuffix:array[tasmop] of TAttSuffix={$i x64atts.inc}
+      gas_op2str:op2strtable={$i x64att.inc}
+      gas_needsuffix:array[tasmop] of TAttSuffix={$i x64atts.inc}
 
-      att_reg2str : reg2strtable = ('',
+      gas_reg2str : reg2strtable = ('',
          '%rax','%rcx','%rdx','%rbx','%rsp','%rbp','%rsi','%rdi',
          '%r8','%r9','%r10','%r11','%r12','%r13','%r14','%r15','%rip',
          '%eax','%ecx','%edx','%ebx','%esp','%ebp','%esi','%edi',
@@ -65,10 +65,10 @@ interface
          '%xmm8','%xmm9','%xmm10','%xmm11','%xmm12','%xmm13','%xmm14','%xmm15'
        );
 
-     att_opsize2str : array[topsize] of string[2] = ('',
+     gas_opsize2str : array[topsize] of string[2] = ('',
        'b','w','l','bw','bl','wl','bq','wq','lq',
        's','l','q',
-       's','l','t','d','q','v',
+       's','l','t','d','q','v','x',
        '','',''
      );
 
@@ -93,7 +93,7 @@ interface
        { should be replaced by coding the segment override  }
        { directly! - DJGPP FAQ                              }
          if segment<>R_NO then
-          s:=att_reg2str[segment]+':'
+          s:=gas_reg2str[segment]+':'
          else
           s:='';
          if assigned(symbol) then
@@ -112,7 +112,7 @@ interface
            s:=s+'0';
          if (index<>R_NO) and (base=R_NO) then
           begin
-            s:=s+'(,'+att_reg2str[index];
+            s:=s+'(,'+gas_reg2str[index];
             if scalefactor<>0 then
              s:=s+','+tostr(scalefactor)+')'
             else
@@ -120,11 +120,11 @@ interface
           end
          else
           if (index=R_NO) and (base<>R_NO) then
-           s:=s+'('+att_reg2str[base]+')'
+           s:=s+'('+gas_reg2str[base]+')'
           else
            if (index<>R_NO) and (base<>R_NO) then
             begin
-              s:=s+'('+att_reg2str[base]+','+att_reg2str[index];
+              s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index];
               if scalefactor<>0 then
                s:=s+','+tostr(scalefactor)+')'
               else
@@ -140,7 +140,7 @@ interface
     begin
       case o.typ of
         top_reg :
-          getopstr:=att_reg2str[o.reg];
+          getopstr:=gas_reg2str[o.reg];
         top_ref :
           getopstr:=getreferencestring(o.ref^);
         top_const :
@@ -172,7 +172,7 @@ interface
     begin
       case o.typ of
         top_reg :
-          getopstr_jmp:='*'+att_reg2str[o.reg];
+          getopstr_jmp:='*'+gas_reg2str[o.reg];
         top_ref :
           getopstr_jmp:='*'+getreferencestring(o.ref^);
         top_const :
@@ -212,18 +212,18 @@ interface
        op:=taicpu(hp).opcode;
        calljmp:=is_calljmp(op);
        { call maybe not translated to call }
-       s:=#9+att_op2str[op]+cond2str[taicpu(hp).condition];
+       s:=#9+gas_op2str[op]+cond2str[taicpu(hp).condition];
        { suffix needed ?  fnstsw,fldcw don't support suffixes
          with binutils 2.9.5 under linux }
        if (not calljmp) and
-           (att_needsuffix[op]<>AttSufNONE) and
+           (gas_needsuffix[op]<>AttSufNONE) and
            (op<>A_FNSTSW) and (op<>A_FSTSW) and
            (op<>A_FNSTCW) and (op<>A_FSTCW) and
            (op<>A_FLDCW) and not(
            (taicpu(hp).oper[0].typ=top_reg) and
            (taicpu(hp).oper[0].reg in [R_ST..R_ST7])
           ) then
-              s:=s+att_opsize2str[taicpu(hp).opsize];
+              s:=s+gas_opsize2str[taicpu(hp).opsize];
        { process operands }
        if taicpu(hp).ops<>0 then
          begin
@@ -262,7 +262,7 @@ interface
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
-            supported_target : target_any;
+            supported_target : system_any;
             outputbinary: false;
             allowdirect : true;
             needar : true;
@@ -281,7 +281,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.3  2002-08-12 15:08:44  carl
+  Revision 1.4  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  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

+ 6 - 2
compiler/x86_64/cgcpu.pas

@@ -43,7 +43,7 @@ unit cgcpu;
 
     uses
        globtype,globals,verbose,systems,cutils,
-       symdef,symsym,defbase,paramgr,
+       symdef,symsym,defutil,paramgr,
        rgobj,tgobj,rgcpu;
 
     procedure tcgx86_64.g_concatcopy(list : taasmoutput;const source,dest : treference;len : aword; delsource,loadref : boolean);
@@ -173,7 +173,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.2  2002-07-25 22:55:33  florian
+  Revision 1.3  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  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

+ 9 - 4
compiler/x86_64/cpubase.pas

@@ -59,7 +59,7 @@ type
   topsize = (S_NO,
     S_B,S_W,S_L,S_BW,S_BL,S_WL,S_BQ,S_WQ,S_LQ,
     S_IS,S_IL,S_IQ,
-    S_FS,S_FL,S_FX,S_D,S_Q,S_FV,
+    S_FS,S_FL,S_FX,S_D,S_Q,S_FV,S_FXX,
     S_NEAR,S_FAR,S_SHORT
   );
 
@@ -270,8 +270,8 @@ const
          LOC_FPUREGISTER,
          { if it is a FPU register variable on the fpu stack }
          LOC_CFPUREGISTER,
-         LOC_SSEREGISTER,
-         LOC_CSSEREGISTER
+         LOC_MMREGISTER,
+         LOC_CMMREGISTER
        );
 
       { tparamlocation describes where a parameter for a procedure is stored.
@@ -281,6 +281,7 @@ const
       tparalocation = packed record
          loc  : TLoc;
          sp_fixup : longint;
+         size : TCGSize;
          case TLoc of
             LOC_REFERENCE : (reference : tparareference);
             { segment in reference at the same place as in loc_register }
@@ -499,7 +500,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.4  2002-11-17 18:26:16  mazen
+  Revision 1.5  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.4  2002/11/17 18:26:16  mazen
   * fixed a compilation bug accmulator-->accumulator, in definition of return_result_reg
 
   Revision 1.3  2002/11/17 17:49:09  mazen

+ 15 - 1
compiler/x86_64/cpuinfo.pas

@@ -50,6 +50,10 @@ Type
 
    pbestreal=^bestreal;
 
+   tprocessors =
+      (no_processor,
+       ClassDefault
+      );
 Const
    { Size of native extended type }
    extended_size = 10;
@@ -59,6 +63,12 @@ Const
    mmreg_size = 16;
    { target cpu string (used by compiler options) }
    target_cpu_string = 'x86_64';
+   { size of the buffer used for setjump/longjmp
+     the size of this buffer is deduced from the
+     jmp_buf structure in setjumph.inc file
+   }
+   {$warning FIX: jmp_buf_size }
+   jmp_buf_size = 48;
 
 
 Implementation
@@ -66,7 +76,11 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.5  2002-09-07 15:25:15  peter
+  Revision 1.6  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.5  2002/09/07 15:25:15  peter
     * old logs removed and tabs fixed
 
   Revision 1.4  2002/08/12 15:08:45  carl

+ 75 - 3
compiler/x86_64/cpupara.pas

@@ -30,7 +30,7 @@ unit cpupara;
 
     uses
        cpubase,
-       symdef,paramgr;
+       symconst,symbase,symtype,symdef,paramgr;
 
     type
        { Returns the location for the nr-st 32 Bit int parameter
@@ -46,7 +46,75 @@ unit cpupara;
   implementation
 
     uses
-       verbose;
+       verbose,
+       globtype,
+       cpuinfo,cginfo,cgbase,
+       defutil;
+
+    function getparaloc(p : tdef) : tloc;
+
+      begin
+         { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
+           if push_addr_param for the def is true
+         }
+         // !!!!! Fix aggregate types
+         case p.deftype of
+            orddef:
+              getparaloc:=LOC_REGISTER;
+            floatdef:
+              case tfloatdef(p).typ of
+                 s80real:
+                   getparaloc:=LOC_REFERENCE;
+                 s32real,
+                 s64real,
+                 s64comp,
+                 s64currency,
+                 s128real:
+                   getparaloc:=LOC_MMREGISTER;
+              end;
+            enumdef:
+              getparaloc:=LOC_REGISTER;
+            pointerdef:
+              getparaloc:=LOC_REGISTER;
+            formaldef:
+              getparaloc:=LOC_REGISTER;
+            classrefdef:
+              getparaloc:=LOC_REGISTER;
+            recorddef:
+              getparaloc:=LOC_REFERENCE;
+            objectdef:
+              if is_object(p) then
+                getparaloc:=LOC_REFERENCE
+              else
+                getparaloc:=LOC_REGISTER;
+            stringdef:
+              if is_shortstring(p) or is_longstring(p) then
+                getparaloc:=LOC_REFERENCE
+              else
+                getparaloc:=LOC_REGISTER;
+            procvardef:
+              if (po_methodpointer in tprocvardef(p).procoptions) then
+                getparaloc:=LOC_REFERENCE
+              else
+                getparaloc:=LOC_REGISTER;
+            filedef:
+              getparaloc:=LOC_REGISTER;
+            arraydef:
+              getparaloc:=LOC_REFERENCE;
+            setdef:
+              if is_smallset(p) then
+                getparaloc:=LOC_REGISTER
+              else
+                getparaloc:=LOC_REFERENCE;
+            variantdef:
+              getparaloc:=LOC_REFERENCE;
+            { avoid problems with errornous definitions }
+            errordef:
+              getparaloc:=LOC_REGISTER;
+            else
+              internalerror(2002071001);
+         end;
+      end;
 
     function tx86_64paramanager.getintparaloc(nr : longint) : tparalocation;
       begin
@@ -66,7 +134,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.1  2002-07-24 22:38:15  florian
+  Revision 1.2  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.1  2002/07/24 22:38:15  florian
     + initial release of x86-64 target code
 
 }

+ 51 - 0
compiler/x86_64/cpupi.pas

@@ -0,0 +1,51 @@
+{
+    $Id$
+    Copyright (c) 2002 by Florian Klaempfl
+
+    This unit contains the CPU specific part of tprocinfo
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+
+{ This unit contains the CPU specific part of tprocinfo. }
+unit cpupi;
+
+{$i fpcdefs.inc}
+
+  interface
+
+    uses
+       cgbase;
+
+    type
+       tx86_64procinfo = class(tprocinfo)
+       end;
+
+
+  implementation
+
+begin
+   cprocinfo:=tx86_64procinfo;
+end.
+{
+  $Log$
+  Revision 1.1  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+}
+
+

+ 86 - 24
compiler/x86_64/radirect.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2001 by Florian Klaempfl
+    Copyright (c) 1998-2002 by Florian Klaempfl
 
     Reads inline assembler and writes the lines direct to the output
 
@@ -20,7 +20,7 @@
 
  ****************************************************************************
 }
-unit Radirect;
+unit radirect;
 
 {$i fpcdefs.inc}
 
@@ -40,17 +40,18 @@ interface
        globals,verbose,
        systems,
        { aasm }
-       cpubase,aasmtai,
+       aasmbase,aasmtai,aasmcpu,
        { symtable }
-       symconst,symbase,symtype,symsym,symtable,defbase,paramgr,
+       symconst,symbase,symtype,symsym,symtable,defutil,paramgr,
        { pass 1 }
        nbas,
        { parser }
        scanner,
        rax86_64,
-       agx64att,
        { codegen }
-       cgbase
+       cgbase,
+       { constants }
+       agx64att
        ;
 
     function assemble : tnode;
@@ -88,7 +89,7 @@ interface
           is_fpu(aktprocdef.rettype.def) then
          tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_assigned;
        if (not is_void(aktprocdef.rettype.def)) then
-         retstr:=upper(tostr(procinfo^.return_offset)+'('+att_reg2str[procinfo^.framepointer]+')')
+         retstr:=upper(tostr(procinfo.return_offset)+'('+gas_reg2str[procinfo.framepointer]+')')
        else
          retstr:='';
          c:=current_scanner.asmgetchar;
@@ -137,7 +138,7 @@ interface
                                  { is the last written character an special }
                                  { char ?                                   }
                                  if (s[length(s)]='%') and
-                                    paramanager.ret_in_acc(aktprocdef.rettype.def) and
+                                    paramanager.ret_in_acc(aktprocdef.rettype.def,aktprocdef.proccalloption) and
                                     ((pos('AX',upper(hs))>0) or
                                     (pos('AL',upper(hs))>0)) then
                                    tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_assigned;
@@ -169,14 +170,14 @@ interface
                                                hs:=tvarsym(sym).mangledname
                                              else
                                                hs:='-'+tostr(tvarsym(sym).address)+
-                                                   '('+att_reg2str[procinfo^.framepointer]+')';
+                                                   '('+gas_reg2str[procinfo.framepointer]+')';
                                              end
                                            else
                                            { call to local function }
                                            if (sym.typ=procsym) and ((pos('CALL',upper(s))>0) or
                                               (pos('LEA',upper(s))>0)) then
                                              begin
-                                                hs:=tprocsym(sym).defs^.def.mangledname;
+                                                hs:=tprocsym(sym).first_procdef.mangledname;
                                              end;
                                         end
                                       else
@@ -192,7 +193,7 @@ interface
                                                      l:=tvarsym(sym).address;
                                                      { set offset }
                                                      inc(l,aktprocdef.parast.address_fixup);
-                                                     hs:=tostr(l)+'('+att_reg2str[procinfo^.framepointer]+')';
+                                                     hs:=tostr(l)+'('+gas_reg2str[procinfo.framepointer]+')';
                                                      if pos(',',s) > 0 then
                                                        tvarsym(sym).varstate:=vs_used;
                                                   end;
@@ -224,10 +225,10 @@ interface
                                                      { procs can be called or the address can be loaded }
                                                      if ((pos('CALL',upper(s))>0) or (pos('LEA',upper(s))>0)) then
                                                       begin
-                                                        if assigned(tprocsym(sym).defs^.def) then
+                                                        if tprocsym(sym).procdef_count>1 then
                                                           Message1(asmr_w_direct_global_is_overloaded_func,hs);
-                                                        Message2(asmr_h_direct_global_to_mangled,hs,tprocsym(sym).defs^.def.mangledname);
-                                                        hs:=tprocsym(sym).defs^.def.mangledname;
+                                                        Message2(asmr_h_direct_global_to_mangled,hs,tprocsym(sym).first_procdef.mangledname);
+                                                        hs:=tprocsym(sym).first_procdef.mangledname;
                                                       end;
                                                    end;
                                                  else
@@ -236,9 +237,9 @@ interface
                                              end
                                            else if upper(hs)='__SELF' then
                                              begin
-                                                if assigned(procinfo^._class) then
-                                                  hs:=tostr(procinfo^.selfpointer_offset)+
-                                                      '('+att_reg2str[procinfo^.framepointer]+')'
+                                                if assigned(procinfo._class) then
+                                                  hs:=tostr(procinfo.selfpointer_offset)+
+                                                      '('+gas_reg2str[procinfo.framepointer]+')'
                                                 else
                                                  Message(asmr_e_cannot_use_SELF_outside_a_method);
                                              end
@@ -254,8 +255,8 @@ interface
                                                 { complicate to check there }
                                                 { we do it: }
                                                 if lexlevel>normal_function_level then
-                                                  hs:=tostr(procinfo^.framepointer_offset)+
-                                                    '('+att_reg2str[procinfo^.framepointer]+')'
+                                                  hs:=tostr(procinfo.framepointer_offset)+
+                                                    '('+gas_reg2str[procinfo.framepointer]+')'
                                                 else
                                                   Message(asmr_e_cannot_use_OLDEBP_outside_nested_procedure);
                                              end;
@@ -303,16 +304,77 @@ initialization
 end.
 {
   $Log$
-  Revision 1.1  2002-08-10 14:53:38  carl
+  Revision 1.2  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.5  2002/11/25 17:43:27  peter
+    * splitted defbase in defutil,symutil,defcmp
+    * merged isconvertable and is_equal into compare_defs(_ext)
+    * made operator search faster by walking the list only once
+
+  Revision 1.4  2002/11/18 17:32:00  peter
+    * pass proccalloption to ret_in_xxx and push_xxx functions
+
+  Revision 1.3  2002/09/03 16:26:28  daniel
+    * Make Tprocdef.defs protected
+
+  Revision 1.2  2002/08/17 09:23:47  florian
+    * first part of procinfo rewrite
+
+  Revision 1.1  2002/08/10 14:47:50  carl
     + moved target_cpu_string to cpuinfo
     * renamed asmmode enum.
     * assembler reader has now less ifdef's
     * move from nppcmem.pas -> ncgmem.pas vec. node.
 
-  Revision 1.2  2002/07/25 22:55:34  florian
-    * several fixes, small test units can be compiled
+  Revision 1.21  2002/07/20 11:58:05  florian
+    * types.pas renamed to defbase.pas because D6 contains a types
+      unit so this would conflicts if D6 programms are compiled
+    + Willamette/SSE2 instructions to assembler added
+
+  Revision 1.20  2002/07/11 14:41:34  florian
+    * start of the new generic parameter handling
+
+  Revision 1.19  2002/07/01 18:46:34  peter
+    * internal linker
+    * reorganized aasm layer
+
+  Revision 1.18  2002/05/18 13:34:26  peter
+    * readded missing revisions
+
+  Revision 1.17  2002/05/16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.15  2002/05/12 16:53:18  peter
+    * moved entry and exitcode to ncgutil and cgobj
+    * foreach gets extra argument for passing local data to the
+      iterator function
+    * -CR checks also class typecasts at runtime by changing them
+      into as
+    * fixed compiler to cycle with the -CR option
+    * fixed stabs with elf writer, finally the global variables can
+      be watched
+    * removed a lot of routines from cga unit and replaced them by
+      calls to cgobj
+    * u32bit-s32bit updates for and,or,xor nodes. When one element is
+      u32bit then the other is typecasted also to u32bit without giving
+      a rangecheck warning/error.
+    * fixed pascal calling method with reversing also the high tree in
+      the parast, detected by tcalcst3 test
+
+  Revision 1.14  2002/04/15 19:12:09  carl
+  + target_info.size_of_pointer -> pointer_size
+  + some cleanup of unused types/variables
+  * move several constants from cpubase to their specific units
+    (where they are used)
+  + att_Reg2str -> gas_reg2str
+  + int_reg2str -> std_reg2str
 
-  Revision 1.1  2002/07/24 22:38:15  florian
-    + initial release of x86-64 target code
+  Revision 1.13  2002/04/14 17:01:52  carl
+  + att_reg2str -> gas_reg2str
 
 }

+ 15 - 11
compiler/x86_64/rax86_64.pas

@@ -182,7 +182,7 @@ end;
 
 Procedure FWaitWarning;
 begin
-  if (target_info.target=target_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
+  if (target_info.system=system_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
    Message(asmr_w_fwait_emu_prob);
 end;
 
@@ -192,14 +192,14 @@ end;
 
 Procedure T386Operand.SetCorrectSize(opcode:tasmop);
 begin
-  if att_needsuffix[opcode]=attsufFPU then
+  if gas_needsuffix[opcode]=attsufFPU then
     begin
      case size of
       S_L : size:=S_FS;
       S_IQ : size:=S_FL;
      end;
     end
-  else if att_needsuffix[opcode]=attsufFPUint then
+  else if gas_needsuffix[opcode]=attsufFPUint then
     begin
       case size of
       S_W : size:=S_IS;
@@ -492,7 +492,7 @@ begin
        else if opcode=A_FDIVR then
          opcode:=A_FDIVRP;
 {$ifdef ATTOP}
-       message1(asmr_w_fadd_to_faddp,att_op2str[opcode]);
+       message1(asmr_w_fadd_to_faddp,gas_op2str[opcode]);
 {$else}
   {$ifdef INTELOP}
        message1(asmr_w_fadd_to_faddp,std_op2str[opcode]);
@@ -516,10 +516,10 @@ begin
       (opcode=A_FDIVR)) then
      begin
 {$ifdef ATTOP}
-       message1(asmr_w_adding_explicit_args_fXX,att_op2str[opcode]);
+       message1(asmr_w_adding_explicit_args_fXX,gas_op2str[opcode]);
 {$else}
   {$ifdef INTELOP}
-       message1(asmr_w_adding_explicit_args_fXX,att_op2str[opcode]);
+       message1(asmr_w_adding_explicit_args_fXX,gas_op2str[opcode]);
   {$else}
        message1(asmr_w_adding_explicit_args_fXX,'fXX');
   {$endif INTELOP}
@@ -541,7 +541,7 @@ begin
       (opcode=A_FMULP)) then
      begin
 {$ifdef ATTOP}
-       message1(asmr_w_adding_explicit_first_arg_fXX,att_op2str[opcode]);
+       message1(asmr_w_adding_explicit_first_arg_fXX,gas_op2str[opcode]);
 {$else}
   {$ifdef INTELOP}
        message1(asmr_w_adding_explicit_first_arg_fXX,std_op2str[opcode]);
@@ -566,7 +566,7 @@ begin
       (opcode=A_FMUL)) then
      begin
 {$ifdef ATTOP}
-       message1(asmr_w_adding_explicit_second_arg_fXX,att_op2str[opcode]);
+       message1(asmr_w_adding_explicit_second_arg_fXX,gas_op2str[opcode]);
 {$else}
   {$ifdef INTELOP}
        message1(asmr_w_adding_explicit_second_arg_fXX,std_op2str[opcode]);
@@ -587,8 +587,8 @@ begin
      So I think its at least a good idea to add a warning
      if someone uses this in assembler code
      FPC itself does not use it at all PM }
-   if (opcode=A_ENTER) and ((target_info.target=target_i386_linux) or
-        (target_info.target=target_i386_FreeBSD)) then
+   if (opcode=A_ENTER) and ((target_info.system=system_i386_linux) or
+        (target_info.system=system_i386_FreeBSD)) then
      begin
        message(asmr_w_enter_not_supported_by_linux);
      end;
@@ -655,7 +655,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  2002-07-24 22:38:15  florian
+  Revision 1.2  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.1  2002/07/24 22:38:15  florian
     + initial release of x86-64 target code
 
   Revision 1.22  2002/07/01 18:46:34  peter

+ 8 - 6
compiler/x86_64/rgcpu.pas

@@ -258,7 +258,7 @@ unit rgcpu;
           exit;
          r := makeregsize(r,OS_INT);
          if (r = R_EDI) or
-            ((not assigned(procinfo^._class)) and (r = R_ESI)) then
+            ((not assigned(procinfo._class)) and (r = R_ESI)) then
            begin
              list.concat(tai_regalloc.DeAlloc(r));
              exit;
@@ -408,8 +408,7 @@ unit rgcpu;
       const s: tregisterset);
 
       begin
-        if (aktoptprocessor in [class386,classP5]) or
-           (CS_LittleSize in aktglobalswitches) then
+        if (CS_LittleSize in aktglobalswitches) then
           pushusedregisters(list,saved,s)
         else
           inherited saveusedregisters(list,saved,s);
@@ -420,8 +419,7 @@ unit rgcpu;
       const saved : tpushedsaved);
 
       begin
-        if (aktoptprocessor in [class386,classP5]) or
-           (CS_LittleSize in aktglobalswitches) then
+        if (CS_LittleSize in aktglobalswitches) then
           popusedregisters(list,saved)
         else
           inherited restoreusedregisters(list,saved);
@@ -475,7 +473,11 @@ end.
 
 {
   $Log$
-  Revision 1.2  2002-07-25 22:55:34  florian
+  Revision 1.3  2003-01-05 13:36:54  florian
+    * x86-64 compiles
+    + very basic support for float128 type (x86-64 only)
+
+  Revision 1.2  2002/07/25 22:55:34  florian
     * several fixes, small test units can be compiled
 
   Revision 1.1  2002/07/24 22:38:15  florian

+ 82 - 1
compiler/x86_64/x64att.inc

@@ -270,6 +270,7 @@
 'prefetch',
 'prefetchw',
 'pslld',
+'pslldq',
 'psllq',
 'psllw',
 'psrad',
@@ -465,5 +466,85 @@
 'pi2fw',
 'pf2iw',
 'pswapd',
-'ffreep'
+'ffreep',
+'maskmovdqu',
+'clflush',
+'movntdq',
+'movnti',
+'movntpd',
+'pause',
+'lfence',
+'mfence',
+'movdqa',
+'movdqu',
+'movdq2q',
+'movq2dq',
+'paddq',
+'pmuludq',
+'pshufd',
+'pshufhw',
+'pshuflw',
+'psrldq',
+'psubq',
+'punpckhqdq',
+'punpcklqdq',
+'addpd',
+'andnpd',
+'andpd',
+'cmpeqpd',
+'cmpeqsd',
+'cmplepd',
+'cmplesd',
+'cmpltpd',
+'cmpltsd',
+'cmpneqpd',
+'cmpnlepd',
+'cmpnlesd',
+'cmpnltpd',
+'cmpnltsd',
+'cmpordpd',
+'cmpordsd',
+'cmpunordpd',
+'cmpunordsd',
+'cmppd',
+'comisd',
+'cvtdq2pd',
+'cvtdq2ps',
+'cvtpd2dq',
+'cvtpd2pi',
+'cvtpd2ps',
+'cvtpi2pd',
+'cvtps2dq',
+'cvtps2pd',
+'cvtsd2si',
+'cvtsd2ss',
+'cvtsi2sd',
+'cvtss2sd',
+'cvttpd2pi',
+'cvttpd2dq',
+'cvttps2dq',
+'cvttsd2si',
+'divpd',
+'divsd',
+'maxpd',
+'maxsd',
+'minpd',
+'minsd',
+'movapd',
+'movhpd',
+'movlpd',
+'movmskpd',
+'movupd',
+'mulpd',
+'mulsd',
+'orpd',
+'shufpd',
+'sqrtpd',
+'sqrtsd',
+'subpd',
+'subsd',
+'ucomisd',
+'unpckhpd',
+'unpcklpd',
+'xorpd'
 );

+ 81 - 0
compiler/x86_64/x64atts.inc

@@ -291,6 +291,7 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
@@ -465,5 +466,85 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE
 );

+ 82 - 1
compiler/x86_64/x86_64in.inc

@@ -270,6 +270,7 @@
 'prefetch',
 'prefetchw',
 'pslld',
+'pslldq',
 'psllq',
 'psllw',
 'psrad',
@@ -465,5 +466,85 @@
 'pi2fw',
 'pf2iw',
 'pswapd',
-'ffreep'
+'ffreep',
+'maskmovdqu',
+'clflush',
+'movntdq',
+'movnti',
+'movntpd',
+'pause',
+'lfence',
+'mfence',
+'movdqa',
+'movdqu',
+'movdq2q',
+'movq2dq',
+'paddq',
+'pmuludq',
+'pshufd',
+'pshufhw',
+'pshuflw',
+'psrldq',
+'psubq',
+'punpckhqdq',
+'punpcklqdq',
+'addpd',
+'andnpd',
+'andpd',
+'cmpeqpd',
+'cmpeqsd',
+'cmplepd',
+'cmplesd',
+'cmpltpd',
+'cmpltsd',
+'cmpneqpd',
+'cmpnlepd',
+'cmpnlesd',
+'cmpnltpd',
+'cmpnltsd',
+'cmpordpd',
+'cmpordsd',
+'cmpunordpd',
+'cmpunordsd',
+'cmppd',
+'comisd',
+'cvtdq2pd',
+'cvtdq2ps',
+'cvtpd2dq',
+'cvtpd2pi',
+'cvtpd2ps',
+'cvtpi2pd',
+'cvtps2dq',
+'cvtps2pd',
+'cvtsd2si',
+'cvtsd2ss',
+'cvtsi2sd',
+'cvtss2sd',
+'cvttpd2pi',
+'cvttpd2dq',
+'cvttps2dq',
+'cvttsd2si',
+'divpd',
+'divsd',
+'maxpd',
+'maxsd',
+'minpd',
+'minsd',
+'movapd',
+'movhpd',
+'movlpd',
+'movmskpd',
+'movupd',
+'mulpd',
+'mulsd',
+'orpd',
+'shufpd',
+'sqrtpd',
+'sqrtsd',
+'subpd',
+'subsd',
+'ucomisd',
+'unpckhpd',
+'unpcklpd',
+'xorpd'
 );

+ 2 - 0
compiler/x86_64/x86_64no.inc

@@ -0,0 +1,2 @@
+{ don't edit, this file is generated from i386ins.dat }
+1624;

+ 82 - 1
compiler/x86_64/x86_64op.inc

@@ -270,6 +270,7 @@ A_POR,
 A_PREFETCH,
 A_PREFETCHW,
 A_PSLLD,
+A_PSLLDQ,
 A_PSLLQ,
 A_PSLLW,
 A_PSRAD,
@@ -465,5 +466,85 @@ A_PFPNACC,
 A_PI2FW,
 A_PF2IW,
 A_PSWAPD,
-A_FFREEP
+A_FFREEP,
+A_MASKMOVDQU,
+A_CLFLUSH,
+A_MOVNTDQ,
+A_MOVNTI,
+A_MOVNTPD,
+A_PAUSE,
+A_LFENCE,
+A_MFENCE,
+A_MOVDQA,
+A_MOVDQU,
+A_MOVDQ2Q,
+A_MOVQ2DQ,
+A_PADDQ,
+A_PMULUDQ,
+A_PSHUFD,
+A_PSHUFHW,
+A_PSHUFLW,
+A_PSRLDQ,
+A_PSUBQ,
+A_PUNPCKHQDQ,
+A_PUNPCKLQDQ,
+A_ADDPD,
+A_ANDNPD,
+A_ANDPD,
+A_CMPEQPD,
+A_CMPEQSD,
+A_CMPLEPD,
+A_CMPLESD,
+A_CMPLTPD,
+A_CMPLTSD,
+A_CMPNEQPD,
+A_CMPNLEPD,
+A_CMPNLESD,
+A_CMPNLTPD,
+A_CMPNLTSD,
+A_CMPORDPD,
+A_CMPORDSD,
+A_CMPUNORDPD,
+A_CMPUNORDSD,
+A_CMPPD,
+A_COMISD,
+A_CVTDQ2PD,
+A_CVTDQ2PS,
+A_CVTPD2DQ,
+A_CVTPD2PI,
+A_CVTPD2PS,
+A_CVTPI2PD,
+A_CVTPS2DQ,
+A_CVTPS2PD,
+A_CVTSD2SI,
+A_CVTSD2SS,
+A_CVTSI2SD,
+A_CVTSS2SD,
+A_CVTTPD2PI,
+A_CVTTPD2DQ,
+A_CVTTPS2DQ,
+A_CVTTSD2SI,
+A_DIVPD,
+A_DIVSD,
+A_MAXPD,
+A_MAXSD,
+A_MINPD,
+A_MINSD,
+A_MOVAPD,
+A_MOVHPD,
+A_MOVLPD,
+A_MOVMSKPD,
+A_MOVUPD,
+A_MULPD,
+A_MULSD,
+A_ORPD,
+A_SHUFPD,
+A_SQRTPD,
+A_SQRTSD,
+A_SUBPD,
+A_SUBSD,
+A_UCOMISD,
+A_UNPCKHPD,
+A_UNPCKLPD,
+A_XORPD
 );

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 711 - 4
compiler/x86_64/x86_64ta.inc


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است