From 37d8f61108e97d88d1422dd1e0efabef833b0f26 Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Sun, 3 Jun 2018 03:26:56 +0000 Subject: [PATCH] [NDS32] Add -march=v3j. gcc/ * config/nds32/nds32-opts.h (nds32_arch_type): Add ARCH_V3J. * config/nds32/nds32.c (nds32_option_override): Consider ARCH_V3J. * config/nds32/nds32.h (TARGET_ISA_V3): Add ARCH_V3J checking. * config/nds32/nds32.opt (march): Add enum value Value(ARCH_V3J). From-SVN: r261123 --- gcc/ChangeLog | 7 +++++++ gcc/config/nds32/nds32-opts.h | 1 + gcc/config/nds32/nds32.c | 4 +++- gcc/config/nds32/nds32.h | 1 + gcc/config/nds32/nds32.opt | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18f539dfa13..1e80862db4b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-06-03 Chung-Ju Wu + + * config/nds32/nds32-opts.h (nds32_arch_type): Add ARCH_V3J. + * config/nds32/nds32.c (nds32_option_override): Consider ARCH_V3J. + * config/nds32/nds32.h (TARGET_ISA_V3): Add ARCH_V3J checking. + * config/nds32/nds32.opt (march): Add enum value Value(ARCH_V3J). + 2018-06-03 Chung-Ju Wu * common/config/nds32/nds32-common.c (nds32_option_optimization_table): diff --git a/gcc/config/nds32/nds32-opts.h b/gcc/config/nds32/nds32-opts.h index e75e75f4332..8d761964439 100644 --- a/gcc/config/nds32/nds32-opts.h +++ b/gcc/config/nds32/nds32-opts.h @@ -29,6 +29,7 @@ enum nds32_arch_type { ARCH_V2, ARCH_V3, + ARCH_V3J, ARCH_V3M, ARCH_V3F, ARCH_V3S diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index a0b6443e5d2..85a29865c7a 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -4087,7 +4087,9 @@ nds32_option_override (void) } if (TARGET_ISA_V3) { - /* Under V3 ISA, currently nothing should be strictly set. */ + /* If this is ARCH_V3J, we need to enable TARGET_REDUCED_REGS. */ + if (nds32_arch_option == ARCH_V3J) + target_flags |= MASK_REDUCED_REGS; } if (TARGET_ISA_V3M) { diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h index 84fae7d09df..9e36c8f2fac 100644 --- a/gcc/config/nds32/nds32.h +++ b/gcc/config/nds32/nds32.h @@ -853,6 +853,7 @@ enum nds32_builtins #define TARGET_ISA_V3 \ (nds32_arch_option == ARCH_V3 \ + || nds32_arch_option == ARCH_V3J \ || nds32_arch_option == ARCH_V3F \ || nds32_arch_option == ARCH_V3S) #define TARGET_ISA_V3M (nds32_arch_option == ARCH_V3M) diff --git a/gcc/config/nds32/nds32.opt b/gcc/config/nds32/nds32.opt index 871ae1e07ca..a9ffae1ea6c 100644 --- a/gcc/config/nds32/nds32.opt +++ b/gcc/config/nds32/nds32.opt @@ -176,6 +176,9 @@ Enum(nds32_arch_type) String(v2) Value(ARCH_V2) EnumValue Enum(nds32_arch_type) String(v3) Value(ARCH_V3) +EnumValue +Enum(nds32_arch_type) String(v3j) Value(ARCH_V3J) + EnumValue Enum(nds32_arch_type) String(v3m) Value(ARCH_V3M) -- 2.30.2