]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sh/sh-protos.h
decl.c, [...]: Remove redundant enum from machine_mode.
[thirdparty/gcc.git] / gcc / config / sh / sh-protos.h
CommitLineData
c8f0269d 1/* Definitions of target machine for GNU compiler for Renesas / SuperH SH.
23a5b65a 2 Copyright (C) 1993-2014 Free Software Foundation, Inc.
318881c0
KG
3 Contributed by Steve Chamberlain (sac@cygnus.com).
4 Improved by Jim Wilson (wilson@cygnus.com).
5
7ec022b2 6This file is part of GCC.
318881c0 7
7ec022b2 8GCC is free software; you can redistribute it and/or modify
318881c0 9it under the terms of the GNU General Public License as published by
2f83c7d6 10the Free Software Foundation; either version 3, or (at your option)
318881c0
KG
11any later version.
12
7ec022b2 13GCC is distributed in the hope that it will be useful,
318881c0
KG
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
2f83c7d6
NC
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
318881c0 21
8b97c5f8
ZW
22#ifndef GCC_SH_PROTOS_H
23#define GCC_SH_PROTOS_H
24
73a4d10b
R
25enum sh_function_kind {
26 /* A function with normal C ABI */
27 FUNCTION_ORDINARY,
28 /* A special function that guarantees that some otherwise call-clobbered
29 registers are not clobbered. These can't go through the SH5 resolver,
30 because it only saves argument passing registers. */
31 SFUNC_GOT,
32 /* A special function that should be linked statically. These are typically
33 smaller or not much larger than a PLT entry.
34 Some also have a non-standard ABI which precludes dynamic linking. */
35 SFUNC_STATIC
36};
37
7bd76b9c
OE
38/* Atomic model. */
39struct sh_atomic_model
40{
41 enum enum_type
42 {
43 none = 0,
44 soft_gusa,
45 hard_llcs,
46 soft_tcb,
47 soft_imask,
48
49 num_models
50 };
51
52 /* If strict is set, disallow mixing of different models, as it would
53 happen on SH4A. */
54 bool strict;
55 enum_type type;
9597375a
OE
56
57 /* Name string as it was specified on the command line. */
58 const char* name;
59
60 /* Name string as it is used in C/C++ defines. */
61 const char* cdef_name;
62
63 /* GBR offset variable for TCB model. */
7bd76b9c
OE
64 int tcb_gbr_offset;
65};
66
67extern const sh_atomic_model& selected_atomic_model (void);
68
69/* Shortcuts to check the currently selected atomic model. */
70#define TARGET_ATOMIC_ANY \
71 selected_atomic_model ().type != sh_atomic_model::none
72
73#define TARGET_ATOMIC_STRICT \
74 selected_atomic_model ().strict
75
76#define TARGET_ATOMIC_SOFT_GUSA \
77 selected_atomic_model ().type == sh_atomic_model::soft_gusa
78
79#define TARGET_ATOMIC_HARD_LLCS \
80 selected_atomic_model ().type == sh_atomic_model::hard_llcs
81
82#define TARGET_ATOMIC_SOFT_TCB \
83 selected_atomic_model ().type == sh_atomic_model::soft_tcb
84
85#define TARGET_ATOMIC_SOFT_TCB_GBR_OFFSET_RTX \
86 GEN_INT (selected_atomic_model ().tcb_gbr_offset)
87
88#define TARGET_ATOMIC_SOFT_IMASK \
89 selected_atomic_model ().type == sh_atomic_model::soft_imask
90
318881c0 91#ifdef RTX_CODE
312209c6 92extern rtx sh_fsca_sf2int (void);
312209c6 93extern rtx sh_fsca_int2sf (void);
318881c0
KG
94
95/* Declare functions defined in sh.c and used in templates. */
96
84034c69 97extern const char *output_branch (int, rtx_insn *, rtx *);
6cb7eb41
DM
98extern const char *output_ieee_ccmpeq (rtx_insn *, rtx *);
99extern const char *output_branchy_insn (enum rtx_code, const char *,
100 rtx_insn *, rtx *);
ef4bddc2
RS
101extern const char *output_movedouble (rtx, rtx[], machine_mode);
102extern const char *output_movepcrel (rtx, rtx[], machine_mode);
6cb7eb41 103extern const char *output_far_jump (rtx_insn *, rtx);
318881c0 104
84034c69 105extern rtx sfunc_uses_reg (rtx_insn *);
b32d5189 106extern int barrier_align (rtx_insn *);
647d790d 107extern int sh_loop_align (rtx_insn *);
aaf701c5
OE
108extern bool fp_zero_operand (rtx);
109extern bool fp_one_operand (rtx);
ef4bddc2
RS
110extern bool sh_legitimate_index_p (machine_mode, rtx, bool, bool);
111extern bool sh_legitimize_reload_address (rtx *, machine_mode, int, int);
112extern rtx legitimize_pic_address (rtx, machine_mode, rtx);
aaf701c5 113extern bool nonpic_symbol_mentioned_p (rtx);
cf277499 114extern void output_pic_addr_const (FILE *, rtx);
aaf701c5 115extern bool expand_block_move (rtx *);
ef4bddc2 116extern void prepare_move_operands (rtx[], machine_mode mode);
8e701300 117extern bool sh_expand_cmpstr (rtx *);
ca494b8d 118extern bool sh_expand_cmpnstr (rtx *);
3a1a7897 119extern bool sh_expand_strlen (rtx *);
fa1aecc1 120extern void sh_expand_setmem (rtx *);
ef4bddc2 121extern enum rtx_code prepare_cbranch_operands (rtx *, machine_mode mode,
78d310c2
R
122 enum rtx_code comparison);
123extern void expand_cbranchsi4 (rtx *operands, enum rtx_code comparison, int);
124extern bool expand_cbranchdi4 (rtx *operands, enum rtx_code comparison);
f90b7a5a 125extern void sh_emit_scc_to_t (enum rtx_code, rtx, rtx);
ef4bddc2
RS
126extern rtx sh_emit_cheap_store_flag (machine_mode, enum rtx_code, rtx, rtx);
127extern void sh_emit_compare_and_branch (rtx *, machine_mode);
128extern void sh_emit_compare_and_set (rtx *, machine_mode);
70d4736c 129extern bool sh_ashlsi_clobbers_t_reg_p (rtx);
5592815a 130extern bool sh_lshrsi_clobbers_t_reg_p (rtx);
cf277499
SB
131extern void gen_shifty_op (int, rtx *);
132extern void gen_shifty_hi_op (int, rtx *);
aaf701c5
OE
133extern bool expand_ashiftrt (rtx *);
134extern bool sh_dynamicalize_shift_p (rtx);
cf277499
SB
135extern int shl_and_kind (rtx, rtx, int *);
136extern int shl_and_length (rtx);
137extern int shl_and_scr_length (rtx);
aaf701c5 138extern bool gen_shl_and (rtx, rtx, rtx, rtx);
cf277499
SB
139extern int shl_sext_kind (rtx, rtx, int *);
140extern int shl_sext_length (rtx);
aaf701c5 141extern bool gen_shl_sext (rtx, rtx, rtx, rtx);
cf277499
SB
142extern rtx gen_datalabel_ref (rtx);
143extern int regs_used (rtx, int);
b32d5189 144extern void fixup_addr_diff_vecs (rtx_insn *);
cf277499 145extern int get_dest_uid (rtx, int);
6cb7eb41 146extern void final_prescan_insn (rtx_insn *, rtx *, int);
ef4bddc2
RS
147extern enum tls_model tls_symbolic_operand (rtx, machine_mode);
148extern bool system_reg_operand (rtx, machine_mode);
b32d5189 149extern bool reg_unused_after (rtx, rtx_insn *);
6cb7eb41 150extern int sh_insn_length_adjustment (rtx_insn *);
b32d5189 151extern bool sh_can_redirect_branch (rtx_insn *, rtx_insn *);
cf277499
SB
152extern void sh_expand_unop_v2sf (enum rtx_code, rtx, rtx);
153extern void sh_expand_binop_v2sf (enum rtx_code, rtx, rtx, rtx);
10c17a58 154extern bool sh_expand_t_scc (rtx *);
ef4bddc2
RS
155extern rtx sh_gen_truncate (machine_mode, rtx, int);
156extern bool sh_vector_mode_supported_p (machine_mode);
d16202ba 157extern bool sh_cfun_trap_exit_p (void);
4eac9c2b 158extern rtx sh_find_equiv_gbr_addr (rtx_insn* cur_insn, rtx mem);
b4eca9c8 159extern int sh_eval_treg_value (rtx op);
91f65b12
OE
160extern HOST_WIDE_INT sh_disp_addr_displacement (rtx mem_op);
161extern int sh_max_mov_insn_displacement (machine_mode mode, bool consider_sh2a);
26943929
OE
162
163/* Result value of sh_find_set_of_reg. */
164struct set_of_reg
165{
166 /* The insn where sh_find_set_of_reg stopped looking.
167 Can be NULL_RTX if the end of the insn list was reached. */
168 rtx insn;
169
170 /* The set rtx of the specified reg if found, NULL_RTX otherwise. */
171 const_rtx set_rtx;
172
173 /* The set source rtx of the specified reg if found, NULL_RTX otherwise.
174 Usually, this is the most interesting return value. */
175 rtx set_src;
176};
177
eb51c837 178extern set_of_reg sh_find_set_of_reg (rtx reg, rtx insn, rtx_insn *(*stepfunc)(rtx));
26943929
OE
179extern bool sh_is_logical_t_store_expr (rtx op, rtx insn);
180extern rtx sh_try_omit_signzero_extend (rtx extended_op, rtx insn);
318881c0
KG
181#endif /* RTX_CODE */
182
9597375a
OE
183extern void sh_cpu_cpp_builtins (cpp_reader* pfile);
184
cf277499 185extern const char *output_jump_label_table (void);
f031c344 186extern rtx get_t_reg_rtx (void);
cf277499
SB
187extern int sh_media_register_for_return (void);
188extern void sh_expand_prologue (void);
726d4cb7 189extern void sh_expand_epilogue (bool);
cf277499
SB
190extern void sh_set_return_address (rtx, rtx);
191extern int initial_elimination_offset (int, int);
aaf701c5
OE
192extern bool sh_hard_regno_rename_ok (unsigned int, unsigned int);
193extern bool sh_cfun_interrupt_handler_p (void);
194extern bool sh_cfun_resbank_handler_p (void);
195extern bool sh_attr_renesas_p (const_tree);
196extern bool sh_cfun_attr_renesas_p (void);
b0c42aed 197extern bool sh_cannot_change_mode_class
ef4bddc2
RS
198 (machine_mode, machine_mode, enum reg_class);
199extern bool sh_small_register_classes_for_mode_p (machine_mode);
cf277499 200extern void sh_mark_label (rtx, int);
b32d5189 201extern bool check_use_sfunc_addr (rtx_insn *, rtx);
9f09b1f2
R
202
203#ifdef HARD_CONST
cf277499 204extern void fpscr_set_from_mem (int, HARD_REG_SET);
9f09b1f2 205#endif
8b97c5f8 206
cf277499
SB
207extern void sh_pr_interrupt (struct cpp_reader *);
208extern void sh_pr_trapa (struct cpp_reader *);
209extern void sh_pr_nosave_low_regs (struct cpp_reader *);
73a4d10b 210extern rtx function_symbol (rtx, const char *, enum sh_function_kind);
fada1961 211extern rtx sh_get_pr_initial_val (void);
8b97c5f8 212
50fe8924 213extern void sh_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree,
ef4bddc2 214 signed int, machine_mode);
63a9de54 215extern rtx sh_dwarf_register_span (rtx);
61f71b34 216
73a4d10b 217extern rtx replace_n_hard_rtx (rtx, rtx *, int , int);
5dabe5a9 218extern int shmedia_cleanup_truncate (rtx);
73a4d10b 219
aaf701c5
OE
220extern bool sh_contains_memref_p (rtx);
221extern bool sh_loads_bankedreg_p (rtx);
73a4d10b 222extern rtx shmedia_prepare_call_address (rtx fnaddr, int is_sibcall);
561642fa 223extern int sh2a_get_function_vector_number (rtx);
aaf701c5 224extern bool sh2a_is_function_vector_call (rtx);
3217af3e 225extern void sh_fix_range (const char *);
ef4bddc2 226extern bool sh_hard_regno_mode_ok (unsigned int, machine_mode);
fcf8632e 227extern bool sh_can_use_simple_return_p (void);
88657302 228#endif /* ! GCC_SH_PROTOS_H */