Commit f082d7a9 by Gunther Nikl Committed by Bernardo Innocenti

m68k.c (MOTOROLA): Move from here...

	* config/m68k/m68k.c (MOTOROLA): Move from here...
	* config/m68k/m68k.h (MOTOROLA): ... to here.
	(OUTPUT_JUMP): Use do {...} while (0).
	* config/m68k/m68k.md: Replace #ifdef MOTOROLA with C statements.

From-SVN: r74049
parent c16202e1
2003-11-28 Gunther Nikl <gni@gecko.de>
* config/m68k/m68k.c (MOTOROLA): Move from here...
* config/m68k/m68k.h (MOTOROLA): ... to here.
(OUTPUT_JUMP): Use do {...} while (0).
* config/m68k/m68k.md: Replace #ifdef MOTOROLA with C statements.
2003-11-28 Gunther Nikl <gni@gecko.de>
* config.gcc (m68020-*-elf*, m68k-*-elf*, m68010-*-netbsdelf*,
m68k*-*-netbsdelf*, m68k-*-rtems*): Add tm_defines containing
MOTOROLA and USE_GAS.
......
......@@ -43,17 +43,6 @@ Boston, MA 02111-1307, USA. */
#include "debug.h"
#include "flags.h"
/* We need to have MOTOROLA always defined (either 0 or 1) because we use
if-statements and ?: on it. This way we have compile-time error checking
for both the MOTOROLA and MIT code paths. We do rely on the host compiler
to optimize away all constant tests. */
#ifdef MOTOROLA
# undef MOTOROLA
# define MOTOROLA 1 /* Use the Motorola assembly syntax. */
#else
# define MOTOROLA 0 /* Use the MIT assembly syntax. */
#endif
/* The ASM_DOT macro allows easy string pasting to handle the differences
between MOTOROLA and MIT syntaxes in asm_fprintf(), which doesn't
support the %. option. */
......
......@@ -20,6 +20,18 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* We need to have MOTOROLA always defined (either 0 or 1) because we use
if-statements and ?: on it. This way we have compile-time error checking
for both the MOTOROLA and MIT code paths. We do rely on the host compiler
to optimize away all constant tests. */
#ifdef MOTOROLA
# undef MOTOROLA
# define MOTOROLA 1 /* Use the Motorola assembly syntax. */
# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
#else
# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)")
# define MOTOROLA 0 /* Use the MIT assembly syntax. */
#endif
/* Note that some other tm.h files include this one and then override
many of the definitions that relate to assembler syntax. */
......@@ -103,13 +115,6 @@ Boston, MA 02111-1307, USA. */
/* Set the default */
#define INT_OP_GROUP INT_OP_DOT_WORD
/* Print subsidiary information on the compiler version in use. */
#ifdef MOTOROLA
#define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)");
#else
#define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)");
#endif
/* Run-time compilation parameters selecting different hardware subsets. */
extern int target_flags;
......@@ -1399,11 +1404,11 @@ __transfer_from_trampoline () \
#define NOTICE_UPDATE_CC(EXP,INSN) notice_update_cc (EXP, INSN)
#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \
{ if (cc_prev_status.flags & CC_IN_68881) \
do { if (cc_prev_status.flags & CC_IN_68881) \
return FLOAT; \
if (cc_prev_status.flags & CC_NO_OVERFLOW) \
return NO_OV; \
return NORMAL; }
return NORMAL; } while (0)
/* Control the assembler format that we output. */
......
......@@ -698,18 +698,14 @@
if (!TARGET_68040 && !TARGET_68060)
return \"sub%.l %0,%0\";
else
{
#ifdef MOTOROLA
return MOTOROLA ?
#ifdef SGS
/* Many SGS assemblers croak on size specifiers for constants. */
return \"lea 0,%0\";
#else
return \"lea 0.w,%0\";
#endif
\"lea 0,%0\" :
#else
return \"lea 0:w,%0\";
\"lea 0.w,%0\" :
#endif
}
\"lea 0:w,%0\";
}
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_COLDFIRE))
......@@ -907,18 +903,14 @@
if (!TARGET_68040 && !TARGET_68060)
return \"sub%.l %0,%0\";
else
{
#ifdef MOTOROLA
return MOTOROLA ?
#ifdef SGS
/* Many SGS assemblers croak on size specifiers for constants. */
return \"lea 0,%0\";
#else
return \"lea 0.w,%0\";
#endif
\"lea 0,%0\" :
#else
return \"lea 0:w,%0\";
\"lea 0.w,%0\" :
#endif
}
\"lea 0:w,%0\";
}
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_COLDFIRE))
......@@ -1448,29 +1440,26 @@
&& GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
return MOTOROLA ?
#ifdef SGS
return \"clr%.l -(%0)\;move%.b %1,3(%0)\";
#else
return \"clr%.l -(%0)\;move%.b %1,(3,%0)\";
#endif
\"clr%.l -(%0)\;move%.b %1,3(%0)\" :
#else
return \"clrl %0@-\;moveb %1,%0@(3)\";
\"clr%.l -(%0)\;move%.b %1,(3,%0)\" :
#endif
\"clrl %0@-\;moveb %1,%0@(3)\";
}
else if (GET_CODE (operands[0]) == MEM
&& GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
#ifdef MOTOROLA
return MOTOROLA ?
#ifdef SGS
return \"clr%.l (%0)+\;move%.b %1,-1(%0)\";
\"clr%.l (%0)+\;move%.b %1,-1(%0)\" :
#else
return \"clr%.l (%0)+\;move%.b %1,(-1,%0)\";
#endif
#else
return \"clrl %0@+\;moveb %1,%0@(-1)\";
\"clr%.l (%0)+\;move%.b %1,(-1,%0)\" :
#endif
\"clrl %0@+\;moveb %1,%0@(-1)\";
}
else
{
......@@ -2003,11 +1992,7 @@
operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
}
output_asm_insn (\"move%.l %1,%0\", operands);
#ifdef MOTOROLA
output_asm_insn (\"jbpl %l3\", operands);
#else
output_asm_insn (\"jpl %l3\", operands);
#endif
output_asm_insn (MOTOROLA ? \"jbpl %l3\" : \"jpl %l3\", operands);
output_asm_insn (\"addq%.l %#1,%2\", operands);
(*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[3]));
......@@ -2094,11 +2079,7 @@
}
}
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA
return \"lea (%c2,%0),%0\";
#else
return \"lea %0@(%c2),%0\";
#endif
return MOTOROLA ? \"lea (%c2,%0),%0\" : \"lea %0@(%c2),%0\";
}
return \"add%.w %2,%0\";
}")
......@@ -2154,11 +2135,7 @@
}
}
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA
return \"lea (%c1,%0),%0\";
#else
return \"lea %0@(%c1),%0\";
#endif
return MOTOROLA ? \"lea (%c1,%0),%0\" : \"lea %0@(%c1),%0\";
}
return \"add%.w %1,%0\";
}")
......@@ -2208,11 +2185,7 @@
}
}
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
#ifdef MOTOROLA
return \"lea (%c1,%0),%0\";
#else
return \"lea %0@(%c1),%0\";
#endif
return MOTOROLA ? \"lea (%c1,%0),%0\" : \"lea %0@(%c1),%0\";
}
return \"add%.w %1,%0\";
}")
......@@ -2621,11 +2594,7 @@
""
"*
{
#if defined(MOTOROLA)
return \"muls%.w %2,%0\";
#else
return \"muls %2,%0\";
#endif
return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\";
}")
(define_insn "mulhisi3"
......@@ -2637,11 +2606,7 @@
""
"*
{
#if defined(MOTOROLA)
return \"muls%.w %2,%0\";
#else
return \"muls %2,%0\";
#endif
return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\";
}")
(define_insn ""
......@@ -2652,11 +2617,7 @@
"INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) <= 0x7fff"
"*
{
#if defined(MOTOROLA)
return \"muls%.w %2,%0\";
#else
return \"muls %2,%0\";
#endif
return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\";
}")
(define_expand "mulsi3"
......@@ -2690,11 +2651,7 @@
""
"*
{
#if defined(MOTOROLA)
return \"mulu%.w %2,%0\";
#else
return \"mulu %2,%0\";
#endif
return MOTOROLA ? \"mulu%.w %2,%0\" : \"mulu %2,%0\";
}")
(define_insn ""
......@@ -2705,11 +2662,7 @@
"INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 0xffff"
"*
{
#if defined(MOTOROLA)
return \"mulu%.w %2,%0\";
#else
return \"mulu %2,%0\";
#endif
return MOTOROLA ? \"mulu%.w %2,%0\" : \"mulu %2,%0\";
}")
;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
......@@ -3182,11 +3135,10 @@
"!TARGET_COLDFIRE || TARGET_CF_HWDIV"
"*
{
#ifdef MOTOROLA
output_asm_insn (\"ext%.l %0\;divs%.w %2,%0\", operands);
#else
output_asm_insn (\"extl %0\;divs %2,%0\", operands);
#endif
output_asm_insn (MOTOROLA ?
\"ext%.l %0\;divs%.w %2,%0\" :
\"extl %0\;divs %2,%0\",
operands);
if (!find_reg_note(insn, REG_UNUSED, operands[3]))
{
CC_STATUS_INIT;
......@@ -3205,11 +3157,10 @@
"!TARGET_COLDFIRE || TARGET_CF_HWDIV"
"*
{
#ifdef MOTOROLA
output_asm_insn (\"and%.l %#0xFFFF,%0\;divu%.w %2,%0\", operands);
#else
output_asm_insn (\"and%.l %#0xFFFF,%0\;divu %2,%0\", operands);
#endif
output_asm_insn (MOTOROLA ?
\"and%.l %#0xFFFF,%0\;divu%.w %2,%0\" :
\"and%.l %#0xFFFF,%0\;divu %2,%0\",
operands);
if (!find_reg_note(insn, REG_UNUSED, operands[3]))
{
CC_STATUS_INIT;
......@@ -5663,22 +5614,19 @@
{
CC_STATUS_INIT;
if (which_alternative == 1)
#ifdef MOTOROLA
return \"move%.l %0,%2\;or%.l %0,%2\;jbeq %l1\";
#else
return \"move%.l %0,%2\;or%.l %0,%2\;jeq %l1\";
#endif
{
if (MOTOROLA)
return \"move%.l %0,%2\;or%.l %0,%2\;jbeq %l1\";
else
return \"move%.l %0,%2\;or%.l %0,%2\;jeq %l1\";
}
if ((cc_prev_status.value1
&& rtx_equal_p (cc_prev_status.value1, operands[0]))
|| (cc_prev_status.value2
&& rtx_equal_p (cc_prev_status.value2, operands[0])))
{
cc_status = cc_prev_status;
#ifdef MOTOROLA
return \"jbeq %l1\";
#else
return \"jeq %l1\";
#endif
return MOTOROLA ? \"jbeq %l1\" : \"jeq %l1\";
}
if (GET_CODE (operands[0]) == REG)
operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
......@@ -5690,47 +5638,42 @@
{
if (reg_overlap_mentioned_p (operands[2], operands[3]))
{
#ifdef MOTOROLA
return \"or%.l %0,%2\;jbeq %l1\";
#else
return \"or%.l %0,%2\;jeq %l1\";
#endif
if (MOTOROLA)
return \"or%.l %0,%2\;jbeq %l1\";
else
return \"or%.l %0,%2\;jeq %l1\";
}
else
{
#ifdef MOTOROLA
return \"or%.l %3,%2\;jbeq %l1\";
#else
return \"or%.l %3,%2\;jeq %l1\";
#endif
if (MOTOROLA)
return \"or%.l %3,%2\;jbeq %l1\";
else
return \"or%.l %3,%2\;jeq %l1\";
}
}
#ifdef MOTOROLA
return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
#else
return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\";
#endif
if (MOTOROLA)
return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
else
return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\";
}
operands[4] = gen_label_rtx();
if (TARGET_68020 || TARGET_COLDFIRE)
{
#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
if (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);
}
else
{
#ifdef MOTOROLA
if (MOTOROLA)
#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
output_asm_insn (\"cmp%.w %0,%#0\;jbne %l4\;cmp%.w %3,%#0\;jbeq %l1\", operands);
#else
output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands);
output_asm_insn (\"cmp%.w %#0,%0\;jbne %l4\;cmp%.w %#0,%3\;jbeq %l1\", operands);
#endif
else
output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands);
}
(*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[4]));
......@@ -5753,11 +5696,7 @@
&& rtx_equal_p (cc_prev_status.value2, operands[0])))
{
cc_status = cc_prev_status;
#ifdef MOTOROLA
return \"jbne %l1\";
#else
return \"jne %l1\";
#endif
return MOTOROLA ? \"jbne %l1\" : \"jne %l1\";
}
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
......@@ -5770,46 +5709,41 @@
{
if (reg_overlap_mentioned_p (operands[2], operands[3]))
{
#ifdef MOTOROLA
return \"or%.l %0,%2\;jbne %l1\";
#else
return \"or%.l %0,%2\;jne %l1\";
#endif
if (MOTOROLA)
return \"or%.l %0,%2\;jbne %l1\";
else
return \"or%.l %0,%2\;jne %l1\";
}
else
{
#ifdef MOTOROLA
return \"or%.l %3,%2\;jbne %l1\";
#else
return \"or%.l %3,%2\;jne %l1\";
#endif
if (MOTOROLA)
return \"or%.l %3,%2\;jbne %l1\";
else
return \"or%.l %3,%2\;jne %l1\";
}
}
#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 (MOTOROLA)
return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\";
else
return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\";
}
if (TARGET_68020 || TARGET_COLDFIRE)
{
#ifdef MOTOROLA
return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\";
#else
return \"tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1\";
#endif
if (MOTOROLA)
return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\";
else
return \"tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1\";
}
else
{
#ifdef MOTOROLA
if (MOTOROLA)
#ifdef SGS_CMP_ORDER
return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\";
return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\";
#else
return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\";
#endif
#else
return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\";
return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\";
#endif
else
return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\";
}
} ")
......@@ -5830,19 +5764,11 @@
cc_status = cc_prev_status;
if (cc_status.flags & CC_REVERSED)
{
#ifdef MOTOROLA
return \"jble %l1\";
#else
return \"jle %l1\";
#endif
return MOTOROLA ? \"jble %l1\" : \"jle %l1\";
}
else
{
#ifdef MOTOROLA
return \"jbpl %l1\";
#else
return \"jpl %l1\";
#endif
return MOTOROLA ? \"jbpl %l1\" : \"jpl %l1\";
}
}
CC_STATUS_INIT;
......@@ -5858,11 +5784,7 @@
#endif
}
#ifdef MOTOROLA
return \"jbpl %l1\";
#else
return \"jpl %l1\";
#endif
return MOTOROLA ? \"jbpl %l1\" : \"jpl %l1\";
} ")
(define_insn "blt0_di"
......@@ -5882,19 +5804,11 @@
cc_status = cc_prev_status;
if (cc_status.flags & CC_REVERSED)
{
#ifdef MOTOROLA
return \"jbgt %l1\";
#else
return \"jgt %l1\";
#endif
return MOTOROLA ? \"jbgt %l1\" : \"jgt %l1\";
}
else
{
#ifdef MOTOROLA
return \"jbmi %l1\";
#else
return \"jmi %l1\";
#endif
return MOTOROLA ? \"jbmi %l1\" : \"jmi %l1\";
}
}
CC_STATUS_INIT;
......@@ -5910,11 +5824,7 @@
#endif
}
#ifdef MOTOROLA
return \"jbmi %l1\";
#else
return \"jmi %l1\";
#endif
return MOTOROLA ? \"jbmi %l1\" : \"jmi %l1\";
} ")
(define_insn "beq"
......@@ -5926,11 +5836,10 @@
""
"*
{
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
#else
OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
else
OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
}")
(define_insn "bne"
......@@ -5942,11 +5851,10 @@
""
"*
{
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
#else
OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
else
OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
}")
(define_insn "bgt"
......@@ -5957,11 +5865,10 @@
(pc)))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbgt %l0\", \"fbgt %l0\", 0);
#else
OUTPUT_JUMP (\"jgt %l0\", \"fjgt %l0\", 0);
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbgt %l0\", \"fbgt %l0\", 0);
else
OUTPUT_JUMP (\"jgt %l0\", \"fjgt %l0\", 0);
")
(define_insn "bgtu"
......@@ -5972,11 +5879,7 @@
(pc)))]
""
"*
#ifdef MOTOROLA
return \"jbhi %l0\";
#else
return \"jhi %l0\";
#endif
return MOTOROLA ? \"jbhi %l0\" : \"jhi %l0\";
")
(define_insn "blt"
......@@ -5987,11 +5890,10 @@
(pc)))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jblt %l0\", \"fblt %l0\", \"jbmi %l0\");
#else
OUTPUT_JUMP (\"jlt %l0\", \"fjlt %l0\", \"jmi %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jblt %l0\", \"fblt %l0\", \"jbmi %l0\");
else
OUTPUT_JUMP (\"jlt %l0\", \"fjlt %l0\", \"jmi %l0\");
")
(define_insn "bltu"
......@@ -6002,11 +5904,7 @@
(pc)))]
""
"*
#ifdef MOTOROLA
return \"jbcs %l0\";
#else
return \"jcs %l0\";
#endif
return MOTOROLA ? \"jbcs %l0\" : \"jcs %l0\";
")
(define_insn "bge"
......@@ -6017,11 +5915,10 @@
(pc)))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbge %l0\", \"fbge %l0\", \"jbpl %l0\");
#else
OUTPUT_JUMP (\"jge %l0\", \"fjge %l0\", \"jpl %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbge %l0\", \"fbge %l0\", \"jbpl %l0\");
else
OUTPUT_JUMP (\"jge %l0\", \"fjge %l0\", \"jpl %l0\");
")
(define_insn "bgeu"
......@@ -6032,11 +5929,7 @@
(pc)))]
""
"*
#ifdef MOTOROLA
return \"jbcc %l0\";
#else
return \"jcc %l0\";
#endif
return MOTOROLA ? \"jbcc %l0\" : \"jcc %l0\";
")
(define_insn "ble"
......@@ -6047,11 +5940,10 @@
(pc)))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jble %l0\", \"fble %l0\", 0);
#else
OUTPUT_JUMP (\"jle %l0\", \"fjle %l0\", 0);
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jble %l0\", \"fble %l0\", 0);
else
OUTPUT_JUMP (\"jle %l0\", \"fjle %l0\", 0);
")
(define_insn "bleu"
......@@ -6062,11 +5954,7 @@
(pc)))]
""
"*
#ifdef MOTOROLA
return \"jbls %l0\";
#else
return \"jls %l0\";
#endif
return MOTOROLA ? \"jbls %l0\" : \"jls %l0\";
")
(define_insn "bordered"
......@@ -6078,11 +5966,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbor %l0";
#else
return "fjor %l0";
#endif
return MOTOROLA ? "fbor %l0" : "fjor %l0";
})
(define_insn "bunordered"
......@@ -6094,11 +5978,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbun %l0";
#else
return "fjun %l0";
#endif
return MOTOROLA ? "fbun %l0" : "fjun %l0";
})
(define_insn "buneq"
......@@ -6110,11 +5990,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbueq %l0";
#else
return "fjueq %l0";
#endif
return MOTOROLA ? "fbueq %l0" : "fjueq %l0";
})
(define_insn "bunge"
......@@ -6126,11 +6002,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbuge %l0";
#else
return "fjuge %l0";
#endif
return MOTOROLA ? "fbuge %l0" : "fjuge %l0";
})
(define_insn "bungt"
......@@ -6142,11 +6014,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbugt %l0";
#else
return "fjugt %l0";
#endif
return MOTOROLA ? "fbugt %l0" : "fjugt %l0";
})
(define_insn "bunle"
......@@ -6158,11 +6026,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbule %l0";
#else
return "fjule %l0";
#endif
return MOTOROLA ? "fbule %l0" : "fjule %l0";
})
(define_insn "bunlt"
......@@ -6174,11 +6038,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbult %l0";
#else
return "fjult %l0";
#endif
return MOTOROLA ? "fbult %l0" : "fjult %l0";
})
(define_insn "bltgt"
......@@ -6190,11 +6050,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbogl %l0";
#else
return "fjogl %l0";
#endif
return MOTOROLA ? "fbogl %l0" : "fjogl %l0";
})
;; Negated conditional jump instructions.
......@@ -6208,11 +6064,10 @@
""
"*
{
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
#else
OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
else
OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
}")
(define_insn ""
......@@ -6224,11 +6079,10 @@
""
"*
{
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
#else
OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
else
OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
}")
(define_insn ""
......@@ -6239,11 +6093,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jble %l0\", \"fbngt %l0\", 0);
#else
OUTPUT_JUMP (\"jle %l0\", \"fjngt %l0\", 0);
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jble %l0\", \"fbngt %l0\", 0);
else
OUTPUT_JUMP (\"jle %l0\", \"fjngt %l0\", 0);
")
(define_insn ""
......@@ -6254,11 +6107,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
return \"jbls %l0\";
#else
return \"jls %l0\";
#endif
return MOTOROLA ? \"jbls %l0\" : \"jls %l0\";
")
(define_insn ""
......@@ -6269,11 +6118,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbge %l0\", \"fbnlt %l0\", \"jbpl %l0\");
#else
OUTPUT_JUMP (\"jge %l0\", \"fjnlt %l0\", \"jpl %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbge %l0\", \"fbnlt %l0\", \"jbpl %l0\");
else
OUTPUT_JUMP (\"jge %l0\", \"fjnlt %l0\", \"jpl %l0\");
")
(define_insn ""
......@@ -6284,11 +6132,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
return \"jbcc %l0\";
#else
return \"jcc %l0\";
#endif
return MOTOROLA ? \"jbcc %l0\" : \"jcc %l0\";
")
(define_insn ""
......@@ -6299,11 +6143,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jblt %l0\", \"fbnge %l0\", \"jbmi %l0\");
#else
OUTPUT_JUMP (\"jlt %l0\", \"fjnge %l0\", \"jmi %l0\");
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jblt %l0\", \"fbnge %l0\", \"jbmi %l0\");
else
OUTPUT_JUMP (\"jlt %l0\", \"fjnge %l0\", \"jmi %l0\");
")
(define_insn ""
......@@ -6314,11 +6157,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
return \"jbcs %l0\";
#else
return \"jcs %l0\";
#endif
return MOTOROLA ? \"jbcs %l0\" : \"jcs %l0\";
")
(define_insn ""
......@@ -6329,11 +6168,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
OUTPUT_JUMP (\"jbgt %l0\", \"fbnle %l0\", 0);
#else
OUTPUT_JUMP (\"jgt %l0\", \"fjnle %l0\", 0);
#endif
if (MOTOROLA)
OUTPUT_JUMP (\"jbgt %l0\", \"fbnle %l0\", 0);
else
OUTPUT_JUMP (\"jgt %l0\", \"fjnle %l0\", 0);
")
(define_insn ""
......@@ -6344,11 +6182,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
#ifdef MOTOROLA
return \"jbhi %l0\";
#else
return \"jhi %l0\";
#endif
return MOTOROLA ? \"jbhi %l0\" : \"jhi %l0\";
")
(define_insn "*bordered_rev"
......@@ -6360,11 +6194,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbun %l0";
#else
return "fjun %l0";
#endif
return MOTOROLA ? "fbun %l0" : "fjun %l0";
})
(define_insn "*bunordered_rev"
......@@ -6376,11 +6206,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbor %l0";
#else
return "fjor %l0";
#endif
return MOTOROLA ? "fbor %l0" : "fjor %l0";
})
(define_insn "*buneq_rev"
......@@ -6392,11 +6218,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbogl %l0";
#else
return "fjogl %l0";
#endif
return MOTOROLA ? "fbogl %l0" : "fjogl %l0";
})
(define_insn "*bunge_rev"
......@@ -6408,11 +6230,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbolt %l0";
#else
return "fjolt %l0";
#endif
return MOTOROLA ? "fbolt %l0" : "fjolt %l0";
})
(define_insn "*bunle_rev"
......@@ -6424,11 +6242,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbogt %l0";
#else
return "fjogt %l0";
#endif
return MOTOROLA ? "fbogt %l0" : "fjogt %l0";
})
(define_insn "*bunlt_rev"
......@@ -6440,11 +6254,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fboge %l0";
#else
return "fjoge %l0";
#endif
return MOTOROLA ? "fboge %l0" : "fjoge %l0";
})
(define_insn "*bltgt_rev"
......@@ -6456,11 +6266,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
#ifdef MOTOROLA
return "fbueq %l0";
#else
return "fjueq %l0";
#endif
return MOTOROLA ? "fbueq %l0" : "fjueq %l0";
})
;; Unconditional and other jump instructions
......@@ -6469,11 +6275,7 @@
(label_ref (match_operand 0 "" "")))]
""
"*
#ifdef MOTOROLA
return \"jbra %l0\";
#else
return \"jra %l0\";
#endif
return MOTOROLA ? \"jbra %l0\" : \"jra %l0\";
")
;; We support two different ways of handling dispatch tables.
......@@ -6497,11 +6299,7 @@
(use (label_ref (match_operand 1 "" "")))]
""
"*
#ifdef MOTOROLA
return \"jmp (%0)\";
#else
return \"jmp %0@\";
#endif
return MOTOROLA ? \"jmp (%0)\" : \"jmp %0@\";
")
;; Jump to variable address from dispatch table of relative addresses.
......@@ -6542,28 +6340,16 @@
{
if (ADDRESS_REG_P (operands[0]))
{
#ifdef MOTOROLA
return \"jmp (2,pc,%0.l)\";
#else
return \"jmp pc@(2,%0:l)\";
#endif
return MOTOROLA ? \"jmp (2,pc,%0.l)\" : \"jmp pc@(2,%0:l)\";
}
else if (MOTOROLA)
return \"ext%.l %0\;jmp (2,pc,%0.l)\";
else
{
#ifdef MOTOROLA
return \"ext%.l %0\;jmp (2,pc,%0.l)\";
#else
return \"extl %0\;jmp pc@(2,%0:l)\";
#endif
}
return \"extl %0\;jmp pc@(2,%0:l)\";
}
else
{
#ifdef MOTOROLA
return \"jmp (2,pc,%0.w)\";
#else
return \"jmp pc@(2,%0:w)\";
#endif
return MOTOROLA ? \"jmp (2,pc,%0.w)\" : \"jmp pc@(2,%0:w)\";
}
#endif
#endif
......@@ -6588,21 +6374,19 @@
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
{
#ifdef MOTOROLA
return \"subq%.w %#1,%0\;jbcc %l1\";
#else /* not MOTOROLA */
return \"subqw %#1,%0\;jcc %l1\";
#endif
if (MOTOROLA)
return \"subq%.w %#1,%0\;jbcc %l1\";
else
return \"subqw %#1,%0\;jcc %l1\";
}
#ifdef MOTOROLA
if (MOTOROLA)
#ifdef SGS_CMP_ORDER
return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
#else /* not SGS_CMP_ORDER */
return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
#endif
#else /* not MOTOROLA */
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
#endif
else
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
}")
(define_insn ""
......@@ -6619,23 +6403,26 @@
"*
{
CC_STATUS_INIT;
#ifdef MOTOROLA
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.l %#1,%0\;jbcc %l1\";
if (MOTOROLA)
{
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.l %#1,%0\;jbcc %l1\";
#ifdef SGS_CMP_ORDER
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#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 */
#else /* not MOTOROLA */
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subql %#1,%0\;jcc %l1\";
return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
#endif /* not MOTOROLA */
}
else
{
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subql %#1,%0\;jcc %l1\";
return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
}
}")
;; Two dbra patterns that use REG_NOTES info generated by strength_reduce.
......@@ -6655,23 +6442,26 @@
"*
{
CC_STATUS_INIT;
#ifdef MOTOROLA
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.w %#1,%0\;jbcc %l1\";
if (MOTOROLA)
{
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.w %#1,%0\;jbcc %l1\";
#ifdef SGS_CMP_ORDER
return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
#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 */
#else /* not MOTOROLA */
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subqw %#1,%0\;jcc %l1\";
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
#endif /* not MOTOROLA */
}
else
{
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subqw %#1,%0\;jcc %l1\";
return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
}
}")
(define_expand "decrement_and_branch_until_zero"
......@@ -6703,23 +6493,26 @@
"*
{
CC_STATUS_INIT;
#ifdef MOTOROLA
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.l %#1,%0\;jbcc %l1\";
if (MOTOROLA)
{
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subq%.l %#1,%0\;jbcc %l1\";
#ifdef SGS_CMP_ORDER
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#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 */
#else /* not MOTOROLA */
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subql %#1,%0\;jcc %l1\";
return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
#endif /* not MOTOROLA */
}
else
{
if (DATA_REG_P (operands[0]))
return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
if (GET_CODE (operands[0]) == MEM)
return \"subql %#1,%0\;jcc %l1\";
return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
}
}")
......@@ -6781,7 +6574,7 @@
"! flag_pic"
"*
#if defined (MOTOROLA) && !defined (USE_GAS)
#if MOTOROLA && !defined (USE_GAS)
return \"jsr %0\";
#else
return \"jbsr %0\";
......@@ -6823,7 +6616,7 @@
;; Operand 2 not really used on the m68000.
"! flag_pic"
"*
#if defined (MOTOROLA) && !defined (USE_GAS)
#if MOTOROLA && !defined (USE_GAS)
return \"jsr %1\";
#else
return \"jbsr %1\";
......@@ -6919,7 +6712,7 @@
&& GET_CODE (XEXP (operands[1], 0)) != PLUS)
{
rtx labelref = XEXP (operands[1], 1);
#if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES)
#if MOTOROLA && !defined (SGS_SWITCH_TABLES)
#ifdef SGS
asm_fprintf (asm_out_file, \"\\tset %LLI%d,.+2\\n\",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
......@@ -6995,12 +6788,10 @@
{
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
else
#ifdef MOTOROLA
else if (MOTOROLA)
output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
#else
else
output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
#endif
}
else
output_asm_insn (\"add%.l %1,%0\", xoperands);
......@@ -7042,14 +6833,10 @@
{
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
else if (MOTOROLA)
output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
else
{
#ifdef MOTOROLA
output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
#else
output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
#endif
}
output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
}
else
output_asm_insn (\"add%.l %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