diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2005-03-17 13:49:48 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2005-03-17 13:49:48 +0000 |
commit | 3ff01d4d50e41aa121a583fd69d42626045127af (patch) | |
tree | 236c09eb9ea6ca592f2398156e0f8eb197b7cbb0 /gcc/config | |
parent | 7416ab0243ea8eb35c6aa375db603755c2ec7706 (diff) | |
download | gcc-3ff01d4d50e41aa121a583fd69d42626045127af.zip gcc-3ff01d4d50e41aa121a583fd69d42626045127af.tar.gz gcc-3ff01d4d50e41aa121a583fd69d42626045127af.tar.bz2 |
arc.c (arc_cpu_string): Make static.
* config/arc/arc.c (arc_cpu_string): Make static. Default to "base"
(arc_text_string, arc_data_string, arc_rodata_string): Make static.
(TARGET_HANDLE_OPTION): Override default.
(arc_handle_option): New function.
(arc_init): Remove code to set arch_cpu_string.
* config/arc/arc.h (target_flags, TARGET_MASK_MANGLE_CPU)
(TARGET_MANGLE_CPU, TARGET_MASK_MANGLE_CPU_LIBGCC)
(TARGET_MANGLE_CPU_LIBGCC, TARGET_MASK_ALIGN_LOOPS, TARGET_ALIGN_LOOPS)
(TARGET_MASK_BIG_ENDIAN, TARGET_BIG_ENDIAN, TARGET_MASK_NO_COND_EXEC)
(TARGET_NO_COND_EXEC, TARGET_SWITCHES, TARGET_DEFAULT)
(SUBTARGET_SWITCHES, arc_cpu_string, arc_text_string, arc_data_string)
(arc_rodata_string, TARGET_OPTIONS): Delete.
* config/arc/arc.opt: New file.
From-SVN: r96607
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arc/arc.c | 64 | ||||
-rw-r--r-- | gcc/config/arc/arc.h | 67 | ||||
-rw-r--r-- | gcc/config/arc/arc.opt | 34 |
3 files changed, 75 insertions, 90 deletions
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 6a334c0..ba8a256 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -43,8 +43,8 @@ Boston, MA 02111-1307, USA. */ #include "target.h" #include "target-def.h" -/* Which cpu we're compiling for (NULL(=base), ???). */ -const char *arc_cpu_string; +/* Which cpu we're compiling for. */ +static const char *arc_cpu_string = "base"; int arc_cpu_type; /* Name of mangle string to add to symbols to separate code compiled for each @@ -57,9 +57,9 @@ rtx arc_compare_op0, arc_compare_op1; /* Name of text, data, and rodata sections, as specified on command line. Selected by -m{text,data,rodata} flags. */ -const char *arc_text_string = ARC_DEFAULT_TEXT_SECTION; -const char *arc_data_string = ARC_DEFAULT_DATA_SECTION; -const char *arc_rodata_string = ARC_DEFAULT_RODATA_SECTION; +static const char *arc_text_string = ARC_DEFAULT_TEXT_SECTION; +static const char *arc_data_string = ARC_DEFAULT_DATA_SECTION; +static const char *arc_rodata_string = ARC_DEFAULT_RODATA_SECTION; /* Name of text, data, and rodata sections used in varasm.c. */ const char *arc_text_section; @@ -86,6 +86,7 @@ static int arc_ccfsm_target_label; arc_print_operand. */ static int last_insn_set_cc_p; static int current_insn_set_cc_p; +static bool arc_handle_option (size_t, const char *, int); static void record_cc_ref (rtx); static void arc_init_reg_tables (void); static int get_arc_condition_code (rtx); @@ -126,6 +127,9 @@ static bool arc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, #undef TARGET_ASM_EXTERNAL_LIBCALL #define TARGET_ASM_EXTERNAL_LIBCALL arc_external_libcall +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION arc_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS arc_rtx_costs #undef TARGET_ADDRESS_COST @@ -150,6 +154,38 @@ static bool arc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +arc_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_mcpu_: + if (strcmp (arg, "base") == 0 || ARC_EXTENSION_CPU (arg)) + { + arc_cpu_string = arg; + return true; + } + return false; + + case OPT_mtext_: + arc_text_string = arg; + return true; + + case OPT_mdata_: + arc_data_string = arg; + return true; + + case OPT_mrodata_: + arc_rodata_string = arg; + return true; + + default: + return true; + } +} + /* Called by OVERRIDE_OPTIONS to initialize various things. */ void @@ -157,24 +193,6 @@ arc_init (void) { char *tmp; - if (arc_cpu_string == 0 - || !strcmp (arc_cpu_string, "base")) - { - /* Ensure we have a printable value for the .cpu pseudo-op. */ - arc_cpu_string = "base"; - arc_cpu_type = 0; - arc_mangle_cpu = NULL; - } - else if (ARC_EXTENSION_CPU (arc_cpu_string)) - ; /* nothing to do */ - else - { - error ("bad value (%s) for -mcpu switch", arc_cpu_string); - arc_cpu_string = "base"; - arc_cpu_type = 0; - arc_mangle_cpu = NULL; - } - /* Set the pseudo-ops for the various standard sections. */ arc_text_section = tmp = xmalloc (strlen (arc_text_string) + sizeof (ARC_SECTION_FORMAT) + 1); sprintf (tmp, ARC_SECTION_FORMAT, arc_text_string); diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index b5259a7..dfc88fe 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -72,79 +72,12 @@ Boston, MA 02111-1307, USA. */ #define ENDFILE_SPEC "crtfini.o%s" -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* Mangle all user symbols for the specified cpu. - ARC's can be shipped in which a collection of cpus are coupled together. - Each CPU may be different in some way, and thus we may need to distinguish - code compiled for one to ensure it isn't linked with code compiled for - another. */ -#define TARGET_MASK_MANGLE_CPU 1 -#define TARGET_MANGLE_CPU (target_flags & TARGET_MASK_MANGLE_CPU) - -#if 0 -/* Mangle libgcc symbols by adding a suffix for the specified cpu. */ -#define TARGET_MASK_MANGLE_CPU_LIBGCC 2 -#define TARGET_MANGLE_CPU_LIBGCC (target_flags & TARGET_MASK_MANGLE_CPU_LIBGCC) -#endif - -/* Align loops to 32 byte boundaries (cache line size). */ -#define TARGET_MASK_ALIGN_LOOPS 4 -#define TARGET_ALIGN_LOOPS (target_flags & TARGET_MASK_ALIGN_LOOPS) - -/* Big Endian. */ -#define TARGET_MASK_BIG_ENDIAN 8 -#define TARGET_BIG_ENDIAN (target_flags & TARGET_MASK_BIG_ENDIAN) - -/* Turn off conditional execution optimization, - so we can see how well it does, or in case it's buggy. */ -#define TARGET_MASK_NO_COND_EXEC 0x10 -#define TARGET_NO_COND_EXEC (target_flags & TARGET_MASK_NO_COND_EXEC) - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ -{ \ - { "mangle-cpu", TARGET_MASK_MANGLE_CPU }, \ - { "no-mangle-cpu", -TARGET_MASK_MANGLE_CPU }, \ -/* { "mangle-cpu-libgcc", TARGET_MASK_MANGLE_CPU_LIBGCC }, */ \ -/* { "no-mangle-cpu-libgcc", -TARGET_MASK_MANGLE_CPU_LIBGCC }, */ \ - { "align-loops", TARGET_MASK_ALIGN_LOOPS }, \ - { "no-align-loops", -TARGET_MASK_ALIGN_LOOPS }, \ - { "big-endian", TARGET_MASK_BIG_ENDIAN }, \ - { "little-endian", -TARGET_MASK_BIG_ENDIAN }, \ - { "no-cond-exec", TARGET_MASK_NO_COND_EXEC }, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT } \ -} - -#define TARGET_DEFAULT (0) - -#define SUBTARGET_SWITCHES - /* Instruction set characteristics. These are internal macros, set by the appropriate -mcpu= option. */ /* Nonzero means the cpu has a barrel shifter. */ #define TARGET_SHIFTER 0 -extern const char *arc_cpu_string; -extern const char *arc_text_string,*arc_data_string,*arc_rodata_string; - -#define TARGET_OPTIONS \ -{ \ - { "cpu=", &arc_cpu_string, 0}, \ - { "text=", &arc_text_string, 0}, \ - { "data=", &arc_data_string, 0}, \ - { "rodata=", &arc_rodata_string, 0}, \ -} - /* Which cpu we're compiling for. */ extern int arc_cpu_type; diff --git a/gcc/config/arc/arc.opt b/gcc/config/arc/arc.opt new file mode 100644 index 0000000..3b14746 --- /dev/null +++ b/gcc/config/arc/arc.opt @@ -0,0 +1,34 @@ +malign-loops +Target Undocumented Report Mask(ALIGN_LOOPS) + +mbig-endian +Target Undocumented Report RejectNegative Mask(BIG_ENDIAN) + +mlittle-endian +Target Undocumented Report RejectNegative InverseMask(BIG_ENDIAN) + +mmangle-cpu +Target Report Mask(MANGLE_CPU) +Prepend the name of the cpu to all public symbol names + +; mmangle-cpu-libgcc +; Target Undocumented Mask(MANGLE_CPU_LIBGC) + +mno-cond-exec +Target Undocumented Report RejectNegative Mask(NO_COND_EXEC) + +mcpu= +Target RejectNegative Joined +-mcpu=CPU Compile code for ARC variant CPU + +mtext= +Target RejectNegative Joined +-mtext=SECTION Put functions in SECTION + +mdata= +Target RejectNegative Joined +-mdata=SECTION Put data in SECTION + +mrodata= +Target RejectNegative Joined +-mrodata=SECTION Put read-only data in SECTION |