Commit d1b87863 by Bernardo Innocenti Committed by Bernardo Innocenti

m68k.c: Strip away code depending on NO_ADDSUB_Q definition.

	* config/m68k/m68k.c: Strip away code depending on NO_ADDSUB_Q definition.
	* config/m68k/m68k.md: Likewise.

From-SVN: r70626
parent b6343a33
2003-08-20 Bernardo Innocenti <bernie@develer.com>
* config/m68k/m68k.c: Strip away code depending on NO_ADDSUB_Q definition.
* config/m68k/m68k.md: Likewise.
2003-08-20 Mark Mitchell <mark@codesourcery.com> 2003-08-20 Mark Mitchell <mark@codesourcery.com>
PR java/11996 PR java/11996
......
...@@ -345,7 +345,6 @@ m68k_output_function_prologue (stream, size) ...@@ -345,7 +345,6 @@ m68k_output_function_prologue (stream, size)
{ {
if (fsize + 4 < 0x8000) if (fsize + 4 < 0x8000)
{ {
#ifndef NO_ADDSUB_Q
if (fsize + 4 <= 8) if (fsize + 4 <= 8)
{ {
if (!TARGET_5200) if (!TARGET_5200)
...@@ -381,9 +380,7 @@ m68k_output_function_prologue (stream, size) ...@@ -381,9 +380,7 @@ m68k_output_function_prologue (stream, size)
fsize + 4 - 8); fsize + 4 - 8);
#endif #endif
} }
else else if (TARGET_68040)
#endif /* not NO_ADDSUB_Q */
if (TARGET_68040)
{ {
/* Adding negative number is faster on the 68040. */ /* Adding negative number is faster on the 68040. */
/* asm_fprintf() cannot handle %. */ /* asm_fprintf() cannot handle %. */
...@@ -800,7 +797,6 @@ m68k_output_function_epilogue (stream, size) ...@@ -800,7 +797,6 @@ m68k_output_function_epilogue (stream, size)
reg_names[FRAME_POINTER_REGNUM]); reg_names[FRAME_POINTER_REGNUM]);
else if (fsize) else if (fsize)
{ {
#ifndef NO_ADDSUB_Q
if (fsize + 4 <= 8) if (fsize + 4 <= 8)
{ {
if (!TARGET_5200) if (!TARGET_5200)
...@@ -833,9 +829,7 @@ m68k_output_function_epilogue (stream, size) ...@@ -833,9 +829,7 @@ m68k_output_function_epilogue (stream, size)
fsize + 4 - 8); fsize + 4 - 8);
#endif #endif
} }
else else if (fsize + 4 < 0x8000)
#endif /* not NO_ADDSUB_Q */
if (fsize + 4 < 0x8000)
{ {
if (TARGET_68040) if (TARGET_68040)
{ {
...@@ -1763,11 +1757,7 @@ output_move_qimode (operands) ...@@ -1763,11 +1757,7 @@ output_move_qimode (operands)
if (!reg_mentioned_p (stack_pointer_rtx, operands[1])) if (!reg_mentioned_p (stack_pointer_rtx, operands[1]))
{ {
xoperands[3] = stack_pointer_rtx; xoperands[3] = stack_pointer_rtx;
#ifndef NO_ADDSUB_Q
output_asm_insn ("subq%.l %#2,%3\n\tmove%.b %1,%2", xoperands); output_asm_insn ("subq%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
#else
output_asm_insn ("sub%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
#endif
} }
else else
output_asm_insn ("move%.b %1,%-\n\tmove%.b %@,%2", xoperands); output_asm_insn ("move%.b %1,%-\n\tmove%.b %@,%2", xoperands);
...@@ -2268,7 +2258,6 @@ output_addsi3 (operands) ...@@ -2268,7 +2258,6 @@ output_addsi3 (operands)
} }
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
#ifndef NO_ADDSUB_Q
if (INTVAL (operands[2]) > 0 if (INTVAL (operands[2]) > 0
&& INTVAL (operands[2]) <= 8) && INTVAL (operands[2]) <= 8)
return "addq%.l %2,%0"; return "addq%.l %2,%0";
...@@ -2296,7 +2285,6 @@ output_addsi3 (operands) ...@@ -2296,7 +2285,6 @@ output_addsi3 (operands)
return "subq%.l %#8,%0\n\tsubq%.l %2,%0"; return "subq%.l %#8,%0\n\tsubq%.l %2,%0";
} }
} }
#endif
if (ADDRESS_REG_P (operands[0]) if (ADDRESS_REG_P (operands[0])
&& INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) >= -0x8000
&& INTVAL (operands[2]) < 0x8000) && INTVAL (operands[2]) < 0x8000)
......
...@@ -1948,21 +1948,11 @@ ...@@ -1948,21 +1948,11 @@
if (GET_CODE (operands[1]) == CONST_INT) if (GET_CODE (operands[1]) == CONST_INT)
{ {
if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8) if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
{ return \"addq%.l %1,%R0\;addx%.l %3,%0\";
#ifdef NO_ADDSUB_Q
return \"add%.l %1,%R0\;addx%.l %3,%0\";
#else
return \"addq%.l %1,%R0\;addx%.l %3,%0\";
#endif
}
else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0) else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
{ {
operands[1] = GEN_INT (-INTVAL (operands[1])); operands[1] = GEN_INT (-INTVAL (operands[1]));
#ifdef NO_ADDSUB_Q
return \"sub%.l %1,%R0\;subx%.l %3,%0\";
#else
return \"subq%.l %1,%R0\;subx%.l %3,%0\"; return \"subq%.l %1,%R0\;subx%.l %3,%0\";
#endif
} }
} }
return \"add%.l %1,%R0\;addx%.l %3,%0\"; return \"add%.l %1,%R0\;addx%.l %3,%0\";
...@@ -2018,11 +2008,7 @@ ...@@ -2018,11 +2008,7 @@
#else #else
output_asm_insn (\"jpl %l3\", operands); output_asm_insn (\"jpl %l3\", operands);
#endif #endif
#ifndef NO_ADDSUB_Q
output_asm_insn (\"addq%.l %#1,%2\", operands); output_asm_insn (\"addq%.l %#1,%2\", operands);
#else
output_asm_insn (\"add%.l %#1,%2\", operands);
#endif
(*targetm.asm_out.internal_label) (asm_out_file, \"L\", (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[3])); CODE_LABEL_NUMBER (operands[3]));
return \"\"; return \"\";
...@@ -2072,7 +2058,6 @@ ...@@ -2072,7 +2058,6 @@
{ {
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as /* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range, elsewhere in the compiler. First check for constants out of range,
...@@ -2108,7 +2093,6 @@ ...@@ -2108,7 +2093,6 @@
return \"subq%.w %#8,%0\;subq%.w %2,%0\"; return \"subq%.w %#8,%0\;subq%.w %2,%0\";
} }
} }
#endif
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040) if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA #ifdef MOTOROLA
return \"lea (%c2,%0),%0\"; return \"lea (%c2,%0),%0\";
...@@ -2134,7 +2118,6 @@ ...@@ -2134,7 +2118,6 @@
{ {
if (GET_CODE (operands[1]) == CONST_INT) if (GET_CODE (operands[1]) == CONST_INT)
{ {
#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as /* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range, elsewhere in the compiler. First check for constants out of range,
...@@ -2170,7 +2153,6 @@ ...@@ -2170,7 +2153,6 @@
return \"subq%.w %#8,%0\;subq%.w %1,%0\"; return \"subq%.w %#8,%0\;subq%.w %1,%0\";
} }
} }
#endif
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040) if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA #ifdef MOTOROLA
return \"lea (%c1,%0),%0\"; return \"lea (%c1,%0),%0\";
...@@ -2190,7 +2172,6 @@ ...@@ -2190,7 +2172,6 @@
{ {
if (GET_CODE (operands[1]) == CONST_INT) if (GET_CODE (operands[1]) == CONST_INT)
{ {
#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as /* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range, elsewhere in the compiler. First check for constants out of range,
...@@ -2226,7 +2207,6 @@ ...@@ -2226,7 +2207,6 @@
return \"subq%.w %#8,%0\;subq%.w %1,%0\"; return \"subq%.w %#8,%0\;subq%.w %1,%0\";
} }
} }
#endif
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040) if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA #ifdef MOTOROLA
return \"lea (%c1,%0),%0\"; return \"lea (%c1,%0),%0\";
...@@ -2244,7 +2224,6 @@ ...@@ -2244,7 +2224,6 @@
"!TARGET_5200" "!TARGET_5200"
"* "*
{ {
#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[2]) == CONST_INT) if (GET_CODE (operands[2]) == CONST_INT)
{ {
if (INTVAL (operands[2]) >= 128) if (INTVAL (operands[2]) >= 128)
...@@ -2259,7 +2238,6 @@ ...@@ -2259,7 +2238,6 @@
return \"subq%.b %2,%0\"; return \"subq%.b %2,%0\";
} }
} }
#endif
return \"add%.b %2,%0\"; return \"add%.b %2,%0\";
}") }")
...@@ -2270,7 +2248,6 @@ ...@@ -2270,7 +2248,6 @@
"!TARGET_5200" "!TARGET_5200"
"* "*
{ {
#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[1]) == CONST_INT) if (GET_CODE (operands[1]) == CONST_INT)
{ {
if (INTVAL (operands[1]) >= 128) if (INTVAL (operands[1]) >= 128)
...@@ -2285,7 +2262,6 @@ ...@@ -2285,7 +2262,6 @@
return \"subq%.b %1,%0\"; return \"subq%.b %1,%0\";
} }
} }
#endif
return \"add%.b %1,%0\"; return \"add%.b %1,%0\";
}") }")
...@@ -2296,7 +2272,6 @@ ...@@ -2296,7 +2272,6 @@
"!TARGET_5200" "!TARGET_5200"
"* "*
{ {
#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[1]) == CONST_INT) if (GET_CODE (operands[1]) == CONST_INT)
{ {
if (INTVAL (operands[1]) >= 128) if (INTVAL (operands[1]) >= 128)
...@@ -2311,7 +2286,6 @@ ...@@ -2311,7 +2286,6 @@
return \"subq%.b %1,%0\"; return \"subq%.b %1,%0\";
} }
} }
#endif
return \"add%.b %1,%0\"; return \"add%.b %1,%0\";
}") }")
...@@ -2478,21 +2452,11 @@ ...@@ -2478,21 +2452,11 @@
if (GET_CODE (operands[1]) == CONST_INT) if (GET_CODE (operands[1]) == CONST_INT)
{ {
if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8) if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
{ return \"subq%.l %1,%R0\;subx%.l %3,%0\";
#ifdef NO_ADDSUB_Q
return \"sub%.l %1,%R0\;subx%.l %3,%0\";
#else
return \"subq%.l %1,%R0\;subx%.l %3,%0\";
#endif
}
else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0) else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
{ {
operands[1] = GEN_INT (-INTVAL (operands[1])); operands[1] = GEN_INT (-INTVAL (operands[1]));
#ifdef NO_ADDSUB_Q
return \"add%.l %1,%R0\;addx%.l %3,%0\";
#else
return \"addq%.l %1,%R0\;addx%.l %3,%0\"; return \"addq%.l %1,%R0\;addx%.l %3,%0\";
#endif
} }
} }
return \"sub%.l %1,%R0\;subx%.l %3,%0\"; return \"sub%.l %1,%R0\;subx%.l %3,%0\";
...@@ -6571,22 +6535,14 @@ ...@@ -6571,22 +6535,14 @@
if (GET_CODE (operands[0]) == MEM) if (GET_CODE (operands[0]) == MEM)
{ {
#ifdef MOTOROLA #ifdef MOTOROLA
#ifdef NO_ADDSUB_Q
return \"sub%.w %#1,%0\;jbcc %l1\";
#else
return \"subq%.w %#1,%0\;jbcc %l1\"; return \"subq%.w %#1,%0\;jbcc %l1\";
#endif
#else /* not MOTOROLA */ #else /* not MOTOROLA */
return \"subqw %#1,%0\;jcc %l1\"; return \"subqw %#1,%0\;jcc %l1\";
#endif #endif
} }
#ifdef MOTOROLA #ifdef MOTOROLA
#ifdef SGS_CMP_ORDER #ifdef SGS_CMP_ORDER
#ifdef NO_ADDSUB_Q
return \"sub%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
#else
return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\"; return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
#endif
#else /* not SGS_CMP_ORDER */ #else /* not SGS_CMP_ORDER */
return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\"; return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
#endif #endif
...@@ -6610,23 +6566,12 @@ ...@@ -6610,23 +6566,12 @@
{ {
CC_STATUS_INIT; CC_STATUS_INIT;
#ifdef MOTOROLA #ifdef MOTOROLA
#ifdef NO_ADDSUB_Q
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;sub%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"sub%.l %#1,%0\;jbcc %l1\";
#else
if (DATA_REG_P (operands[0])) if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\"; return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM) if (GET_CODE (operands[0]) == MEM)
return \"subq%.l %#1,%0\;jbcc %l1\"; return \"subq%.l %#1,%0\;jbcc %l1\";
#endif /* NO_ADDSUB_Q */
#ifdef SGS_CMP_ORDER #ifdef SGS_CMP_ORDER
#ifdef NO_ADDSUB_Q
return \"sub.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#else
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\"; return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#endif
#else /* not SGS_CMP_ORDER */ #else /* not SGS_CMP_ORDER */
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\"; return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */ #endif /* not SGS_CMP_ORDER */
...@@ -6657,23 +6602,12 @@ ...@@ -6657,23 +6602,12 @@
{ {
CC_STATUS_INIT; CC_STATUS_INIT;
#ifdef MOTOROLA #ifdef MOTOROLA
#ifdef NO_ADDSUB_Q
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
return \"sub%.w %#1,%0\;jbcc %l1\";
#else
if (DATA_REG_P (operands[0])) if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\"; return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM) if (GET_CODE (operands[0]) == MEM)
return \"subq%.w %#1,%0\;jbcc %l1\"; return \"subq%.w %#1,%0\;jbcc %l1\";
#endif
#ifdef SGS_CMP_ORDER #ifdef SGS_CMP_ORDER
#ifdef NO_ADDSUB_Q
return \"sub.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
#else
return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\"; return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
#endif
#else /* not SGS_CMP_ORDER */ #else /* not SGS_CMP_ORDER */
return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\"; return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */ #endif /* not SGS_CMP_ORDER */
...@@ -6716,23 +6650,12 @@ ...@@ -6716,23 +6650,12 @@
{ {
CC_STATUS_INIT; CC_STATUS_INIT;
#ifdef MOTOROLA #ifdef MOTOROLA
#ifdef NO_ADDSUB_Q
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;sub%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"sub%.l %#1,%0\;jbcc %l1\";
#else
if (DATA_REG_P (operands[0])) if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\"; return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM) if (GET_CODE (operands[0]) == MEM)
return \"subq%.l %#1,%0\;jbcc %l1\"; return \"subq%.l %#1,%0\;jbcc %l1\";
#endif
#ifdef SGS_CMP_ORDER #ifdef SGS_CMP_ORDER
#ifdef NO_ADDSUB_Q
return \"sub.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#else
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\"; return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#endif
#else /* not SGS_CMP_ORDER */ #else /* not SGS_CMP_ORDER */
return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\"; return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */ #endif /* not SGS_CMP_ORDER */
...@@ -7048,7 +6971,6 @@ ...@@ -7048,7 +6971,6 @@
rtx xoperands[2]; rtx xoperands[2];
xoperands[0] = stack_pointer_rtx; xoperands[0] = stack_pointer_rtx;
xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4); xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
#ifndef NO_ADDSUB_Q
if (INTVAL (xoperands[1]) <= 8) if (INTVAL (xoperands[1]) <= 8)
{ {
if (!TARGET_5200) if (!TARGET_5200)
...@@ -7061,9 +6983,7 @@ ...@@ -7061,9 +6983,7 @@
xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8); xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands); output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
} }
else else if (INTVAL (xoperands[1]) <= 0x7FFF)
#endif
if (INTVAL (xoperands[1]) <= 0x7FFF)
{ {
if (TARGET_68040) if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands); output_asm_insn (\"add%.w %1,%0\", xoperands);
...@@ -7098,7 +7018,6 @@ ...@@ -7098,7 +7018,6 @@
rtx xoperands[2]; rtx xoperands[2];
xoperands[0] = stack_pointer_rtx; xoperands[0] = stack_pointer_rtx;
xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4); xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
#ifndef NO_ADDSUB_Q
if (INTVAL (xoperands[1]) <= 8) if (INTVAL (xoperands[1]) <= 8)
{ {
if (!TARGET_5200) if (!TARGET_5200)
...@@ -7111,9 +7030,7 @@ ...@@ -7111,9 +7030,7 @@
xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8); xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands); output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
} }
else else if (INTVAL (xoperands[1]) <= 0x7FFF)
#endif
if (INTVAL (xoperands[1]) <= 0x7FFF)
{ {
if (TARGET_68040) if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands); output_asm_insn (\"add%.w %1,%0\", xoperands);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment