Commit db25893c by Joseph Myers Committed by Joseph Myers

frv-opts.h: New.

	* config/frv/frv-opts.h: New.
	* config/frv/frv-protos.h (enum frv_cpu, frv_cpu_t): Move to
	frv-opts.h.
	(frv_cpu_type): Remove.
	* config/frv/frv.c: Don't include opts.h.
	(frv_cpu_type, frv_handle_option, TARGET_HANDLE_OPTION): Remove.
	* config/frv/frv.opt (config/frv/frv-opts.h): New HeaderInclude
	entry.
	(frv_cpu_type): New Variable entry.
	(frv_cpu): New Enum and EnumValue entries.

From-SVN: r171316
parent 6c223f5d
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/frv/frv-opts.h: New.
* config/frv/frv-protos.h (enum frv_cpu, frv_cpu_t): Move to
frv-opts.h.
(frv_cpu_type): Remove.
* config/frv/frv.c: Don't include opts.h.
(frv_cpu_type, frv_handle_option, TARGET_HANDLE_OPTION): Remove.
* config/frv/frv.opt (config/frv/frv-opts.h): New HeaderInclude
entry.
(frv_cpu_type): New Variable entry.
(frv_cpu): New Enum and EnumValue entries.
2011-03-22 Joseph Myers <joseph@codesourcery.com>
* config/cris/cris.c (cris_handle_option): Access target_flags via
opts pointer. Don't assert that global structures are in use.
Don't call CRIS_SUBTARGET_HANDLE_OPTION.
......
/* Frv option-handling defitions.
Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 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 FRV_OPTS_H
#define FRV_OPTS_H
/* CPU type. This must be identical to the cpu enumeration in frv.md. */
typedef enum frv_cpu
{
FRV_CPU_GENERIC,
FRV_CPU_FR550,
FRV_CPU_FR500,
FRV_CPU_FR450,
FRV_CPU_FR405,
FRV_CPU_FR400,
FRV_CPU_FR300,
FRV_CPU_SIMPLE,
FRV_CPU_TOMCAT
} frv_cpu_t;
#endif
/* Frv prototypes.
Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
2011
Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
......@@ -19,22 +20,6 @@ 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/>. */
/* CPU type. This must be identical to the cpu enumeration in frv.md. */
typedef enum frv_cpu
{
FRV_CPU_GENERIC,
FRV_CPU_FR550,
FRV_CPU_FR500,
FRV_CPU_FR450,
FRV_CPU_FR405,
FRV_CPU_FR400,
FRV_CPU_FR300,
FRV_CPU_SIMPLE,
FRV_CPU_TOMCAT
} frv_cpu_t;
extern frv_cpu_t frv_cpu_type; /* value of -mcpu= */
/* Define functions defined in frv.c */
extern void frv_expand_prologue (void);
extern void frv_expand_epilogue (bool);
......
......@@ -49,7 +49,6 @@ along with GCC; see the file COPYING3. If not see
#include "integrate.h"
#include "langhooks.h"
#include "df.h"
#include "opts.h"
#ifndef FRV_INLINE
#define FRV_INLINE inline
......@@ -256,15 +255,8 @@ enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
/* Cached value of frv_stack_info. */
static frv_stack_t *frv_stack_cache = (frv_stack_t *)0;
/* -mcpu= support */
frv_cpu_t frv_cpu_type = CPU_TYPE; /* value of -mcpu= */
/* Forward references */
static bool frv_handle_option (struct gcc_options *,
struct gcc_options *,
const struct cl_decoded_option *,
location_t);
static void frv_option_override (void);
static bool frv_legitimate_address_p (enum machine_mode, rtx, bool);
static int frv_default_flags_for_cpu (void);
......@@ -444,8 +436,6 @@ static const struct default_options frv_option_optimization_table[] =
| MASK_VLIW_BRANCH \
| MASK_MULTI_CE \
| MASK_NESTED_CE)
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION frv_handle_option
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE frv_option_override
#undef TARGET_OPTION_OPTIMIZATION_TABLE
......@@ -631,49 +621,6 @@ frv_cannot_force_const_mem (rtx x ATTRIBUTE_UNUSED)
return TARGET_FDPIC;
}
/* Implement TARGET_HANDLE_OPTION. */
static bool
frv_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
const struct cl_decoded_option *decoded,
location_t loc ATTRIBUTE_UNUSED)
{
size_t code = decoded->opt_index;
const char *arg = decoded->arg;
gcc_assert (opts == &global_options);
gcc_assert (opts_set == &global_options_set);
switch (code)
{
case OPT_mcpu_:
if (strcmp (arg, "simple") == 0)
frv_cpu_type = FRV_CPU_SIMPLE;
else if (strcmp (arg, "tomcat") == 0)
frv_cpu_type = FRV_CPU_TOMCAT;
else if (strcmp (arg, "fr550") == 0)
frv_cpu_type = FRV_CPU_FR550;
else if (strcmp (arg, "fr500") == 0)
frv_cpu_type = FRV_CPU_FR500;
else if (strcmp (arg, "fr450") == 0)
frv_cpu_type = FRV_CPU_FR450;
else if (strcmp (arg, "fr405") == 0)
frv_cpu_type = FRV_CPU_FR405;
else if (strcmp (arg, "fr400") == 0)
frv_cpu_type = FRV_CPU_FR400;
else if (strcmp (arg, "fr300") == 0)
frv_cpu_type = FRV_CPU_FR300;
else if (strcmp (arg, "frv") == 0)
frv_cpu_type = FRV_CPU_GENERIC;
else
return false;
return true;
default:
return true;
}
}
static int
frv_default_flags_for_cpu (void)
{
......
; Options for the FR-V port of the compiler.
; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
......@@ -18,6 +18,13 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
HeaderInclude
config/frv/frv-opts.h
; Value of -mcpu=.
Variable
frv_cpu_t frv_cpu_type = CPU_TYPE
macc-4
Target Report RejectNegative Mask(ACC_4)
Use 4 media accumulators
......@@ -58,9 +65,40 @@ Target Report Mask(COND_MOVE)
Enable conditional moves
mcpu=
Target RejectNegative Joined
Target RejectNegative Joined Enum(frv_cpu) Var(frv_cpu_type)
Set the target CPU type
Enum
Name(frv_cpu) Type(frv_cpu_t)
Known FR-V CPUs (for use with the -mcpu= option):
EnumValue
Enum(frv_cpu) String(simple) Value(FRV_CPU_SIMPLE)
EnumValue
Enum(frv_cpu) String(tomcat) Value(FRV_CPU_TOMCAT)
EnumValue
Enum(frv_cpu) String(fr550) Value(FRV_CPU_FR550)
EnumValue
Enum(frv_cpu) String(fr500) Value(FRV_CPU_FR500)
EnumValue
Enum(frv_cpu) String(fr450) Value(FRV_CPU_FR450)
EnumValue
Enum(frv_cpu) String(fr405) Value(FRV_CPU_FR405)
EnumValue
Enum(frv_cpu) String(fr400) Value(FRV_CPU_FR400)
EnumValue
Enum(frv_cpu) String(fr300) Value(FRV_CPU_FR300)
EnumValue
Enum(frv_cpu) String(frv) Value(FRV_CPU_GENERIC)
mdebug
Target Undocumented Var(TARGET_DEBUG)
......
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