| 1 |
/* Tuning model description for AArch64 architecture. |
| 2 |
Copyright (C) 2009-2025 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_THUNDERX |
| 21 |
#define GCC_AARCH64_H_THUNDERX |
| 22 |
|
| 23 |
#include "generic.h" |
| 24 |
|
| 25 |
static const struct cpu_regmove_cost thunderx_regmove_cost = |
| 26 |
{ |
| 27 |
2, /* GP2GP */ |
| 28 |
2, /* GP2FP */ |
| 29 |
6, /* FP2GP */ |
| 30 |
4 /* FP2FP */ |
| 31 |
}; |
| 32 |
|
| 33 |
static const advsimd_vec_cost thunderx_advsimd_vector_cost = |
| 34 |
{ |
| 35 |
4, /* int_stmt_cost */ |
| 36 |
1, /* fp_stmt_cost */ |
| 37 |
0, /* ld2_st2_permute_cost */ |
| 38 |
0, /* ld3_st3_permute_cost */ |
| 39 |
0, /* ld4_st4_permute_cost */ |
| 40 |
4, /* permute_cost */ |
| 41 |
2, /* reduc_i8_cost */ |
| 42 |
2, /* reduc_i16_cost */ |
| 43 |
2, /* reduc_i32_cost */ |
| 44 |
2, /* reduc_i64_cost */ |
| 45 |
2, /* reduc_f16_cost */ |
| 46 |
2, /* reduc_f32_cost */ |
| 47 |
2, /* reduc_f64_cost */ |
| 48 |
2, /* store_elt_extra_cost */ |
| 49 |
2, /* vec_to_scalar_cost */ |
| 50 |
2, /* scalar_to_vec_cost */ |
| 51 |
3, /* align_load_cost */ |
| 52 |
5, /* unalign_load_cost */ |
| 53 |
5, /* unalign_store_cost */ |
| 54 |
1 /* store_cost */ |
| 55 |
}; |
| 56 |
|
| 57 |
/* ThunderX costs for vector insn classes. */ |
| 58 |
static const struct cpu_vector_cost thunderx_vector_cost = |
| 59 |
{ |
| 60 |
1, /* scalar_int_stmt_cost */ |
| 61 |
1, /* scalar_fp_stmt_cost */ |
| 62 |
3, /* scalar_load_cost */ |
| 63 |
1, /* scalar_store_cost */ |
| 64 |
3, /* cond_taken_branch_cost */ |
| 65 |
3, /* cond_not_taken_branch_cost */ |
| 66 |
&thunderx_advsimd_vector_cost, /* advsimd */ |
| 67 |
nullptr, /* sve */ |
| 68 |
nullptr /* issue_info */ |
| 69 |
}; |
| 70 |
|
| 71 |
static const cpu_prefetch_tune thunderx_prefetch_tune = |
| 72 |
{ |
| 73 |
8, /* num_slots */ |
| 74 |
32, /* l1_cache_size */ |
| 75 |
128, /* l1_cache_line_size */ |
| 76 |
-1, /* l2_cache_size */ |
| 77 |
true, /* prefetch_dynamic_strides */ |
| 78 |
-1, /* minimum_stride */ |
| 79 |
-1 /* default_opt_level */ |
| 80 |
}; |
| 81 |
|
| 82 |
static const struct tune_params thunderx_tunings = |
| 83 |
{ |
| 84 |
&thunderx_extra_costs, |
| 85 |
&generic_addrcost_table, |
| 86 |
&thunderx_regmove_cost, |
| 87 |
&thunderx_vector_cost, |
| 88 |
&generic_branch_cost, |
| 89 |
&generic_approx_modes, |
| 90 |
SVE_NOT_IMPLEMENTED, /* sve_width */ |
| 91 |
{ 6, /* load_int. */ |
| 92 |
6, /* store_int. */ |
| 93 |
6, /* load_fp. */ |
| 94 |
6, /* store_fp. */ |
| 95 |
6, /* load_pred. */ |
| 96 |
6 /* store_pred. */ |
| 97 |
}, /* memmov_cost. */ |
| 98 |
2, /* issue_rate */ |
| 99 |
AARCH64_FUSE_ALU_BRANCH, /* fusible_ops */ |
| 100 |
"8", /* function_align. */ |
| 101 |
"8", /* jump_align. */ |
| 102 |
"8", /* loop_align. */ |
| 103 |
2, /* int_reassoc_width. */ |
| 104 |
4, /* fp_reassoc_width. */ |
| 105 |
1, /* fma_reassoc_width. */ |
| 106 |
1, /* vec_reassoc_width. */ |
| 107 |
2, /* min_div_recip_mul_sf. */ |
| 108 |
2, /* min_div_recip_mul_df. */ |
| 109 |
0, /* max_case_values. */ |
| 110 |
tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */ |
| 111 |
(AARCH64_EXTRA_TUNE_CHEAP_SHIFT_EXTEND), /* tune_flags. */ |
| 112 |
&thunderx_prefetch_tune, |
| 113 |
AARCH64_LDP_STP_POLICY_ALIGNED, /* ldp_policy_model. */ |
| 114 |
AARCH64_LDP_STP_POLICY_ALIGNED /* stp_policy_model. */ |
| 115 |
}; |
| 116 |
|
| 117 |
#endif /* GCC_AARCH64_H_THUNDERX. */ |