diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-03-17 22:21:25 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-03-17 22:21:25 +0000 |
commit | a421ea47b3b7ff44e7a8584379626bff24164c95 (patch) | |
tree | a2086516f8f2b009ab09cfd034a7f83558785763 /gcc/config/m68k/m68k.md | |
parent | d367b401f384f104d06366b3a2e5692d1b0df4ce (diff) | |
download | gcc-a421ea47b3b7ff44e7a8584379626bff24164c95.tar.gz |
(beq0_di, bne0_di, bge0_di, blt0_di): Use cmpw #0 instead of tstl when
testing address registers on the 68000.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13728 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m68k/m68k.md')
-rw-r--r-- | gcc/config/m68k/m68k.md | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 058f4742144..3828d612dc9 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -5452,10 +5452,21 @@ return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\"; #endif operands[4] = gen_label_rtx(); + if (TARGET_68020 || TARGET_5200) +#ifdef MOTOROLA + output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands); +#else + output_asm_insn (\"tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1\", operands); +#endif + else #ifdef MOTOROLA - output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands); +#ifdef SGS_CMP_ORDER + output_asm_insn (\"cmp%.w %0,%#0\;jbne %l4\;cmp%.w %3,%#0\;jbeq %l1\", operands); +#else + output_asm_insn (\"cmp%.w %#0,%0\;jbne %l4\;cmp%.w %#0,%3\;jbeq %l1\", operands); +#endif #else - output_asm_insn (\"tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1\", operands); + output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands); #endif ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4])); @@ -5489,7 +5500,13 @@ operands[3] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1); else operands[3] = adj_offsettable_operand (operands[0], 4); - if (ADDRESS_REG_P (operands[0])) + if (!ADDRESS_REG_P (operands[0])) +#ifdef MOTOROLA + return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\"; +#else + return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\"; +#endif + if (TARGET_68020 || TARGET_5200) #ifdef MOTOROLA return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\"; #else @@ -5497,9 +5514,13 @@ #endif else #ifdef MOTOROLA - return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\"; +#ifdef SGS_CMP_ORDER + return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\"; #else - return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\"; + return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\"; +#endif +#else + return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\"; #endif } ") @@ -5536,10 +5557,20 @@ } } CC_STATUS_INIT; + if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (operands[0])) + output_asm_insn(\"tst%.l %0\", operands); + else + /* On an address reg, cmpw may replace cmpl. */ +#ifdef SGS_CMP_ORDER + output_asm_insn(\"cmp%.w %0,%#0\", operands); +#else + output_asm_insn(\"cmp%.w %#0,%0\", operands); +#endif + #ifdef MOTOROLA - return \"tst%.l %0\;jbpl %l1\"; + return \"jbpl %l1\"; #else - return \"tst%.l %0\;jpl %l1\"; + return \"jpl %l1\"; #endif } ") @@ -5576,10 +5607,20 @@ } } CC_STATUS_INIT; + if (TARGET_68020 || TARGET_5200 || ! ADDRESS_REG_P (operands[0])) + output_asm_insn(\"tst%.l %0\", operands); + else + /* On an address reg, cmpw may replace cmpl. */ +#ifdef SGS_CMP_ORDER + output_asm_insn(\"cmp%.w %0,%#0\", operands); +#else + output_asm_insn(\"cmp%.w %#0,%0\", operands); +#endif + #ifdef MOTOROLA - return \"tst%.l %0\;jbmi %l1\"; + return \"jbmi %l1\"; #else - return \"tst%.l %0\;jmi %l1\"; + return \"jmi %l1\"; #endif } ") |