xref: /netbsd-src/external/gpl3/gcc/dist/gcc/config/loongarch/loongarch-tune.h (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1 /* Definitions for microarchitecture-related data structures.
2    Copyright (C) 2021-2022 Free Software Foundation, Inc.
3    Contributed by Loongson Ltd.
4 
5 This file is part of GCC.
6 
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11 
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3.  If not see
19 <http://www.gnu.org/licenses/>.  */
20 
21 #ifndef LOONGARCH_TUNE_H
22 #define LOONGARCH_TUNE_H
23 
24 /* RTX costs of various operations on the different architectures.  */
25 struct loongarch_rtx_cost_data
26 {
27   unsigned short fp_add;
28   unsigned short fp_mult_sf;
29   unsigned short fp_mult_df;
30   unsigned short fp_div_sf;
31   unsigned short fp_div_df;
32   unsigned short int_mult_si;
33   unsigned short int_mult_di;
34   unsigned short int_div_si;
35   unsigned short int_div_di;
36   unsigned short branch_cost;
37   unsigned short memory_latency;
38 };
39 
40 /* Costs to use when optimizing for size.  */
41 extern const struct loongarch_rtx_cost_data loongarch_rtx_cost_optimize_size;
42 
43 /* Cache size record of known processor models.  */
44 struct loongarch_cache {
45     int l1d_line_size;  /* bytes */
46     int l1d_size;       /* KiB */
47     int l2d_size;       /* kiB */
48 };
49 
50 #endif /* LOONGARCH_TUNE_H */
51