1 /* Common hooks for Renesas RX.
2 Copyright (C) 2008-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 /* Extra processing for target specific command line options. */
33 rx_handle_option (struct gcc_options
*opts
,
34 struct gcc_options
*opts_set ATTRIBUTE_UNUSED
,
35 const struct cl_decoded_option
*decoded
,
38 size_t code
= decoded
->opt_index
;
39 int value
= decoded
->value
;
43 case OPT_mint_register_
:
44 /* Make sure that the -mint-register option is in range. Other
45 handling in rx_option_override. */
46 return value
>= 0 && value
<= 4;
49 case OPT_mmax_constant_size_
:
50 /* Make sure that the -mmax-constant_size option is in range. */
51 return value
>= 0 && value
<= 4;
54 if ((enum rx_cpu_types
) value
== RX200
||
55 (enum rx_cpu_types
) value
== RX100
)
56 opts
->x_target_flags
|= MASK_NO_USE_FPU
;
60 if (opts
->x_rx_cpu_type
== RX200
)
61 error_at (loc
, "the RX200 cpu does not have FPU hardware");
62 else if (opts
->x_rx_cpu_type
== RX100
)
63 error_at (loc
, "the RX100 cpu does not have FPU hardware");
73 #undef TARGET_HANDLE_OPTION
74 #define TARGET_HANDLE_OPTION rx_handle_option
76 #undef TARGET_EXCEPT_UNWIND_INFO
77 #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
79 struct gcc_targetm_common targetm_common
= TARGETM_COMMON_INITIALIZER
;