+2002-09-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * frv-protos.h (frv_init_builtins, frv_expand_builtin,
+ frv_select_section, frv_select_rtx_section,
+ frv_encode_section_info, frv_unique_section): Delete.
+ * frv.c: Update for target hooks.
+ * frv.h (STRIP_NAME_ENCODING, SLOW_ZERO_EXTEND, SELECT_SECTION,
+ SELECT_RTX_SECTION, ENCODE_SECTION_INFO, UNIQUE_SECTION,
+ EASY_DIV_EXPR, MD_INIT_BUILTINS, MD_EXPAND_BUILTIN): Delete.
+
2002-09-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ip2k-protos.h (function_prologue, function_epilogue,
enum machine_mode));
#ifdef TREE_CODE
-extern void frv_init_builtins PARAMS ((void));
-extern rtx frv_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
-
extern void frv_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree,
rtx, int, int));
#ifdef TREE_CODE
extern int frv_adjust_field_align PARAMS ((tree, int));
-extern void frv_select_section PARAMS ((tree, int));
-#endif
-
-#ifdef RTX_CODE
-extern void frv_select_rtx_section PARAMS ((enum machine_mode, rtx));
-#endif
-
-#ifdef TREE_CODE
-extern void frv_encode_section_info PARAMS ((tree));
-extern void frv_unique_section PARAMS ((tree, int));
#endif
extern void fixup_section PARAMS ((void));
static void frv_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void frv_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static bool frv_assemble_integer PARAMS ((rtx, unsigned, int));
+static const char * frv_strip_name_encoding PARAMS ((const char *));
+static void frv_encode_section_info PARAMS ((tree, int));
+static void frv_unique_section PARAMS ((tree, int));
+static void frv_init_builtins PARAMS ((void));
+static rtx frv_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
+static void frv_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT));
+static void frv_select_rtx_section PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
\f
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE frv_function_epilogue
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER frv_assemble_integer
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING frv_strip_name_encoding
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO frv_encode_section_info
+#undef TARGET_ASM_UNIQUE_SECTION
+#define TARGET_ASM_UNIQUE_SECTION frv_unique_section
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS frv_init_builtins
+#undef TARGET_EXPAND_BUILTIN
+#define TARGET_EXPAND_BUILTIN frv_expand_builtin
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION frv_select_section
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION frv_select_rtx_section
struct gcc_target targetm = TARGET_INITIALIZER;
\f
Defined in svr4.h. */
-void
-frv_select_section (decl, reloc)
+static void
+frv_select_section (decl, reloc, align)
tree decl;
int reloc;
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
{
int size = int_size_in_bytes (TREE_TYPE (decl));
Defined in svr4.h. */
-void
-frv_select_rtx_section (mode, op)
+static void
+frv_select_rtx_section (mode, op, align)
enum machine_mode mode;
rtx op ATTRIBUTE_UNUSED;
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
{
int size = (int) GET_MODE_SIZE (mode);
if (size > 0 && size <= g_switch_value)
*/
-void
-frv_encode_section_info (decl)
+static void
+frv_encode_section_info (decl, first)
tree decl;
+ int first;
{
+ if (first)
+ return;
if (TREE_CODE (decl) == VAR_DECL)
{
int size = int_size_in_bytes (TREE_TYPE (decl));
}
}
-void
+static void
frv_unique_section (decl, reloc)
tree decl;
int reloc;
const char *name;
char *string;
const char *prefix;
- static const char *prefixes[4][2] =
+ static const char *const prefixes[4][2] =
{
{ ".text.", ".gnu.linkonce.t." },
{ ".rodata.", ".gnu.linkonce.r." },
if (TREE_CODE (decl) == FUNCTION_DECL)
sec = 0;
- else if (DECL_READONLY_SECTION (decl, reloc))
+ else if (decl_readonly_section (decl, reloc))
sec = 1;
else if (SDATA_NAME_P (XSTR (XEXP (DECL_RTL (decl), 0), 0)))
sec = 3;
sec = 2;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- STRIP_NAME_ENCODING (name, name);
+ name = (* targetm.strip_name_encoding) (name);
prefix = prefixes[sec][DECL_ONE_ONLY (decl)];
len = strlen (name) + strlen (prefix);
string = alloca (len + 1);
with suitable punctuation to prevent any ambiguity. Allocate the new name
in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to
remove and decode the added text and output the name accordingly, and define
- `STRIP_NAME_ENCODING' to access the original name string.
+ `(* targetm.strip_name_encoding)' to access the original name string.
You can check the information stored here into the `symbol_ref' in the
definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
const char *p;
ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", label_num++);
- STRIP_NAME_ENCODING (p, buf);
+ p = (* targetm.strip_name_encoding) (buf);
fprintf (asm_out_file, "%s:\n", p);
fprintf (asm_out_file, "%s\n", FIXUP_SECTION_ASM_OP);
/* Initialize media builtins. */
-void
+static void
frv_init_builtins ()
{
tree endlink = void_list_node;
/* Expand builtins. */
-rtx
+static rtx
frv_expand_builtin (exp, target, subtarget, mode, ignore)
tree exp;
rtx target;
}
return 0;
}
+
+static const char *
+frv_strip_name_encoding (str)
+ const char *str;
+{
+ while (*str == '*' || *str == SDATA_FLAG_CHAR)
+ str++;
+ return str;
+}
with suitable punctuation to prevent any ambiguity. Allocate the new name
in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to
remove and decode the added text and output the name accordingly, and define
- `STRIP_NAME_ENCODING' to access the original name string.
+ `(* targetm.strip_name_encoding)' to access the original name string.
You can check the information stored here into the `symbol_ref' in the
definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
same word of the structure, but to different bytes. */
#define SLOW_BYTE_ACCESS 1
-/* Define this macro if zero-extension (of a `char' or `short' to an `int') can
- be done faster if the destination is a register that is known to be zero.
-
- If you define this macro, you must have instruction patterns that recognize
- RTL structures like this:
-
- (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
-
- and likewise for `HImode'. */
-#define SLOW_ZERO_EXTEND 0
-
/* Define this macro if it is as good or better to call a constant function
address than to call an address kept in a register. */
#define NO_FUNCTION_CSE
} \
} \
-/* A C statement or statements to switch to the appropriate section for output
- of EXP. You can assume that EXP is either a `VAR_DECL' node or a constant
- of some sort. RELOC indicates whether the initial value of EXP requires
- link-time relocations. Select the section by calling `text_section' or one
- of the alternatives for other sections.
-
- Do not define this macro if you put all read-only variables and constants in
- the read-only data section (usually the text section).
-
- Defined in svr4.h. */
-#undef SELECT_SECTION
-#define SELECT_SECTION(EXP, RELOC, ALIGN) frv_select_section ((EXP), (RELOC))
-
-/* A C statement or statements to switch to the appropriate section for output
- of RTX in mode MODE. You can assume that RTX is some kind of constant in
- RTL. The argument MODE is redundant except in the case of a `const_int'
- rtx. Select the section by calling `text_section' or one of the
- alternatives for other sections.
-
- Do not define this macro if you put all constants in the read-only data
- section.
-
- Defined in svr4.h. */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) frv_select_rtx_section (MODE, RTX)
-
#define SDATA_FLAG_CHAR '@'
#define SDATA_NAME_P(NAME) (*(NAME) == SDATA_FLAG_CHAR)
-
-#define ENCODE_SECTION_INFO(DECL, FIRST) \
- do \
- { \
- if (FIRST) \
- frv_encode_section_info (DECL); \
- } \
- while (0)
-
-/* Decode SYM_NAME and store the real name part in VAR, sans
- the characters that encode section info. Define this macro if
- ENCODE_SECTION_INFO alters the symbol's name string. */
-
-#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
- do \
- { \
- const char * _name = (SYMBOL_NAME); \
- \
- while (* _name == '*' || * _name == SDATA_FLAG_CHAR) \
- _name ++; \
- (VAR) = _name; \
- } \
- while (0)
-
\f
/* Position Independent Code. */
Defined in svr4.h. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-/* This version of UNIQUE_SECTION overrides the one in elfos.h. We
- need to check whether DECL is destined for the .sdata section. */
-
-#undef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL,RELOC) frv_unique_section (DECL, RELOC)
\f
/* Miscellaneous Parameters. */
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
-/* An alias for a tree code that is the easiest kind of division to compile
- code for in the general case. It may be `TRUNC_DIV_EXPR', `FLOOR_DIV_EXPR',
- `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four division operators differ
- in how they round the result to an integer. `EASY_DIV_EXPR' is used when it
- is permissible to use any of those kinds of division and the choice should
- be made on the basis of efficiency. */
-#define EASY_DIV_EXPR TRUNC_DIV_EXPR
-
/* The maximum number of bytes that a single instruction can move quickly from
memory to memory. */
#define MOVE_MAX 8
FRV_BUILTIN_MHDSETH
};
-#define MD_INIT_BUILTINS do { \
- frv_init_builtins (); \
- } while (0)
-
-#define MD_EXPAND_BUILTIN(EXP, TARGET, SUBTARGET, MODE, IGNORE) \
- frv_expand_builtin ((EXP), (TARGET), (SUBTARGET), (MODE), (IGNORE))
-
/* Enable prototypes on the call rtl functions. */
#define MD_CALL_PROTOTYPES 1