]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/config/mep/mep-common.c
Update copyright years.
[thirdparty/gcc.git] / gcc / common / config / mep / mep-common.c
CommitLineData
677f3fa8 1/* Common hooks for Toshiba Media Processor.
818ab71a 2 Copyright (C) 2001-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 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 "tm.h"
24#include "common/common-target.h"
25#include "common/common-target-def.h"
26#include "opts.h"
27#include "flags.h"
28
29static const struct default_options mep_option_optimization_table[] =
30 {
31 /* The first scheduling pass often increases register pressure and
32 tends to result in more spill code. Only run it when
33 specifically asked. */
34 { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 },
35
36 /* Using $fp doesn't gain us much, even when debugging is
37 important. */
38 { OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 1 },
39
40 { OPT_LEVELS_NONE, 0, NULL, 0 }
41 };
42
43static bool
44mep_handle_option (struct gcc_options *opts,
45 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
46 const struct cl_decoded_option *decoded,
47 location_t loc ATTRIBUTE_UNUSED)
48{
49 size_t code = decoded->opt_index;
50
51 switch (code)
52 {
53 case OPT_mall_opts:
54 opts->x_target_flags |= MEP_ALL_OPTS;
55 break;
56
57 case OPT_mno_opts:
58 opts->x_target_flags &= ~ MEP_ALL_OPTS;
59 break;
60
61 case OPT_mcop64:
62 opts->x_target_flags |= MASK_COP;
63 opts->x_target_flags |= MASK_64BIT_CR_REGS;
64 break;
65
66 case OPT_mivc2:
67 opts->x_target_flags |= MASK_COP;
68 opts->x_target_flags |= MASK_64BIT_CR_REGS;
69 opts->x_target_flags |= MASK_VLIW;
70 opts->x_target_flags |= MASK_OPT_VL64;
71 opts->x_target_flags |= MASK_IVC2;
72
73 /* Remaining handling of this option deferred. */
74 break;
75
76 default:
77 break;
78 }
79 return TRUE;
80}
81
82#undef TARGET_HANDLE_OPTION
83#define TARGET_HANDLE_OPTION mep_handle_option
84#undef TARGET_OPTION_OPTIMIZATION_TABLE
85#define TARGET_OPTION_OPTIMIZATION_TABLE mep_option_optimization_table
86#undef TARGET_DEFAULT_TARGET_FLAGS
87#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
88
89struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;