]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/config/ia64/ia64-common.cc
Update copyright years.
[thirdparty/gcc.git] / gcc / common / config / ia64 / ia64-common.cc
CommitLineData
677f3fa8 1/* Common hooks for IA64.
a945c346 2 Copyright (C) 1999-2024 Free Software Foundation, Inc.
677f3fa8
JM
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#include "config.h"
21#include "system.h"
22#include "coretypes.h"
23#include "diagnostic-core.h"
24#include "tm.h"
4d0cdd0c 25#include "memmodel.h"
677f3fa8
JM
26#include "tm_p.h"
27#include "common/common-target.h"
28#include "common/common-target-def.h"
29#include "opts.h"
30#include "flags.h"
31
32/* Implement overriding of the optimization options. */
33static const struct default_options ia64_option_optimization_table[] =
34 {
677f3fa8
JM
35#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
36 SUBTARGET_OPTIMIZATION_OPTIONS,
37#endif
8100e93b
ML
38
39 /* Let the scheduler form additional regions. */
40 { OPT_LEVELS_ALL, OPT__param_max_sched_extend_regions_iters_, NULL, 2 },
41 /* Set the default values for cache-related parameters. */
42 { OPT_LEVELS_ALL, OPT__param_simultaneous_prefetches_, NULL, 6 },
43 { OPT_LEVELS_ALL, OPT__param_l1_cache_line_size_ , NULL, 32},
44 { OPT_LEVELS_ALL, OPT__param_sched_mem_true_dep_cost_, NULL, 4 },
45
677f3fa8
JM
46 { OPT_LEVELS_NONE, 0, NULL, 0 }
47 };
48
49/* Implement TARGET_HANDLE_OPTION. */
50
51static bool
52ia64_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
53 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
54 const struct cl_decoded_option *decoded,
55 location_t loc)
56{
57 size_t code = decoded->opt_index;
58 const char *arg = decoded->arg;
59 int value = decoded->value;
60
61 switch (code)
62 {
63 case OPT_mtls_size_:
64 if (value != 14 && value != 22 && value != 64)
a3f9f006 65 error_at (loc, "bad value %<%s%> for %<-mtls-size=%> switch", arg);
677f3fa8
JM
66 return true;
67
68 default:
69 return true;
70 }
71}
72
73/* Implement TARGET_EXCEPT_UNWIND_INFO. */
74
75enum unwind_info_type
76ia64_except_unwind_info (struct gcc_options *opts)
77{
78 /* Honor the --enable-sjlj-exceptions configure switch. */
d656c9c5
TG
79#ifdef CONFIG_SJLJ_EXCEPTIONS
80 if (CONFIG_SJLJ_EXCEPTIONS)
677f3fa8
JM
81 return UI_SJLJ;
82#endif
83
84 /* For simplicity elsewhere in this file, indicate that all unwind
85 info is disabled if we're not emitting unwind tables. */
86 if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
87 return UI_NONE;
88
89 return UI_TARGET;
90}
91
92#undef TARGET_OPTION_OPTIMIZATION_TABLE
93#define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table
94
95#undef TARGET_EXCEPT_UNWIND_INFO
96#define TARGET_EXCEPT_UNWIND_INFO ia64_except_unwind_info
97
98#undef TARGET_DEFAULT_TARGET_FLAGS
99#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
100#undef TARGET_HANDLE_OPTION
101#define TARGET_HANDLE_OPTION ia64_handle_option
102
103struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;