1 /* Definitions of target machine for GNU compiler for Renesas / SuperH SH.
2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003,
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 2, 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 COPYING. If not, write to
22 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA. */
25 #ifndef GCC_SH_PROTOS_H
26 #define GCC_SH_PROTOS_H
28 enum sh_function_kind
{
29 /* A function with normal C ABI */
31 /* A special function that guarantees that some otherwise call-clobbered
32 registers are not clobbered. These can't go through the SH5 resolver,
33 because it only saves argument passing registers. */
35 /* A special function that should be linked statically. These are typically
36 smaller or not much larger than a PLT entry.
37 Some also have a non-standard ABI which precludes dynamic linking. */
42 extern rtx
sh_fsca_sf2int (void);
43 extern rtx
sh_fsca_df2int (void);
44 extern rtx
sh_fsca_int2sf (void);
45 extern struct rtx_def
*prepare_scc_operands (enum rtx_code
);
47 /* Declare functions defined in sh.c and used in templates. */
49 extern const char *output_branch (int, rtx
, rtx
*);
50 extern const char *output_ieee_ccmpeq (rtx
, rtx
*);
51 extern const char *output_branchy_insn (enum rtx_code
, const char *, rtx
, rtx
*);
52 extern const char *output_movedouble (rtx
, rtx
[], enum machine_mode
);
53 extern const char *output_movepcrel (rtx
, rtx
[], enum machine_mode
);
54 extern const char *output_far_jump (rtx
, rtx
);
56 extern struct rtx_def
*sfunc_uses_reg (rtx
);
57 extern int barrier_align (rtx
);
58 extern int sh_loop_align (rtx
);
59 extern int fp_zero_operand (rtx
);
60 extern int fp_one_operand (rtx
);
61 extern int fp_int_operand (rtx
);
62 extern rtx
get_fpscr_rtx (void);
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 print_operand_address (FILE *, rtx
);
68 extern void print_operand (FILE *, rtx
, int);
69 extern void output_pic_addr_const (FILE *, rtx
);
70 extern int expand_block_move (rtx
*);
71 extern int prepare_move_operands (rtx
[], enum machine_mode mode
);
72 extern void from_compare (rtx
*, int);
73 extern int shift_insns_rtx (rtx
);
74 extern void gen_ashift (int, int, rtx
);
75 extern void gen_ashift_hi (int, int, rtx
);
76 extern void gen_shifty_op (int, rtx
*);
77 extern void gen_shifty_hi_op (int, rtx
*);
78 extern int expand_ashiftrt (rtx
*);
79 extern int sh_dynamicalize_shift_p (rtx
);
80 extern int shl_and_kind (rtx
, rtx
, int *);
81 extern int shl_and_length (rtx
);
82 extern int shl_and_scr_length (rtx
);
83 extern int gen_shl_and (rtx
, rtx
, rtx
, rtx
);
84 extern int shl_sext_kind (rtx
, rtx
, int *);
85 extern int shl_sext_length (rtx
);
86 extern int gen_shl_sext (rtx
, rtx
, rtx
, rtx
);
87 extern rtx
gen_datalabel_ref (rtx
);
88 extern int regs_used (rtx
, int);
89 extern void fixup_addr_diff_vecs (rtx
);
90 extern int get_dest_uid (rtx
, int);
91 extern void final_prescan_insn (rtx
, rtx
*, int);
92 extern int symbol_ref_operand (rtx
, enum machine_mode
);
93 extern int tls_symbolic_operand (rtx
, enum machine_mode
);
94 extern int system_reg_operand (rtx
, enum machine_mode
);
95 extern int general_movsrc_operand (rtx
, enum machine_mode
);
96 extern int general_movdst_operand (rtx
, enum machine_mode
);
97 extern int arith_reg_operand (rtx
, enum machine_mode
);
98 extern int fp_arith_reg_operand (rtx
, enum machine_mode
);
99 extern int arith_operand (rtx
, enum machine_mode
);
100 extern int arith_reg_or_0_operand (rtx
, enum machine_mode
);
101 extern int logical_operand (rtx
, enum machine_mode
);
102 extern int tertiary_reload_operand (rtx
, enum machine_mode
);
103 extern int fpscr_operand (rtx
, enum machine_mode
);
104 extern int fpul_operand (rtx
, enum machine_mode
);
105 extern int commutative_float_operator (rtx
, enum machine_mode
);
106 extern int noncommutative_float_operator (rtx
, enum machine_mode
);
107 extern int reg_unused_after (rtx
, rtx
);
108 extern void expand_sf_unop (rtx (*)(rtx
, rtx
, rtx
), rtx
*);
109 extern void expand_sf_binop (rtx (*)(rtx
, rtx
, rtx
, rtx
), rtx
*);
110 extern void expand_df_unop (rtx (*)(rtx
, rtx
, rtx
), rtx
*);
111 extern void expand_df_binop (rtx (*)(rtx
, rtx
, rtx
, rtx
), rtx
*);
112 extern void expand_fp_branch (rtx (*)(void), rtx (*)(void));
113 extern int sh_insn_length_adjustment (rtx
);
114 extern int sh_can_redirect_branch (rtx
, rtx
);
115 extern void sh_expand_unop_v2sf (enum rtx_code
, rtx
, rtx
);
116 extern void sh_expand_binop_v2sf (enum rtx_code
, rtx
, rtx
, rtx
);
117 extern int sh_expand_t_scc (enum rtx_code code
, rtx target
);
118 extern rtx
sh_gen_truncate (enum machine_mode
, rtx
, int);
119 extern bool sh_vector_mode_supported_p (enum machine_mode
);
121 extern void sh_va_start (tree
, rtx
);
122 #endif /* TREE_CODE */
123 #endif /* RTX_CODE */
125 extern const char *output_jump_label_table (void);
126 extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *);
127 extern struct rtx_def
*get_fpscr_rtx (void);
128 extern int sh_media_register_for_return (void);
129 extern void sh_expand_prologue (void);
130 extern void sh_expand_epilogue (bool);
131 extern int sh_need_epilogue (void);
132 extern void sh_set_return_address (rtx
, rtx
);
133 extern int initial_elimination_offset (int, int);
134 extern int fldi_ok (void);
135 extern int sh_hard_regno_rename_ok (unsigned int, unsigned int);
136 extern int sh_cfun_interrupt_handler_p (void);
137 extern int sh_attr_renesas_p (tree
);
138 extern int sh_cfun_attr_renesas_p (void);
139 extern void sh_initialize_trampoline (rtx
, rtx
, rtx
);
140 extern bool sh_cannot_change_mode_class
141 (enum machine_mode
, enum machine_mode
, enum reg_class
);
142 extern void sh_mark_label (rtx
, int);
143 extern int sh_register_move_cost
144 (enum machine_mode mode
, enum reg_class
, enum reg_class
);
145 extern int check_use_sfunc_addr (rtx
, rtx
);
148 extern void fpscr_set_from_mem (int, HARD_REG_SET
);
151 extern void sh_pr_interrupt (struct cpp_reader
*);
152 extern void sh_pr_trapa (struct cpp_reader
*);
153 extern void sh_pr_nosave_low_regs (struct cpp_reader
*);
154 extern rtx
function_symbol (rtx
, const char *, enum sh_function_kind
);
155 extern rtx
sh_get_pr_initial_val (void);
157 extern rtx
sh_function_arg (CUMULATIVE_ARGS
*, enum machine_mode
, tree
, int);
158 extern void sh_function_arg_advance (CUMULATIVE_ARGS
*, enum machine_mode
, tree
, int);
159 extern int sh_pass_in_reg_p (CUMULATIVE_ARGS
*, enum machine_mode
, tree
);
160 extern void sh_init_cumulative_args (CUMULATIVE_ARGS
*, tree
, rtx
, tree
, signed int, enum machine_mode
);
161 extern bool sh_promote_prototypes (tree
);
163 extern rtx
replace_n_hard_rtx (rtx
, rtx
*, int , int);
164 extern int shmedia_cleanup_truncate (rtx
*, void *);
166 extern int sh_contains_memref_p (rtx
);
167 extern rtx
shmedia_prepare_call_address (rtx fnaddr
, int is_sibcall
);
169 extern bool sh_cfun_trap_exit_p (void);
172 #endif /* ! GCC_SH_PROTOS_H */
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);
180 extern bool sh_symbian_dllexport_p (tree
);
181 extern tree
sh_symbian_handle_dll_attribute (tree
*, tree
, tree
, int, bool *);
183 extern void sh_symbian_encode_section_info (tree
, rtx
, int);