1 |
38 |
julius |
/* Definitions of target machine for GNU compiler for Renesas / SuperH SH.
|
2 |
|
|
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003,
|
3 |
|
|
2004, 2005, 2007
|
4 |
|
|
Free Software Foundation, Inc.
|
5 |
|
|
Contributed by Steve Chamberlain (sac@cygnus.com).
|
6 |
|
|
Improved by Jim Wilson (wilson@cygnus.com).
|
7 |
|
|
|
8 |
|
|
This file is part of GCC.
|
9 |
|
|
|
10 |
|
|
GCC is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 3, or (at your option)
|
13 |
|
|
any later version.
|
14 |
|
|
|
15 |
|
|
GCC is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with GCC; see the file COPYING3. If not see
|
22 |
|
|
<http://www.gnu.org/licenses/>. */
|
23 |
|
|
|
24 |
|
|
#ifndef GCC_SH_PROTOS_H
|
25 |
|
|
#define GCC_SH_PROTOS_H
|
26 |
|
|
|
27 |
|
|
enum sh_function_kind {
|
28 |
|
|
/* A function with normal C ABI */
|
29 |
|
|
FUNCTION_ORDINARY,
|
30 |
|
|
/* A special function that guarantees that some otherwise call-clobbered
|
31 |
|
|
registers are not clobbered. These can't go through the SH5 resolver,
|
32 |
|
|
because it only saves argument passing registers. */
|
33 |
|
|
SFUNC_GOT,
|
34 |
|
|
/* A special function that should be linked statically. These are typically
|
35 |
|
|
smaller or not much larger than a PLT entry.
|
36 |
|
|
Some also have a non-standard ABI which precludes dynamic linking. */
|
37 |
|
|
SFUNC_STATIC
|
38 |
|
|
};
|
39 |
|
|
|
40 |
|
|
#ifdef RTX_CODE
|
41 |
|
|
extern rtx sh_fsca_sf2int (void);
|
42 |
|
|
extern rtx sh_fsca_df2int (void);
|
43 |
|
|
extern rtx sh_fsca_int2sf (void);
|
44 |
|
|
extern struct rtx_def *prepare_scc_operands (enum rtx_code);
|
45 |
|
|
|
46 |
|
|
/* Declare functions defined in sh.c and used in templates. */
|
47 |
|
|
|
48 |
|
|
extern const char *output_branch (int, rtx, rtx *);
|
49 |
|
|
extern const char *output_ieee_ccmpeq (rtx, rtx *);
|
50 |
|
|
extern const char *output_branchy_insn (enum rtx_code, const char *, rtx, rtx *);
|
51 |
|
|
extern const char *output_movedouble (rtx, rtx[], enum machine_mode);
|
52 |
|
|
extern const char *output_movepcrel (rtx, rtx[], enum machine_mode);
|
53 |
|
|
extern const char *output_far_jump (rtx, rtx);
|
54 |
|
|
|
55 |
|
|
extern struct rtx_def *sfunc_uses_reg (rtx);
|
56 |
|
|
extern int barrier_align (rtx);
|
57 |
|
|
extern int sh_loop_align (rtx);
|
58 |
|
|
extern int fp_zero_operand (rtx);
|
59 |
|
|
extern int fp_one_operand (rtx);
|
60 |
|
|
extern int fp_int_operand (rtx);
|
61 |
|
|
extern rtx get_fpscr_rtx (void);
|
62 |
|
|
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
|
63 |
|
|
extern int nonpic_symbol_mentioned_p (rtx);
|
64 |
|
|
extern void emit_sf_insn (rtx);
|
65 |
|
|
extern void emit_df_insn (rtx);
|
66 |
|
|
extern void print_operand_address (FILE *, rtx);
|
67 |
|
|
extern void print_operand (FILE *, rtx, int);
|
68 |
|
|
extern void output_pic_addr_const (FILE *, rtx);
|
69 |
|
|
extern int expand_block_move (rtx *);
|
70 |
|
|
extern int prepare_move_operands (rtx[], enum machine_mode mode);
|
71 |
|
|
extern void from_compare (rtx *, int);
|
72 |
|
|
extern int shift_insns_rtx (rtx);
|
73 |
|
|
extern void gen_ashift (int, int, rtx);
|
74 |
|
|
extern void gen_ashift_hi (int, int, rtx);
|
75 |
|
|
extern void gen_shifty_op (int, rtx *);
|
76 |
|
|
extern void gen_shifty_hi_op (int, rtx *);
|
77 |
|
|
extern int expand_ashiftrt (rtx *);
|
78 |
|
|
extern int sh_dynamicalize_shift_p (rtx);
|
79 |
|
|
extern int shl_and_kind (rtx, rtx, int *);
|
80 |
|
|
extern int shl_and_length (rtx);
|
81 |
|
|
extern int shl_and_scr_length (rtx);
|
82 |
|
|
extern int gen_shl_and (rtx, rtx, rtx, rtx);
|
83 |
|
|
extern int shl_sext_kind (rtx, rtx, int *);
|
84 |
|
|
extern int shl_sext_length (rtx);
|
85 |
|
|
extern int gen_shl_sext (rtx, rtx, rtx, rtx);
|
86 |
|
|
extern rtx gen_datalabel_ref (rtx);
|
87 |
|
|
extern int regs_used (rtx, int);
|
88 |
|
|
extern void fixup_addr_diff_vecs (rtx);
|
89 |
|
|
extern int get_dest_uid (rtx, int);
|
90 |
|
|
extern void final_prescan_insn (rtx, rtx *, int);
|
91 |
|
|
extern int symbol_ref_operand (rtx, enum machine_mode);
|
92 |
|
|
extern int tls_symbolic_operand (rtx, enum machine_mode);
|
93 |
|
|
extern int system_reg_operand (rtx, enum machine_mode);
|
94 |
|
|
extern int general_movsrc_operand (rtx, enum machine_mode);
|
95 |
|
|
extern int general_movdst_operand (rtx, enum machine_mode);
|
96 |
|
|
extern int arith_reg_operand (rtx, enum machine_mode);
|
97 |
|
|
extern int fp_arith_reg_operand (rtx, enum machine_mode);
|
98 |
|
|
extern int arith_operand (rtx, enum machine_mode);
|
99 |
|
|
extern int arith_reg_or_0_operand (rtx, enum machine_mode);
|
100 |
|
|
extern int logical_operand (rtx, enum machine_mode);
|
101 |
|
|
extern int tertiary_reload_operand (rtx, enum machine_mode);
|
102 |
|
|
extern int fpscr_operand (rtx, enum machine_mode);
|
103 |
|
|
extern int fpul_operand (rtx, enum machine_mode);
|
104 |
|
|
extern int commutative_float_operator (rtx, enum machine_mode);
|
105 |
|
|
extern int noncommutative_float_operator (rtx, enum machine_mode);
|
106 |
|
|
extern int reg_unused_after (rtx, rtx);
|
107 |
|
|
extern void expand_sf_unop (rtx (*)(rtx, rtx, rtx), rtx *);
|
108 |
|
|
extern void expand_sf_binop (rtx (*)(rtx, rtx, rtx, rtx), rtx *);
|
109 |
|
|
extern void expand_df_unop (rtx (*)(rtx, rtx, rtx), rtx *);
|
110 |
|
|
extern void expand_df_binop (rtx (*)(rtx, rtx, rtx, rtx), rtx *);
|
111 |
|
|
extern void expand_fp_branch (rtx (*)(void), rtx (*)(void));
|
112 |
|
|
extern int sh_insn_length_adjustment (rtx);
|
113 |
|
|
extern int sh_can_redirect_branch (rtx, rtx);
|
114 |
|
|
extern void sh_expand_unop_v2sf (enum rtx_code, rtx, rtx);
|
115 |
|
|
extern void sh_expand_binop_v2sf (enum rtx_code, rtx, rtx, rtx);
|
116 |
|
|
extern int sh_expand_t_scc (enum rtx_code code, rtx target);
|
117 |
|
|
extern rtx sh_gen_truncate (enum machine_mode, rtx, int);
|
118 |
|
|
extern bool sh_vector_mode_supported_p (enum machine_mode);
|
119 |
|
|
#ifdef TREE_CODE
|
120 |
|
|
extern void sh_va_start (tree, rtx);
|
121 |
|
|
#endif /* TREE_CODE */
|
122 |
|
|
#endif /* RTX_CODE */
|
123 |
|
|
|
124 |
|
|
extern const char *output_jump_label_table (void);
|
125 |
|
|
extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *);
|
126 |
|
|
extern struct rtx_def *get_fpscr_rtx (void);
|
127 |
|
|
extern int sh_media_register_for_return (void);
|
128 |
|
|
extern void sh_expand_prologue (void);
|
129 |
|
|
extern void sh_expand_epilogue (bool);
|
130 |
|
|
extern int sh_need_epilogue (void);
|
131 |
|
|
extern void sh_set_return_address (rtx, rtx);
|
132 |
|
|
extern int initial_elimination_offset (int, int);
|
133 |
|
|
extern int fldi_ok (void);
|
134 |
|
|
extern int sh_hard_regno_rename_ok (unsigned int, unsigned int);
|
135 |
|
|
extern int sh_cfun_interrupt_handler_p (void);
|
136 |
|
|
extern int sh_attr_renesas_p (tree);
|
137 |
|
|
extern int sh_cfun_attr_renesas_p (void);
|
138 |
|
|
extern void sh_initialize_trampoline (rtx, rtx, rtx);
|
139 |
|
|
extern bool sh_cannot_change_mode_class
|
140 |
|
|
(enum machine_mode, enum machine_mode, enum reg_class);
|
141 |
|
|
extern void sh_mark_label (rtx, int);
|
142 |
|
|
extern int sh_register_move_cost
|
143 |
|
|
(enum machine_mode mode, enum reg_class, enum reg_class);
|
144 |
|
|
extern int check_use_sfunc_addr (rtx, rtx);
|
145 |
|
|
|
146 |
|
|
#ifdef HARD_CONST
|
147 |
|
|
extern void fpscr_set_from_mem (int, HARD_REG_SET);
|
148 |
|
|
#endif
|
149 |
|
|
|
150 |
|
|
extern void sh_pr_interrupt (struct cpp_reader *);
|
151 |
|
|
extern void sh_pr_trapa (struct cpp_reader *);
|
152 |
|
|
extern void sh_pr_nosave_low_regs (struct cpp_reader *);
|
153 |
|
|
extern rtx function_symbol (rtx, const char *, enum sh_function_kind);
|
154 |
|
|
extern rtx sh_get_pr_initial_val (void);
|
155 |
|
|
|
156 |
|
|
extern rtx sh_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
|
157 |
|
|
extern void sh_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
|
158 |
|
|
extern int sh_pass_in_reg_p (CUMULATIVE_ARGS *, enum machine_mode, tree);
|
159 |
|
|
extern void sh_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, signed int, enum machine_mode);
|
160 |
|
|
extern bool sh_promote_prototypes (tree);
|
161 |
|
|
|
162 |
|
|
extern rtx replace_n_hard_rtx (rtx, rtx *, int , int);
|
163 |
|
|
extern int shmedia_cleanup_truncate (rtx *, void *);
|
164 |
|
|
|
165 |
|
|
extern int sh_contains_memref_p (rtx);
|
166 |
|
|
extern rtx shmedia_prepare_call_address (rtx fnaddr, int is_sibcall);
|
167 |
|
|
struct secondary_reload_info;
|
168 |
|
|
extern enum reg_class sh_secondary_reload (bool, rtx, enum reg_class,
|
169 |
|
|
enum machine_mode,
|
170 |
|
|
struct secondary_reload_info *);
|
171 |
|
|
|
172 |
|
|
#endif /* ! GCC_SH_PROTOS_H */
|
173 |
|
|
|
174 |
|
|
#ifdef SYMBIAN
|
175 |
|
|
extern bool sh_symbian_dllimport_name_p (const char *);
|
176 |
|
|
extern const char * sh_symbian_strip_name_encoding (const char *);
|
177 |
|
|
extern bool sh_symbian_dllexport_name_p (const char *);
|
178 |
|
|
extern int symbian_import_export_class (tree, int);
|
179 |
|
|
#ifdef TREE_CODE
|
180 |
|
|
extern bool sh_symbian_dllexport_p (tree);
|
181 |
|
|
extern tree sh_symbian_handle_dll_attribute (tree *, tree, tree, int, bool *);
|
182 |
|
|
#ifdef RTX_CODE
|
183 |
|
|
extern void sh_symbian_encode_section_info (tree, rtx, int);
|
184 |
|
|
#endif
|
185 |
|
|
#endif
|
186 |
|
|
#endif /* SYMBIAN */
|