]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/gcn/gcn-protos.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / gcn / gcn-protos.h
1 /* Copyright (C) 2016-2024 Free Software Foundation, Inc.
2
3 This file is free software; you can redistribute it and/or modify it under
4 the terms of the GNU General Public License as published by the Free
5 Software Foundation; either version 3 of the License, or (at your option)
6 any later version.
7
8 This file is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with GCC; see the file COPYING3. If not see
15 <http://www.gnu.org/licenses/>. */
16
17 #ifndef _GCN_PROTOS_
18 #define _GCN_PROTOS_
19
20 extern void gcn_asm_output_symbol_ref (FILE *file, rtx x);
21 extern tree gcn_builtin_decl (unsigned code, bool initialize_p);
22 extern bool gcn_can_split_p (machine_mode, rtx);
23 extern bool gcn_constant64_p (rtx);
24 extern bool gcn_constant_p (rtx);
25 extern rtx gcn_convert_mask_mode (rtx reg);
26 extern unsigned int gcn_dwarf_register_number (unsigned int regno);
27 extern rtx get_exec (int64_t);
28 extern rtx get_exec (machine_mode mode);
29 extern char * gcn_expand_dpp_shr_insn (machine_mode, const char *, int, int);
30 extern char * gcn_expand_dpp_swap_pairs_insn (machine_mode, const char *, int);
31 extern char * gcn_expand_dpp_distribute_even_insn (machine_mode, const char *,
32 int unspec);
33 extern char * gcn_expand_dpp_distribute_odd_insn (machine_mode, const char *,
34 int unspec);
35 extern void gcn_expand_epilogue ();
36 extern rtx gcn_expand_scaled_offsets (addr_space_t as, rtx base, rtx offsets,
37 rtx scale, bool unsigned_p, rtx exec);
38 extern void gcn_expand_prologue ();
39 extern rtx gcn_expand_reduc_scalar (machine_mode, rtx, int);
40 extern rtx gcn_expand_scalar_to_vector_address (machine_mode, rtx, rtx, rtx);
41 extern void gcn_expand_vector_init (rtx, rtx);
42 extern bool gcn_flat_address_p (rtx, machine_mode);
43 extern bool gcn_fp_constant_p (rtx, bool);
44 extern rtx gcn_gen_undef (machine_mode);
45 extern bool gcn_global_address_p (rtx);
46 extern tree gcn_goacc_adjust_private_decl (location_t, tree var, int level);
47 extern tree gcn_goacc_create_worker_broadcast_record (tree record_type,
48 bool sender,
49 const char *name,
50 unsigned HOST_WIDE_INT offset);
51 extern void gcn_goacc_reduction (gcall *call);
52 extern bool gcn_hard_regno_rename_ok (unsigned int from_reg,
53 unsigned int to_reg);
54 extern machine_mode gcn_hard_regno_caller_save_mode (unsigned int regno,
55 unsigned int nregs,
56 machine_mode regmode);
57 extern bool gcn_hard_regno_mode_ok (int regno, machine_mode mode);
58 extern int gcn_hard_regno_nregs (int regno, machine_mode mode);
59 extern void gcn_hsa_declare_function_name (FILE *file, const char *name,
60 tree decl);
61 extern HOST_WIDE_INT gcn_initial_elimination_offset (int, int);
62 extern REAL_VALUE_TYPE gcn_dconst1over2pi (void);
63 extern bool gcn_inline_constant64_p (rtx, bool);
64 extern bool gcn_inline_constant_p (rtx);
65 extern int gcn_inline_fp_constant_p (rtx, bool);
66 extern reg_class gcn_mode_code_base_reg_class (machine_mode, addr_space_t,
67 int, int);
68 extern rtx gcn_oacc_dim_pos (int dim);
69 extern rtx gcn_oacc_dim_size (int dim);
70 extern rtx gcn_operand_doublepart (machine_mode, rtx, int);
71 extern rtx gcn_operand_part (machine_mode, rtx, int);
72 extern bool gcn_regno_mode_code_ok_for_base_p (int, machine_mode,
73 addr_space_t, int, int);
74 extern reg_class gcn_regno_reg_class (int regno);
75 extern bool gcn_scalar_flat_address_p (rtx);
76 extern bool gcn_scalar_flat_mem_p (rtx);
77 extern bool gcn_sgpr_move_p (rtx, rtx);
78 extern bool gcn_stepped_zero_int_parallel_p (rtx op, int step);
79 extern bool gcn_valid_move_p (machine_mode, rtx, rtx);
80 extern rtx gcn_vec_constant (machine_mode, int);
81 extern rtx gcn_vec_constant (machine_mode, rtx);
82 extern bool gcn_vgpr_move_p (rtx, rtx);
83 extern void print_operand_address (FILE *file, rtx addr);
84 extern void print_operand (FILE *file, rtx x, int code);
85 extern bool regno_ok_for_index_p (int);
86
87 enum gcn_cvt_t
88 {
89 fix_trunc_cvt,
90 fixuns_trunc_cvt,
91 float_cvt,
92 floatuns_cvt,
93 extend_cvt,
94 trunc_cvt
95 };
96
97 extern bool gcn_valid_cvt_p (machine_mode from, machine_mode to,
98 enum gcn_cvt_t op);
99
100 #ifdef TREE_CODE
101 extern void gcn_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree,
102 int);
103 class gimple_opt_pass;
104 extern gimple_opt_pass *make_pass_omp_gcn (gcc::context *ctxt);
105 #endif
106
107 /* Return true if MODE is valid for 1 VGPR register. */
108
109 inline bool
110 vgpr_1reg_mode_p (machine_mode mode)
111 {
112 if (VECTOR_MODE_P (mode))
113 mode = GET_MODE_INNER (mode);
114
115 return (mode == SImode || mode == SFmode || mode == HImode || mode == HFmode
116 || mode == QImode || mode == BImode);
117 }
118
119 /* Return true if MODE is valid for 1 SGPR register. */
120
121 inline bool
122 sgpr_1reg_mode_p (machine_mode mode)
123 {
124 return (mode == SImode || mode == SFmode || mode == HImode
125 || mode == QImode || mode == BImode);
126 }
127
128 /* Return true if MODE is valid for pair of VGPR registers. */
129
130 inline bool
131 vgpr_2reg_mode_p (machine_mode mode)
132 {
133 if (VECTOR_MODE_P (mode))
134 mode = GET_MODE_INNER (mode);
135
136 return (mode == DImode || mode == DFmode);
137 }
138
139 /* Return true if MODE is valid for four VGPR registers. */
140
141 inline bool
142 vgpr_4reg_mode_p (machine_mode mode)
143 {
144 if (VECTOR_MODE_P (mode))
145 mode = GET_MODE_INNER (mode);
146
147 return (mode == TImode);
148 }
149
150 /* Return true if MODE can be handled directly by VGPR operations. */
151
152 inline bool
153 vgpr_vector_mode_p (machine_mode mode)
154 {
155 return VECTOR_MODE_P (mode);
156 }
157
158
159 /* Return true if MODE is valid for pair of SGPR registers. */
160
161 inline bool
162 sgpr_2reg_mode_p (machine_mode mode)
163 {
164 return mode == DImode || mode == DFmode;
165 }
166
167 #endif