Browse Source

* fixed exception reason size for 64 bit systems

florian 21 years ago
parent
commit
01d16548f4
4 changed files with 32 additions and 50 deletions
  1. 5 2
      compiler/ncgutil.pas
  2. 13 11
      compiler/x86/cgx86.pas
  3. 4 33
      compiler/x86/cpubase.pas
  4. 10 4
      compiler/x86_64/cgcpu.pas

+ 5 - 2
compiler/ncgutil.pas

@@ -321,7 +321,7 @@ implementation
          if not onlyfree then
          if not onlyfree then
           begin
           begin
             cg.g_exception_reason_load(list, href);
             cg.g_exception_reason_load(list, href);
-            cg.a_cmp_const_reg_label(list,OS_S32,OC_EQ,a,NR_FUNCTION_RESULT_REG,endexceptlabel);
+            cg.a_cmp_const_reg_label(list,OS_INT,OC_EQ,a,NR_FUNCTION_RESULT_REG,endexceptlabel);
           end;
           end;
      end;
      end;
 
 
@@ -2141,7 +2141,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.192  2004-02-08 17:48:59  jonas
+  Revision 1.193  2004-02-22 18:27:21  florian
+    * fixed exception reason size for 64 bit systems
+
+  Revision 1.192  2004/02/08 17:48:59  jonas
     * fixed regvars
     * fixed regvars
 
 
   Revision 1.191  2004/02/05 19:35:27  florian
   Revision 1.191  2004/02/05 19:35:27  florian

+ 13 - 11
compiler/x86/cgx86.pas

@@ -1477,22 +1477,21 @@ unit cgx86;
 
 
 
 
     procedure tcgx86.g_exception_reason_save(list : taasmoutput; const href : treference);
     procedure tcgx86.g_exception_reason_save(list : taasmoutput; const href : treference);
+      begin
+        list.concat(Taicpu.op_reg(A_PUSH,tcgsize2opsize[OS_INT],NR_FUNCTION_RESULT_REG));
+      end;
 
 
-    begin
-        list.concat(Taicpu.op_reg(A_PUSH,tcgsize2opsize[OS_ADDR],NR_FUNCTION_RESULT_REG));
-    end;
 
 
     procedure tcgx86.g_exception_reason_save_const(list : taasmoutput;const href : treference; a: aword);
     procedure tcgx86.g_exception_reason_save_const(list : taasmoutput;const href : treference; a: aword);
+      begin
+        list.concat(Taicpu.op_const(A_PUSH,tcgsize2opsize[OS_INT],a));
+      end;
 
 
-    begin
-        list.concat(Taicpu.op_const(A_PUSH,tcgsize2opsize[OS_ADDR],a));
-    end;
 
 
     procedure tcgx86.g_exception_reason_load(list : taasmoutput; const href : treference);
     procedure tcgx86.g_exception_reason_load(list : taasmoutput; const href : treference);
-
-    begin
-        list.concat(Taicpu.op_reg(A_POP,tcgsize2opsize[OS_ADDR],NR_FUNCTION_RESULT_REG));
-    end;
+      begin
+        list.concat(Taicpu.op_reg(A_POP,tcgsize2opsize[OS_INT],NR_FUNCTION_RESULT_REG));
+      end;
 
 
 
 
 {****************************************************************************
 {****************************************************************************
@@ -1781,7 +1780,10 @@ unit cgx86;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.113  2004-02-22 16:48:10  florian
+  Revision 1.114  2004-02-22 18:27:21  florian
+    * fixed exception reason size for 64 bit systems
+
+  Revision 1.113  2004/02/22 16:48:10  florian
     * x86_64 uses generic concatcopy_valueopenarray for now
     * x86_64 uses generic concatcopy_valueopenarray for now
 
 
   Revision 1.112  2004/02/21 19:46:37  florian
   Revision 1.112  2004/02/21 19:46:37  florian

+ 4 - 33
compiler/x86/cpubase.pas

@@ -321,39 +321,7 @@ uses
       LOC_CSSEREGISTER = LOC_CMMREGISTER;
       LOC_CSSEREGISTER = LOC_CMMREGISTER;
 
 
       max_operands = 3;
       max_operands = 3;
-
-      maxfpuregs = 8;
-
-(*
-      { low and high of the available maximum width integer general purpose }
-      { registers                                                            }
-      LoGPReg = RS_EAX;
-      HiGPReg = RS_EDX;
-
-      { Table of registers which can be allocated by the code generator
-        internally, when generating the code.
-      }
-      { legend:                                                                }
-      { xxxregs = set of all possibly used registers of that type in the code  }
-      {           generator                                                    }
-      { usableregsxxx = set of all 32bit components of registers that can be   }
-      {           possible allocated to a regvar or using getregisterxxx (this }
-      {           excludes registers which can be only used for parameter      }
-      {           passing on ABI's that define this)                           }
-      { c_countusableregsxxx = amount of registers in the usableregsxxx set    }
-
-//      maxintregs = 4;
-//      intregs = [R_EAX..R_BL]-[R_ESI,R_SI];
-      { to determine how many registers to use for regvars }
-      maxintscratchregs = 1;
-
       maxfpuregs = 8;
       maxfpuregs = 8;
-      usableregsfpu = [];
-      c_countusableregsfpu = 0;
-
-      usableregsmm = [RS_MM0..RS_MM7];
-      c_countusableregsmm  = 8;
-*)
 
 
 {*****************************************************************************
 {*****************************************************************************
                             CPU Dependent Constants
                             CPU Dependent Constants
@@ -539,7 +507,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.40  2004-02-05 18:28:37  peter
+  Revision 1.41  2004-02-22 18:27:21  florian
+    * fixed exception reason size for 64 bit systems
+
+  Revision 1.40  2004/02/05 18:28:37  peter
     * x86_64 fixes for opsize
     * x86_64 fixes for opsize
 
 
   Revision 1.39  2004/02/04 22:01:13  peter
   Revision 1.39  2004/02/04 22:01:13  peter

+ 10 - 4
compiler/x86_64/cgcpu.pas

@@ -55,10 +55,13 @@ unit cgcpu;
       begin
       begin
         inherited init_register_allocators;
         inherited init_register_allocators;
         if cs_create_pic in aktmoduleswitches then
         if cs_create_pic in aktmoduleswitches then
-          rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_EAX,RS_EDX,RS_ECX,RS_ESI,RS_EDI],first_int_imreg,[RS_EBP,RS_EBX])
+          rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_RAX,RS_RDX,RS_RCX,RS_RSI,RS_RDI,
+            RS_R8,RS_R9,RS_R10,RS_R11,RS_R12,RS_R13,RS_R14,RS_R15],first_int_imreg,[RS_EBP,RS_EBX])
         else
         else
-          rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_EAX,RS_EDX,RS_ECX,RS_EBX,RS_ESI,RS_EDI],first_int_imreg,[RS_EBP]);
-        rg[R_MMXREGISTER]:=trgcpu.create(R_MMXREGISTER,R_SUBNONE,[RS_XMM0,RS_XMM1,RS_XMM2,RS_XMM3,RS_XMM4,RS_XMM5,RS_XMM6,RS_XMM7],first_sse_imreg,[]);
+          rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,[RS_RAX,RS_RDX,RS_RCX,RS_RBX,RS_RSI,RS_RDI,
+          RS_R8,RS_R9,RS_R10,RS_R11,RS_R12,RS_R13,RS_R14,RS_R15],first_int_imreg,[RS_EBP]);
+        rg[R_MMXREGISTER]:=trgcpu.create(R_MMXREGISTER,R_SUBNONE,[RS_XMM0,RS_XMM1,RS_XMM2,RS_XMM3,RS_XMM4,RS_XMM5,RS_XMM6,RS_XMM7,
+          RS_XMM8,RS_XMM9,RS_XMM10,RS_XMM11,RS_XMM12,RS_XMM13,RS_XMM14,RS_XMM15],first_sse_imreg,[]);
         rg[R_MMREGISTER]:=trgcpu.create(R_MMREGISTER,R_SUBNONE,[RS_XMM0,RS_XMM1,RS_XMM2,RS_XMM3,RS_XMM4,RS_XMM5,RS_XMM6,RS_XMM7],first_sse_imreg,[]);
         rg[R_MMREGISTER]:=trgcpu.create(R_MMREGISTER,R_SUBNONE,[RS_XMM0,RS_XMM1,RS_XMM2,RS_XMM3,RS_XMM4,RS_XMM5,RS_XMM6,RS_XMM7],first_sse_imreg,[]);
         rgfpu:=Trgx86fpu.create;
         rgfpu:=Trgx86fpu.create;
       end;
       end;
@@ -108,7 +111,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2004-02-09 22:14:17  peter
+  Revision 1.12  2004-02-22 18:27:21  florian
+    * fixed exception reason size for 64 bit systems
+
+  Revision 1.11  2004/02/09 22:14:17  peter
     * more x86_64 parameter fixes
     * more x86_64 parameter fixes
     * tparalocation.lochigh is now used to indicate if registerhigh
     * tparalocation.lochigh is now used to indicate if registerhigh
       is used and what the type is
       is used and what the type is