From b1b90211f1963e7d4cee4d2e34ef9cd1af17a87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Sun, 6 Oct 2013 16:51:39 +0000 Subject: [PATCH] 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 - --- compiler/m68k/aasmcpu.pas | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/compiler/m68k/aasmcpu.pas b/compiler/m68k/aasmcpu.pas index 19e5d63656..9b3be04d86 100644 --- a/compiler/m68k/aasmcpu.pas +++ b/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; - A_DBRA: - if opnr=1 then begin + if opnr=1 then + result:=operand_readwrite; + A_DBRA: + 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]);