فهرست منبع

- tiny bits of mess cleanup

git-svn-id: trunk@2399 -
Károly Balogh 19 سال پیش
والد
کامیت
a9dbab1035
1فایلهای تغییر یافته به همراه22 افزوده شده و 47 حذف شده
  1. 22 47
      compiler/m68k/aasmcpu.pas

+ 22 - 47
compiler/m68k/aasmcpu.pas

@@ -485,7 +485,6 @@ type
 
 
     function taicpu.is_same_reg_move(regtype: Tregistertype):boolean;
     function taicpu.is_same_reg_move(regtype: Tregistertype):boolean;
       begin
       begin
-//        writeln('is_same_reg_move');
         result:=(((opcode=A_MOVE) or (opcode=A_EXG)) and
         result:=(((opcode=A_MOVE) or (opcode=A_EXG)) and
                  (regtype = R_INTREGISTER) and
                  (regtype = R_INTREGISTER) and
                  (ops=2) and
                  (ops=2) and
@@ -493,6 +492,13 @@ type
                  (oper[1]^.typ=top_reg) and
                  (oper[1]^.typ=top_reg) and
                  (oper[0]^.reg=oper[1]^.reg)
                  (oper[0]^.reg=oper[1]^.reg)
                 ) or
                 ) or
+                (((opcode=A_MOVE) or (opcode=A_EXG) or (opcode=A_MOVEA)) and
+                 (regtype = R_ADDRESSREGISTER) and
+                 (ops=2) and
+                 (oper[0]^.typ=top_reg) and
+                 (oper[1]^.typ=top_reg) and
+                 (oper[0]^.reg=oper[1]^.reg)
+                ) or
                 ((opcode=A_FMOVE) and
                 ((opcode=A_FMOVE) and
                  (regtype = R_FPUREGISTER) and
                  (regtype = R_FPUREGISTER) and
                  (ops=2) and
                  (ops=2) and
@@ -509,55 +515,36 @@ type
           A_MOVE, A_MOVEQ, A_ADD, A_ADDQ, A_ADDX, A_SUB, A_SUBQ,
           A_MOVE, A_MOVEQ, A_ADD, A_ADDQ, A_ADDX, A_SUB, A_SUBQ,
           A_AND, A_LSR, A_LSL, A_ASR, A_ASL, A_EOR, A_EORI:
           A_AND, A_LSR, A_LSL, A_ASR, A_ASL, A_EOR, A_EORI:
             if opnr=1 then begin
             if opnr=1 then begin
-//              writeln('move/etc write');
               result:=operand_write;
               result:=operand_write;
             end else begin
             end else begin
-//              writeln('move/etc read');
               result:=operand_read;
               result:=operand_read;
             end;
             end;
           A_TST,A_CMP,A_CMPI:
           A_TST,A_CMP,A_CMPI:
             result:=operand_read;
             result:=operand_read;
           A_CLR,A_NEG,A_SXX:
           A_CLR,A_NEG,A_SXX:
             result:=operand_write;
             result:=operand_write;
-        else
-          writeln('other opcode: ',gas_op2str[opcode],' (faked value returned)',opnr);
-	  result:=operand_write;
+          else begin
+{$WARNING FIX ME!!! remove ugly debug code ... }
+            writeln('M68K: unknown opcode when spilling: ',gas_op2str[opcode]);
+            internalerror(200404091);
+          end;
         end;
         end;
-	// fake
-
-//        internalerror(200404091);
       end;
       end;
 
 
+
     function spilling_create_load(const ref:treference;r:tregister): tai;
     function spilling_create_load(const ref:treference;r:tregister): tai;
       begin
       begin
-//        writeln('spilling_create_load');
         case getregtype(r) of
         case getregtype(r) of
           R_INTREGISTER :
           R_INTREGISTER :
             result:=taicpu.op_ref_reg(A_MOVE,S_L,ref,r);
             result:=taicpu.op_ref_reg(A_MOVE,S_L,ref,r);
-          R_FPUREGISTER :
-	    result:=taicpu.op_ref_reg(A_FMOVE,S_L,ref,r);
           R_ADDRESSREGISTER :
           R_ADDRESSREGISTER :
             result:=taicpu.op_ref_reg(A_MOVE,S_L,ref,r);
             result:=taicpu.op_ref_reg(A_MOVE,S_L,ref,r);
-        end;
-{
-        case getregtype(r) of
-          R_INTREGISTER :
-            result:=taicpu.op_ref_reg(A_LD,ref,r);
           R_FPUREGISTER :
           R_FPUREGISTER :
-            begin
-              case getsubreg(r) of
-                R_SUBFS :
-                  result:=taicpu.op_ref_reg(A_LDF,ref,r);
-                R_SUBFD :
-                  result:=taicpu.op_ref_reg(A_LDD,ref,r);
-                else
-                  internalerror(200401042);
-              end;
-            end
+            // no need to handle sizes here
+            result:=taicpu.op_ref_reg(A_FMOVE,S_FS,ref,r);
           else
           else
-            internalerror(200401041);
+            internalerror(200602011);            
         end;
         end;
-        }
       end;
       end;
 
 
 
 
@@ -569,27 +556,14 @@ type
 	  R_ADDRESSREGISTER :
 	  R_ADDRESSREGISTER :
 	    result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
 	    result:=taicpu.op_reg_ref(A_MOVE,S_L,r,ref);
 	  R_FPUREGISTER :
 	  R_FPUREGISTER :
-	    result:=taicpu.op_reg_ref(A_FMOVE,S_L,r,ref);
-	end;
-        {case getregtype(r) of
-          R_INTREGISTER :
-            result:=taicpu.op_reg_ref(A_ST,r,ref);
-          R_FPUREGISTER :
-            begin
-              case getsubreg(r) of
-                R_SUBFS :
-                  result:=taicpu.op_reg_ref(A_STF,r,ref);
-                R_SUBFD :
-                  result:=taicpu.op_reg_ref(A_STD,r,ref);
-                else
-                  internalerror(200401042);
-              end;
-            end
+            // no need to handle sizes here
+            result:=taicpu.op_reg_ref(A_FMOVE,S_FS,r,ref);
           else
           else
-            internalerror(200401041);
-        end;}
+            internalerror(200602012);
+	end;
       end;
       end;
 
 
+
     procedure InitAsm;
     procedure InitAsm;
       begin
       begin
       end;
       end;
@@ -599,4 +573,5 @@ type
       begin
       begin
       end;
       end;
 
 
+
 end.
 end.