]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/config/alpha/alpha-common.c
Update copyright years.
[thirdparty/gcc.git] / gcc / common / config / alpha / alpha-common.c
CommitLineData
677f3fa8 1/* Common hooks for DEC Alpha.
8d9254fc 2 Copyright (C) 1992-2020 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"
25#include "common/common-target.h"
26#include "common/common-target-def.h"
27#include "opts.h"
28#include "flags.h"
29
30/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
31static const struct default_options alpha_option_optimization_table[] =
32 {
64729d8c
UB
33 /* Enable redundant extension instructions removal at -O2 and higher. */
34 { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 },
677f3fa8
JM
35 { OPT_LEVELS_NONE, 0, NULL, 0 }
36 };
37
f7a57cdc
TG
38/* Implement TARGET_OPTION_INIT_STRUCT. */
39
40static void
41alpha_option_init_struct (struct gcc_options *opts ATTRIBUTE_UNUSED)
42{
43#if TARGET_ABI_OPEN_VMS
44 /* Enable section anchors by default. */
45 opts->x_flag_section_anchors = 1;
46#endif
47}
48
677f3fa8
JM
49/* Implement TARGET_HANDLE_OPTION. */
50
51static bool
52alpha_handle_option (struct gcc_options *opts,
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_mfp_regs:
64 if (value == 0)
65 opts->x_target_flags |= MASK_SOFT_FP;
66 break;
67
68 case OPT_mieee:
69 case OPT_mieee_with_inexact:
70 opts->x_target_flags |= MASK_IEEE_CONFORMANT;
71 break;
72
73 case OPT_mtls_size_:
74 if (value != 16 && value != 32 && value != 64)
a3f9f006 75 error_at (loc, "bad value %qs for %<-mtls-size%> switch", arg);
677f3fa8
JM
76 break;
77 }
78
79 return true;
80}
81
82#undef TARGET_DEFAULT_TARGET_FLAGS
83#define TARGET_DEFAULT_TARGET_FLAGS \
84 (TARGET_DEFAULT | TARGET_CPU_DEFAULT | TARGET_DEFAULT_EXPLICIT_RELOCS)
85#undef TARGET_HANDLE_OPTION
86#define TARGET_HANDLE_OPTION alpha_handle_option
87
f7a57cdc
TG
88#undef TARGET_OPTION_INIT_STRUCT
89#define TARGET_OPTION_INIT_STRUCT alpha_option_init_struct
90
677f3fa8
JM
91#undef TARGET_OPTION_OPTIMIZATION_TABLE
92#define TARGET_OPTION_OPTIMIZATION_TABLE alpha_option_optimization_table
93
94struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;