| 1 |
/* Definitions of target machine for GNU compiler, for IBM S/390. |
| 2 |
Copyright (C) 2000-2025 Free Software Foundation, Inc. |
| 3 |
|
| 4 |
Contributed by Hartmut Penner ([email protected]) |
| 5 |
|
| 6 |
This file is part of GCC. |
| 7 |
|
| 8 |
GCC is free software; you can redistribute it and/or modify it under |
| 9 |
the terms of the GNU General Public License as published by the Free |
| 10 |
Software Foundation; either version 3, or (at your option) any later |
| 11 |
version. |
| 12 |
|
| 13 |
GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 14 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 16 |
for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with GCC; see the file COPYING3. If not see |
| 20 |
<http://www.gnu.org/licenses/>. */ |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
/* Prototypes of functions used for constraint evaluation in |
| 25 |
constraints.c. */ |
| 26 |
|
| 27 |
extern int s390_mem_constraint (const char *str, rtx op); |
| 28 |
extern int s390_O_constraint_str (const char c, HOST_WIDE_INT value); |
| 29 |
extern int s390_N_constraint_str (const char *str, HOST_WIDE_INT value); |
| 30 |
extern int s390_float_const_zero_p (rtx value); |
| 31 |
extern bool s390_check_symref_alignment (rtx addr, HOST_WIDE_INT alignment); |
| 32 |
|
| 33 |
|
| 34 |
/* In s390-common.cc. */ |
| 35 |
extern bool s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED, |
| 36 |
struct gcc_options *opts_set ATTRIBUTE_UNUSED, |
| 37 |
const struct cl_decoded_option *decoded, |
| 38 |
location_t loc); |
| 39 |
|
| 40 |
/* Declare functions in s390.cc. */ |
| 41 |
|
| 42 |
extern HOST_WIDE_INT s390_initial_elimination_offset (int, int); |
| 43 |
extern void s390_emit_prologue (void); |
| 44 |
extern void s390_emit_epilogue (bool); |
| 45 |
extern void s390_expand_split_stack_prologue (void); |
| 46 |
extern bool s390_can_use_simple_return_insn (void); |
| 47 |
extern bool s390_can_use_return_insn (void); |
| 48 |
extern void s390_function_profiler (FILE *, int); |
| 49 |
extern void s390_set_has_landing_pad_p (bool); |
| 50 |
extern bool s390_hard_regno_rename_ok (unsigned int, unsigned int); |
| 51 |
extern int s390_class_max_nregs (enum reg_class, machine_mode); |
| 52 |
extern bool s390_return_addr_from_memory(void); |
| 53 |
extern bool s390_fma_allowed_p (machine_mode); |
| 54 |
#if S390_USE_TARGET_ATTRIBUTE |
| 55 |
extern tree s390_valid_target_attribute_tree (tree args, |
| 56 |
struct gcc_options *opts, |
| 57 |
const struct gcc_options |
| 58 |
*opts_set, bool is_pragma); |
| 59 |
extern void s390_activate_target_options (tree new_tree); |
| 60 |
extern void |
| 61 |
s390_asm_output_function_prefix (FILE *asm_out_file, |
| 62 |
const char *fnname ATTRIBUTE_UNUSED); |
| 63 |
extern void |
| 64 |
s390_asm_declare_function_size (FILE *asm_out_file, |
| 65 |
const char *fnname ATTRIBUTE_UNUSED, tree decl); |
| 66 |
#endif |
| 67 |
|
| 68 |
extern void s390_rawmemchr (machine_mode elt_mode, rtx dst, rtx src, rtx pat); |
| 69 |
|
| 70 |
#ifdef RTX_CODE |
| 71 |
extern int s390_extra_constraint_str (rtx, int, const char *); |
| 72 |
extern int s390_const_ok_for_constraint_p (HOST_WIDE_INT, int, const char *); |
| 73 |
extern int s390_const_double_ok_for_constraint_p (rtx, int, const char *); |
| 74 |
extern int s390_single_part (rtx, machine_mode, machine_mode, int); |
| 75 |
extern unsigned HOST_WIDE_INT s390_extract_part (rtx, machine_mode, int); |
| 76 |
extern bool s390_contiguous_bitmask_p (unsigned HOST_WIDE_INT, bool, int, int *, int *); |
| 77 |
extern bool s390_constant_via_vgm_p (rtx, machine_mode *, int *, int *); |
| 78 |
extern bool s390_constant_via_vrepi_p (rtx, machine_mode *, short *); |
| 79 |
extern bool s390_constant_via_vgbm_p (rtx, unsigned *); |
| 80 |
extern bool s390_split_ok_p (rtx, rtx, machine_mode, int); |
| 81 |
extern bool s390_overlap_p (rtx, rtx, HOST_WIDE_INT); |
| 82 |
extern bool s390_offset_p (rtx, rtx, rtx); |
| 83 |
extern bool s390_rel_address_ok_p (rtx); |
| 84 |
extern int tls_symbolic_operand (rtx); |
| 85 |
|
| 86 |
extern bool s390_match_ccmode (rtx_insn *, machine_mode); |
| 87 |
extern machine_mode s390_tm_ccmode (rtx, rtx, bool); |
| 88 |
extern machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx); |
| 89 |
extern rtx s390_emit_compare (machine_mode, enum rtx_code, rtx, rtx); |
| 90 |
extern rtx_insn *s390_emit_jump (rtx, rtx); |
| 91 |
extern bool symbolic_reference_mentioned_p (rtx); |
| 92 |
extern bool tls_symbolic_reference_mentioned_p (rtx); |
| 93 |
extern bool legitimate_la_operand_p (rtx); |
| 94 |
extern bool preferred_la_operand_p (rtx, rtx); |
| 95 |
extern int legitimate_pic_operand_p (rtx); |
| 96 |
extern bool legitimate_reload_constant_p (rtx); |
| 97 |
extern rtx legitimize_pic_address (rtx, rtx); |
| 98 |
extern rtx legitimize_reload_address (rtx, machine_mode, int, int); |
| 99 |
extern enum reg_class s390_secondary_input_reload_class (enum reg_class, |
| 100 |
machine_mode, |
| 101 |
rtx); |
| 102 |
extern enum reg_class s390_secondary_output_reload_class (enum reg_class, |
| 103 |
machine_mode, |
| 104 |
rtx); |
| 105 |
extern void s390_reload_larl_operand (rtx , rtx , rtx); |
| 106 |
extern void s390_reload_symref_address (rtx , rtx , rtx , bool); |
| 107 |
extern void s390_expand_plus_operand (rtx, rtx, rtx); |
| 108 |
extern void emit_symbolic_move (rtx *); |
| 109 |
extern void s390_load_address (rtx, rtx); |
| 110 |
extern bool s390_expand_cpymem (rtx, rtx, rtx, rtx, rtx); |
| 111 |
extern bool s390_expand_movmem (rtx, rtx, rtx, rtx, rtx); |
| 112 |
extern void s390_expand_setmem (rtx, rtx, rtx, rtx, rtx); |
| 113 |
extern bool s390_expand_cmpmem (rtx, rtx, rtx, rtx); |
| 114 |
extern void s390_expand_vec_strlen (rtx, rtx, rtx); |
| 115 |
extern void s390_expand_vec_movstr (rtx, rtx, rtx); |
| 116 |
extern bool s390_expand_addcc (enum rtx_code, rtx, rtx, rtx, rtx, rtx); |
| 117 |
extern bool s390_expand_insv (rtx, rtx, rtx, rtx); |
| 118 |
extern void s390_expand_cs (machine_mode, rtx, rtx, rtx, rtx, rtx, bool); |
| 119 |
extern void s390_expand_atomic_exchange_tdsi (rtx, rtx, rtx); |
| 120 |
extern void s390_expand_atomic (machine_mode, enum rtx_code, |
| 121 |
rtx, rtx, rtx, bool); |
| 122 |
extern void s390_expand_tbegin (rtx, rtx, rtx, bool); |
| 123 |
extern void s390_expand_vec_compare (rtx, enum rtx_code, rtx, rtx); |
| 124 |
extern void s390_expand_vec_compare_cc (rtx, enum rtx_code, rtx, rtx, bool); |
| 125 |
extern enum rtx_code s390_reverse_condition (machine_mode, enum rtx_code); |
| 126 |
extern void s390_expand_vcond (rtx, rtx, rtx, enum rtx_code, rtx, rtx); |
| 127 |
extern void s390_expand_vec_init (rtx, rtx); |
| 128 |
extern rtx s390_expand_merge_perm_const (machine_mode, bool); |
| 129 |
extern void s390_expand_merge (rtx, rtx, rtx, bool); |
| 130 |
extern rtx s390_build_signbit_mask (machine_mode); |
| 131 |
extern rtx s390_return_addr_rtx (int, rtx); |
| 132 |
extern rtx s390_back_chain_rtx (void); |
| 133 |
extern rtx_insn *s390_emit_call (rtx, rtx, rtx, rtx); |
| 134 |
extern void s390_expand_logical_operator (enum rtx_code, |
| 135 |
machine_mode, rtx *); |
| 136 |
extern bool s390_logical_operator_ok_p (rtx *); |
| 137 |
extern void s390_narrow_logical_operator (enum rtx_code, rtx *, rtx *); |
| 138 |
extern void s390_split_access_reg (rtx, rtx *, rtx *); |
| 139 |
|
| 140 |
extern void print_operand_address (FILE *, rtx); |
| 141 |
extern void print_operand (FILE *, rtx, int); |
| 142 |
extern void s390_output_pool_entry (rtx, machine_mode, unsigned int); |
| 143 |
extern bool s390_const_int_pool_entry_p (rtx, HOST_WIDE_INT *); |
| 144 |
extern int s390_label_align (rtx_insn *); |
| 145 |
extern int s390_agen_dep_p (rtx_insn *, rtx_insn *); |
| 146 |
extern rtx_insn *s390_load_got (void); |
| 147 |
extern rtx s390_get_thread_pointer (void); |
| 148 |
extern void s390_emit_tpf_eh_return (rtx); |
| 149 |
extern bool s390_legitimate_address_without_index_p (rtx); |
| 150 |
extern bool s390_decompose_addrstyle_without_index (rtx, rtx *, |
| 151 |
HOST_WIDE_INT *); |
| 152 |
extern bool s390_valid_shift_count (rtx op, HOST_WIDE_INT required_mask = 63); |
| 153 |
extern int s390_branch_condition_mask (rtx); |
| 154 |
extern int s390_compare_and_branch_condition_mask (rtx); |
| 155 |
extern bool s390_extzv_shift_ok (int, int, unsigned HOST_WIDE_INT); |
| 156 |
extern void s390_asm_output_function_label (FILE *, const char *, tree); |
| 157 |
extern void s390_output_split_stack_data (rtx, rtx, rtx, rtx); |
| 158 |
|
| 159 |
enum s390_indirect_branch_type |
| 160 |
{ |
| 161 |
s390_indirect_branch_type_jump = 0, |
| 162 |
s390_indirect_branch_type_call, |
| 163 |
s390_indirect_branch_type_return |
| 164 |
}; |
| 165 |
extern void s390_indirect_branch_via_thunk (unsigned int regno, |
| 166 |
unsigned int return_addr_regno, |
| 167 |
rtx comparison_operator, |
| 168 |
enum s390_indirect_branch_type type); |
| 169 |
extern void s390_indirect_branch_via_inline_thunk (rtx execute_target); |
| 170 |
#endif /* RTX_CODE */ |
| 171 |
|
| 172 |
/* s390-c.cc routines */ |
| 173 |
extern void s390_cpu_cpp_builtins (struct cpp_reader *); |
| 174 |
extern void s390_register_target_pragmas (void); |
| 175 |
|
| 176 |
/* Routines for s390-c.cc */ |
| 177 |
extern bool s390_const_operand_ok (tree, int, int, tree); |
| 178 |
|
| 179 |
/* Pass management. */ |
| 180 |
namespace gcc { class context; } |
| 181 |
class rtl_opt_pass; |
| 182 |
|
| 183 |
extern rtl_opt_pass *make_pass_s390_early_mach (gcc::context *ctxt); |