浏览代码

fixed spilling operation type for lots of operations (thanks Florian), fixes a few endless loops in the testsuite, at least

git-svn-id: trunk@25696 -
Károly Balogh 11 年之前
父节点
当前提交
b1b90211f1
共有 1 个文件被更改,包括 12 次插入13 次删除
  1. 12 13
      compiler/m68k/aasmcpu.pas

+ 12 - 13
compiler/m68k/aasmcpu.pas

@@ -511,28 +511,27 @@ type
 
     function taicpu.spilling_get_operation_type(opnr: longint): topertype;
       begin
+        result:=operand_read;
+
         case opcode of
-          A_MOVE, A_MOVEQ, A_ADD, A_ADDQ, A_ADDX, A_SUB, A_SUBQ, A_SUBX,
+          A_MOVE, A_MOVEQ, A_MOVEA:
+            if opnr=1 then
+              result:=operand_write;
+          A_ADD, A_ADDQ, A_ADDX, A_SUB, A_SUBQ, A_SUBX,
           A_AND, A_LSR, A_LSL, A_ASR, A_ASL, A_EOR, A_EORI, A_OR,
           A_MULS, A_MULU, A_DIVS, A_DIVU, A_DIVSL, A_DIVUL:
-            if opnr=1 then begin
-              result:=operand_write;
-            end else begin
-              result:=operand_read;
-            end;
+            if opnr=1 then
+              result:=operand_readwrite;
           A_DBRA:
-            if opnr=1 then begin
+            if opnr=0 then
               result:=operand_readwrite;
-            end else begin
-              result:=operand_read;
-            end;
-          A_TST,A_CMP,A_CMPI:
-            result:=operand_read;
           A_CLR, A_SXX, A_SEQ, A_SNE, A_SLT, A_SLE, A_SGT, A_SGE, A_SCS, A_SCC,
           A_SMI, A_SPL, A_SF, A_ST, A_SVS, A_SVC, A_SHI, A_SLS:
             result:=operand_write;
-          A_NEG, A_EXT, A_EXTB, A_NOT, A_NEGX:
+          A_NEG, A_NEGX, A_EXT, A_EXTB, A_NOT:
             result:=operand_readwrite;
+          A_TST,A_CMP,A_CMPI:
+            begin end; { Do nothing, default operand_read is fine here. }
           else begin
 { TODO: FIX ME!!! remove ugly debug code ... }
             writeln('M68K: unknown opcode when spilling: ',gas_op2str[opcode]);