From f9ccf89916a2adc029d9e2f8611b09e17a236c3d Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Tue, 15 Nov 2016 16:10:13 +0100 Subject: [PATCH] [ARC] New option handling, refurbish multilib support. gcc/ 2016-11-15 Claudiu Zissulescu * config/arc/arc-arch.h: New file. * config/arc/arc-arches.def: Likewise. * config/arc/arc-cpus.def: Likewise. * config/arc/arc-options.def: Likewise. * config/arc/t-multilib: Likewise. * config/arc/genmultilib.awk: Likewise. * config/arc/genoptions.awk: Likewise. * config/arc/arc-tables.opt: Likewise. * config/arc/driver-arc.c: Likewise. * testsuite/gcc.target/arc/nps400-cpu-flag.c: Likewise. * common/config/arc/arc-common.c (arc_handle_option): Trace toggled options. * config.gcc (arc*-*-*): Add arc-tables.opt to arc's extra options; check for supported cpu against arc-cpus.def file. (arc*-*-elf*, arc*-*-linux-uclibc*): Use new make fragment; define TARGET_CPU_BUILD macro; add driver-arc.o as an extra object. * config/arc/arc-c.def: Add emacs local variables. * config/arc/arc-opts.h (processor_type): Use arc-cpus.def file. (FPU_FPUS, FPU_FPUD, FPU_FPUDA, FPU_FPUDA_DIV, FPU_FPUDA_FMA) (FPU_FPUDA_ALL, FPU_FPUS_DIV, FPU_FPUS_FMA, FPU_FPUS_ALL) (FPU_FPUD_DIV, FPU_FPUD_FMA, FPU_FPUD_ALL): New defines. (DEFAULT_arc_fpu_build): Define. (DEFAULT_arc_mpy_option): Define. * config/arc/arc-protos.h (arc_init): Delete. * config/arc/arc.c (arc_cpu_name): New variable. (arc_selected_cpu, arc_selected_arch, arc_arcem, arc_archs) (arc_arc700, arc_arc600, arc_arc601): New variable. (arc_init): Add static; remove selection of default tune value, cleanup obsolete error messages. (arc_override_options): Make use of .def files for selecting the right cpu and option configurations. * config/arc/arc.h (stdbool.h): Include. (TARGET_CPU_DEFAULT): Define. (CPP_SPEC): Remove mcpu=NPS400 handling. (arc_cpu_to_as): Declare. (EXTRA_SPEC_FUNCTIONS): Define. (OPTION_DEFAULT_SPECS): Likewise. (ASM_DEFAULT): Remove. (ASM_SPEC): Use arc_cpu_to_as. (DRIVER_SELF_SPECS): Remove deprecated options. (arc_base_cpu): Declare. (TARGET_ARC600, TARGET_ARC601, TARGET_ARC700, TARGET_EM) (TARGET_HS, TARGET_V2, TARGET_ARC600): Make them use arc_base_cpu variable. (MULTILIB_DEFAULTS): Use ARC_MULTILIB_CPU_DEFAULT. * config/arc/arc.md (attr_cpu): Remove. * config/arc/arc.opt (mno-mpy): Deprecate. (mcpu=ARC600, mcpu=ARC601, mcpu=ARC700, mcpu=NPS400, mcpu=ARCEM) (mcpu=ARCHS): Remove. (mcrc, mdsp-packa, mdvbf, mmac-d16, mmac-24, mtelephony, mrtsc): Deprecate. (mbarrel_shifte, mspfp_, mdpfp_, mdsp_pack, mmac_): Remove. (arc_fpu): Use new defines. (mpy-option): Change to use numeric or string like inputs. * config/arc/t-arc (driver-arc.o): New target. (arc-cpus, t-multilib, arc-tables.opt): Likewise. * config/arc/t-arc-newlib: Delete. * config/arc/t-arc-uClibc: Renamed to t-uClibc. * doc/invoke.texi (ARC): Update arc options. Fixup From-SVN: r242425 --- gcc/ChangeLog | 62 ++++++ gcc/common/config/arc/arc-common.c | 69 ++---- gcc/config.gcc | 47 ++-- gcc/config/arc/arc-arch.h | 123 +++++++++++ gcc/config/arc/arc-arches.def | 56 +++++ gcc/config/arc/arc-c.def | 4 + gcc/config/arc/arc-cpus.def | 75 +++++++ gcc/config/arc/arc-options.def | 109 ++++++++++ gcc/config/arc/arc-opts.h | 49 ++++- gcc/config/arc/arc-protos.h | 1 - gcc/config/arc/arc-tables.opt | 90 ++++++++ gcc/config/arc/arc.c | 179 +++++++-------- gcc/config/arc/arc.h | 89 ++++---- gcc/config/arc/arc.md | 5 - gcc/config/arc/arc.opt | 169 ++++++++------- gcc/config/arc/driver-arc.c | 81 +++++++ gcc/config/arc/genmultilib.awk | 203 ++++++++++++++++++ gcc/config/arc/genoptions.awk | 86 ++++++++ gcc/config/arc/t-arc | 19 ++ gcc/config/arc/t-arc-newlib | 46 ---- gcc/config/arc/t-multilib | 34 +++ gcc/config/arc/{t-arc-uClibc => t-uClibc} | 0 gcc/doc/invoke.texi | 90 ++++++-- .../gcc.target/arc/nps400-cpu-flag.c | 4 + 24 files changed, 1332 insertions(+), 358 deletions(-) create mode 100644 gcc/config/arc/arc-arch.h create mode 100644 gcc/config/arc/arc-arches.def create mode 100644 gcc/config/arc/arc-cpus.def create mode 100644 gcc/config/arc/arc-options.def create mode 100644 gcc/config/arc/arc-tables.opt create mode 100644 gcc/config/arc/driver-arc.c create mode 100644 gcc/config/arc/genmultilib.awk create mode 100644 gcc/config/arc/genoptions.awk delete mode 100644 gcc/config/arc/t-arc-newlib create mode 100644 gcc/config/arc/t-multilib rename gcc/config/arc/{t-arc-uClibc => t-uClibc} (100%) create mode 100644 gcc/testsuite/gcc.target/arc/nps400-cpu-flag.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b91bf89652c..1bc0f809858 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,65 @@ +2016-11-15 Claudiu Zissulescu + + * config/arc/arc-arch.h: New file. + * config/arc/arc-arches.def: Likewise. + * config/arc/arc-cpus.def: Likewise. + * config/arc/arc-options.def: Likewise. + * config/arc/t-multilib: Likewise. + * config/arc/genmultilib.awk: Likewise. + * config/arc/genoptions.awk: Likewise. + * config/arc/arc-tables.opt: Likewise. + * config/arc/driver-arc.c: Likewise. + * testsuite/gcc.target/arc/nps400-cpu-flag.c: Likewise. + * common/config/arc/arc-common.c (arc_handle_option): Trace + toggled options. + * config.gcc (arc*-*-*): Add arc-tables.opt to arc's extra + options; check for supported cpu against arc-cpus.def file. + (arc*-*-elf*, arc*-*-linux-uclibc*): Use new make fragment; define + TARGET_CPU_BUILD macro; add driver-arc.o as an extra object. + * config/arc/arc-c.def: Add emacs local variables. + * config/arc/arc-opts.h (processor_type): Use arc-cpus.def file. + (FPU_FPUS, FPU_FPUD, FPU_FPUDA, FPU_FPUDA_DIV, FPU_FPUDA_FMA) + (FPU_FPUDA_ALL, FPU_FPUS_DIV, FPU_FPUS_FMA, FPU_FPUS_ALL) + (FPU_FPUD_DIV, FPU_FPUD_FMA, FPU_FPUD_ALL): New defines. + (DEFAULT_arc_fpu_build): Define. + (DEFAULT_arc_mpy_option): Define. + * config/arc/arc-protos.h (arc_init): Delete. + * config/arc/arc.c (arc_cpu_name): New variable. + (arc_selected_cpu, arc_selected_arch, arc_arcem, arc_archs) + (arc_arc700, arc_arc600, arc_arc601): New variable. + (arc_init): Add static; remove selection of default tune value, + cleanup obsolete error messages. + (arc_override_options): Make use of .def files for selecting the + right cpu and option configurations. + * config/arc/arc.h (stdbool.h): Include. + (TARGET_CPU_DEFAULT): Define. + (CPP_SPEC): Remove mcpu=NPS400 handling. + (arc_cpu_to_as): Declare. + (EXTRA_SPEC_FUNCTIONS): Define. + (OPTION_DEFAULT_SPECS): Likewise. + (ASM_DEFAULT): Remove. + (ASM_SPEC): Use arc_cpu_to_as. + (DRIVER_SELF_SPECS): Remove deprecated options. + (arc_base_cpu): Declare. + (TARGET_ARC600, TARGET_ARC601, TARGET_ARC700, TARGET_EM) + (TARGET_HS, TARGET_V2, TARGET_ARC600): Make them use arc_base_cpu + variable. + (MULTILIB_DEFAULTS): Use ARC_MULTILIB_CPU_DEFAULT. + * config/arc/arc.md (attr_cpu): Remove. + * config/arc/arc.opt (mno-mpy): Deprecate. + (mcpu=ARC600, mcpu=ARC601, mcpu=ARC700, mcpu=NPS400, mcpu=ARCEM) + (mcpu=ARCHS): Remove. + (mcrc, mdsp-packa, mdvbf, mmac-d16, mmac-24, mtelephony, mrtsc): + Deprecate. + (mbarrel_shifte, mspfp_, mdpfp_, mdsp_pack, mmac_): Remove. + (arc_fpu): Use new defines. + (mpy-option): Change to use numeric or string like inputs. + * config/arc/t-arc (driver-arc.o): New target. + (arc-cpus, t-multilib, arc-tables.opt): Likewise. + * config/arc/t-arc-newlib: Delete. + * config/arc/t-arc-uClibc: Renamed to t-uClibc. + * doc/invoke.texi (ARC): Update arc options. + 2016-11-15 Maciej W. Rozycki * config/mips/mips.c (mips16_emit_constants): Emit `consttable' diff --git a/gcc/common/config/arc/arc-common.c b/gcc/common/config/arc/arc-common.c index 5b687fb16ad..1dbddae388a 100644 --- a/gcc/common/config/arc/arc-common.c +++ b/gcc/common/config/arc/arc-common.c @@ -2,6 +2,7 @@ Copyright (C) 1994-2016 Free Software Foundation, Inc. Contributor: Joern Rennecke on behalf of Synopsys Inc. + Claudiu Zissulescu This file is part of GCC. @@ -61,17 +62,19 @@ static const struct default_options arc_option_optimization_table[] = /* Process options. */ static bool -arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, +arc_handle_option (struct gcc_options *opts, + struct gcc_options *opts_set ATTRIBUTE_UNUSED, const struct cl_decoded_option *decoded, location_t loc) { size_t code = decoded->opt_index; int value = decoded->value; const char *arg = decoded->arg; + static int mcpu_seen = PROCESSOR_NONE; + char *p; switch (code) { - static int mcpu_seen = PROCESSOR_NONE; case OPT_mcpu_: /* N.B., at this point arc_cpu has already been set to its new value by our caller, so comparing arc_cpu with PROCESSOR_NONE is pointless. */ @@ -79,71 +82,33 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, if (mcpu_seen != PROCESSOR_NONE && mcpu_seen != value) warning_at (loc, 0, "multiple -mcpu= options specified."); mcpu_seen = value; - - switch (value) - { - case PROCESSOR_NPS400: - if (! (opts_set->x_TARGET_CASE_VECTOR_PC_RELATIVE) ) - opts->x_TARGET_CASE_VECTOR_PC_RELATIVE = 1; - /* Fall through */ - case PROCESSOR_ARC600: - case PROCESSOR_ARC700: - if (! (opts_set->x_target_flags & MASK_BARREL_SHIFTER) ) - opts->x_target_flags |= MASK_BARREL_SHIFTER; - break; - case PROCESSOR_ARC601: - if (! (opts_set->x_target_flags & MASK_BARREL_SHIFTER) ) - opts->x_target_flags &= ~MASK_BARREL_SHIFTER; - break; - case PROCESSOR_ARCHS: - if ( !(opts_set->x_target_flags & MASK_BARREL_SHIFTER)) - opts->x_target_flags |= MASK_BARREL_SHIFTER; /* Default: on. */ - if ( !(opts_set->x_target_flags & MASK_CODE_DENSITY)) - opts->x_target_flags |= MASK_CODE_DENSITY; /* Default: on. */ - if ( !(opts_set->x_target_flags & MASK_NORM_SET)) - opts->x_target_flags |= MASK_NORM_SET; /* Default: on. */ - if ( !(opts_set->x_target_flags & MASK_SWAP_SET)) - opts->x_target_flags |= MASK_SWAP_SET; /* Default: on. */ - if ( !(opts_set->x_target_flags & MASK_DIVREM)) - opts->x_target_flags |= MASK_DIVREM; /* Default: on. */ - break; - - case PROCESSOR_ARCEM: - if ( !(opts_set->x_target_flags & MASK_BARREL_SHIFTER)) - opts->x_target_flags |= MASK_BARREL_SHIFTER; /* Default: on. */ - if ( !(opts_set->x_target_flags & MASK_CODE_DENSITY)) - opts->x_target_flags &= ~MASK_CODE_DENSITY; /* Default: off. */ - if ( !(opts_set->x_target_flags & MASK_NORM_SET)) - opts->x_target_flags &= ~MASK_NORM_SET; /* Default: off. */ - if ( !(opts_set->x_target_flags & MASK_SWAP_SET)) - opts->x_target_flags &= ~MASK_SWAP_SET; /* Default: off. */ - if ( !(opts_set->x_target_flags & MASK_DIVREM)) - opts->x_target_flags &= ~MASK_DIVREM; /* Default: off. */ - break; - default: - gcc_unreachable (); - } break; case OPT_mmpy_option_: - if (value < 0 || value > 9) - error_at (loc, "bad value %qs for -mmpy-option switch", arg); + if (opts->x_arc_mpy_option == 1) + warning_at (loc, 0, "Unsupported value for mmpy-option"); + break; + + default: break; } return true; } +#undef TARGET_OPTION_INIT_STRUCT #define TARGET_OPTION_INIT_STRUCT arc_option_init_struct + +#undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE arc_option_optimization_table -#define TARGET_HANDLE_OPTION arc_handle_option #define DEFAULT_NO_SDATA (TARGET_SDATA_DEFAULT ? 0 : MASK_NO_SDATA_SET) -/* We default to ARC700, which has the barrel shifter enabled. */ -#define TARGET_DEFAULT_TARGET_FLAGS \ - (MASK_BARREL_SHIFTER|MASK_VOLATILE_CACHE_SET|DEFAULT_NO_SDATA) +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (DEFAULT_NO_SDATA | MASK_VOLATILE_CACHE_SET) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION arc_handle_option #include "common/common-target-def.h" diff --git a/gcc/config.gcc b/gcc/config.gcc index 3e0be229765..595563b40ee 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -318,6 +318,7 @@ arc*-*-*) cpu_type=arc c_target_objs="arc-c.o" cxx_target_objs="arc-c.o" + extra_options="${extra_options} arc/arc-tables.opt" ;; arm*-*-*) cpu_type=arm @@ -999,13 +1000,12 @@ alpha*-dec-*vms*) ;; arc*-*-elf*) extra_headers="arc-simd.h" - tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}" - tmake_file="arc/t-arc-newlib arc/t-arc" - case x"${with_cpu}" in - xarc600|xarc601|xarc700) - target_cpu_default="TARGET_CPU_$with_cpu" - ;; - esac + tm_file="arc/arc-arch.h dbxelf.h elfos.h newlib-stdint.h ${tm_file}" + tmake_file="arc/t-multilib arc/t-arc" + extra_gcc_objs="driver-arc.o" + if test "x$with_cpu" != x; then + tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu" + fi if test x${with_endian} = x; then case ${target} in arc*be-*-* | arc*eb-*-*) with_endian=big ;; @@ -1022,15 +1022,14 @@ arc*-*-elf*) ;; arc*-*-linux-uclibc*) extra_headers="arc-simd.h" - tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file}" - tmake_file="${tmake_file} arc/t-arc-uClibc arc/t-arc" + tm_file="arc/arc-arch.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file}" + tmake_file="${tmake_file} arc/t-uClibc arc/t-arc" tm_defines="${tm_defines} TARGET_SDATA_DEFAULT=0" tm_defines="${tm_defines} TARGET_MMEDIUM_CALLS_DEFAULT=1" - case x"${with_cpu}" in - xarc600|xarc601|xarc700) - target_cpu_default="TARGET_CPU_$with_cpu" - ;; - esac + extra_gcc_objs="driver-arc.o" + if test "x$with_cpu" != x; then + tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu" + fi if test x${with_endian} = x; then case ${target} in arc*be-*-* | arc*eb-*-*) with_endian=big ;; @@ -3624,15 +3623,19 @@ case "${target}" in done ;; - arc*-*-*) # was: arc*-*-linux-uclibc) + arc*-*-*) supported_defaults="cpu" - case $with_cpu in - arc600|arc601|arc700) - ;; - *) echo "Unknown cpu type" - exit 1 - ;; - esac + + if [ x"$with_cpu" = x ] \ + || grep "^ARC_CPU ($with_cpu," \ + ${srcdir}/config/arc/arc-cpus.def \ + > /dev/null; then + # Ok + true + else + echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2 + exit 1 + fi ;; arm*-*-*) diff --git a/gcc/config/arc/arc-arch.h b/gcc/config/arc/arc-arch.h new file mode 100644 index 00000000000..bfd3f234f32 --- /dev/null +++ b/gcc/config/arc/arc-arch.h @@ -0,0 +1,123 @@ +/* Definitions of types that are used to store ARC architecture and + device information. + Copyright (C) 2016 Free Software Foundation, Inc. + Contributed by Claudiu Zissulescu (claziss@synopsys.com) + +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 +. */ + +#ifndef GCC_ARC_ARCH_H +#define GCC_ARC_ARCH_H + +#ifndef IN_LIBGCC2 +/* Architecture selection types. */ + +enum cpu_flags + { +#define ARC_OPT(NAME, CODE, MASK, DOC) NAME = CODE, +#define ARC_OPTX(NAME, CODE, VAR, VAL, DOC) NAME = CODE, +#include "arc-options.def" +#undef ARC_OPT +#undef ARC_OPTX + FL_END + }; + + +/* ARC architecture variants. */ + +enum base_architecture + { + BASE_ARCH_NONE, +#define ARC_ARCH(NAME, ARCH, FLAGS, DFLAGS) BASE_ARCH_##ARCH, +#include "arc-arches.def" +#undef ARC_ARCH + BASE_ARCH_END + }; + + +/* Tune variants. Needs to match the attr_tune enum. */ + +enum arc_tune_attr + { + ARC_TUNE_NONE, + ARC_TUNE_ARC600, + ARC_TUNE_ARC700_4_2_STD, + ARC_TUNE_ARC700_4_2_XMAC + }; + +/* CPU specific properties. */ + +typedef struct +{ + /* CPU name. */ + const char *const name; + + /* Architecture class. */ + enum base_architecture arch; + + /* Specific processor type. */ + enum processor_type processor; + + /* Specific flags. */ + const unsigned long long flags; + + /* Tune value. */ + enum arc_tune_attr tune; +} arc_cpu_t; + + +/* Architecture specific propoerties. */ + +typedef struct +{ + /* Architecture name. */ + const char *const name; + + /* Architecture class. */ + enum base_architecture arch; + + /* All allowed flags for this architecture. */ + const unsigned long long flags; + + /* Default flags for this architecture. It is a subset of + FLAGS. */ + const unsigned long long dflags; +} arc_arch_t; + + + +const arc_arch_t arc_arch_types[] = + { + {"none", BASE_ARCH_NONE, 0, 0}, +#define ARC_ARCH(NAME, ARCH, FLAGS, DFLAGS) \ + {NAME, BASE_ARCH_##ARCH, FLAGS, DFLAGS}, +#include "arc-arches.def" +#undef ARC_ARCH + {NULL, BASE_ARCH_END, 0, 0} + }; + +const arc_cpu_t arc_cpu_types[] = + { + {"none", BASE_ARCH_NONE, PROCESSOR_NONE, 0, ARC_TUNE_NONE}, +#define ARC_CPU(NAME, ARCH, FLAGS, TUNE) \ + {#NAME, BASE_ARCH_##ARCH, PROCESSOR_##NAME, FLAGS, ARC_TUNE_##TUNE}, +#include "arc-cpus.def" +#undef ARC_CPU + {NULL, BASE_ARCH_END, PROCESSOR_NONE, 0, ARC_TUNE_NONE} + }; + +#endif +#endif /* GCC_ARC_ARCH_H */ diff --git a/gcc/config/arc/arc-arches.def b/gcc/config/arc/arc-arches.def new file mode 100644 index 00000000000..f24babb4d53 --- /dev/null +++ b/gcc/config/arc/arc-arches.def @@ -0,0 +1,56 @@ +/* ARC ARCH architectures. + Copyright (C) 2016 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 + . */ + +/* List of all known ARC base architectures. These defines are used + to check if command line given options are valid for a specific + architecture, and to set default architecture options, if needed. + + Before including this file, define a macro: + + ARC_ARCH (NAME, ARCH, DEV_HW_FACILITIES, DEF_HW_FACILITIES) + + where the arguments are the fields of arc_arch_t: + + NAME Architecture given name; + + ARCH Architecture class as in enum base_architecture; + + DEV_HW_FACILITIES All allowed architecture hardware facilities. + These facilities are represented as compiler + options, defined in arc_options.def file. + + DEF_HW_FACILITIES Default flags for this architecture. It is a + subset of DEV_HW_FACILITIES. */ + +ARC_ARCH ("arcem", em, FL_MPYOPT_1_6 | FL_DIVREM | FL_CD | FL_NORM \ + | FL_BS | FL_SWAP | FL_FPUS | FL_SPFP | FL_DPFP \ + | FL_SIMD | FL_FPUDA, 0) +ARC_ARCH ("archs", hs, FL_MPYOPT_7_9 | FL_DIVREM | FL_NORM | FL_CD \ + | FL_ATOMIC | FL_LL64 | FL_BS | FL_SWAP \ + | FL_FPUS | FL_FPUD, \ + FL_CD | FL_ATOMIC | FL_BS | FL_NORM | FL_SWAP) +ARC_ARCH ("arc6xx", 6xx, FL_BS | FL_NORM | FL_SWAP | FL_MUL64 | FL_MUL32x16 \ + | FL_SPFP | FL_ARGONAUT | FL_DPFP, 0) +ARC_ARCH ("arc700", 700, FL_ATOMIC | FL_BS | FL_NORM | FL_SWAP | FL_EA \ + | FL_SIMD | FL_SPFP | FL_ARGONAUT | FL_DPFP, \ + FL_BS | FL_NORM | FL_SWAP) + +/* Local Variables: */ +/* mode: c */ +/* End: */ diff --git a/gcc/config/arc/arc-c.def b/gcc/config/arc/arc-c.def index 065e97360de..4cfd7b6e35f 100644 --- a/gcc/config/arc/arc-c.def +++ b/gcc/config/arc/arc-c.def @@ -66,3 +66,7 @@ ARC_C_DEF ("__EM__", TARGET_EM) ARC_C_DEF ("__HS__", TARGET_HS) ARC_C_DEF ("__Xnorm", TARGET_NORM) ARC_C_DEF ("__Xbarrel_shifter", TARGET_BARREL_SHIFTER) + +/* Local Variables: */ +/* mode: c */ +/* End: */ diff --git a/gcc/config/arc/arc-cpus.def b/gcc/config/arc/arc-cpus.def new file mode 100644 index 00000000000..0ceb7344a83 --- /dev/null +++ b/gcc/config/arc/arc-cpus.def @@ -0,0 +1,75 @@ +/* ARC CPU architectures. + Copyright (C) 2016 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 + . */ + +/* List of various ARC CPU configurations. If updated, cd to + $(builddir)/gcc and run + + $ make arc-cpus + + This will regenerate / update the following source files: + + - $(srcdir)/config/arc/t-multilib + - $(srcdir)/config/arc/arc-tables.opt + + After that, rebuild everything and check-in the new sources to the + repo. This file defines the accepted values for -mcpu= + option. + + Before including this file, define a macro: + + ARC_CPU (NAME, ARCH, FLAGS, TUNE) + + where the arguments are the fields of arc_cpu_t: + + NAME A given arbitrary name. + ARCH Base architecture for the given CPU. + FLAGS Specific hardware flags that are enabled by this CPU configuration, + as defined in arc-options.def file, and allowed by arc-arches.def + file. The specific hardware flags are enumerated without using + spaces between the '|' character and consequtive flags. + TUNE Tune value for the given configuration, otherwise NONE. */ + +ARC_CPU (em, em, 0, NONE) +ARC_CPU (arcem, em, FL_MPYOPT_2|FL_CD|FL_BS, NONE) +ARC_CPU (em4, em, FL_CD, NONE) +ARC_CPU (em4_dmips, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS, NONE) +ARC_CPU (em4_fpus, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUS, NONE) +ARC_CPU (em4_fpuda, em, FL_MPYOPT_2|FL_CD|FL_DIVREM|FL_NORM|FL_SWAP|FL_BS|FL_FPU_FPUDA, NONE) + +ARC_CPU (hs, hs, 0, NONE) +ARC_CPU (archs, hs, FL_MPYOPT_2|FL_DIVREM|FL_LL64, NONE) +ARC_CPU (hs34, hs, FL_MPYOPT_2, NONE) +ARC_CPU (hs38, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64, NONE) +ARC_CPU (hs38_linux, hs, FL_MPYOPT_9|FL_DIVREM|FL_LL64|FL_FPU_FPUD_ALL, NONE) + +ARC_CPU (arc600, 6xx, FL_BS, ARC600) +ARC_CPU (arc600_norm, 6xx, FL_BS|FL_NORM, ARC600) +ARC_CPU (arc600_mul64, 6xx, FL_BS|FL_NORM|FL_MUL64, ARC600) +ARC_CPU (arc600_mul32x16, 6xx, FL_BS|FL_NORM|FL_MUL32x16, ARC600) +ARC_CPU (arc601, 6xx, 0, ARC600) +ARC_CPU (arc601_norm, 6xx, FL_NORM, ARC600) +ARC_CPU (arc601_mul64, 6xx, FL_NORM|FL_MUL64, ARC600) +ARC_CPU (arc601_mul32x16, 6xx, FL_NORM|FL_MUL32x16, ARC600) + +ARC_CPU (arc700, 700, 0, ARC700_4_2_STD) +ARC_CPU (nps400, 700, 0, ARC700_4_2_STD) + +/* Local Variables: */ +/* mode: c */ +/* End: */ diff --git a/gcc/config/arc/arc-options.def b/gcc/config/arc/arc-options.def new file mode 100644 index 00000000000..0f9d36ccc84 --- /dev/null +++ b/gcc/config/arc/arc-options.def @@ -0,0 +1,109 @@ +/* ARC options. + Copyright (C) 2016 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 + . */ + +/* List of all known ARC hardware modifier options (i.e., compiler + options that are selecting a hardware facility). There can be two + types options: simple switches (e.g. code-density option can be + on/off), or can accept multiple values (e.g., fpu options). + + For any valid HW option, define a macro: + + ARC_OPT (NAME, CODE, MASK, DOC) + + where: + NAME Name (identifier) of a particular hardware modifier option, + as in enum cpu_flags. + + CODE 64-bit mask used to encode NAME. + + MASK Corresponding GCC's MASK_