Ver código fonte

* fixed compilation with removed loadref

peter 21 anos atrás
pai
commit
2ee2004032

+ 8 - 14
compiler/arm/cgcpu.pas

@@ -80,13 +80,12 @@ unit cgcpu;
 
         procedure g_flags2reg(list: taasmoutput; size: TCgSize; const f: TResFlags; reg: TRegister); override;
 
-        procedure g_copyvaluepara_openarray(list : taasmoutput;const ref:treference;const lenloc:tlocation;elesize:aint;loadref:boolean);override;
         procedure g_proc_entry(list : taasmoutput;localsize : longint;nostackframe:boolean);override;
         procedure g_proc_exit(list : taasmoutput;parasize : longint;nostackframe:boolean); override;
 
         procedure a_loadaddr_ref_reg(list : taasmoutput;const ref : treference;r : tregister);override;
 
-        procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint;loadref : boolean);override;
+        procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);override;
 
         procedure g_overflowcheck(list: taasmoutput; const l: tlocation; def: tdef); override;
 
@@ -834,11 +833,6 @@ unit cgcpu;
       end;
 
 
-    procedure tcgarm.g_copyvaluepara_openarray(list : taasmoutput;const ref:treference;const lenloc:tlocation;elesize:aint;loadref:boolean);
-      begin
-      end;
-
-
     procedure tcgarm.g_proc_entry(list : taasmoutput;localsize : longint;nostackframe:boolean);
       var
          ref : treference;
@@ -1044,7 +1038,7 @@ unit cgcpu;
       end;
 
 
-    procedure tcgarm.g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint;loadref : boolean);
+    procedure tcgarm.g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);
       var
         srcref,dstref:treference;
         srcreg,destreg,countreg,r:tregister;
@@ -1084,7 +1078,7 @@ unit cgcpu;
         srcref:=source;
         if cs_littlesize in aktglobalswitches then
           helpsize:=8;
-        if not loadref and (len<=helpsize) then
+        if (len<=helpsize) then
           begin
             copysize:=4;
             cgsize:=OS_32;
@@ -1115,10 +1109,7 @@ unit cgcpu;
             reference_reset_base(dstref,destreg,0);
 
             srcreg:=getintregister(list,OS_ADDR);
-            if loadref then
-              a_load_ref_reg(list,OS_ADDR,OS_ADDR,source,srcreg)
-            else
-              a_loadaddr_ref_reg(list,source,srcreg);
+            a_loadaddr_ref_reg(list,source,srcreg);
             reference_reset_base(srcref,srcreg,0);
 
             countreg:=getintregister(list,OS_32);
@@ -1304,7 +1295,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.56  2004-10-24 07:54:25  florian
+  Revision 1.57  2004-10-24 11:53:45  peter
+    * fixed compilation with removed loadref
+
+  Revision 1.56  2004/10/24 07:54:25  florian
     * fixed compilation of arm compiler
 
   Revision 1.55  2004/10/11 15:46:45  peter

+ 5 - 2
compiler/ncgcal.pas

@@ -748,7 +748,7 @@ implementation
                                      reference_reset_base(htempref,tmpparaloc^.reference.index,tmpparaloc^.reference.offset);
                                      { use concatcopy, because it can also be a float which fails when
                                        load_ref_ref is used }
-                                     cg.g_concatcopy(exprasmlist,htempref,href,tcgsize2size[tmpparaloc^.size],false);
+                                     cg.g_concatcopy(exprasmlist,htempref,href,tcgsize2size[tmpparaloc^.size]);
                                    end;
                                  LOC_REGISTER:
                                    cg.a_load_reg_ref(exprasmlist,tmpparaloc^.size,tmpparaloc^.size,tmpparaloc^.register,href);
@@ -1243,7 +1243,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.179  2004-10-24 11:44:28  peter
+  Revision 1.180  2004-10-24 11:53:45  peter
+    * fixed compilation with removed loadref
+
+  Revision 1.179  2004/10/24 11:44:28  peter
     * small regvar fixes
     * loadref parameter removed from concatcopy,incrrefcount,etc
 

+ 27 - 31
compiler/powerpc/cgcpu.pas

@@ -86,7 +86,7 @@ unit cgcpu;
 
         procedure a_loadaddr_ref_reg(list : taasmoutput;const ref : treference;r : tregister);override;
 
-        procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint; loadref : boolean);override;
+        procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);override;
 
         procedure g_overflowcheck(list: taasmoutput; const l: tlocation; def: tdef); override;
         { find out whether a is of the form 11..00..11b or 00..11...00. If }
@@ -1824,7 +1824,7 @@ const
     maxmoveunit = 4;
 {$endif ppc603}
 
-    procedure tcgppc.g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint; loadref : boolean);
+    procedure tcgppc.g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);
 
       var
         countreg: TRegister;
@@ -1841,40 +1841,33 @@ const
 {$endif extdebug}
 
         { make sure short loads are handled as optimally as possible }
-        if not loadref then
-          if (len <= maxmoveunit) and
-             (byte(len) in [1,2,4,8]) then
-            begin
-              if len < 8 then
-                begin
-                  size := int_cgsize(len);
-                  a_load_ref_ref(list,size,size,source,dest);
-                end
-              else
-                begin
-                  a_reg_alloc(list,NR_F0);
-                  a_loadfpu_ref_reg(list,OS_F64,source,NR_F0);
-                  a_loadfpu_reg_ref(list,OS_F64,NR_F0,dest);
-                  a_reg_dealloc(list,NR_F0);
-                end;
-              exit;
-            end;
+        if (len <= maxmoveunit) and
+           (byte(len) in [1,2,4,8]) then
+          begin
+            if len < 8 then
+              begin
+                size := int_cgsize(len);
+                a_load_ref_ref(list,size,size,source,dest);
+              end
+            else
+              begin
+                a_reg_alloc(list,NR_F0);
+                a_loadfpu_ref_reg(list,OS_F64,source,NR_F0);
+                a_loadfpu_reg_ref(list,OS_F64,NR_F0,dest);
+                a_reg_dealloc(list,NR_F0);
+              end;
+            exit;
+          end;
 
         count := len div maxmoveunit;
 
         reference_reset(src);
         reference_reset(dst);
         { load the address of source into src.base }
-        if loadref then
-          begin
-            src.base := rg[R_INTREGISTER].getregister(list,R_SUBWHOLE);
-            a_load_ref_reg(list,OS_32,OS_32,source,src.base);
-            orgsrc := false;
-          end
-        else if (count > 4) or
-                not issimpleref(source) or
-                ((source.index <> NR_NO) and
-                 ((source.offset + longint(len)) > high(smallint))) then
+        if (count > 4) or
+           not issimpleref(source) or
+           ((source.index <> NR_NO) and
+            ((source.offset + longint(len)) > high(smallint))) then
           begin
             src.base := rg[R_INTREGISTER].getregister(list,R_SUBWHOLE);
             a_loadaddr_ref_reg(list,source,src.base);
@@ -2373,7 +2366,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.180  2004-10-20 07:32:42  jonas
+  Revision 1.181  2004-10-24 11:53:45  peter
+    * fixed compilation with removed loadref
+
+  Revision 1.180  2004/10/20 07:32:42  jonas
     + support for nostackframe directive
 
   Revision 1.179  2004/10/11 07:13:14  jonas

+ 12 - 24
compiler/sparc/cgcpu.pas

@@ -88,8 +88,8 @@ interface
         procedure g_restore_standard_registers(list:taasmoutput);override;
         procedure g_save_all_registers(list : taasmoutput);override;
         procedure g_save_standard_registers(list : taasmoutput);override;
-        procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint;loadref : boolean);override;
-        procedure g_concatcopy_unaligned(list : taasmoutput;const source,dest : treference;len : aint;loadref : boolean);override;
+        procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);override;
+        procedure g_concatcopy_unaligned(list : taasmoutput;const source,dest : treference;len : aint);override;
       end;
 
       TCg64Sparc=class(tcg64f32)
@@ -989,7 +989,7 @@ implementation
 
     { ************* concatcopy ************ }
 
-    procedure TCgSparc.g_concatcopy(list:taasmoutput;const source,dest:treference;len:aint;loadref:boolean);
+    procedure TCgSparc.g_concatcopy(list:taasmoutput;const source,dest:treference;len:aint);
       var
         tmpreg1,
         hreg,
@@ -997,29 +997,17 @@ implementation
         src, dst: TReference;
         lab: tasmlabel;
         count, count2: aint;
-        orgsrc, orgdst: boolean;
       begin
         if len>high(longint) then
           internalerror(2002072704);
         reference_reset(src);
         reference_reset(dst);
         { load the address of source into src.base }
-        if loadref then
-          begin
-            src.base:=GetAddressRegister(list);
-            a_load_ref_reg(list,OS_32,OS_32,source,src.base);
-            orgsrc := false;
-          end
-        else
-          begin
-            src.base:=GetAddressRegister(list);
-            a_loadaddr_ref_reg(list,source,src.base);
-            orgsrc := false;
-          end;
-          { load the address of dest into dst.base }
+        src.base:=GetAddressRegister(list);
+        a_loadaddr_ref_reg(list,source,src.base);
+        { load the address of dest into dst.base }
         dst.base:=GetAddressRegister(list);
         a_loadaddr_ref_reg(list,dest,dst.base);
-        orgdst := false;
         { generate a loop }
         count:=len div 4;
         if count>4 then
@@ -1088,7 +1076,7 @@ implementation
       end;
 
 
-    procedure tcgsparc.g_concatcopy_unaligned(list : taasmoutput;const source,dest : treference;len : aint;loadref : boolean);
+    procedure tcgsparc.g_concatcopy_unaligned(list : taasmoutput;const source,dest : treference;len : aint);
       var
         paraloc1,paraloc2,paraloc3 : TCGPara;
       begin
@@ -1103,10 +1091,7 @@ implementation
         paramanager.allocparaloc(list,paraloc2);
         a_paramaddr_ref(list,dest,paraloc2);
         paramanager.allocparaloc(list,paraloc2);
-        if loadref then
-          a_param_ref(list,OS_ADDR,source,paraloc1)
-        else
-          a_paramaddr_ref(list,source,paraloc1);
+        a_paramaddr_ref(list,source,paraloc1);
         paramanager.freeparaloc(list,paraloc3);
         paramanager.freeparaloc(list,paraloc2);
         paramanager.freeparaloc(list,paraloc1);
@@ -1274,7 +1259,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.95  2004-10-10 20:51:46  peter
+  Revision 1.96  2004-10-24 11:53:45  peter
+    * fixed compilation with removed loadref
+
+  Revision 1.95  2004/10/10 20:51:46  peter
     * fixed sparc compile
     * fixed float regvar loading
 

+ 7 - 2
compiler/x86_64/rgcpu.pas

@@ -29,7 +29,7 @@ unit rgcpu;
   interface
 
      uses
-       rgx86;
+       cgbase,rgx86;
 
      type
        trgcpu = class(trgx86)
@@ -38,6 +38,8 @@ unit rgcpu;
 
   implementation
 
+    uses
+      cpubase;
 
     procedure trgcpu.add_constraints(reg:Tregister);
       var
@@ -53,7 +55,10 @@ end.
 
 {
   $Log$
-  Revision 1.10  2004-10-13 21:12:51  peter
+  Revision 1.11  2004-10-24 11:53:45  peter
+    * fixed compilation with removed loadref
+
+  Revision 1.10  2004/10/13 21:12:51  peter
     * -Or fixes for open array
 
   Revision 1.9  2004/06/20 08:55:32  florian