/* Xstormy16 cpu description.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
+ 2008, 2009 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
\f
/* Driver configuration */
R8_REGS,
ICALL_REGS,
GENERAL_REGS,
- CARRY_REGS,
ALL_REGS,
LIM_REG_CLASSES
};
#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, LIM_REG_CLASSES \
+}
+
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
"R8_REGS", \
"ICALL_REGS", \
"GENERAL_REGS", \
- "CARRY_REGS", \
"ALL_REGS" \
}
{ 0x00100 }, \
{ 0x00300 }, \
{ 0x6FFFF }, \
- { 0x10000 }, \
{ (1 << FIRST_PSEUDO_REGISTER) - 1 } \
}
#define REGNO_REG_CLASS(REGNO) \
- ((REGNO) == 0 ? R0_REGS \
- : (REGNO) == 1 ? R1_REGS \
- : (REGNO) == 2 ? R2_REGS \
- : (REGNO) < 8 ? EIGHT_REGS \
- : (REGNO) == 8 ? R8_REGS \
- : (REGNO) == 16 ? CARRY_REGS \
+ ( (REGNO) == 0 ? R0_REGS \
+ : (REGNO) == 1 ? R1_REGS \
+ : (REGNO) == 2 ? R2_REGS \
+ : (REGNO) < 8 ? EIGHT_REGS \
+ : (REGNO) == 8 ? R8_REGS \
: (REGNO) <= 18 ? GENERAL_REGS \
: ALL_REGS)
: (CHAR) == 'd' ? R8_REGS \
: (CHAR) == 'e' ? EIGHT_REGS \
: (CHAR) == 't' ? TWO_REGS \
- : (CHAR) == 'y' ? CARRY_REGS \
: (CHAR) == 'z' ? ICALL_REGS \
: NO_REGS)
because we don't have any pre-increment ones. */
#define STACK_PUSH_CODE POST_INC
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
#define ARGS_GROW_DOWNWARD 1
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-4)))
-#define INCOMING_FRAME_SP_OFFSET (xstormy16_interrupt_function_p () ? 6 : 4)
+#define INCOMING_FRAME_SP_OFFSET (xstormy16_interrupt_function_p () ? -6 : -4)
\f
/* Register That Address the Stack Frame. */
-#define STACK_POINTER_REGNUM 15
-
-#define FRAME_POINTER_REGNUM 17
-
+#define STATIC_CHAIN_REGNUM 1
#define HARD_FRAME_POINTER_REGNUM 13
-
-#define ARG_POINTER_REGNUM 18
-
-#define STATIC_CHAIN_REGNUM 1
+#define STACK_POINTER_REGNUM 15
+#define CARRY_REGNUM 16
+#define FRAME_POINTER_REGNUM 17
+#define ARG_POINTER_REGNUM 18
\f
/* Eliminating the Frame Pointer and the Arg Pointer */
-#define FRAME_POINTER_REQUIRED 0
-
#define ELIMINABLE_REGS \
{ \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
}
-#define CAN_ELIMINATE(FROM, TO) \
- ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
- ? ! frame_pointer_needed \
- : 1)
-
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
(OFFSET) = xstormy16_initial_elimination_offset (FROM, TO)
contains a '%s' sequence, this will be replaced by the name of the function. */
/* #define TARGET_CANNOT_INLINE_P(FN_DECL) xstormy16_cannot_inline_p (FN_DECL) */
\f
-/* Implementing the Varargs Macros. */
-
-/* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this
- is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
- variable to initialize. NEXTARG is the machine independent notion of the
- 'next' argument after the variable arguments. If not defined, a standard
- implementation will be defined that works for arguments passed on the stack. */
-#define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
- xstormy16_expand_builtin_va_start (VALIST, NEXTARG)
-\f
/* Trampolines for Nested Functions. */
#define TRAMPOLINE_SIZE 8
-
#define TRAMPOLINE_ALIGNMENT 16
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
- xstormy16_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
-
\f
/* Define this macro to override the type used by the library routines to pick
up arguments of type `float'. (By default, they use a union of `float' and
#define HAVE_PRE_DECREMENT 1
-#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-
#define MAX_REGS_PER_ADDRESS 1
#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
-do { \
- if (xstormy16_legitimate_address_p (MODE, X, 1)) \
- goto LABEL; \
-} while (0)
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
-do { \
- if (xstormy16_legitimate_address_p (MODE, X, 0)) \
- goto LABEL; \
-} while (0)
-#endif
-
-#ifdef REG_OK_STRICT
#define REG_OK_FOR_BASE_P(X) \
(REGNO_OK_FOR_BASE_P (REGNO (X)) && (REGNO (X) < FIRST_PSEUDO_REGISTER))
#else
#define MEMORY_MOVE_COST(M,C,I) (5 + memory_move_secondary_cost (M, C, I))
-#define BRANCH_COST 5
+#define BRANCH_COST(speed_p, predictable_p) 5
#define SLOW_BYTE_ACCESS 0
#undef DTORS_SECTION_ASM_OP
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"a\""
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"a\""
-#define EXTRA_SECTIONS in_bss100
-
-/* We define the function body in a separate macro so that if we ever
- add another section, we can just add an entry to
- EXTRA_SECTION_FUNCTIONS without making it difficult to read. It is
- not used anywhere else. */
-#define XSTORMY16_SECTION_FUNCTION(name, in, string, bits) \
- void \
- name () \
- { \
- if (in_section != in) \
- { \
- fprintf (asm_out_file, "\t.section %s,\"aw\",@%sbits\n", string, bits); \
- in_section = in; \
- } \
- }
-
-#undef EXTRA_SECTION_FUNCTIONS
-#define EXTRA_SECTION_FUNCTIONS \
- XSTORMY16_SECTION_FUNCTION (bss100_section, in_bss100, ".bss_below100", "no")
-#define JUMP_TABLES_IN_TEXT_SECTION 1
+#define TARGET_ASM_INIT_SECTIONS xstormy16_asm_init_sections
+#define JUMP_TABLES_IN_TEXT_SECTION 1
\f
/* The Overall Framework of an Assembler File. */
\f
/* Output of Data. */
-#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '|')
+#define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) ((C) == '|')
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(STREAM, DECL, NAME, SIZE, ALIGNMENT) \
- xstormy16_asm_output_aligned_common(STREAM, DECL, NAME, SIZE, ALIGNMENT, 1)
+ xstormy16_asm_output_aligned_common (STREAM, DECL, NAME, SIZE, ALIGNMENT, 1)
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGNMENT) \
- xstormy16_asm_output_aligned_common(STREAM, DECL, NAME, SIZE, ALIGNMENT, 0)
+ xstormy16_asm_output_aligned_common (STREAM, DECL, NAME, SIZE, ALIGNMENT, 0)
\f
/* Output and Generation of Labels. */
+#define SYMBOL_FLAG_XSTORMY16_BELOW100 (SYMBOL_FLAG_MACH_DEP << 0)
#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL) \
do { \
const char *rn = XSTR (SYMBOL, 0); \
- if (rn[0] == '@' && rn[2] == '.') \
- rn += 3; \
if (SYMBOL_REF_FUNCTION_P (SYMBOL)) \
ASM_OUTPUT_LABEL_REF ((STREAM), rn); \
else \
fputc (')', STREAM); \
} while (0)
-#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
- asm_fprintf ((STREAM), "%U%s", xstormy16_strip_name_encoding (NAME));
-
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl "
\f
/* Assembler Commands for Exception Regions. */
-#define DWARF2_UNWIND_INFO 0
+#define DWARF2_UNWIND_INFO 0
+#define DWARF_CIE_DATA_ALIGNMENT 1
/* Don't use __builtin_setjmp for unwinding, since it's tricky to get
at the high 16 bits of an address. */
is responsible for updating the value of MORE (typically by (MORE)--). */
/* #define MD_SCHED_VARIABLE_ISSUE (FILE, VERBOSE, INSN, MORE) */
-\f
-/* Define the information needed to generate branch and scc insns. This is
- stored from the compare operation. Note that we can't use "rtx" here
- since it hasn't been defined! */
-
-extern struct rtx_def *xstormy16_compare_op0, *xstormy16_compare_op1;
-
/* End of xstormy16.h */