Kaynağa Gözat

* commented out more obsolete constants

peter 22 yıl önce
ebeveyn
işleme
0939085ab1

+ 4 - 4
compiler/i386/rgcpu.pas

@@ -56,7 +56,6 @@ unit rgcpu;
           { these counters contain the number of elements in the }
           { these counters contain the number of elements in the }
           { unusedregsxxx/usableregsxxx sets                     }
           { unusedregsxxx/usableregsxxx sets                     }
           countunusedregsfpu : byte;
           countunusedregsfpu : byte;
-          countusableregsfpu : byte;
 
 
           { Contains the registers which are really used by the proc itself.
           { Contains the registers which are really used by the proc itself.
             It doesn't take care of registers used by called procedures
             It doesn't take care of registers used by called procedures
@@ -130,9 +129,7 @@ implementation
       begin
       begin
         used_in_proc:=[];
         used_in_proc:=[];
         t_times := 0;
         t_times := 0;
-        countusableregsfpu:=c_countusableregsfpu;
         unusedregsfpu:=usableregsfpu;
         unusedregsfpu:=usableregsfpu;
-        countunusedregsfpu:=countusableregsfpu;
       end;
       end;
 
 
 
 
@@ -253,7 +250,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.39  2003-10-17 14:38:32  peter
+  Revision 1.40  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.39  2003/10/17 14:38:32  peter
     * 64k registers supported
     * 64k registers supported
     * fixed some memory leaks
     * fixed some memory leaks
 
 

+ 7 - 7
compiler/ncgutil.pas

@@ -154,12 +154,7 @@ implementation
                  (p.location.loc<>LOC_FPUREGISTER)
                  (p.location.loc<>LOC_FPUREGISTER)
                 ) and
                 ) and
                 (p.left.registers32<p.right.registers32)
                 (p.left.registers32<p.right.registers32)
-               ) and
-               { the following check is appropriate, because all }
-               { 4 registers are rarely used and it is thereby   }
-               { achieved that the extra code is being dropped   }
-               { by exchanging not commutative operators     }
-               (p.right.registers32<=c_countusableregsint)
+               )
               ) then
               ) then
             begin
             begin
               hp:=p.left;
               hp:=p.left;
@@ -667,6 +662,7 @@ implementation
 
 
     function maybe_pushfpu(list:taasmoutput;needed : byte;var l:tlocation) : boolean;
     function maybe_pushfpu(list:taasmoutput;needed : byte;var l:tlocation) : boolean;
       begin
       begin
+{$ifdef i386}
         if (needed>=maxfpuregs) and
         if (needed>=maxfpuregs) and
            (l.loc = LOC_FPUREGISTER) then
            (l.loc = LOC_FPUREGISTER) then
           begin
           begin
@@ -675,6 +671,7 @@ implementation
           end
           end
         else
         else
           maybe_pushfpu:=false;
           maybe_pushfpu:=false;
+{$endif i386}
       end;
       end;
 
 
 
 
@@ -1960,7 +1957,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.159  2003-10-17 14:38:32  peter
+  Revision 1.160  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.159  2003/10/17 14:38:32  peter
     * 64k registers supported
     * 64k registers supported
     * fixed some memory leaks
     * fixed some memory leaks
 
 

+ 6 - 1
compiler/pass_2.pas

@@ -290,8 +290,10 @@ implementation
 }
 }
 {$endif EXTDEBUG}
 {$endif EXTDEBUG}
 
 
+{$ifdef i386}
               if assigned(current_procinfo.procdef) then
               if assigned(current_procinfo.procdef) then
                 current_procinfo.procdef.fpu_used:=p.registersfpu;
                 current_procinfo.procdef.fpu_used:=p.registersfpu;
+{$endif i386}
 
 
            end;
            end;
          current_procinfo.aktproccode.concatlist(exprasmlist);
          current_procinfo.aktproccode.concatlist(exprasmlist);
@@ -300,7 +302,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.69  2003-10-10 17:48:13  peter
+  Revision 1.70  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.69  2003/10/10 17:48:13  peter
     * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
     * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
     * tregisteralloctor renamed to trgobj
     * tregisteralloctor renamed to trgobj
     * removed rgobj from a lot of units
     * removed rgobj from a lot of units

+ 10 - 7
compiler/powerpc/cgcpu.pas

@@ -1016,7 +1016,7 @@ const
 
 
         usesgpr:=false;
         usesgpr:=false;
         if not (po_assembler in current_procinfo.procdef.procoptions) then
         if not (po_assembler in current_procinfo.procdef.procoptions) then
-          for regcounter2:=firstsaveintreg to RS_R31 do
+          for regcounter2:=RS_R13 to RS_R31 do
             begin
             begin
               if supregset_in(rgint.used_in_proc,regcounter2) then
               if supregset_in(rgint.used_in_proc,regcounter2) then
                 begin
                 begin
@@ -1125,7 +1125,7 @@ const
                a_call_name(objectlibrary.newasmsymbol('_savegpr_'+tostr(ord(firstreggpr)-ord(R_14)+14))
                a_call_name(objectlibrary.newasmsymbol('_savegpr_'+tostr(ord(firstreggpr)-ord(R_14)+14))
              }
              }
             reference_reset_base(href,NR_R12,-4);
             reference_reset_base(href,NR_R12,-4);
-            for regcounter2:=firstsaveintreg to RS_R31 do
+            for regcounter2:=RS_R13 to RS_R31 do
               begin
               begin
                 if supregset_in(rgint.used_in_proc,regcounter2) then
                 if supregset_in(rgint.used_in_proc,regcounter2) then
                   begin
                   begin
@@ -1230,7 +1230,7 @@ const
 
 
         usesgpr:=false;
         usesgpr:=false;
         if not (po_assembler in current_procinfo.procdef.procoptions) then
         if not (po_assembler in current_procinfo.procdef.procoptions) then
-          for regcounter2:=firstsaveintreg to RS_R31 do
+          for regcounter2:=RS_R13 to RS_R31 do
             begin
             begin
               if supregset_in(rgint.used_in_proc,regcounter2) then
               if supregset_in(rgint.used_in_proc,regcounter2) then
                 begin
                 begin
@@ -1264,7 +1264,7 @@ const
              else
              else
                reference_reset_base(href,NR_R12,-4);
                reference_reset_base(href,NR_R12,-4);
 
 
-            for regcounter2:=firstsaveintreg to RS_R31 do
+            for regcounter2:=RS_R13 to RS_R31 do
               begin
               begin
                 if supregset_in(rgint.used_in_proc,regcounter2) then
                 if supregset_in(rgint.used_in_proc,regcounter2) then
                   begin
                   begin
@@ -1360,7 +1360,7 @@ const
          end;
          end;
       usesgpr:=false;
       usesgpr:=false;
       if not (po_assembler in current_procinfo.procdef.procoptions) then
       if not (po_assembler in current_procinfo.procdef.procoptions) then
-        for regcounter2:=firstsaveintreg to RS_R31 do
+        for regcounter2:=RS_R13 to RS_R31 do
           begin
           begin
             if supregset_in(rgint.used_in_proc,regcounter2) then
             if supregset_in(rgint.used_in_proc,regcounter2) then
               begin
               begin
@@ -2117,7 +2117,7 @@ const
                  { a register here, we must first reallocate the index register, since }
                  { a register here, we must first reallocate the index register, since }
                  { otherwise it may be overwritten (and it's still used afterwards)    }
                  { otherwise it may be overwritten (and it's still used afterwards)    }
                  freeindex := false;
                  freeindex := false;
-                 if (getsupreg(ref.index) >= first_int_supreg) and
+                 if (getsupreg(ref.index) < first_int_imreg) and
                     (supregset_in(rgint.unusedregs,getsupreg(ref.index))) then
                     (supregset_in(rgint.unusedregs,getsupreg(ref.index))) then
                    begin
                    begin
                      rgint.getexplicitregister(list,ref.index);
                      rgint.getexplicitregister(list,ref.index);
@@ -2436,7 +2436,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.131  2003-10-17 14:52:07  peter
+  Revision 1.132  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.131  2003/10/17 14:52:07  peter
     * fixed ppc build
     * fixed ppc build
 
 
   Revision 1.130  2003/10/17 01:22:08  florian
   Revision 1.130  2003/10/17 01:22:08  florian

+ 7 - 15
compiler/powerpc/cpubase.pas

@@ -116,24 +116,13 @@ uses
       {$i rppccon.inc}
       {$i rppccon.inc}
 
 
       { Integer Super registers first and last }
       { Integer Super registers first and last }
-      first_int_supreg = RS_R0;
-      last_int_supreg = RS_R31;
-
       first_int_imreg = $20;
       first_int_imreg = $20;
-      last_int_imreg = $fe;
 
 
       { Float Super register first and last }
       { Float Super register first and last }
-      first_fpu_supreg    = $00;
-      last_fpu_supreg     = $1f;
-
       first_fpu_imreg     = $20;
       first_fpu_imreg     = $20;
-      last_fpu_imreg      = $fe;
 
 
       { MM Super register first and last }
       { MM Super register first and last }
-      first_mm_supreg    = RS_INVALID;
-      last_mm_supreg     = RS_INVALID;
-      first_mm_imreg     = RS_INVALID;
-      last_mm_imreg      = RS_INVALID;
+      first_mm_imreg     = $0;
 
 
 {$warning TODO Calculate bsstart}
 {$warning TODO Calculate bsstart}
       regnumber_count_bsstart = 64;
       regnumber_count_bsstart = 64;
@@ -361,8 +350,7 @@ uses
     const
     const
       max_operands = 5;
       max_operands = 5;
 
 
-      general_superregisters = [RS_R0..RS_R31];
-
+(*
       {# Table of registers which can be allocated by the code generator
       {# Table of registers which can be allocated by the code generator
          internally, when generating the code.
          internally, when generating the code.
       }
       }
@@ -426,6 +414,7 @@ uses
         (R_M1,R_M2,R_M3,R_M4,R_M5,R_M6,R_M7,R_M8,R_M9,R_M10,R_M11,R_M12,R_M13);
         (R_M1,R_M2,R_M3,R_M4,R_M5,R_M6,R_M7,R_M8,R_M9,R_M10,R_M11,R_M12,R_M13);
 }
 }
 
 
+*)
 
 
 {*****************************************************************************
 {*****************************************************************************
                           Default generic sizes
                           Default generic sizes
@@ -725,7 +714,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.71  2003-10-11 16:06:42  florian
+  Revision 1.72  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.71  2003/10/11 16:06:42  florian
     * fixed some MMX<->SSE
     * fixed some MMX<->SSE
     * started to fix ppc, needs an overhaul
     * started to fix ppc, needs an overhaul
     + stabs info improve for spilling, not sure if it works correctly/completly
     + stabs info improve for spilling, not sure if it works correctly/completly

+ 20 - 1
compiler/symdef.pas

@@ -431,7 +431,9 @@ interface
           procoptions     : tprocoptions;
           procoptions     : tprocoptions;
           maxparacount,
           maxparacount,
           minparacount    : byte;
           minparacount    : byte;
+{$ifdef i386}
           fpu_used        : byte;    { how many stack fpu must be empty }
           fpu_used        : byte;    { how many stack fpu must be empty }
+{$endif i386}
           funcret_paraloc : array[tcallercallee] of tparalocation;
           funcret_paraloc : array[tcallercallee] of tparalocation;
           has_paraloc_info : boolean; { paraloc info is available }
           has_paraloc_info : boolean; { paraloc info is available }
           constructor create(level:byte);
           constructor create(level:byte);
@@ -3101,7 +3103,9 @@ implementation
          proccalloption:=pocall_none;
          proccalloption:=pocall_none;
          procoptions:=[];
          procoptions:=[];
          rettype:=voidtype;
          rettype:=voidtype;
+{$ifdef i386}
          fpu_used:=0;
          fpu_used:=0;
+{$endif i386}
          savesize:=POINTER_SIZE;
          savesize:=POINTER_SIZE;
          has_paraloc_info:=false;
          has_paraloc_info:=false;
       end;
       end;
@@ -3211,9 +3215,11 @@ implementation
       is processed   PM }
       is processed   PM }
     procedure tabstractprocdef.test_if_fpu_result;
     procedure tabstractprocdef.test_if_fpu_result;
       begin
       begin
+{$ifdef i386}
          if assigned(rettype.def) and
          if assigned(rettype.def) and
             (rettype.def.deftype=floatdef) then
             (rettype.def.deftype=floatdef) then
            fpu_used:=maxfpuregs;
            fpu_used:=maxfpuregs;
+{$endif i386}
       end;
       end;
 
 
 
 
@@ -3250,7 +3256,11 @@ implementation
          minparacount:=0;
          minparacount:=0;
          maxparacount:=0;
          maxparacount:=0;
          ppufile.gettype(rettype);
          ppufile.gettype(rettype);
+{$ifdef i386}
          fpu_used:=ppufile.getbyte;
          fpu_used:=ppufile.getbyte;
+{$else}
+         ppufile.getbyte;
+{$endif i386}
          proctypeoption:=tproctypeoption(ppufile.getbyte);
          proctypeoption:=tproctypeoption(ppufile.getbyte);
          proccalloption:=tproccalloption(ppufile.getbyte);
          proccalloption:=tproccalloption(ppufile.getbyte);
          ppufile.getsmallset(procoptions);
          ppufile.getsmallset(procoptions);
@@ -3293,9 +3303,13 @@ implementation
          ppufile.puttype(rettype);
          ppufile.puttype(rettype);
          oldintfcrc:=ppufile.do_interface_crc;
          oldintfcrc:=ppufile.do_interface_crc;
          ppufile.do_interface_crc:=false;
          ppufile.do_interface_crc:=false;
+{$ifdef i386}
          if simplify_ppu then
          if simplify_ppu then
           fpu_used:=0;
           fpu_used:=0;
          ppufile.putbyte(fpu_used);
          ppufile.putbyte(fpu_used);
+{$else}
+         ppufile.putbyte(0);
+{$endif}
          ppufile.putbyte(ord(proctypeoption));
          ppufile.putbyte(ord(proctypeoption));
          ppufile.putbyte(ord(proccalloption));
          ppufile.putbyte(ord(proccalloption));
          ppufile.putsmallset(procoptions);
          ppufile.putsmallset(procoptions);
@@ -4181,10 +4195,12 @@ implementation
         { plausible (PM) }
         { plausible (PM) }
         { a more secure way would be
         { a more secure way would be
           to allways store in a temp }
           to allways store in a temp }
+{$ifdef i386}
         if is_fpu(rettype.def) then
         if is_fpu(rettype.def) then
           fpu_used:={2}maxfpuregs
           fpu_used:={2}maxfpuregs
         else
         else
           fpu_used:=0;
           fpu_used:=0;
+{$endif i386}
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
 
 
         { Write this entry }
         { Write this entry }
@@ -5868,7 +5884,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.180  2003-10-17 14:52:07  peter
+  Revision 1.181  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.180  2003/10/17 14:52:07  peter
     * fixed ppc build
     * fixed ppc build
 
 
   Revision 1.179  2003/10/17 14:38:32  peter
   Revision 1.179  2003/10/17 14:38:32  peter

+ 8 - 1
compiler/x86/cpubase.pas

@@ -314,6 +314,9 @@ uses
 
 
       max_operands = 3;
       max_operands = 3;
 
 
+      maxfpuregs = 8;
+
+(*
       { low and high of the available maximum width integer general purpose }
       { low and high of the available maximum width integer general purpose }
       { registers                                                            }
       { registers                                                            }
       LoGPReg = RS_EAX;
       LoGPReg = RS_EAX;
@@ -342,6 +345,7 @@ uses
 
 
       usableregsmm = [RS_MM0..RS_MM7];
       usableregsmm = [RS_MM0..RS_MM7];
       c_countusableregsmm  = 8;
       c_countusableregsmm  = 8;
+*)
 
 
 {*****************************************************************************
 {*****************************************************************************
                             CPU Dependent Constants
                             CPU Dependent Constants
@@ -554,7 +558,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.26  2003-10-17 14:38:32  peter
+  Revision 1.27  2003-10-17 15:08:34  peter
+    * commented out more obsolete constants
+
+  Revision 1.26  2003/10/17 14:38:32  peter
     * 64k registers supported
     * 64k registers supported
     * fixed some memory leaks
     * fixed some memory leaks