aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraburgess <aburgess@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-09 00:35:20 +0000
committeraburgess <aburgess@138bc75d-0d04-0410-961f-82ee72b054a4>2017-02-09 00:35:20 +0000
commitfa31f56e353137a5b7709b8d6fd02cd7b49703e5 (patch)
treebf34be77ceeca7a3b6a0a35183eb8197c2d7e0cc
parentc47d4a067d940bdffbaf72e2fbf93ab1a8d3d1de (diff)
arc/gcc: Better creation of __NPS400__ define
The __NPS400__ define is currently created in CPP_SPEC unlike the other target defines, which are created in arc-c.def. Further, the current __NPS400__ define is (currently) only created when -mcpu=nps400 is passed, which is fine, except that if GCC is configured using --with-cpu=nps400 then the -mcpu option is not required and the __NPS400__ define will not be created. This commit moves the __NPS400__ define into arc-c.def inline with all of the other target defines, and removes the code in CPP_SPEC that used to create the define. In order to support the creation of the define in arc-c.def, a new TARGET_NPS400 macro is created in arc.h. gcc/ChangeLog: * config/arc/arc-c.def: Add __NPS400__ definition. * config/arc/arc.h (CPP_SPEC): Don't define __NPS400__ here. (TARGET_NPS400): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245294 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arc/arc-c.def1
-rw-r--r--gcc/config/arc/arc.h9
3 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4d8e9293255..8865d745440 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-02-09 Andrew Burgess <andrew.burgess@embecosm.com>
+ * config/arc/arc-c.def: Add __NPS400__ definition.
+ * config/arc/arc.h (CPP_SPEC): Don't define __NPS400__ here.
+ (TARGET_NPS400): Define.
+
+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
diff --git a/gcc/config/arc/arc-c.def b/gcc/config/arc/arc-c.def
index 4903d8480de..8c5097ea6ce 100644
--- a/gcc/config/arc/arc-c.def
+++ b/gcc/config/arc/arc-c.def
@@ -20,6 +20,7 @@
ARC_C_DEF ("__ARC600__", TARGET_ARC600)
ARC_C_DEF ("__ARC601__", TARGET_ARC601)
ARC_C_DEF ("__ARC700__", TARGET_ARC700)
+ARC_C_DEF ("__NPS400__", TARGET_NPS400)
ARC_C_DEF ("__ARCEM__", TARGET_EM)
ARC_C_DEF ("__ARCHS__", TARGET_HS)
ARC_C_DEF ("__ARC_ATOMIC__", TARGET_ATOMIC)
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 64a3724b6cc..13415371013 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -92,8 +92,7 @@ along with GCC; see the file COPYING3. If not see
%{mmac-d16:-D__Xxmac_d16} %{mmac-24:-D__Xxmac_24} \
%{mdsp-packa:-D__Xdsp_packa} %{mcrc:-D__Xcrc} %{mdvbf:-D__Xdvbf} \
%{mtelephony:-D__Xtelephony} %{mxy:-D__Xxy} %{mmul64: -D__Xmult32} \
-%{mlock:-D__Xlock} %{mswape:-D__Xswape} %{mrtsc:-D__Xrtsc} \
-%{mcpu=nps400:-D__NPS400__}"
+%{mlock:-D__Xlock} %{mswape:-D__Xswape} %{mrtsc:-D__Xrtsc}"
#define CC1_SPEC "\
%{EB:%{EL:%emay not use both -EB and -EL}} \
@@ -223,6 +222,12 @@ extern const char *arc_cpu_to_as (int argc, const char **argv);
&& (!TARGET_BARREL_SHIFTER))
#define TARGET_ARC700 (arc_selected_cpu->arch_info->arch_id \
== BASE_ARCH_700)
+/* An NPS400 is a specialisation of ARC700, so it is correct for NPS400
+ TARGET_ARC700 is true, and TARGET_NPS400 is true. */
+#define TARGET_NPS400 ((arc_selected_cpu->arch_info->arch_id \
+ == BASE_ARCH_700) \
+ && (arc_selected_cpu->processor \
+ == PROCESSOR_nps400))
#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)