Debian Codegraph @

gcc/config/aarch64/tuning_models/hip12.h

raw
1 /* Tuning model description for AArch64 architecture.
2 Copyright (C) 2009-2026 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GCC is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20 #ifndef GCC_AARCH64_H_HIP12
21 #define GCC_AARCH64_H_HIP12
22
23 #include "generic.h"
24
25 static const struct cpu_addrcost_table hip12_addrcost_table =
26 {
27 {
28 0, /* hi */
29 0, /* si */
30 0, /* di */
31 2, /* ti */
32 },
33 0, /* pre_modify */
34 0, /* post_modify */
35 2, /* post_modify_ld3_st3 */
36 2, /* post_modify_ld4_st4 */
37 0, /* register_offset */
38 0, /* register_sextend */
39 0, /* register_zextend */
40 0, /* imm_offset */
41 };
42
43 static const struct cpu_regmove_cost hip12_regmove_cost =
44 {
45 1, /* GP2GP */
46 /* Spilling to int<->fp instead of memory is recommended so set
47 realistic costs compared to memmov_cost. */
48 5, /* GP2FP */
49 2, /* FP2GP */
50 2 /* FP2FP */
51 };
52
53 static const advsimd_vec_cost hip12_advsimd_vector_cost =
54 {
55 2, /* int_stmt_cost */
56 2, /* fp_stmt_cost */
57 2, /* ld2_st2_permute_cost */
58 2, /* ld3_st3_permute_cost */
59 3, /* ld4_st4_permute_cost */
60 2, /* permute_cost */
61 9, /* reduc_i8_cost */
62 7, /* reduc_i16_cost */
63 5, /* reduc_i32_cost */
64 3, /* reduc_i64_cost */
65 9, /* reduc_f16_cost */
66 6, /* reduc_f32_cost */
67 3, /* reduc_f64_cost */
68 2, /* store_elt_extra_cost */
69 2, /* vec_to_scalar_cost */
70 4, /* scalar_to_vec_cost */
71 6, /* align_load_cost */
72 6, /* unalign_load_cost */
73 1, /* unalign_store_cost */
74 1 /* store_cost */
75 };
76
77 static const sve_vec_cost hip12_sve_vector_cost =
78 {
79 {
80 2, /* int_stmt_cost */
81 2, /* fp_stmt_cost */
82 2, /* ld2_st2_permute_cost */
83 3, /* ld3_st3_permute_cost */
84 3, /* ld4_st4_permute_cost */
85 2, /* permute_cost */
86 /* Theoretically, a reduction involving 31 scalar ADDs could
87 complete in ~6 cycles and would have a cost of 31. [SU]ADDV
88 completes in 13 cycles, so give it a cost of 31 + 7. */
89 38, /* reduc_i8_cost */
90 /* Likewise for 15 scalar ADDs (~3 cycles) vs. 10: 15 + 7. */
91 22, /* reduc_i16_cost */
92 /* Likewise for 7 scalar ADDs (~2 cycles) vs. 7: 7 + 5. */
93 12, /* reduc_i32_cost */
94 /* Likewise for 3 scalar ADDs (~1 cycles) vs. 4: 3 + 3. */
95 6, /* reduc_i64_cost */
96 /* Theoretically, a reduction involving 15 scalar FADDs could
97 complete in ~8 cycles and would have a cost of 30. FADDV
98 completes in 15 cycles, so give it a cost of 30 + 7. */
99 37, /* reduc_f16_cost */
100 /* Likewise for 7 scalar FADDs (~4 cycles) vs. 12: 14 + 8. */
101 22, /* reduc_f32_cost */
102 /* Likewise for 3 scalar FADDs (~2 cycles) vs. 9: 6 + 7. */
103 13, /* reduc_f64_cost */
104 2, /* store_elt_extra_cost */
105 2, /* vec_to_scalar_cost */
106 4, /* scalar_to_vec_cost */
107 6, /* align_load_cost */
108 6, /* unalign_load_cost */
109 1, /* unalign_store_cost */
110 1 /* store_cost */
111 },
112 3, /* clast_cost */
113 42, /* fadda_f16_cost */
114 26, /* fadda_f32_cost */
115 20, /* fadda_f64_cost */
116 32, /* gather_load_x32_cost */
117 16, /* gather_load_x64_cost */
118 96, /* gather_load_x32_init_cost */
119 32, /* gather_load_x64_init_cost */
120 3 /* scatter_store_elt_cost */
121 };
122
123 static const aarch64_scalar_vec_issue_info hip12_scalar_issue_info =
124 {
125 5, /* loads_stores_per_cycle */
126 2, /* stores_per_cycle */
127 6, /* general_ops_per_cycle */
128 0, /* fp_simd_load_general_ops */
129 1 /* fp_simd_store_general_ops */
130 };
131
132 static const aarch64_advsimd_vec_issue_info hip12_advsimd_issue_info =
133 {
134 {
135 5, /* loads_stores_per_cycle */
136 2, /* stores_per_cycle */
137 4, /* general_ops_per_cycle */
138 0, /* fp_simd_load_general_ops */
139 1 /* fp_simd_store_general_ops */
140 },
141 2, /* ld2_st2_general_ops */
142 2, /* ld3_st3_general_ops */
143 3 /* ld4_st4_general_ops */
144 };
145
146 static const aarch64_sve_vec_issue_info hip12_sve_issue_info =
147 {
148 {
149 {
150 5, /* loads_stores_per_cycle */
151 2, /* stores_per_cycle */
152 2, /* general_ops_per_cycle */
153 0, /* fp_simd_load_general_ops */
154 1 /* fp_simd_store_general_ops */
155 },
156 2, /* ld2_st2_general_ops */
157 2, /* ld3_st3_general_ops */
158 3 /* ld4_st4_general_ops */
159 },
160 2, /* pred_ops_per_cycle */
161 2, /* while_pred_ops */
162 2, /* int_cmp_pred_ops */
163 1, /* fp_cmp_pred_ops */
164 1, /* gather_scatter_pair_general_ops */
165 1 /* gather_scatter_pair_pred_ops */
166 };
167
168 static const aarch64_vec_issue_info hip12_vec_issue_info =
169 {
170 &hip12_scalar_issue_info,
171 &hip12_advsimd_issue_info,
172 &hip12_sve_issue_info
173 };
174
175 static const struct cpu_vector_cost hip12_vector_cost =
176 {
177 1, /* scalar_int_stmt_cost */
178 2, /* scalar_fp_stmt_cost */
179 4, /* scalar_load_cost */
180 1, /* scalar_store_cost */
181 1, /* cond_taken_branch_cost */
182 1, /* cond_not_taken_branch_cost */
183 &hip12_advsimd_vector_cost, /* advsimd */
184 &hip12_sve_vector_cost, /* sve */
185 &hip12_vec_issue_info /* issue_info */
186 };
187
188 static const struct tune_params hip12_tunings =
189 {
190 &hip12_extra_costs,
191 &hip12_addrcost_table,
192 &hip12_regmove_cost,
193 &hip12_vector_cost,
194 &generic_branch_cost,
195 &generic_approx_modes,
196 SVE_256, /* sve_width */
197 { 4, /* load_int. */
198 1, /* store_int. */
199 6, /* load_fp. */
200 1, /* store_fp. */
201 8, /* load_pred. */
202 4 /* store_pred. */
203 }, /* memmov_cost. */
204 8, /* issue_rate */
205 (AARCH64_FUSE_BASE
206 | AARCH64_FUSE_CMP_CSEL
207 | AARCH64_FUSE_CMP_CSET), /* fusible_ops */
208 "16", /* function_align. */
209 "4", /* jump_align. */
210 "8", /* loop_align. */
211 2, /* int_reassoc_width. */
212 4, /* fp_reassoc_width. */
213 2, /* fma_reassoc_width. */
214 2, /* vec_reassoc_width. */
215 2, /* min_div_recip_mul_sf. */
216 2, /* min_div_recip_mul_df. */
217 0, /* max_case_values. */
218 tune_params::AUTOPREFETCHER_WEAK, /* autoprefetcher_model. */
219 (AARCH64_EXTRA_TUNE_BASE
220 | AARCH64_EXTRA_TUNE_MATCHED_VECTOR_THROUGHPUT), /* tune_flags. */
221 &generic_armv8_a_prefetch_tune,
222 AARCH64_LDP_STP_POLICY_ALWAYS, /* ldp_policy_model. */
223 AARCH64_LDP_STP_POLICY_ALWAYS /* stp_policy_model. */
224 };
225
226 #endif /* GCC_AARCH64_H_HIP12. */