Commit abd016e6 by Joseph Myers Committed by Joseph Myers

rx-opts.h: New.

	* config/rx/rx-opts.h: New.
	* config/rx/rx.c (rx_cpu_type): Remove.
	(rx_handle_option): Don't assert that global structures are in
	use.  Access variables via opts pointer.  Defer most handling of
	OPT_mint_register_.  Use error_at.
	(rx_option_override): Handle deferred OPT_mint_register_ here.
	* config/rx/rx.h (enum rx_cpu_types): Move to rx-opts.h.
	* config/rx/rx.opt (config/rx/rx-opts.h: New HeaderInclude.
	(mcpu=): Use Enum and specifiy rx_cpu_type with Var.
	(rx_cpu_types): New Enum and EnumValue entries.
	(mint-register=): Use Defer and use Var accordingly.

From-SVN: r171984
parent 3b8c1a3f
2011-04-05 Joseph Myers <joseph@codesourcery.com>
* config/rx/rx-opts.h: New.
* config/rx/rx.c (rx_cpu_type): Remove.
(rx_handle_option): Don't assert that global structures are in
use. Access variables via opts pointer. Defer most handling of
OPT_mint_register_. Use error_at.
(rx_option_override): Handle deferred OPT_mint_register_ here.
* config/rx/rx.h (enum rx_cpu_types): Move to rx-opts.h.
* config/rx/rx.opt (config/rx/rx-opts.h: New HeaderInclude.
(mcpu=): Use Enum and specifiy rx_cpu_type with Var.
(rx_cpu_types): New Enum and EnumValue entries.
(mint-register=): Use Defer and use Var accordingly.
2011-04-05 Nathan Froyd <froydnj@codesourcery.com> 2011-04-05 Nathan Froyd <froydnj@codesourcery.com>
* debug.h (debug_flush_symbol_queue, debug_queue_symbol): Delete. * debug.h (debug_flush_symbol_queue, debug_queue_symbol): Delete.
......
/* GCC option-handling definitions for the Renesas RX processor.
Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef RX_OPTS_H
#define RX_OPTS_H
enum rx_cpu_types
{
RX600,
RX610,
RX200
};
#endif
...@@ -62,8 +62,6 @@ static void rx_print_operand (FILE *, rtx, int); ...@@ -62,8 +62,6 @@ static void rx_print_operand (FILE *, rtx, int);
static unsigned int flags_from_mode (enum machine_mode mode); static unsigned int flags_from_mode (enum machine_mode mode);
static unsigned int flags_from_code (enum rtx_code code); static unsigned int flags_from_code (enum rtx_code code);
enum rx_cpu_types rx_cpu_type = RX600;
/* Return true if OP is a reference to an object in a small data area. */ /* Return true if OP is a reference to an object in a small data area. */
...@@ -2268,39 +2266,20 @@ const struct attribute_spec rx_attribute_table[] = ...@@ -2268,39 +2266,20 @@ const struct attribute_spec rx_attribute_table[] =
/* Extra processing for target specific command line options. */ /* Extra processing for target specific command line options. */
static bool static bool
rx_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, rx_handle_option (struct gcc_options *opts,
struct gcc_options *opts_set ATTRIBUTE_UNUSED,
const struct cl_decoded_option *decoded, const struct cl_decoded_option *decoded,
location_t loc ATTRIBUTE_UNUSED) location_t loc)
{ {
size_t code = decoded->opt_index; size_t code = decoded->opt_index;
const char *arg = decoded->arg;
int value = decoded->value; int value = decoded->value;
gcc_assert (opts == &global_options);
gcc_assert (opts_set == &global_options_set);
switch (code) switch (code)
{ {
case OPT_mint_register_: case OPT_mint_register_:
switch (value) /* Make sure that the -mint-register option is in range. Other
{ handling in rx_option_override. */
case 4: return value >= 0 && value <= 4;
fixed_regs[10] = call_used_regs [10] = 1;
/* Fall through. */
case 3:
fixed_regs[11] = call_used_regs [11] = 1;
/* Fall through. */
case 2:
fixed_regs[12] = call_used_regs [12] = 1;
/* Fall through. */
case 1:
fixed_regs[13] = call_used_regs [13] = 1;
/* Fall through. */
case 0:
return true;
default:
return false;
}
break; break;
case OPT_mmax_constant_size_: case OPT_mmax_constant_size_:
...@@ -2308,20 +2287,13 @@ rx_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -2308,20 +2287,13 @@ rx_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
return value >= 0 && value <= 4; return value >= 0 && value <= 4;
case OPT_mcpu_: case OPT_mcpu_:
if (strcmp (arg, "rx610") == 0) if ((enum rx_cpu_types) value == RX200)
rx_cpu_type = RX610; opts->x_target_flags |= MASK_NO_USE_FPU;
else if (strcmp (arg, "rx200") == 0)
{
target_flags |= MASK_NO_USE_FPU;
rx_cpu_type = RX200;
}
else if (strcmp (arg, "rx600") != 0)
warning (0, "unrecognized argument '%s' to -mcpu= option", arg);
break; break;
case OPT_fpu: case OPT_fpu:
if (rx_cpu_type == RX200) if (opts->x_rx_cpu_type == RX200)
error ("the RX200 cpu does not have FPU hardware"); error_at (loc, "the RX200 cpu does not have FPU hardware");
break; break;
default: default:
...@@ -2361,6 +2333,44 @@ rx_override_options_after_change (void) ...@@ -2361,6 +2333,44 @@ rx_override_options_after_change (void)
static void static void
rx_option_override (void) rx_option_override (void)
{ {
unsigned int i;
cl_deferred_option *opt;
VEC(cl_deferred_option,heap) *vec
= (VEC(cl_deferred_option,heap) *) rx_deferred_options;
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
{
switch (opt->opt_index)
{
case OPT_mint_register_:
switch (opt->value)
{
case 4:
fixed_regs[10] = call_used_regs [10] = 1;
/* Fall through. */
case 3:
fixed_regs[11] = call_used_regs [11] = 1;
/* Fall through. */
case 2:
fixed_regs[12] = call_used_regs [12] = 1;
/* Fall through. */
case 1:
fixed_regs[13] = call_used_regs [13] = 1;
/* Fall through. */
case 0:
break;
default:
/* Error message already given because rx_handle_option
returned false. */
break;
}
break;
default:
gcc_unreachable ();
}
}
/* This target defaults to strict volatile bitfields. */ /* This target defaults to strict volatile bitfields. */
if (flag_strict_volatile_bitfields < 0) if (flag_strict_volatile_bitfields < 0)
flag_strict_volatile_bitfields = 1; flag_strict_volatile_bitfields = 1;
......
...@@ -52,15 +52,6 @@ ...@@ -52,15 +52,6 @@
} \ } \
while (0) while (0)
enum rx_cpu_types
{
RX600,
RX610,
RX200
};
extern enum rx_cpu_types rx_cpu_type;
#undef CC1_SPEC #undef CC1_SPEC
#define CC1_SPEC "\ #define CC1_SPEC "\
%{mas100-syntax:%{gdwarf*:%e-mas100-syntax is incompatible with -gdwarf}} \ %{mas100-syntax:%{gdwarf*:%e-mas100-syntax is incompatible with -gdwarf}} \
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
; <http://www.gnu.org/licenses/>. ; <http://www.gnu.org/licenses/>.
;--------------------------------------------------- ;---------------------------------------------------
HeaderInclude
config/rx/rx-opts.h
; The default is -fpu -m32bit-doubles. ; The default is -fpu -m32bit-doubles.
m64bit-doubles m64bit-doubles
...@@ -43,9 +46,21 @@ Enable the use of RX FPU instructions. This is the default. ...@@ -43,9 +46,21 @@ Enable the use of RX FPU instructions. This is the default.
;--------------------------------------------------- ;---------------------------------------------------
mcpu= mcpu=
Target RejectNegative Joined Var(rx_cpu_name) Report ToLower Target RejectNegative Joined Var(rx_cpu_type) Report ToLower Enum(rx_cpu_types) Init(RX600)
Specify the target RX cpu type. Specify the target RX cpu type.
Enum
Name(rx_cpu_types) Type(enum rx_cpu_types)
EnumValue
Name(rx_cpu_types) String(rx610) Value(RX610)
EnumValue
Name(rx_cpu_types) String(rx200) Value(RX200)
EnumValue
Name(rx_cpu_types) String(rx600) Value(RX600)
;--------------------------------------------------- ;---------------------------------------------------
mbig-endian-data mbig-endian-data
...@@ -89,7 +104,7 @@ Maximum size in bytes of constant values allowed as operands. ...@@ -89,7 +104,7 @@ Maximum size in bytes of constant values allowed as operands.
;--------------------------------------------------- ;---------------------------------------------------
mint-register= mint-register=
Target RejectNegative Joined UInteger Var(rx_interrupt_registers) Init(0) Target RejectNegative Joined UInteger Var(rx_deferred_options) Defer
Specifies the number of registers to reserve for interrupt handlers. Specifies the number of registers to reserve for interrupt handlers.
;--------------------------------------------------- ;---------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment