Reverting merge from trunk
[official-gcc.git] / gcc / common / config / mep / mep-common.c
bloba6376831a2a74b0cfa25a3237c08e8f5ba476517
1 /* Common hooks for Toshiba Media Processor.
2 Copyright (C) 2001-2013 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
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"
29 static const struct default_options mep_option_optimization_table[] =
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 },
36 /* Using $fp doesn't gain us much, even when debugging is
37 important. */
38 { OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 1 },
40 { OPT_LEVELS_NONE, 0, NULL, 0 }
43 static bool
44 mep_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)
49 size_t code = decoded->opt_index;
51 switch (code)
53 case OPT_mall_opts:
54 opts->x_target_flags |= MEP_ALL_OPTS;
55 break;
57 case OPT_mno_opts:
58 opts->x_target_flags &= ~ MEP_ALL_OPTS;
59 break;
61 case OPT_mcop64:
62 opts->x_target_flags |= MASK_COP;
63 opts->x_target_flags |= MASK_64BIT_CR_REGS;
64 break;
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;
73 /* Remaining handling of this option deferred. */
74 break;
76 default:
77 break;
79 return TRUE;
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
89 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;