1 /* Common hooks for Motorola 68000 family.
2 Copyright (C) 1987-2024 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License 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/>. */
22 #include "coretypes.h"
23 #include "diagnostic-core.h"
25 #include "common/common-target.h"
26 #include "common/common-target-def.h"
30 /* Implement TARGET_HANDLE_OPTION. */
33 m68k_handle_option (struct gcc_options
*opts
,
34 struct gcc_options
*opts_set
,
35 const struct cl_decoded_option
*decoded
,
38 size_t code
= decoded
->opt_index
;
39 const char *arg
= decoded
->arg
;
40 int value
= decoded
->value
;
45 opts
->x_m68k_tune_option
= u68020_40
;
46 opts_set
->x_m68k_tune_option
= (uarch_type
) 1;
47 opts
->x_m68k_cpu_option
= m68020
;
48 opts_set
->x_m68k_cpu_option
= (target_device
) 1;
52 opts
->x_m68k_tune_option
= u68020_60
;
53 opts_set
->x_m68k_tune_option
= (uarch_type
) 1;
54 opts
->x_m68k_cpu_option
= m68020
;
55 opts_set
->x_m68k_cpu_option
= (target_device
) 1;
58 case OPT_mshared_library_id_
:
59 if (value
> MAX_LIBRARY_ID
)
60 error_at (loc
, "%<-mshared-library-id=%s%> is not between 0 and %d",
65 asprintf (&tmp
, "%d", (value
* -4) - 4);
66 opts
->x_m68k_library_id_string
= tmp
;
75 #undef TARGET_HANDLE_OPTION
76 #define TARGET_HANDLE_OPTION m68k_handle_option
78 struct gcc_targetm_common targetm_common
= TARGETM_COMMON_INITIALIZER
;