1 /* 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, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
5 Contributed by Steve Chamberlain (sac@cygnus.com).
6 Improved by Jim Wilson (wilson@cygnus.com).
8 This file is part of GCC.
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)
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.
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/>. */
24 #ifndef GCC_SH_PROTOS_H
25 #define GCC_SH_PROTOS_H
27 enum sh_function_kind
{
28 /* A function with normal C ABI */
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. */
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. */
41 extern rtx
sh_fsca_sf2int (void);
42 extern rtx
sh_fsca_df2int (void);
43 extern rtx
sh_fsca_int2sf (void);
45 /* Declare functions defined in sh.c and used in templates. */
47 extern const char *output_branch (int, rtx
, rtx
*);
48 extern const char *output_ieee_ccmpeq (rtx
, rtx
*);
49 extern const char *output_branchy_insn (enum rtx_code
, const char *, rtx
, rtx
*);
50 extern const char *output_movedouble (rtx
, rtx
[], enum machine_mode
);
51 extern const char *output_movepcrel (rtx
, rtx
[], enum machine_mode
);
52 extern const char *output_far_jump (rtx
, rtx
);
54 extern struct rtx_def
*sfunc_uses_reg (rtx
);
55 extern int barrier_align (rtx
);
56 extern int sh_loop_align (rtx
);
57 extern int fp_zero_operand (rtx
);
58 extern int fp_one_operand (rtx
);
59 extern int fp_int_operand (rtx
);
60 extern rtx
get_fpscr_rtx (void);
61 extern bool sh_legitimate_index_p (enum machine_mode
, rtx
);
62 extern bool sh_legitimize_reload_address (rtx
*, enum machine_mode
, int, int);
63 extern rtx
legitimize_pic_address (rtx
, enum machine_mode
, rtx
);
64 extern int nonpic_symbol_mentioned_p (rtx
);
65 extern void emit_sf_insn (rtx
);
66 extern void emit_df_insn (rtx
);
67 extern void output_pic_addr_const (FILE *, rtx
);
68 extern int expand_block_move (rtx
*);
69 extern int prepare_move_operands (rtx
[], enum machine_mode mode
);
70 extern enum rtx_code
prepare_cbranch_operands (rtx
*, enum machine_mode mode
,
71 enum rtx_code comparison
);
72 extern void expand_cbranchsi4 (rtx
*operands
, enum rtx_code comparison
, int);
73 extern bool expand_cbranchdi4 (rtx
*operands
, enum rtx_code comparison
);
74 extern void sh_emit_scc_to_t (enum rtx_code
, rtx
, rtx
);
75 extern rtx
sh_emit_cheap_store_flag (enum machine_mode
, enum rtx_code
, rtx
, rtx
);
76 extern void sh_emit_compare_and_branch (rtx
*, enum machine_mode
);
77 extern void sh_emit_compare_and_set (rtx
*, enum machine_mode
);
78 extern int shift_insns_rtx (rtx
);
79 extern void gen_ashift (int, int, rtx
);
80 extern void gen_ashift_hi (int, int, rtx
);
81 extern void gen_shifty_op (int, rtx
*);
82 extern void gen_shifty_hi_op (int, rtx
*);
83 extern int expand_ashiftrt (rtx
*);
84 extern int sh_dynamicalize_shift_p (rtx
);
85 extern int shl_and_kind (rtx
, rtx
, int *);
86 extern int shl_and_length (rtx
);
87 extern int shl_and_scr_length (rtx
);
88 extern int gen_shl_and (rtx
, rtx
, rtx
, rtx
);
89 extern int shl_sext_kind (rtx
, rtx
, int *);
90 extern int shl_sext_length (rtx
);
91 extern int gen_shl_sext (rtx
, rtx
, rtx
, rtx
);
92 extern rtx
gen_datalabel_ref (rtx
);
93 extern int regs_used (rtx
, int);
94 extern void fixup_addr_diff_vecs (rtx
);
95 extern int get_dest_uid (rtx
, int);
96 extern void final_prescan_insn (rtx
, rtx
*, int);
97 extern int symbol_ref_operand (rtx
, enum machine_mode
);
98 extern enum tls_model
tls_symbolic_operand (rtx
, enum machine_mode
);
99 extern int system_reg_operand (rtx
, enum machine_mode
);
100 extern int general_movsrc_operand (rtx
, enum machine_mode
);
101 extern int general_movdst_operand (rtx
, enum machine_mode
);
102 extern int arith_reg_operand (rtx
, enum machine_mode
);
103 extern int fp_arith_reg_operand (rtx
, enum machine_mode
);
104 extern int arith_operand (rtx
, enum machine_mode
);
105 extern int arith_reg_or_0_operand (rtx
, enum machine_mode
);
106 extern int logical_operand (rtx
, enum machine_mode
);
107 extern int tertiary_reload_operand (rtx
, enum machine_mode
);
108 extern int fpscr_operand (rtx
, enum machine_mode
);
109 extern int fpul_operand (rtx
, enum machine_mode
);
110 extern int commutative_float_operator (rtx
, enum machine_mode
);
111 extern int noncommutative_float_operator (rtx
, enum machine_mode
);
112 extern int reg_unused_after (rtx
, rtx
);
113 extern void expand_sf_unop (rtx (*)(rtx
, rtx
, rtx
), rtx
*);
114 extern void expand_sf_binop (rtx (*)(rtx
, rtx
, rtx
, rtx
), rtx
*);
115 extern void expand_df_unop (rtx (*)(rtx
, rtx
, rtx
), rtx
*);
116 extern void expand_df_binop (rtx (*)(rtx
, rtx
, rtx
, rtx
), rtx
*);
117 extern void expand_fp_branch (rtx (*)(void), rtx (*)(void));
118 extern int sh_insn_length_adjustment (rtx
);
119 extern int sh_can_redirect_branch (rtx
, rtx
);
120 extern void sh_expand_unop_v2sf (enum rtx_code
, rtx
, rtx
);
121 extern void sh_expand_binop_v2sf (enum rtx_code
, rtx
, rtx
, rtx
);
122 extern int sh_expand_t_scc (rtx
*);
123 extern rtx
sh_gen_truncate (enum machine_mode
, rtx
, int);
124 extern bool sh_vector_mode_supported_p (enum machine_mode
);
125 #endif /* RTX_CODE */
127 extern void sh_optimization_options (int, int);
128 extern void sh_override_options (void);
129 extern const char *output_jump_label_table (void);
130 extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *);
131 extern struct rtx_def
*get_fpscr_rtx (void);
132 extern int sh_media_register_for_return (void);
133 extern void sh_expand_prologue (void);
134 extern void sh_expand_epilogue (bool);
135 extern int sh_need_epilogue (void);
136 extern void sh_set_return_address (rtx
, rtx
);
137 extern int initial_elimination_offset (int, int);
138 extern int fldi_ok (void);
139 extern int sh_hard_regno_rename_ok (unsigned int, unsigned int);
140 extern int sh_cfun_interrupt_handler_p (void);
141 extern int sh_cfun_resbank_handler_p (void);
142 extern int sh_attr_renesas_p (const_tree
);
143 extern int sh_cfun_attr_renesas_p (void);
144 extern bool sh_cannot_change_mode_class
145 (enum machine_mode
, enum machine_mode
, enum reg_class
);
146 extern bool sh_small_register_classes_for_mode_p (enum machine_mode
);
147 extern void sh_mark_label (rtx
, int);
148 extern int sh_register_move_cost
149 (enum machine_mode mode
, enum reg_class
, enum reg_class
);
150 extern int check_use_sfunc_addr (rtx
, rtx
);
153 extern void fpscr_set_from_mem (int, HARD_REG_SET
);
156 extern void sh_pr_interrupt (struct cpp_reader
*);
157 extern void sh_pr_trapa (struct cpp_reader
*);
158 extern void sh_pr_nosave_low_regs (struct cpp_reader
*);
159 extern rtx
function_symbol (rtx
, const char *, enum sh_function_kind
);
160 extern rtx
sh_get_pr_initial_val (void);
162 extern int sh_pass_in_reg_p (CUMULATIVE_ARGS
*, enum machine_mode
, tree
);
163 extern void sh_init_cumulative_args (CUMULATIVE_ARGS
*, tree
, rtx
, tree
, signed int, enum machine_mode
);
164 extern bool sh_function_value_regno_p (const unsigned int);
165 extern rtx
sh_dwarf_register_span (rtx
);
167 extern rtx
replace_n_hard_rtx (rtx
, rtx
*, int , int);
168 extern int shmedia_cleanup_truncate (rtx
*, void *);
170 extern int sh_contains_memref_p (rtx
);
171 extern int sh_loads_bankedreg_p (rtx
);
172 extern rtx
shmedia_prepare_call_address (rtx fnaddr
, int is_sibcall
);
173 struct secondary_reload_info
;
174 extern reg_class_t
sh_secondary_reload (bool, rtx
, reg_class_t
,
176 struct secondary_reload_info
*);
177 extern int sh2a_get_function_vector_number (rtx
);
178 extern int sh2a_is_function_vector_call (rtx
);
179 extern void sh_fix_range (const char *);
180 extern bool sh_hard_regno_mode_ok (unsigned int, enum machine_mode
);
181 #endif /* ! GCC_SH_PROTOS_H */
184 extern const char * sh_symbian_strip_name_encoding (const char *);
185 extern bool sh_symbian_is_dllexported_name (const char *);
187 extern bool sh_symbian_is_dllexported (tree
);
188 extern int sh_symbian_import_export_class (tree
, int);
189 extern tree
sh_symbian_handle_dll_attribute (tree
*, tree
, tree
, int, bool *);
191 extern void sh_symbian_encode_section_info (tree
, rtx
, int);