diff options
author | Joseph Myers <joseph@codesourcery.com> | 2011-03-22 22:32:33 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2011-03-22 22:32:33 +0000 |
commit | db25893ca7ca3f37425c24c04ab9beed253462d9 (patch) | |
tree | e7337b5122d9494439d8c5865fa790afb0744756 /gcc/config/frv | |
parent | 6c223f5da144ae11fe0d9b81e4c1ee625e3bef6b (diff) | |
download | gcc-db25893ca7ca3f37425c24c04ab9beed253462d9.zip gcc-db25893ca7ca3f37425c24c04ab9beed253462d9.tar.gz gcc-db25893ca7ca3f37425c24c04ab9beed253462d9.tar.bz2 |
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
Diffstat (limited to 'gcc/config/frv')
-rw-r--r-- | gcc/config/frv/frv-opts.h | 39 | ||||
-rw-r--r-- | gcc/config/frv/frv-protos.h | 19 | ||||
-rw-r--r-- | gcc/config/frv/frv.c | 53 | ||||
-rw-r--r-- | gcc/config/frv/frv.opt | 42 |
4 files changed, 81 insertions, 72 deletions
diff --git a/gcc/config/frv/frv-opts.h b/gcc/config/frv/frv-opts.h new file mode 100644 index 0000000..f578ed9 --- /dev/null +++ b/gcc/config/frv/frv-opts.h @@ -0,0 +1,39 @@ +/* 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 diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 04a3f92..c7223a7 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -1,5 +1,6 @@ /* 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); diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index dac5323..0913765 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -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) { diff --git a/gcc/config/frv/frv.opt b/gcc/config/frv/frv.opt index f44de1f..186508b 100644 --- a/gcc/config/frv/frv.opt +++ b/gcc/config/frv/frv.opt @@ -1,6 +1,6 @@ ; 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) |