rs6000-protos.h 9.98 KB
Newer Older
1
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
rsandifo's avatar
rsandifo committed
2
   Copyright (C) 2000-2014 Free Software Foundation, Inc.
3 4
   Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)

nickc's avatar
nickc committed
5
   This file is part of GCC.
6

nickc's avatar
nickc committed
7 8
   GCC is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published
9
   by the Free Software Foundation; either version 3, or (at your
nickc's avatar
nickc committed
10
   option) any later version.
11

nickc's avatar
nickc committed
12 13 14 15
   GCC is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   License for more details.
16

nickc's avatar
nickc committed
17
   You should have received a copy of the GNU General Public License
18 19
   along with GCC; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.  */
20

21 22 23
#ifndef GCC_RS6000_PROTOS_H
#define GCC_RS6000_PROTOS_H

24 25 26 27 28
/* Declare functions in rs6000.c */

#ifdef RTX_CODE

#ifdef TREE_CODE
29 30
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, int, int, int,
				  tree, enum machine_mode);
31 32
#endif /* TREE_CODE */

33
extern bool easy_altivec_constant (rtx, enum machine_mode);
jakub's avatar
jakub committed
34
extern HOST_WIDE_INT const_vector_elt_as_int (rtx, unsigned int);
35 36 37 38
extern bool macho_lo_sum_memory_operand (rtx, enum machine_mode);
extern int num_insns_constant (rtx, enum machine_mode);
extern int num_insns_constant_wide (HOST_WIDE_INT);
extern int small_data_operand (rtx, enum machine_mode);
amodra's avatar
amodra committed
39
extern bool mem_operand_gpr (rtx, enum machine_mode);
40
extern bool toc_relative_expr_p (const_rtx, bool);
41 42
extern bool invalid_e500_subreg (rtx, enum machine_mode);
extern void validate_condition_mode (enum rtx_code, enum machine_mode);
amodra's avatar
amodra committed
43 44
extern bool legitimate_constant_pool_address_p (const_rtx, enum machine_mode,
						bool);
45
extern bool legitimate_indirect_address_p (rtx, int);
46
extern bool legitimate_indexed_address_p (rtx, int);
47
extern bool avoiding_indexed_address_p (enum machine_mode);
48

49 50
extern rtx rs6000_got_register (rtx);
extern rtx find_addr_reg (rtx);
51
extern rtx gen_easy_altivec_constant (rtx);
dalej's avatar
dalej committed
52
extern const char *output_vec_const_move (rtx *);
meissner's avatar
[gcc]  
meissner committed
53
extern const char *rs6000_output_move_128bit (rtx *);
meissner's avatar
[gcc]  
meissner committed
54 55
extern bool rs6000_move_128bit_ok_p (rtx []);
extern bool rs6000_split_128bit_ok_p (rtx []);
dje's avatar
dje committed
56
extern void rs6000_expand_vector_init (rtx, rtx);
57
extern void paired_expand_vector_init (rtx, rtx);
dje's avatar
dje committed
58 59
extern void rs6000_expand_vector_set (rtx, rtx, int);
extern void rs6000_expand_vector_extract (rtx, rtx, int);
60
extern bool altivec_expand_vec_perm_const (rtx op[4]);
61
extern void altivec_expand_vec_perm_le (rtx op[4]);
62
extern bool rs6000_expand_vec_perm_const (rtx op[4]);
wschmidt's avatar
gcc:  
wschmidt committed
63 64
extern void altivec_expand_lvx_be (rtx, rtx, enum machine_mode, unsigned);
extern void altivec_expand_stvx_be (rtx, rtx, enum machine_mode, unsigned);
wschmidt's avatar
gcc:  
wschmidt committed
65
extern void altivec_expand_stvex_be (rtx, rtx, enum machine_mode, unsigned);
66 67
extern void rs6000_expand_extract_even (rtx, rtx, rtx);
extern void rs6000_expand_interleave (rtx, rtx, rtx, bool);
dalej's avatar
dalej committed
68
extern void build_mask64_2_operands (rtx, rtx *);
69
extern int expand_block_clear (rtx[]);
dalej's avatar
dalej committed
70 71 72 73 74 75
extern int expand_block_move (rtx[]);
extern const char * rs6000_output_load_multiple (rtx[]);
extern int includes_lshift_p (rtx, rtx);
extern int includes_rshift_p (rtx, rtx);
extern int includes_rldic_lshift_p (rtx, rtx);
extern int includes_rldicr_lshift_p (rtx, rtx);
76
extern int insvdi_rshift_rlwimi_p (rtx, rtx, rtx);
dalej's avatar
dalej committed
77
extern int registers_ok_for_quad_peep (rtx, rtx);
78
extern int mems_ok_for_quad_peep (rtx, rtx);
79
extern bool gpr_or_gpr_p (rtx, rtx);
meissner's avatar
[gcc]  
meissner committed
80 81
extern bool direct_move_p (rtx, rtx);
extern bool quad_load_store_p (rtx, rtx);
82
extern bool fusion_gpr_load_p (rtx, rtx, rtx, rtx);
83
extern void expand_fusion_gpr_load (rtx *);
84
extern const char *emit_fusion_gpr_load (rtx, rtx);
85 86 87 88 89 90 91 92 93 94 95 96
extern enum reg_class (*rs6000_preferred_reload_class_ptr) (rtx,
							    enum reg_class);
extern enum reg_class (*rs6000_secondary_reload_class_ptr) (enum reg_class,
							    enum machine_mode,
							    rtx);
extern bool (*rs6000_secondary_memory_needed_ptr) (enum reg_class,
						   enum reg_class,
						   enum machine_mode);
extern bool (*rs6000_cannot_change_mode_class_ptr) (enum machine_mode,
						    enum machine_mode,
						    enum reg_class);
extern void rs6000_secondary_reload_inner (rtx, rtx, rtx, bool);
amodra's avatar
amodra committed
97
extern void rs6000_secondary_reload_gpr (rtx, rtx, rtx, bool);
98 99 100 101 102
extern int paired_emit_vector_cond_expr (rtx, rtx, rtx,
                                         rtx, rtx, rtx);
extern void paired_expand_vector_move (rtx operands[]);


dalej's avatar
dalej committed
103 104 105
extern int ccr_bit (rtx, int);
extern int extract_MB (rtx);
extern int extract_ME (rtx);
106
extern void rs6000_output_function_entry (FILE *, const char *);
dalej's avatar
dalej committed
107 108 109
extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern enum rtx_code rs6000_reverse_condition (enum machine_mode,
110
					       enum rtx_code);
111
extern void rs6000_emit_sISEL (enum machine_mode, rtx[]);
bonzini's avatar
bonzini committed
112 113
extern void rs6000_emit_sCOND (enum machine_mode, rtx[]);
extern void rs6000_emit_cbranch (enum machine_mode, rtx[]);
114
extern char * output_fused_cbranch (rtx operands[], const char *, rtx);
dalej's avatar
dalej committed
115
extern char * output_cbranch (rtx, const char *, int, rtx);
116
extern char * output_e500_flip_gt_bit (rtx, rtx);
117
extern const char * output_probe_stack_range (rtx, rtx);
dalej's avatar
dalej committed
118 119
extern rtx rs6000_emit_set_const (rtx, enum machine_mode, rtx, int);
extern int rs6000_emit_cmove (rtx, rtx, rtx, rtx);
120
extern int rs6000_emit_vector_cond_expr (rtx, rtx, rtx, rtx, rtx, rtx);
dalej's avatar
dalej committed
121
extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx);
122 123 124
extern void rs6000_expand_atomic_compare_and_swap (rtx op[]);
extern void rs6000_expand_atomic_exchange (rtx op[]);
extern void rs6000_expand_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx);
125 126
extern void rs6000_emit_swdiv (rtx, rtx, rtx, bool);
extern void rs6000_emit_swrsqrt (rtx, rtx);
dalej's avatar
dalej committed
127
extern void output_toc (FILE *, rtx, int, enum machine_mode);
128
extern rtx rs6000_longcall_ref (rtx);
dalej's avatar
dalej committed
129
extern void rs6000_fatal_bad_address (rtx);
130
extern rtx create_TOC_reference (rtx, rtx);
geoffk's avatar
geoffk committed
131
extern void rs6000_split_multireg_move (rtx, rtx);
wschmidt's avatar
gcc:  
wschmidt committed
132
extern void rs6000_emit_le_vsx_move (rtx, rtx, enum machine_mode);
dalej's avatar
dalej committed
133
extern void rs6000_emit_move (rtx, rtx, enum machine_mode);
bergner's avatar
bergner committed
134
extern rtx rs6000_secondary_memory_needed_rtx (enum machine_mode);
135 136
extern enum machine_mode rs6000_secondary_memory_needed_mode (enum
							      machine_mode);
137 138
extern rtx (*rs6000_legitimize_reload_address_ptr) (rtx, enum machine_mode,
						    int, int, int, int *);
amodra's avatar
amodra committed
139 140
extern bool rs6000_legitimate_offset_address_p (enum machine_mode, rtx,
						bool, bool);
rsandifo's avatar
gcc/  
rsandifo committed
141
extern rtx rs6000_find_base_term (rtx);
dalej's avatar
dalej committed
142 143
extern rtx rs6000_return_addr (int, rtx);
extern void rs6000_output_symbol_ref (FILE*, rtx);
144
extern HOST_WIDE_INT rs6000_initial_elimination_offset (int, int);
sayle's avatar
 
sayle committed
145 146
extern void rs6000_emit_popcount (rtx, rtx);
extern void rs6000_emit_parity (rtx, rtx);
dalej's avatar
dalej committed
147

amodra's avatar
amodra committed
148 149
extern rtx rs6000_machopic_legitimize_pic_address (rtx, enum machine_mode,
						   rtx);
150
extern rtx rs6000_address_for_fpconvert (rtx);
meissner's avatar
meissner committed
151
extern rtx rs6000_address_for_altivec (rtx);
152
extern rtx rs6000_allocate_stack_temp (enum machine_mode, bool, bool);
153
extern int rs6000_loop_align (rtx);
meissner's avatar
[gcc]  
meissner committed
154
extern void rs6000_split_logical (rtx [], enum rtx_code, bool, bool, bool, rtx);
155 156 157
#endif /* RTX_CODE */

#ifdef TREE_CODE
158
extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
uweigand's avatar
gcc/  
uweigand committed
159
extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
amodra's avatar
amodra committed
160 161
extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
						     unsigned int);
geoffk's avatar
geoffk committed
162 163
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
							    unsigned int);
164
extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *);
165
extern rtx rs6000_libcall_value (enum machine_mode);
166
extern rtx rs6000_va_arg (tree, tree);
dalej's avatar
dalej committed
167
extern int function_ok_for_sibcall (tree);
amodra's avatar
amodra committed
168
extern int rs6000_reg_parm_stack_space (tree, bool);
dalej's avatar
dalej committed
169
extern void rs6000_elf_declare_function_name (FILE *, const char *, tree);
170
extern bool rs6000_elf_in_small_data_p (const_tree);
171 172
#ifdef ARGS_SIZE_RTX
/* expr.h defines ARGS_SIZE_RTX and `enum direction' */
173
extern enum direction function_arg_padding (enum machine_mode, const_tree);
174
#endif /* ARGS_SIZE_RTX */
175

176 177
#endif /* TREE_CODE */

dalej's avatar
dalej committed
178 179 180 181 182 183 184 185
extern int direct_return (void);
extern int first_reg_to_save (void);
extern int first_fp_reg_to_save (void);
extern void output_ascii (FILE *, const char *, int);
extern void rs6000_gen_section_name (char **, const char *, const char *);
extern void output_function_profiler (FILE *, int);
extern void output_profile_hook  (int);
extern int rs6000_trampoline_size (void);
ian's avatar
./:  
ian committed
186
extern alias_set_type get_TOC_alias_set (void);
dalej's avatar
dalej committed
187 188
extern void rs6000_emit_prologue (void);
extern void rs6000_emit_load_toc_table (int);
189
extern unsigned int rs6000_dbx_register_number (unsigned int);
dalej's avatar
dalej committed
190
extern void rs6000_emit_epilogue (int);
191
extern void rs6000_emit_eh_reg_restore (rtx, rtx);
dalej's avatar
dalej committed
192
extern const char * output_isel (rtx *);
193 194
extern void rs6000_call_aix (rtx, rtx, rtx, rtx);
extern void rs6000_sibcall_aix (rtx, rtx, rtx, rtx);
hainque's avatar
 
hainque committed
195
extern void rs6000_aix_asm_output_dwarf_table_ref (char *);
196
extern void get_ppc476_thunk_name (char name[32]);
197
extern bool rs6000_overloaded_builtin_p (enum rs6000_builtins);
198
extern HOST_WIDE_INT rs6000_builtin_mask_calculate (void);
hainque's avatar
 
hainque committed
199

200 201
/* Declare functions in rs6000-c.c */

dalej's avatar
dalej committed
202 203
extern void rs6000_pragma_longcall (struct cpp_reader *);
extern void rs6000_cpu_cpp_builtins (struct cpp_reader *);
204 205 206
#ifdef TREE_CODE
extern bool rs6000_pragma_target_parse (tree, tree);
#endif
207 208 209
extern void rs6000_target_modify_macros (bool, HOST_WIDE_INT, HOST_WIDE_INT);
extern void (*rs6000_target_modify_macros_ptr) (bool, HOST_WIDE_INT,
						HOST_WIDE_INT);
210

211 212 213 214
#if TARGET_MACHO
char *output_call (rtx, rtx *, int, int);
#endif

dje's avatar
dje committed
215 216 217 218
#ifdef NO_DOLLAR_IN_LABEL
const char * rs6000_xcoff_strip_dollar (const char *);
#endif

219 220
void rs6000_final_prescan_insn (rtx, rtx *operand, int num_operands);

221
extern bool rs6000_hard_regno_mode_ok_p[][FIRST_PSEUDO_REGISTER];
222 223
extern unsigned char rs6000_class_max_nregs[][LIM_REG_CLASSES];
extern unsigned char rs6000_hard_regno_nregs[][FIRST_PSEUDO_REGISTER];
224 225

extern bool rs6000_linux_float_exceptions_rounding_supported_p (void);
Doug Gilbert's avatar
Doug Gilbert committed
226
extern bool mem_contiguous(rtx, rtx);
227
#endif  /* rs6000-protos.h */