+2017-02-09 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * config/arc/arc-arch.h (arc_arch_t): Move unchanged to earlier in
+ file.
+ (arc_cpu_t): Change base_architecture field, arch, to a arc_arc_t
+ pointer, arch_info.
+ (arc_cpu_types): Fill the arch_info field with a pointer into the
+ arc_arch_types table.
+ (arc_selected_cpu): Declare.
+ * config/arc/arc.c (arc_selected_cpu): Make global.
+ (arc_selected_arch): Delete.
+ (arc_base_cpu): Delete.
+ (arc_override_options): Remove references to deleted variables,
+ update access to arch information.
+ (ARC_OPT): Update access to arch information.
+ (ARC_OPTX): Likewise.
+ * config/arc/arc.h (arc_base_cpu): Remove declaration.
+ (TARGET_ARC600): Update access to arch information.
+ (TARGET_ARC601): Likewise.
+ (TARGET_ARC700): Likewise.
+ (TARGET_EM): Likewise.
+ (TARGET_HS): Likewise.
+ * config/arc/driver-arc.c (arc_cpu_to_as): Update access to arch
+ information.
+
2017-02-08 Pat Haugen <pthaugen@us.ibm.com>
PR target/78604
BASE_ARCH_END
};
+/* Architecture specific propoerties. */
+
+typedef struct
+{
+ /* Architecture name. */
+ const char *const name;
+
+ /* Architecture class. */
+ enum base_architecture arch_id;
+
+ /* 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;
/* Tune variants. Needs to match the attr_tune enum. */
const char *const name;
/* Architecture class. */
- enum base_architecture arch;
+ const arc_arch_t *arch_info;
/* Specific processor type. */
enum processor_type processor;
/* 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;
-
+} arc_cpu_t;
const arc_arch_t arc_arch_types[] =
{
const arc_cpu_t arc_cpu_types[] =
{
- {"none", BASE_ARCH_NONE, PROCESSOR_NONE, 0, ARC_TUNE_NONE},
+ {"none", NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE},
#define ARC_CPU(NAME, ARCH, FLAGS, TUNE) \
- {#NAME, BASE_ARCH_##ARCH, PROCESSOR_##NAME, FLAGS, ARC_TUNE_##TUNE},
+ {#NAME, &arc_arch_types [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}
+ {NULL, NULL, PROCESSOR_NONE, 0, ARC_TUNE_NONE}
};
+/* Currently selected cpu type. */
+extern const arc_cpu_t *arc_selected_cpu;
+
#endif
#endif /* GCC_ARC_ARCH_H */
enum by_pieces_operation op,
bool);
-static const arc_cpu_t *arc_selected_cpu;
-static const arc_arch_t *arc_selected_arch;
-
-/* Global var which sets the current compilation architecture. */
-enum base_architecture arc_base_cpu;
+/* Globally visible information about currently selected cpu. */
+const arc_cpu_t *arc_selected_cpu;
/* Implements target hook vector_mode_supported_p. */
/* Set the default cpu options. */
arc_selected_cpu = &arc_cpu_types[(int) arc_cpu];
- arc_selected_arch = &arc_arch_types[(int) arc_selected_cpu->arch];
- arc_base_cpu = arc_selected_arch->arch;
/* Set the architectures. */
- switch (arc_selected_arch->arch)
+ switch (arc_selected_cpu->arch_info->arch_id)
{
case BASE_ARCH_em:
arc_cpu_string = "EM";
if ((arc_selected_cpu->flags & CODE) \
&& ((target_flags_explicit & MASK) == 0)) \
target_flags |= MASK; \
- if (arc_selected_arch->dflags & CODE) \
+ if (arc_selected_cpu->arch_info->dflags & CODE) \
target_flags |= MASK; \
} while (0);
-#define ARC_OPTX(NAME, CODE, VAR, VAL, DOC) \
- do { \
- if ((arc_selected_cpu->flags & CODE) \
- && (VAR == DEFAULT_##VAR)) \
- VAR = VAL; \
- if (arc_selected_arch->dflags & CODE) \
- VAR = VAL; \
+#define ARC_OPTX(NAME, CODE, VAR, VAL, DOC) \
+ do { \
+ if ((arc_selected_cpu->flags & CODE) \
+ && (VAR == DEFAULT_##VAR)) \
+ VAR = VAL; \
+ if (arc_selected_cpu->arch_info->dflags & CODE) \
+ VAR = VAL; \
} while (0);
#include "arc-options.def"
#define ARC_OPTX(NAME, CODE, VAR, VAL, DOC) \
do { \
if ((VAR == VAL) \
- && (!(arc_selected_arch->flags & CODE))) \
+ && (!(arc_selected_cpu->arch_info->flags & CODE))) \
{ \
error ("%s is not available for %s architecture", \
- DOC, arc_selected_arch->name); \
+ DOC, arc_selected_cpu->arch_info->name); \
} \
} while (0);
#define ARC_OPT(NAME, CODE, MASK, DOC) \
do { \
if ((target_flags & MASK) \
- && (!(arc_selected_arch->flags & CODE))) \
+ && (!(arc_selected_cpu->arch_info->flags & CODE))) \
error ("%s is not available for %s architecture", \
- DOC, arc_selected_arch->name); \
+ DOC, arc_selected_cpu->arch_info->name); \
} while (0);
#include "arc-options.def"
use conditional execution? */
#define TARGET_AT_DBR_CONDEXEC (!TARGET_ARC700 && !TARGET_V2)
-extern enum base_architecture arc_base_cpu;
-
-#define TARGET_ARC600 ((arc_base_cpu == BASE_ARCH_6xx) \
+#define TARGET_ARC600 ((arc_selected_cpu->arch_info->arch_id \
+ == BASE_ARCH_6xx) \
&& (TARGET_BARREL_SHIFTER))
-#define TARGET_ARC601 ((arc_base_cpu == BASE_ARCH_6xx) \
+#define TARGET_ARC601 ((arc_selected_cpu->arch_info->arch_id \
+ == BASE_ARCH_6xx) \
&& (!TARGET_BARREL_SHIFTER))
-#define TARGET_ARC700 (arc_base_cpu == BASE_ARCH_700)
-#define TARGET_EM (arc_base_cpu == BASE_ARCH_em)
-#define TARGET_HS (arc_base_cpu == BASE_ARCH_hs)
+#define TARGET_ARC700 (arc_selected_cpu->arch_info->arch_id \
+ == BASE_ARCH_700)
+#define TARGET_EM (arc_selected_cpu->arch_info->arch_id == BASE_ARCH_em)
+#define TARGET_HS (arc_selected_cpu->arch_info->arch_id == BASE_ARCH_hs)
#define TARGET_V2 (TARGET_EM || TARGET_HS)
#ifdef ARC_MULTILIB_CPU_DEFAULT
}
}
- switch (arc_selected_cpu->arch)
+ switch (arc_selected_cpu->arch_info->arch_id)
{
case BASE_ARCH_em:
if (arc_selected_cpu->flags & FL_CD)