Browse Source

* spilling problem fixed
* handling of floating point memory references fixed

florian 21 years ago
parent
commit
16366a944c
3 changed files with 24 additions and 8 deletions
  1. 7 2
      compiler/arm/aasmcpu.pas
  2. 11 5
      compiler/arm/cgcpu.pas
  3. 6 1
      compiler/arm/rgcpu.pas

+ 7 - 2
compiler/arm/aasmcpu.pas

@@ -321,7 +321,8 @@ implementation
 
     function taicpu.spilling_get_operation_type(opnr: longint): topertype;
       begin
-        if opnr = 0 then
+        if (opnr=0) and not(opcode in [A_STR,A_STRB,A_STRBT,A_STRD,
+              A_STRH,A_STRT,A_STF]) then
           result := operand_write
         else
           result:=operand_read;
@@ -423,7 +424,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.28  2004-02-09 22:48:45  florian
+  Revision 1.29  2004-03-14 16:15:39  florian
+    * spilling problem fixed
+    * handling of floating point memory references fixed
+
+  Revision 1.28  2004/02/09 22:48:45  florian
     * several fixes to parameter handling on arm
 
   Revision 1.27  2004/02/08 23:10:21  jonas

+ 11 - 5
compiler/arm/cgcpu.pas

@@ -597,17 +597,19 @@ unit cgcpu;
                 if ref.base=tmpreg then
                   begin
                     if ref.signindex<0 then
-                      list.concat(taicpu.op_reg_reg_reg(A_ADD,tmpreg,tmpreg,ref.index))
+                      list.concat(taicpu.op_reg_reg_reg(A_SUB,tmpreg,tmpreg,ref.index))
                     else
-                      list.concat(taicpu.op_reg_reg_reg(A_SUB,tmpreg,tmpreg,ref.index));
+                      list.concat(taicpu.op_reg_reg_reg(A_ADD,tmpreg,tmpreg,ref.index));
                     ref.index:=NR_NO;
                   end
                 else
                   begin
+                    if ref.index<>tmpreg then
+                      internalerror(200403161);
                     if ref.signindex<0 then
-                      list.concat(taicpu.op_reg_reg_reg(A_ADD,tmpreg,tmpreg,ref.base))
+                      list.concat(taicpu.op_reg_reg_reg(A_SUB,tmpreg,ref.base,tmpreg))
                     else
-                      list.concat(taicpu.op_reg_reg_reg(A_SUB,tmpreg,tmpreg,ref.base));
+                      list.concat(taicpu.op_reg_reg_reg(A_ADD,tmpreg,ref.base,tmpreg));
                     ref.base:=tmpreg;
                     ref.index:=NR_NO;
                   end;
@@ -1281,7 +1283,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.47  2004-03-10 22:35:40  florian
+  Revision 1.48  2004-03-14 16:15:40  florian
+    * spilling problem fixed
+    * handling of floating point memory references fixed
+
+  Revision 1.47  2004/03/10 22:35:40  florian
     + fixed code generation for cmn
 
   Revision 1.46  2004/03/06 20:35:19  florian

+ 6 - 1
compiler/arm/rgcpu.pas

@@ -181,6 +181,7 @@ unit rgcpu;
 
       begin
         ref:=spilltemplist[regs[regidx].orgreg];
+        internalerror(200403141);
         {
         if abs(ref.offset)>4095 then
           begin
@@ -221,7 +222,11 @@ end.
 
 {
   $Log$
-  Revision 1.9  2004-03-06 20:35:20  florian
+  Revision 1.10  2004-03-14 16:15:40  florian
+    * spilling problem fixed
+    * handling of floating point memory references fixed
+
+  Revision 1.9  2004/03/06 20:35:20  florian
     * fixed arm compilation
     * cleaned up code generation for exported linux procedures