diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2002-09-04 20:56:33 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2002-09-04 20:56:33 +0000 |
commit | 14966b9462e5f6d52e27d86238a36b59ef5d5089 (patch) | |
tree | 9c81a2751550b9bee5cc87f12390e71ca73bf7a8 /gcc/config/frv | |
parent | c8bf1a1a914158643b5c953e672f7275766623f6 (diff) | |
download | gcc-14966b9462e5f6d52e27d86238a36b59ef5d5089.zip gcc-14966b9462e5f6d52e27d86238a36b59ef5d5089.tar.gz gcc-14966b9462e5f6d52e27d86238a36b59ef5d5089.tar.bz2 |
frv-protos.h (frv_init_builtins, [...]): Delete.
* 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.
From-SVN: r56810
Diffstat (limited to 'gcc/config/frv')
-rw-r--r-- | gcc/config/frv/frv-protos.h | 13 | ||||
-rw-r--r-- | gcc/config/frv/frv.c | 63 | ||||
-rw-r--r-- | gcc/config/frv/frv.h | 84 |
3 files changed, 50 insertions, 110 deletions
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index d00a9b8..c3f13f5 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -69,9 +69,6 @@ extern rtx frv_legitimize_address PARAMS ((rtx, rtx, 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)); @@ -174,16 +171,6 @@ extern int frv_register_move_cost PARAMS ((enum reg_class, enum reg_class)); #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)); diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 11b3674..0ef0afe 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -274,6 +274,13 @@ static void frv_pack_insns 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)); /* Initialize the GCC target structure. */ #undef TARGET_ASM_FUNCTION_PROLOGUE @@ -282,6 +289,20 @@ static bool frv_assemble_integer PARAMS ((rtx, unsigned, int)); #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; @@ -620,10 +641,11 @@ frv_optimization_options (level, size) 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)); @@ -676,10 +698,11 @@ frv_select_section (decl, reloc) 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) @@ -713,10 +736,13 @@ frv_string_begins_with (name, prefix) */ -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)); @@ -757,7 +783,7 @@ frv_encode_section_info (decl) } } -void +static void frv_unique_section (decl, reloc) tree decl; int reloc; @@ -767,7 +793,7 @@ frv_unique_section (decl, 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." }, @@ -777,7 +803,7 @@ frv_unique_section (decl, reloc) 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; @@ -785,7 +811,7 @@ frv_unique_section (decl, reloc) 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); @@ -3480,7 +3506,7 @@ frv_regno_ok_for_base_p (regno, strict_p) 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 @@ -8309,7 +8335,7 @@ frv_assemble_integer (value, size, aligned_p) 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); @@ -9087,7 +9113,7 @@ static struct builtin_description bdesc_voidacc[] = /* Initialize media builtins. */ -void +static void frv_init_builtins () { tree endlink = void_list_node; @@ -9706,7 +9732,7 @@ frv_expand_mwtacc_builtin (icode, arglist) /* Expand builtins. */ -rtx +static rtx frv_expand_builtin (exp, target, subtarget, mode, ignore) tree exp; rtx target; @@ -9854,3 +9880,12 @@ frv_expand_builtin (exp, target, subtarget, mode, ignore) } return 0; } + +static const char * +frv_strip_name_encoding (str) + const char *str; +{ + while (*str == '*' || *str == SDATA_FLAG_CHAR) + str++; + return str; +} diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 0bd7b4d..a663c03 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -2464,7 +2464,7 @@ __asm__("\n" \ 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 @@ -2722,17 +2722,6 @@ __asm__("\n" \ 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 @@ -2837,59 +2826,9 @@ fixup_section () \ } \ } \ -/* 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) - /* Position Independent Code. */ @@ -3366,12 +3305,6 @@ do { \ 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) /* Miscellaneous Parameters. */ @@ -3494,14 +3427,6 @@ do { \ /* 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 @@ -3726,13 +3651,6 @@ enum frv_builtins 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 |