Browse Source

* fixed a_call_reg
+ implemented paramgr.get_volative_registers

florian 21 years ago
parent
commit
162ff2e6d4
2 changed files with 30 additions and 6 deletions
  1. 8 3
      compiler/arm/cgcpu.pas
  2. 22 3
      compiler/arm/cpupara.pas

+ 8 - 3
compiler/arm/cgcpu.pas

@@ -233,6 +233,7 @@ unit cgcpu;
       var
       var
          r : tregister;
          r : tregister;
       begin
       begin
+        list.concat(taicpu.op_reg_reg(A_MOV,NR_R14,NR_PC));
         list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,reg));
         list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,reg));
         if not(pi_do_call in current_procinfo.flags) then
         if not(pi_do_call in current_procinfo.flags) then
           internalerror(2003060704);
           internalerror(2003060704);
@@ -775,7 +776,7 @@ unit cgcpu;
         reference_reset(ref);
         reference_reset(ref);
         ref.index:=NR_STACK_POINTER_REG;
         ref.index:=NR_STACK_POINTER_REG;
         ref.addressmode:=AM_PREINDEXED;
         ref.addressmode:=AM_PREINDEXED;
-        list.concat(setoppostfix(taicpu.op_ref_regset(A_STM,ref,rg[R_INTREGISTER].used_in_proc-[RS_R0..RS_R3]+[RS_R11,RS_R12,RS_R14,RS_R15]),PF_DB));
+        list.concat(setoppostfix(taicpu.op_ref_regset(A_STM,ref,rg[R_INTREGISTER].used_in_proc-[RS_R0..RS_R3]+[RS_R11,RS_R12,RS_R14,RS_R15]),PF_FD));
 
 
         list.concat(taicpu.op_reg_reg_const(A_SUB,NR_FRAME_POINTER_REG,NR_R12,4));
         list.concat(taicpu.op_reg_reg_const(A_SUB,NR_FRAME_POINTER_REG,NR_R12,4));
 
 
@@ -807,7 +808,7 @@ unit cgcpu;
             { restore int registers and return }
             { restore int registers and return }
             reference_reset(ref);
             reference_reset(ref);
             ref.index:=NR_FRAME_POINTER_REG;
             ref.index:=NR_FRAME_POINTER_REG;
-            list.concat(setoppostfix(taicpu.op_ref_regset(A_LDM,ref,rg[R_INTREGISTER].used_in_proc-[RS_R0..RS_R3]+[RS_R11,RS_R13,RS_R15]),PF_DB));
+            list.concat(setoppostfix(taicpu.op_ref_regset(A_LDM,ref,rg[R_INTREGISTER].used_in_proc-[RS_R0..RS_R3]+[RS_R11,RS_R13,RS_R15]),PF_EA));
           end;
           end;
       end;
       end;
 
 
@@ -1198,7 +1199,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.29  2003-12-26 14:02:30  peter
+  Revision 1.30  2004-01-20 23:18:00  florian
+    * fixed a_call_reg
+    + implemented paramgr.get_volative_registers
+
+  Revision 1.29  2003/12/26 14:02:30  peter
     * sparc updates
     * sparc updates
     * use registertype in spill_register
     * use registertype in spill_register
 
 

+ 22 - 3
compiler/arm/cpupara.pas

@@ -30,11 +30,13 @@ unit cpupara;
     uses
     uses
        globtype,
        globtype,
        aasmtai,
        aasmtai,
-       cpubase,
+       cpubase,cgbase,
        symconst,symbase,symtype,symdef,paramgr;
        symconst,symbase,symtype,symdef,paramgr;
 
 
     type
     type
        tarmparamanager = class(tparamanager)
        tarmparamanager = class(tparamanager)
+          function get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;override;
+          function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;override;
           function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
           function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
           function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;override;
           function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;override;
           // procedure freeintparaloc(list: taasmoutput; nr : longint); override;
           // procedure freeintparaloc(list: taasmoutput; nr : longint); override;
@@ -46,10 +48,23 @@ unit cpupara;
 
 
     uses
     uses
        verbose,systems,
        verbose,systems,
-       cpuinfo,cgbase,
+       cpuinfo,
        rgobj,
        rgobj,
        defutil,symsym;
        defutil,symsym;
 
 
+
+    function tarmparamanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
+      begin
+        result:=VOLATILE_INTREGISTERS;
+      end;
+
+
+    function tarmparamanager.get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;
+      begin
+        result:=VOLATILE_FPUREGISTERS;
+      end;
+
+
     function tarmparamanager.getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;
     function tarmparamanager.getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;
       begin
       begin
          fillchar(result,sizeof(tparalocation),0);
          fillchar(result,sizeof(tparalocation),0);
@@ -336,7 +351,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2003-12-18 17:06:21  florian
+  Revision 1.12  2004-01-20 23:18:00  florian
+    * fixed a_call_reg
+    + implemented paramgr.get_volative_registers
+
+  Revision 1.11  2003/12/18 17:06:21  florian
     * arm compiler compilation fixed
     * arm compiler compilation fixed
 
 
   Revision 1.10  2003/12/03 17:39:05  florian
   Revision 1.10  2003/12/03 17:39:05  florian