target-def.h revision 90075
190075Sobrien/* Default initializers for a generic GCC target.
290075Sobrien   Copyright (C) 2001 Free Software Foundation, Inc.
390075Sobrien
490075SobrienThis program is free software; you can redistribute it and/or modify it
590075Sobrienunder the terms of the GNU General Public License as published by the
690075SobrienFree Software Foundation; either version 2, or (at your option) any
790075Sobrienlater version.
890075Sobrien
990075SobrienThis program is distributed in the hope that it will be useful,
1090075Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1190075SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1290075SobrienGNU General Public License for more details.
1390075Sobrien
1490075SobrienYou should have received a copy of the GNU General Public License
1590075Sobrienalong with this program; if not, write to the Free Software
1690075SobrienFoundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1790075Sobrien
1890075Sobrien In other words, you are welcome to use, share and improve this program.
1990075Sobrien You are forbidden to forbid anyone else to use, share and improve
2090075Sobrien what you give them.   Help stamp out software-hoarding!  */
2190075Sobrien
2290075Sobrien/* See target.h for a description of what this file contains and how to
2390075Sobrien   use it.
2490075Sobrien
2590075Sobrien   We want to have non-NULL default definitions of all hook functions,
2690075Sobrien   even if they do nothing.  */
2790075Sobrien
2890075Sobrien/* Note that if one of these macros must be defined in an OS .h file
2990075Sobrien   rather than the .c file, then we need to wrap the default
3090075Sobrien   definition in a #ifndef, since files include tm.h before this one.  */
3190075Sobrien
3290075Sobrien/* Assembler output.  */
3390075Sobrien#define TARGET_ASM_OPEN_PAREN "("
3490075Sobrien#define TARGET_ASM_CLOSE_PAREN ")"
3590075Sobrien#define TARGET_ASM_BYTE_OP "\t.byte\t"
3690075Sobrien
3790075Sobrien#define TARGET_ASM_ALIGNED_HI_OP "\t.short\t"
3890075Sobrien#define TARGET_ASM_ALIGNED_SI_OP "\t.long\t"
3990075Sobrien#define TARGET_ASM_ALIGNED_DI_OP NULL
4090075Sobrien#define TARGET_ASM_ALIGNED_TI_OP NULL
4190075Sobrien
4290075Sobrien/* GAS and SYSV4 assemblers accept these.  */
4390075Sobrien#if defined (OBJECT_FORMAT_ELF) || defined (OBJECT_FORMAT_ROSE)
4490075Sobrien#define TARGET_ASM_UNALIGNED_HI_OP "\t.2byte\t"
4590075Sobrien#define TARGET_ASM_UNALIGNED_SI_OP "\t.4byte\t"
4690075Sobrien#define TARGET_ASM_UNALIGNED_DI_OP "\t.8byte\t"
4790075Sobrien#define TARGET_ASM_UNALIGNED_TI_OP NULL
4890075Sobrien#else
4990075Sobrien#define TARGET_ASM_UNALIGNED_HI_OP NULL
5090075Sobrien#define TARGET_ASM_UNALIGNED_SI_OP NULL
5190075Sobrien#define TARGET_ASM_UNALIGNED_DI_OP NULL
5290075Sobrien#define TARGET_ASM_UNALIGNED_TI_OP NULL
5390075Sobrien#endif /* OBJECT_FORMAT_ELF || OBJECT_FORMAT_ROSE */
5490075Sobrien
5590075Sobrien#define TARGET_ASM_INTEGER default_assemble_integer
5690075Sobrien
5790075Sobrien#define TARGET_ASM_FUNCTION_PROLOGUE default_function_pro_epilogue
5890075Sobrien#define TARGET_ASM_FUNCTION_EPILOGUE default_function_pro_epilogue
5990075Sobrien#define TARGET_ASM_FUNCTION_END_PROLOGUE no_asm_to_stream
6090075Sobrien#define TARGET_ASM_FUNCTION_BEGIN_EPILOGUE no_asm_to_stream
6190075Sobrien
6290075Sobrien#if !defined(TARGET_ASM_CONSTRUCTOR) && !defined(USE_COLLECT2)
6390075Sobrien# ifdef CTORS_SECTION_ASM_OP
6490075Sobrien#  define TARGET_ASM_CONSTRUCTOR default_ctor_section_asm_out_constructor
6590075Sobrien# else
6690075Sobrien#  ifdef TARGET_ASM_NAMED_SECTION
6790075Sobrien#   define TARGET_ASM_CONSTRUCTOR default_named_section_asm_out_constructor
6890075Sobrien#  else
6990075Sobrien#   define TARGET_ASM_CONSTRUCTOR default_stabs_asm_out_constructor
7090075Sobrien#  endif
7190075Sobrien# endif
7290075Sobrien#endif
7390075Sobrien
7490075Sobrien#if !defined(TARGET_ASM_DESTRUCTOR) && !defined(USE_COLLECT2)
7590075Sobrien# ifdef DTORS_SECTION_ASM_OP
7690075Sobrien#  define TARGET_ASM_DESTRUCTOR default_dtor_section_asm_out_destructor
7790075Sobrien# else
7890075Sobrien#  ifdef TARGET_ASM_NAMED_SECTION
7990075Sobrien#   define TARGET_ASM_DESTRUCTOR default_named_section_asm_out_destructor
8090075Sobrien#  else
8190075Sobrien#   define TARGET_ASM_DESTRUCTOR default_stabs_asm_out_destructor
8290075Sobrien#  endif
8390075Sobrien# endif
8490075Sobrien#endif
8590075Sobrien
8690075Sobrien#if defined(TARGET_ASM_CONSTRUCTOR) && defined(TARGET_ASM_DESTRUCTOR)
8790075Sobrien#define TARGET_HAVE_CTORS_DTORS true
8890075Sobrien#else
8990075Sobrien#define TARGET_HAVE_CTORS_DTORS false
9090075Sobrien#define TARGET_ASM_CONSTRUCTOR NULL
9190075Sobrien#define TARGET_ASM_DESTRUCTOR NULL
9290075Sobrien#endif
9390075Sobrien
9490075Sobrien#ifdef TARGET_ASM_NAMED_SECTION
9590075Sobrien#define TARGET_HAVE_NAMED_SECTIONS true
9690075Sobrien#else
9790075Sobrien#define TARGET_ASM_NAMED_SECTION default_no_named_section
9890075Sobrien#define TARGET_HAVE_NAMED_SECTIONS false
9990075Sobrien#endif
10090075Sobrien
10190075Sobrien#ifndef TARGET_ASM_EXCEPTION_SECTION
10290075Sobrien#define TARGET_ASM_EXCEPTION_SECTION default_exception_section
10390075Sobrien#endif
10490075Sobrien
10590075Sobrien#ifndef TARGET_ASM_EH_FRAME_SECTION
10690075Sobrien#define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
10790075Sobrien#endif
10890075Sobrien
10990075Sobrien#define TARGET_ASM_ALIGNED_INT_OP				\
11090075Sobrien		       {TARGET_ASM_ALIGNED_HI_OP,		\
11190075Sobrien			TARGET_ASM_ALIGNED_SI_OP,		\
11290075Sobrien			TARGET_ASM_ALIGNED_DI_OP,		\
11390075Sobrien			TARGET_ASM_ALIGNED_TI_OP}
11490075Sobrien
11590075Sobrien#define TARGET_ASM_UNALIGNED_INT_OP				\
11690075Sobrien		       {TARGET_ASM_UNALIGNED_HI_OP,		\
11790075Sobrien			TARGET_ASM_UNALIGNED_SI_OP,		\
11890075Sobrien			TARGET_ASM_UNALIGNED_DI_OP,		\
11990075Sobrien			TARGET_ASM_UNALIGNED_TI_OP}
12090075Sobrien
12190075Sobrien#define TARGET_ASM_OUT {TARGET_ASM_OPEN_PAREN,			\
12290075Sobrien			TARGET_ASM_CLOSE_PAREN,			\
12390075Sobrien			TARGET_ASM_BYTE_OP,			\
12490075Sobrien			TARGET_ASM_ALIGNED_INT_OP,		\
12590075Sobrien			TARGET_ASM_UNALIGNED_INT_OP,		\
12690075Sobrien			TARGET_ASM_INTEGER,			\
12790075Sobrien			TARGET_ASM_FUNCTION_PROLOGUE,		\
12890075Sobrien			TARGET_ASM_FUNCTION_END_PROLOGUE,	\
12990075Sobrien			TARGET_ASM_FUNCTION_BEGIN_EPILOGUE,	\
13090075Sobrien			TARGET_ASM_FUNCTION_EPILOGUE,		\
13190075Sobrien			TARGET_ASM_NAMED_SECTION,		\
13290075Sobrien			TARGET_ASM_EXCEPTION_SECTION,		\
13390075Sobrien			TARGET_ASM_EH_FRAME_SECTION,		\
13490075Sobrien			TARGET_ASM_CONSTRUCTOR,			\
13590075Sobrien			TARGET_ASM_DESTRUCTOR}
13690075Sobrien
13790075Sobrien/* Scheduler hooks.  All of these default to null pointers, which
13890075Sobrien   haifa-sched.c looks for and handles.  */
13990075Sobrien#define TARGET_SCHED_ADJUST_COST 0
14090075Sobrien#define TARGET_SCHED_ADJUST_PRIORITY 0
14190075Sobrien#define TARGET_SCHED_ISSUE_RATE 0
14290075Sobrien#define TARGET_SCHED_VARIABLE_ISSUE 0
14390075Sobrien#define TARGET_SCHED_INIT 0
14490075Sobrien#define TARGET_SCHED_FINISH 0
14590075Sobrien#define TARGET_SCHED_REORDER 0
14690075Sobrien#define TARGET_SCHED_REORDER2 0
14790075Sobrien#define TARGET_SCHED_CYCLE_DISPLAY 0
14890075Sobrien
14990075Sobrien#define TARGET_SCHED	{TARGET_SCHED_ADJUST_COST,	\
15090075Sobrien			 TARGET_SCHED_ADJUST_PRIORITY,	\
15190075Sobrien			 TARGET_SCHED_ISSUE_RATE,	\
15290075Sobrien			 TARGET_SCHED_VARIABLE_ISSUE,	\
15390075Sobrien			 TARGET_SCHED_INIT,		\
15490075Sobrien			 TARGET_SCHED_FINISH,		\
15590075Sobrien			 TARGET_SCHED_REORDER,		\
15690075Sobrien			 TARGET_SCHED_REORDER2,		\
15790075Sobrien			 TARGET_SCHED_CYCLE_DISPLAY}
15890075Sobrien
15990075Sobrien/* All in tree.c.  */
16090075Sobrien#define TARGET_MERGE_DECL_ATTRIBUTES merge_decl_attributes
16190075Sobrien#define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes
16290075Sobrien#define TARGET_ATTRIBUTE_TABLE default_target_attribute_table
16390075Sobrien#define TARGET_COMP_TYPE_ATTRIBUTES default_comp_type_attributes
16490075Sobrien#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES default_set_default_type_attributes
16590075Sobrien#define TARGET_INSERT_ATTRIBUTES default_insert_attributes
16690075Sobrien#define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P default_function_attribute_inlinable_p
16790075Sobrien
16890075Sobrien/* In builtins.c.  */
16990075Sobrien#define TARGET_INIT_BUILTINS default_init_builtins
17090075Sobrien#define TARGET_EXPAND_BUILTIN default_expand_builtin
17190075Sobrien
17290075Sobrien/* In varasm.c.  */
17390075Sobrien#ifndef TARGET_SECTION_TYPE_FLAGS
17490075Sobrien#define TARGET_SECTION_TYPE_FLAGS default_section_type_flags
17590075Sobrien#endif
17690075Sobrien
17790075Sobrien/* The whole shebang.  */
17890075Sobrien#define TARGET_INITIALIZER			\
17990075Sobrien{						\
18090075Sobrien  TARGET_ASM_OUT,				\
18190075Sobrien  TARGET_SCHED,					\
18290075Sobrien  TARGET_MERGE_DECL_ATTRIBUTES,			\
18390075Sobrien  TARGET_MERGE_TYPE_ATTRIBUTES,			\
18490075Sobrien  TARGET_ATTRIBUTE_TABLE,			\
18590075Sobrien  TARGET_COMP_TYPE_ATTRIBUTES,			\
18690075Sobrien  TARGET_SET_DEFAULT_TYPE_ATTRIBUTES,		\
18790075Sobrien  TARGET_INSERT_ATTRIBUTES,			\
18890075Sobrien  TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P,	\
18990075Sobrien  TARGET_INIT_BUILTINS,				\
19090075Sobrien  TARGET_EXPAND_BUILTIN,			\
19190075Sobrien  TARGET_SECTION_TYPE_FLAGS,			\
19290075Sobrien  TARGET_HAVE_NAMED_SECTIONS,			\
19390075Sobrien  TARGET_HAVE_CTORS_DTORS			\
19490075Sobrien}
195