]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/rs6000/rs6000-protos.h
re PR target/85424 (The __builtin_packlongdouble function might have issues with...
[thirdparty/gcc.git] / gcc / config / rs6000 / rs6000-protos.h
CommitLineData
9ebbca7d 1/* Definitions of target machine for GNU compiler, for IBM RS/6000.
85ec4feb 2 Copyright (C) 2000-2018 Free Software Foundation, Inc.
9ebbca7d
GK
3 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
4
5de601cf 5 This file is part of GCC.
9ebbca7d 6
5de601cf
NC
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
2f83c7d6 9 by the Free Software Foundation; either version 3, or (at your
5de601cf 10 option) any later version.
9ebbca7d 11
5de601cf
NC
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.
9ebbca7d 16
5de601cf 17 You should have received a copy of the GNU General Public License
2f83c7d6
NC
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
9ebbca7d 20
a5c76ee6
ZW
21#ifndef GCC_RS6000_PROTOS_H
22#define GCC_RS6000_PROTOS_H
23
9ebbca7d
GK
24/* Declare functions in rs6000.c */
25
26#ifdef RTX_CODE
27
28#ifdef TREE_CODE
617718f7 29extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, int, int, int,
ef4bddc2 30 tree, machine_mode);
9ebbca7d
GK
31#endif /* TREE_CODE */
32
ef4bddc2 33extern bool easy_altivec_constant (rtx, machine_mode);
50c78b9a 34extern bool xxspltib_constant_p (rtx, machine_mode, int *, int *);
683be46f 35extern int vspltis_shifted (rtx);
847535b6 36extern HOST_WIDE_INT const_vector_elt_as_int (rtx, unsigned int);
ef4bddc2
RS
37extern bool macho_lo_sum_memory_operand (rtx, machine_mode);
38extern int num_insns_constant (rtx, machine_mode);
48d72335 39extern int num_insns_constant_wide (HOST_WIDE_INT);
ef4bddc2
RS
40extern int small_data_operand (rtx, machine_mode);
41extern bool mem_operand_gpr (rtx, machine_mode);
ad69178c 42extern bool mem_operand_ds_form (rtx, machine_mode);
f990f3a3 43extern bool toc_relative_expr_p (const_rtx, bool, const_rtx *, const_rtx *);
ef4bddc2
RS
44extern void validate_condition_mode (enum rtx_code, machine_mode);
45extern bool legitimate_constant_pool_address_p (const_rtx, machine_mode,
77b0791e 46 bool);
48d72335 47extern bool legitimate_indirect_address_p (rtx, int);
6fb5fa3c 48extern bool legitimate_indexed_address_p (rtx, int);
ef4bddc2 49extern bool avoiding_indexed_address_p (machine_mode);
48d72335 50
9390387d
AM
51extern rtx rs6000_got_register (rtx);
52extern rtx find_addr_reg (rtx);
66180ff3 53extern rtx gen_easy_altivec_constant (rtx);
a2369ed3 54extern const char *output_vec_const_move (rtx *);
19be72ab 55extern const char *rs6000_output_move_128bit (rtx *);
a16a872d
MM
56extern bool rs6000_move_128bit_ok_p (rtx []);
57extern bool rs6000_split_128bit_ok_p (rtx []);
526303ec 58extern void rs6000_expand_float128_convert (rtx, rtx, bool);
7a4eca66 59extern void rs6000_expand_vector_init (rtx, rtx);
f5027409 60extern void paired_expand_vector_init (rtx, rtx);
7a4eca66 61extern void rs6000_expand_vector_set (rtx, rtx, int);
98060bbe 62extern void rs6000_expand_vector_extract (rtx, rtx, rtx);
e0d32185 63extern void rs6000_split_vec_extract_var (rtx, rtx, rtx, rtx, rtx);
d0047a25 64extern rtx rs6000_adjust_vec_address (rtx, rtx, rtx, rtx, machine_mode);
6019c0fc 65extern void rs6000_split_v4si_init (rtx []);
f200869a 66extern void altivec_expand_vec_perm_le (rtx op[4]);
ef4bddc2
RS
67extern void altivec_expand_lvx_be (rtx, rtx, machine_mode, unsigned);
68extern void altivec_expand_stvx_be (rtx, rtx, machine_mode, unsigned);
69extern void altivec_expand_stvex_be (rtx, rtx, machine_mode, unsigned);
5aebfdad
RH
70extern void rs6000_expand_extract_even (rtx, rtx, rtx);
71extern void rs6000_expand_interleave (rtx, rtx, rtx, bool);
70f0f8b2 72extern void rs6000_scale_v2df (rtx, rtx, int);
be1418c7 73extern void rs6000_generate_float2_code (bool, rtx, rtx, rtx);
19d22f7c 74extern void rs6000_generate_float2_double_code (rtx, rtx, rtx);
e5898daf 75extern void rs6000_generate_vsigned2_code (bool, rtx, rtx, rtx);
fba73eb1 76extern int expand_block_clear (rtx[]);
a2369ed3 77extern int expand_block_move (rtx[]);
9f38dde2 78extern bool expand_block_compare (rtx[]);
0edd264d 79extern bool expand_strn_compare (rtx[], int);
7fc5cca3
SB
80extern bool rs6000_is_valid_mask (rtx, int *, int *, machine_mode);
81extern bool rs6000_is_valid_and_mask (rtx, machine_mode);
82extern bool rs6000_is_valid_shift_mask (rtx, rtx, machine_mode);
83extern bool rs6000_is_valid_insert_mask (rtx, rtx, machine_mode);
84extern const char *rs6000_insn_for_and_mask (machine_mode, rtx *, bool);
85extern const char *rs6000_insn_for_shift_mask (machine_mode, rtx *, bool);
86extern const char *rs6000_insn_for_insert_mask (machine_mode, rtx *, bool);
87extern bool rs6000_is_valid_2insn_and (rtx, machine_mode);
a34f4f64 88extern void rs6000_emit_2insn_and (machine_mode, rtx *, bool, int);
a2369ed3 89extern int registers_ok_for_quad_peep (rtx, rtx);
90f81f99 90extern int mems_ok_for_quad_peep (rtx, rtx);
3a1f863f 91extern bool gpr_or_gpr_p (rtx, rtx);
19be72ab 92extern bool direct_move_p (rtx, rtx);
3fd2b007 93extern bool quad_address_p (rtx, machine_mode, bool);
19be72ab 94extern bool quad_load_store_p (rtx, rtx);
3f99b061 95extern bool fusion_gpr_load_p (rtx, rtx, rtx, rtx);
f758f299 96extern void expand_fusion_gpr_load (rtx *);
0bcd172e 97extern void emit_fusion_addis (rtx, rtx);
0299bc72 98extern void emit_fusion_load_store (rtx, rtx, rtx, const char *);
3f99b061 99extern const char *emit_fusion_gpr_load (rtx, rtx);
0299bc72
MM
100extern bool fusion_p9_p (rtx, rtx, rtx, rtx);
101extern void expand_fusion_p9_load (rtx *);
102extern void expand_fusion_p9_store (rtx *);
103extern const char *emit_fusion_p9_load (rtx, rtx, rtx);
104extern const char *emit_fusion_p9_store (rtx, rtx, rtx);
105extern rtx fusion_wrap_memory_address (rtx);
8beb65e3
MM
106extern enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx,
107 enum reg_class);
108extern enum reg_class (*rs6000_secondary_reload_class_ptr) (enum reg_class,
ef4bddc2 109 machine_mode,
8beb65e3 110 rtx);
8beb65e3 111extern void rs6000_secondary_reload_inner (rtx, rtx, rtx, bool);
d32d6b75 112extern void rs6000_secondary_reload_gpr (rtx, rtx, rtx, bool);
e2e95f45
RE
113extern int paired_emit_vector_cond_expr (rtx, rtx, rtx,
114 rtx, rtx, rtx);
115extern void paired_expand_vector_move (rtx operands[]);
116
117
a2369ed3 118extern int ccr_bit (rtx, int);
85b776df 119extern void rs6000_output_function_entry (FILE *, const char *);
a2369ed3
DJ
120extern void print_operand (FILE *, rtx, int);
121extern void print_operand_address (FILE *, rtx);
ef4bddc2 122extern enum rtx_code rs6000_reverse_condition (machine_mode,
3a1f863f 123 enum rtx_code);
a935964d 124extern rtx rs6000_emit_eqne (machine_mode, rtx, rtx, rtx);
ef4bddc2
RS
125extern void rs6000_emit_sCOND (machine_mode, rtx[]);
126extern void rs6000_emit_cbranch (machine_mode, rtx[]);
e64e631b 127extern char * output_cbranch (rtx, const char *, int, rtx_insn *);
af2c8a96 128extern const char * output_probe_stack_range (rtx, rtx, rtx);
8845cb37 129extern void rs6000_emit_dot_insn (rtx dst, rtx src, int dot, rtx ccreg);
bfe51f42 130extern bool rs6000_emit_set_const (rtx, rtx);
a2369ed3 131extern int rs6000_emit_cmove (rtx, rtx, rtx, rtx);
d0481454 132extern int rs6000_emit_int_cmove (rtx, rtx, rtx, rtx);
21213b4c 133extern int rs6000_emit_vector_cond_expr (rtx, rtx, rtx, rtx, rtx, rtx);
a2369ed3 134extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx);
2747a046 135extern void rs6000_expand_atomic_compare_and_swap (rtx op[]);
fc504349
CL
136extern rtx swap_endian_selector_for_mode (machine_mode mode);
137
2747a046
RH
138extern void rs6000_expand_atomic_exchange (rtx op[]);
139extern void rs6000_expand_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx);
92902797 140extern void rs6000_emit_swdiv (rtx, rtx, rtx, bool);
4f0055bd 141extern void rs6000_emit_swsqrt (rtx, rtx, bool);
ef4bddc2 142extern void output_toc (FILE *, rtx, int, machine_mode);
9390387d 143extern rtx rs6000_longcall_ref (rtx);
a2369ed3 144extern void rs6000_fatal_bad_address (rtx);
070b27da 145extern rtx create_TOC_reference (rtx, rtx);
a9baceb1 146extern void rs6000_split_multireg_move (rtx, rtx);
02d3ba0e 147extern void rs6000_emit_le_vsx_permute (rtx, rtx, machine_mode);
ef4bddc2 148extern void rs6000_emit_le_vsx_move (rtx, rtx, machine_mode);
fba4b861 149extern bool valid_sf_si_move (rtx, rtx, machine_mode);
ef4bddc2 150extern void rs6000_emit_move (rtx, rtx, machine_mode);
ef4bddc2 151extern rtx (*rs6000_legitimize_reload_address_ptr) (rtx, machine_mode,
8beb65e3 152 int, int, int, int *);
ef4bddc2 153extern bool rs6000_legitimate_offset_address_p (machine_mode, rtx,
d32d6b75 154 bool, bool);
944258eb 155extern rtx rs6000_find_base_term (rtx);
a2369ed3
DJ
156extern rtx rs6000_return_addr (int, rtx);
157extern void rs6000_output_symbol_ref (FILE*, rtx);
d1d0c603 158extern HOST_WIDE_INT rs6000_initial_elimination_offset (int, int);
565ef4ba
RS
159extern void rs6000_emit_popcount (rtx, rtx);
160extern void rs6000_emit_parity (rtx, rtx);
a2369ed3 161
ef4bddc2 162extern rtx rs6000_machopic_legitimize_pic_address (rtx, machine_mode,
fa5b0972 163 rtx);
7042fe5e 164extern rtx rs6000_address_for_fpconvert (rtx);
ef4bddc2 165extern rtx rs6000_allocate_stack_temp (machine_mode, bool, bool);
58082ff6 166extern int rs6000_loop_align (rtx);
44c3a8bb 167extern void rs6000_split_logical (rtx [], enum rtx_code, bool, bool, bool);
9ebbca7d
GK
168#endif /* RTX_CODE */
169
170#ifdef TREE_CODE
69eff9da 171extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
98326512 172extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
fa5b0972
AM
173extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
174 unsigned int);
58182de3
GK
175extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
176 unsigned int);
4b29c5e5 177extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *);
ef4bddc2 178extern rtx rs6000_libcall_value (machine_mode);
9390387d 179extern rtx rs6000_va_arg (tree, tree);
a2369ed3 180extern int function_ok_for_sibcall (tree);
ddbb449f 181extern int rs6000_reg_parm_stack_space (tree, bool);
8d91472f 182extern void rs6000_asm_weaken_decl (FILE *, tree, const char *, const char *);
b36e833f 183extern void rs6000_xcoff_declare_function_name (FILE *, const char *, tree);
9af46873 184extern void rs6000_xcoff_declare_object_name (FILE *, const char *, tree);
8d91472f
DE
185extern void rs6000_xcoff_asm_output_aligned_decl_common (FILE *, tree,
186 const char *,
187 unsigned HOST_WIDE_INT,
188 unsigned HOST_WIDE_INT);
a2369ed3 189extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
3101faab 190extern bool rs6000_elf_in_small_data_p (const_tree);
ee890fe2 191
9ebbca7d
GK
192#endif /* TREE_CODE */
193
a2369ed3 194extern int direct_return (void);
a2369ed3
DJ
195extern int first_reg_to_save (void);
196extern int first_fp_reg_to_save (void);
a2369ed3
DJ
197extern void output_ascii (FILE *, const char *, int);
198extern void rs6000_gen_section_name (char **, const char *, const char *);
199extern void output_function_profiler (FILE *, int);
200extern void output_profile_hook (int);
201extern int rs6000_trampoline_size (void);
4862826d 202extern alias_set_type get_TOC_alias_set (void);
a2369ed3
DJ
203extern void rs6000_emit_prologue (void);
204extern void rs6000_emit_load_toc_table (int);
3d36d470 205extern unsigned int rs6000_dbx_register_number (unsigned int, unsigned int);
a2369ed3 206extern void rs6000_emit_epilogue (int);
0f0fd745
AM
207extern void rs6000_expand_split_stack_prologue (void);
208extern void rs6000_split_stack_space_check (rtx, rtx);
d1d0c603 209extern void rs6000_emit_eh_reg_restore (rtx, rtx);
f90f960c
UW
210extern void rs6000_call_aix (rtx, rtx, rtx, rtx);
211extern void rs6000_sibcall_aix (rtx, rtx, rtx, rtx);
7e49a4b3 212extern void rs6000_aix_asm_output_dwarf_table_ref (char *);
be26142a 213extern void get_ppc476_thunk_name (char name[32]);
7fa14a01 214extern bool rs6000_overloaded_builtin_p (enum rs6000_builtins);
e9e6d4f6 215extern const char *rs6000_overloaded_builtin_name (enum rs6000_builtins);
6ba86ba7 216extern int rs6000_store_data_bypass_p (rtx_insn *, rtx_insn *);
b85aed95 217extern HOST_WIDE_INT rs6000_builtin_mask_calculate (void);
e707a2dd
AD
218extern void rs6000_asm_output_dwarf_pcrel (FILE *file, int size,
219 const char *label);
220extern void rs6000_asm_output_dwarf_datarel (FILE *file, int size,
221 const char *label);
7e49a4b3 222
4c4eb375
GK
223/* Declare functions in rs6000-c.c */
224
a2369ed3
DJ
225extern void rs6000_pragma_longcall (struct cpp_reader *);
226extern void rs6000_cpu_cpp_builtins (struct cpp_reader *);
fd438373
MM
227#ifdef TREE_CODE
228extern bool rs6000_pragma_target_parse (tree, tree);
229#endif
20a7e14a 230extern void rs6000_activate_target_options (tree new_tree);
b85aed95
MM
231extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT, HOST_WIDE_INT);
232extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT,
233 HOST_WIDE_INT);
a5c76ee6 234
efdba735 235#if TARGET_MACHO
a1950df3 236char *output_call (rtx_insn *, rtx *, int, int);
efdba735
SH
237#endif
238
ee06c6a5
DE
239#ifdef NO_DOLLAR_IN_LABEL
240const char * rs6000_xcoff_strip_dollar (const char *);
241#endif
242
e64e631b 243void rs6000_final_prescan_insn (rtx_insn *, rtx *operand, int num_operands);
c921bad8 244
cacf1ca8
MM
245extern unsigned char rs6000_class_max_nregs[][LIM_REG_CLASSES];
246extern unsigned char rs6000_hard_regno_nregs[][FIRST_PSEUDO_REGISTER];
9193fb05
JM
247
248extern bool rs6000_linux_float_exceptions_rounding_supported_p (void);
5715e980
BS
249
250/* Pass management. */
251namespace gcc { class context; }
252class rtl_opt_pass;
253
254extern rtl_opt_pass *make_pass_analyze_swaps (gcc::context *);
a3a821c9
KN
255extern bool rs6000_sum_of_two_registers_p (const_rtx expr);
256extern bool rs6000_quadword_masked_address_p (const_rtx exp);
257extern rtx rs6000_gen_lvx (enum machine_mode, rtx, rtx);
258extern rtx rs6000_gen_stvx (enum machine_mode, rtx, rtx);
5715e980 259
a5c76ee6 260#endif /* rs6000-protos.h */