]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/config/s390/s390-common.c
Update copyright years.
[thirdparty/gcc.git] / gcc / common / config / s390 / s390-common.c
CommitLineData
218e3e4e 1/* Common hooks for IBM S/390 and zSeries.
f1717362 2 Copyright (C) 1999-2016 Free Software Foundation, Inc.
218e3e4e 3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for 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"
25#include "common/common-target.h"
26#include "common/common-target-def.h"
27#include "opts.h"
28#include "flags.h"
29
30EXPORTED_CONST int processor_flags_table[] =
31 {
32 /* g5 */ PF_IEEE_FLOAT,
33 /* g6 */ PF_IEEE_FLOAT,
34 /* z900 */ PF_IEEE_FLOAT | PF_ZARCH,
35 /* z990 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT,
36 /* z9-109 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
37 | PF_EXTIMM,
38 /* z9-ec */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
39 | PF_EXTIMM | PF_DFP,
40 /* z10 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
41 | PF_EXTIMM | PF_DFP | PF_Z10,
42 /* z196 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
81769881 43 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196,
44 /* zEC12 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
cc79fcc9 45 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX,
46 /* z13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
5ada7a14 47 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
cc79fcc9 48 | PF_Z13 | PF_VX
218e3e4e 49 };
50
51/* Change optimizations to be performed, depending on the
52 optimization level. */
53
54static const struct default_options s390_option_optimization_table[] =
55 {
56 { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
57
d86dbf92 58 /* Enable -fsched-pressure by default when optimizing. */
e9f1fe86 59 { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 },
e9f1fe86 60
218e3e4e 61 /* ??? There are apparently still problems with -fcaller-saves. */
62 { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
63
64 /* Use MVCLE instructions to decrease code size if requested. */
65 { OPT_LEVELS_SIZE, OPT_mmvcle, NULL, 1 },
66
67 { OPT_LEVELS_NONE, 0, NULL, 0 }
68 };
69
70/* Implement TARGET_OPTION_INIT_STRUCT. */
71
72static void
73s390_option_init_struct (struct gcc_options *opts)
74{
75 /* By default, always emit DWARF-2 unwind info. This allows debugging
76 without maintaining a stack frame back-chain. */
77 opts->x_flag_asynchronous_unwind_tables = 1;
78}
79
80/* Implement TARGET_HANDLE_OPTION. */
81
7a0cee35 82bool
83s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED,
218e3e4e 84 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
85 const struct cl_decoded_option *decoded,
86 location_t loc)
87{
88 size_t code = decoded->opt_index;
218e3e4e 89 int value = decoded->value;
90
91 switch (code)
92 {
218e3e4e 93 case OPT_mstack_guard_:
7a0cee35 94 if (value != 0 && exact_log2 (value) == -1)
218e3e4e 95 error_at (loc, "stack guard value must be an exact power of 2");
96 return true;
97
98 case OPT_mstack_size_:
7a0cee35 99 if (value != 0 && exact_log2 (value) == -1)
218e3e4e 100 error_at (loc, "stack size must be an exact power of 2");
101 return true;
102
218e3e4e 103 default:
104 return true;
105 }
106}
107
108#undef TARGET_DEFAULT_TARGET_FLAGS
109#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
110
111#undef TARGET_HANDLE_OPTION
112#define TARGET_HANDLE_OPTION s390_handle_option
113
114#undef TARGET_OPTION_OPTIMIZATION_TABLE
115#define TARGET_OPTION_OPTIMIZATION_TABLE s390_option_optimization_table
116
117#undef TARGET_OPTION_INIT_STRUCT
118#define TARGET_OPTION_INIT_STRUCT s390_option_init_struct
119
120struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;