1 /* Definitions of target machine for GNU compiler, for IBM RS/6000.
2 Copyright (C) 2000-2017 Free Software Foundation, Inc.
3 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #ifndef GCC_RS6000_PROTOS_H
22 #define GCC_RS6000_PROTOS_H
24 /* Declare functions in rs6000.c */
29 extern void init_cumulative_args (CUMULATIVE_ARGS
*, tree
, rtx
, int, int, int,
31 #endif /* TREE_CODE */
33 extern bool easy_altivec_constant (rtx
, machine_mode
);
34 extern bool xxspltib_constant_p (rtx
, machine_mode
, int *, int *);
35 extern int vspltis_shifted (rtx
);
36 extern HOST_WIDE_INT
const_vector_elt_as_int (rtx
, unsigned int);
37 extern bool macho_lo_sum_memory_operand (rtx
, machine_mode
);
38 extern int num_insns_constant (rtx
, machine_mode
);
39 extern int num_insns_constant_wide (HOST_WIDE_INT
);
40 extern int small_data_operand (rtx
, machine_mode
);
41 extern bool mem_operand_gpr (rtx
, machine_mode
);
42 extern bool mem_operand_ds_form (rtx
, machine_mode
);
43 extern bool toc_relative_expr_p (const_rtx
, bool);
44 extern bool invalid_e500_subreg (rtx
, machine_mode
);
45 extern void validate_condition_mode (enum rtx_code
, machine_mode
);
46 extern bool legitimate_constant_pool_address_p (const_rtx
, machine_mode
,
48 extern bool legitimate_indirect_address_p (rtx
, int);
49 extern bool legitimate_indexed_address_p (rtx
, int);
50 extern bool avoiding_indexed_address_p (machine_mode
);
52 extern rtx
rs6000_got_register (rtx
);
53 extern rtx
find_addr_reg (rtx
);
54 extern rtx
gen_easy_altivec_constant (rtx
);
55 extern const char *output_vec_const_move (rtx
*);
56 extern const char *rs6000_output_move_128bit (rtx
*);
57 extern bool rs6000_move_128bit_ok_p (rtx
[]);
58 extern bool rs6000_split_128bit_ok_p (rtx
[]);
59 extern void rs6000_expand_float128_convert (rtx
, rtx
, bool);
60 extern void rs6000_expand_vector_init (rtx
, rtx
);
61 extern void paired_expand_vector_init (rtx
, rtx
);
62 extern void rs6000_expand_vector_set (rtx
, rtx
, int);
63 extern void rs6000_expand_vector_extract (rtx
, rtx
, rtx
);
64 extern void rs6000_split_vec_extract_var (rtx
, rtx
, rtx
, rtx
, rtx
);
65 extern rtx
rs6000_adjust_vec_address (rtx
, rtx
, rtx
, rtx
, machine_mode
);
66 extern void rs6000_split_v4si_init (rtx
[]);
67 extern bool altivec_expand_vec_perm_const (rtx op
[4]);
68 extern void altivec_expand_vec_perm_le (rtx op
[4]);
69 extern bool rs6000_expand_vec_perm_const (rtx op
[4]);
70 extern void altivec_expand_lvx_be (rtx
, rtx
, machine_mode
, unsigned);
71 extern void altivec_expand_stvx_be (rtx
, rtx
, machine_mode
, unsigned);
72 extern void altivec_expand_stvex_be (rtx
, rtx
, machine_mode
, unsigned);
73 extern void rs6000_expand_extract_even (rtx
, rtx
, rtx
);
74 extern void rs6000_expand_interleave (rtx
, rtx
, rtx
, bool);
75 extern void rs6000_scale_v2df (rtx
, rtx
, int);
76 extern int expand_block_clear (rtx
[]);
77 extern int expand_block_move (rtx
[]);
78 extern bool expand_block_compare (rtx
[]);
79 extern bool expand_strn_compare (rtx
[], int);
80 extern const char * rs6000_output_load_multiple (rtx
[]);
81 extern bool rs6000_is_valid_mask (rtx
, int *, int *, machine_mode
);
82 extern bool rs6000_is_valid_and_mask (rtx
, machine_mode
);
83 extern bool rs6000_is_valid_shift_mask (rtx
, rtx
, machine_mode
);
84 extern bool rs6000_is_valid_insert_mask (rtx
, rtx
, machine_mode
);
85 extern const char *rs6000_insn_for_and_mask (machine_mode
, rtx
*, bool);
86 extern const char *rs6000_insn_for_shift_mask (machine_mode
, rtx
*, bool);
87 extern const char *rs6000_insn_for_insert_mask (machine_mode
, rtx
*, bool);
88 extern bool rs6000_is_valid_2insn_and (rtx
, machine_mode
);
89 extern void rs6000_emit_2insn_and (machine_mode
, rtx
*, bool, int);
90 extern int registers_ok_for_quad_peep (rtx
, rtx
);
91 extern int mems_ok_for_quad_peep (rtx
, rtx
);
92 extern bool gpr_or_gpr_p (rtx
, rtx
);
93 extern bool direct_move_p (rtx
, rtx
);
94 extern bool quad_address_p (rtx
, machine_mode
, bool);
95 extern bool quad_load_store_p (rtx
, rtx
);
96 extern bool fusion_gpr_load_p (rtx
, rtx
, rtx
, rtx
);
97 extern void expand_fusion_gpr_load (rtx
*);
98 extern void emit_fusion_addis (rtx
, rtx
, const char *, const char *);
99 extern void emit_fusion_load_store (rtx
, rtx
, rtx
, const char *);
100 extern const char *emit_fusion_gpr_load (rtx
, rtx
);
101 extern bool fusion_p9_p (rtx
, rtx
, rtx
, rtx
);
102 extern void expand_fusion_p9_load (rtx
*);
103 extern void expand_fusion_p9_store (rtx
*);
104 extern const char *emit_fusion_p9_load (rtx
, rtx
, rtx
);
105 extern const char *emit_fusion_p9_store (rtx
, rtx
, rtx
);
106 extern rtx
fusion_wrap_memory_address (rtx
);
107 extern enum reg_class (*rs6000_preferred_reload_class_ptr
) (rtx
,
109 extern enum reg_class (*rs6000_secondary_reload_class_ptr
) (enum reg_class
,
112 extern bool (*rs6000_cannot_change_mode_class_ptr
) (machine_mode
,
115 extern void rs6000_secondary_reload_inner (rtx
, rtx
, rtx
, bool);
116 extern void rs6000_secondary_reload_gpr (rtx
, rtx
, rtx
, bool);
117 extern int paired_emit_vector_cond_expr (rtx
, rtx
, rtx
,
119 extern void paired_expand_vector_move (rtx operands
[]);
122 extern int ccr_bit (rtx
, int);
123 extern void rs6000_output_function_entry (FILE *, const char *);
124 extern void print_operand (FILE *, rtx
, int);
125 extern void print_operand_address (FILE *, rtx
);
126 extern enum rtx_code
rs6000_reverse_condition (machine_mode
,
128 extern rtx
rs6000_emit_eqne (machine_mode
, rtx
, rtx
, rtx
);
129 extern void rs6000_emit_sISEL (machine_mode
, rtx
[]);
130 extern void rs6000_emit_sCOND (machine_mode
, rtx
[]);
131 extern void rs6000_emit_cbranch (machine_mode
, rtx
[]);
132 extern char * output_cbranch (rtx
, const char *, int, rtx_insn
*);
133 extern char * output_e500_flip_gt_bit (rtx
, rtx
);
134 extern const char * output_probe_stack_range (rtx
, rtx
);
135 extern bool rs6000_emit_set_const (rtx
, rtx
);
136 extern int rs6000_emit_cmove (rtx
, rtx
, rtx
, rtx
);
137 extern int rs6000_emit_vector_cond_expr (rtx
, rtx
, rtx
, rtx
, rtx
, rtx
);
138 extern void rs6000_emit_minmax (rtx
, enum rtx_code
, rtx
, rtx
);
139 extern void rs6000_split_signbit (rtx
, rtx
);
140 extern void rs6000_expand_atomic_compare_and_swap (rtx op
[]);
141 extern void rs6000_expand_atomic_exchange (rtx op
[]);
142 extern void rs6000_expand_atomic_op (enum rtx_code
, rtx
, rtx
, rtx
, rtx
, rtx
);
143 extern void rs6000_emit_swdiv (rtx
, rtx
, rtx
, bool);
144 extern void rs6000_emit_swsqrt (rtx
, rtx
, bool);
145 extern void output_toc (FILE *, rtx
, int, machine_mode
);
146 extern rtx
rs6000_longcall_ref (rtx
);
147 extern void rs6000_fatal_bad_address (rtx
);
148 extern rtx
create_TOC_reference (rtx
, rtx
);
149 extern void rs6000_split_multireg_move (rtx
, rtx
);
150 extern void rs6000_emit_le_vsx_move (rtx
, rtx
, machine_mode
);
151 extern bool valid_sf_si_move (rtx
, rtx
, machine_mode
);
152 extern void rs6000_emit_move (rtx
, rtx
, machine_mode
);
153 extern rtx
rs6000_secondary_memory_needed_rtx (machine_mode
);
154 extern rtx (*rs6000_legitimize_reload_address_ptr
) (rtx
, machine_mode
,
155 int, int, int, int *);
156 extern bool rs6000_legitimate_offset_address_p (machine_mode
, rtx
,
158 extern rtx
rs6000_find_base_term (rtx
);
159 extern rtx
rs6000_return_addr (int, rtx
);
160 extern void rs6000_output_symbol_ref (FILE*, rtx
);
161 extern HOST_WIDE_INT
rs6000_initial_elimination_offset (int, int);
162 extern void rs6000_emit_popcount (rtx
, rtx
);
163 extern void rs6000_emit_parity (rtx
, rtx
);
165 extern rtx
rs6000_machopic_legitimize_pic_address (rtx
, machine_mode
,
167 extern rtx
rs6000_address_for_fpconvert (rtx
);
168 extern rtx
rs6000_address_for_altivec (rtx
);
169 extern rtx
rs6000_allocate_stack_temp (machine_mode
, bool, bool);
170 extern int rs6000_loop_align (rtx
);
171 extern void rs6000_split_logical (rtx
[], enum rtx_code
, bool, bool, bool);
172 #endif /* RTX_CODE */
175 extern unsigned int rs6000_data_alignment (tree
, unsigned int, enum data_align
);
176 extern bool rs6000_special_adjust_field_align_p (tree
, unsigned int);
177 extern unsigned int rs6000_special_round_type_align (tree
, unsigned int,
179 extern unsigned int darwin_rs6000_special_round_type_align (tree
, unsigned int,
181 extern tree
altivec_resolve_overloaded_builtin (location_t
, tree
, void *);
182 extern rtx
rs6000_libcall_value (machine_mode
);
183 extern rtx
rs6000_va_arg (tree
, tree
);
184 extern int function_ok_for_sibcall (tree
);
185 extern int rs6000_reg_parm_stack_space (tree
, bool);
186 extern void rs6000_asm_weaken_decl (FILE *, tree
, const char *, const char *);
187 extern void rs6000_xcoff_declare_function_name (FILE *, const char *, tree
);
188 extern void rs6000_xcoff_declare_object_name (FILE *, const char *, tree
);
189 extern void rs6000_xcoff_asm_output_aligned_decl_common (FILE *, tree
,
191 unsigned HOST_WIDE_INT
,
192 unsigned HOST_WIDE_INT
);
193 extern void rs6000_elf_declare_function_name (FILE *, const char *, tree
);
194 extern bool rs6000_elf_in_small_data_p (const_tree
);
196 #endif /* TREE_CODE */
198 extern int direct_return (void);
199 extern int first_reg_to_save (void);
200 extern int first_fp_reg_to_save (void);
201 extern void output_ascii (FILE *, const char *, int);
202 extern void rs6000_gen_section_name (char **, const char *, const char *);
203 extern void output_function_profiler (FILE *, int);
204 extern void output_profile_hook (int);
205 extern int rs6000_trampoline_size (void);
206 extern alias_set_type
get_TOC_alias_set (void);
207 extern void rs6000_emit_prologue (void);
208 extern void rs6000_emit_load_toc_table (int);
209 extern unsigned int rs6000_dbx_register_number (unsigned int, unsigned int);
210 extern void rs6000_emit_epilogue (int);
211 extern void rs6000_expand_split_stack_prologue (void);
212 extern void rs6000_split_stack_space_check (rtx
, rtx
);
213 extern void rs6000_emit_eh_reg_restore (rtx
, rtx
);
214 extern const char * output_isel (rtx
*);
215 extern void rs6000_call_aix (rtx
, rtx
, rtx
, rtx
);
216 extern void rs6000_sibcall_aix (rtx
, rtx
, rtx
, rtx
);
217 extern void rs6000_aix_asm_output_dwarf_table_ref (char *);
218 extern void get_ppc476_thunk_name (char name
[32]);
219 extern bool rs6000_overloaded_builtin_p (enum rs6000_builtins
);
220 extern const char *rs6000_overloaded_builtin_name (enum rs6000_builtins
);
221 extern int rs6000_store_data_bypass_p (rtx_insn
*, rtx_insn
*);
222 extern HOST_WIDE_INT
rs6000_builtin_mask_calculate (void);
223 extern void rs6000_asm_output_dwarf_pcrel (FILE *file
, int size
,
225 extern void rs6000_asm_output_dwarf_datarel (FILE *file
, int size
,
228 /* Declare functions in rs6000-c.c */
230 extern void rs6000_pragma_longcall (struct cpp_reader
*);
231 extern void rs6000_cpu_cpp_builtins (struct cpp_reader
*);
233 extern bool rs6000_pragma_target_parse (tree
, tree
);
235 extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT
, HOST_WIDE_INT
);
236 extern void (*rs6000_target_modify_macros_ptr
) (bool, HOST_WIDE_INT
,
240 char *output_call (rtx_insn
*, rtx
*, int, int);
243 #ifdef NO_DOLLAR_IN_LABEL
244 const char * rs6000_xcoff_strip_dollar (const char *);
247 void rs6000_final_prescan_insn (rtx_insn
*, rtx
*operand
, int num_operands
);
249 extern unsigned char rs6000_class_max_nregs
[][LIM_REG_CLASSES
];
250 extern unsigned char rs6000_hard_regno_nregs
[][FIRST_PSEUDO_REGISTER
];
252 extern bool rs6000_linux_float_exceptions_rounding_supported_p (void);
254 /* Pass management. */
255 namespace gcc
{ class context
; }
258 extern rtl_opt_pass
*make_pass_analyze_swaps (gcc::context
*);
260 #endif /* rs6000-protos.h */