1 /* Common hooks for Motorola 68000 family.
2 Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
25 #include "diagnostic-core.h"
27 #include "common/common-target.h"
28 #include "common/common-target-def.h"
32 /* Implement TARGET_HANDLE_OPTION. */
35 m68k_handle_option (struct gcc_options *opts,
36 struct gcc_options *opts_set,
37 const struct cl_decoded_option *decoded,
40 size_t code = decoded->opt_index;
41 const char *arg = decoded->arg;
42 int value = decoded->value;
47 opts->x_m68k_tune_option = u68020_40;
48 opts_set->x_m68k_tune_option = (enum uarch_type) 1;
49 opts->x_m68k_cpu_option = m68020;
50 opts_set->x_m68k_cpu_option = (enum target_device) 1;
54 opts->x_m68k_tune_option = u68020_60;
55 opts_set->x_m68k_tune_option = (enum uarch_type) 1;
56 opts->x_m68k_cpu_option = m68020;
57 opts_set->x_m68k_cpu_option = (enum target_device) 1;
60 case OPT_mshared_library_id_:
61 if (value > MAX_LIBRARY_ID)
62 error_at (loc, "-mshared-library-id=%s is not between 0 and %d",
67 asprintf (&tmp, "%d", (value * -4) - 4);
68 opts->x_m68k_library_id_string = tmp;
77 #undef TARGET_HANDLE_OPTION
78 #define TARGET_HANDLE_OPTION m68k_handle_option
80 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;