]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/config/ia64/ia64-common.c
Move MEMMODEL_* from coretypes.h to memmodel.h
[thirdparty/gcc.git] / gcc / common / config / ia64 / ia64-common.c
CommitLineData
677f3fa8 1/* Common hooks for IA64.
818ab71a 2 Copyright (C) 1999-2016 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"
4c77620d 31#include "params.h"
677f3fa8
JM
32
33/* Implement overriding of the optimization options. */
34static const struct default_options ia64_option_optimization_table[] =
35 {
36 { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
37#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
38 SUBTARGET_OPTIMIZATION_OPTIONS,
39#endif
40 { OPT_LEVELS_NONE, 0, NULL, 0 }
41 };
42
43/* Implement TARGET_HANDLE_OPTION. */
44
45static bool
46ia64_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
47 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
48 const struct cl_decoded_option *decoded,
49 location_t loc)
50{
51 size_t code = decoded->opt_index;
52 const char *arg = decoded->arg;
53 int value = decoded->value;
54
55 switch (code)
56 {
57 case OPT_mtls_size_:
58 if (value != 14 && value != 22 && value != 64)
59 error_at (loc, "bad value %<%s%> for -mtls-size= switch", arg);
60 return true;
61
62 default:
63 return true;
64 }
65}
66
67/* Implement TARGET_EXCEPT_UNWIND_INFO. */
68
69enum unwind_info_type
70ia64_except_unwind_info (struct gcc_options *opts)
71{
72 /* Honor the --enable-sjlj-exceptions configure switch. */
d656c9c5
TG
73#ifdef CONFIG_SJLJ_EXCEPTIONS
74 if (CONFIG_SJLJ_EXCEPTIONS)
677f3fa8
JM
75 return UI_SJLJ;
76#endif
77
78 /* For simplicity elsewhere in this file, indicate that all unwind
79 info is disabled if we're not emitting unwind tables. */
80 if (!opts->x_flag_exceptions && !opts->x_flag_unwind_tables)
81 return UI_NONE;
82
83 return UI_TARGET;
84}
85
4c77620d
JM
86/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
87
88static void
89ia64_option_default_params (void)
90{
91 /* Let the scheduler form additional regions. */
92 set_default_param_value (PARAM_MAX_SCHED_EXTEND_REGIONS_ITERS, 2);
93
94 /* Set the default values for cache-related parameters. */
95 set_default_param_value (PARAM_SIMULTANEOUS_PREFETCHES, 6);
96 set_default_param_value (PARAM_L1_CACHE_LINE_SIZE, 32);
97
98 set_default_param_value (PARAM_SCHED_MEM_TRUE_DEP_COST, 4);
99}
100
677f3fa8
JM
101#undef TARGET_OPTION_OPTIMIZATION_TABLE
102#define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table
4c77620d
JM
103#undef TARGET_OPTION_DEFAULT_PARAMS
104#define TARGET_OPTION_DEFAULT_PARAMS ia64_option_default_params
677f3fa8
JM
105
106#undef TARGET_EXCEPT_UNWIND_INFO
107#define TARGET_EXCEPT_UNWIND_INFO ia64_except_unwind_info
108
109#undef TARGET_DEFAULT_TARGET_FLAGS
110#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
111#undef TARGET_HANDLE_OPTION
112#define TARGET_HANDLE_OPTION ia64_handle_option
113
114struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;