This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v3 1/5] [ARC] Add NPS400 instruction subclass and flag


gas/ChangeLog:

	* config/tc-arc.c (check_cpu_feature, md_parse_option):
	Add nps400 option and feature. Add check for nps400
        feature. Refactor existing checks to check subclass before
        feature enablement.

include/ChangeLog:

        * opcode/arc.h: Add nps400 extension and instruction
        subclass.
---
 gas/ChangeLog        |  6 ++++++
 gas/config/tc-arc.c  | 21 +++++++++++++--------
 include/ChangeLog    |  4 ++++
 include/opcode/arc.h |  2 ++
 4 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 966b18d..10fee83 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -100,6 +100,7 @@ enum arc_rlx_types
 #define is_fpuda_p(op)          (((sc) == DPA))
 #define is_br_jmp_insn_p(op)    (((op)->insn_class == BRANCH || (op)->insn_class == JUMP))
 #define is_kernel_insn_p(op)    (((op)->insn_class == KERNEL))
+#define is_nps400_p(op)         (((sc) == NPS400))
 
 /* Generic assembler global variables which must be defined by all
    targets.  */
@@ -179,6 +180,7 @@ enum options
   OPTION_MCPU,
   OPTION_CD,
   OPTION_RELAX,
+  OPTION_NPS400,
 
   /* The following options are deprecated and provided here only for
      compatibility reasons.  */
@@ -221,6 +223,7 @@ struct option md_longopts[] =
   { "mHS",		no_argument,	   NULL, OPTION_ARCHS },
   { "mcode-density",	no_argument,	   NULL, OPTION_CD },
   { "mrelax",           no_argument,       NULL, OPTION_RELAX },
+  { "mnps400",          no_argument,       NULL, OPTION_NPS400 },
 
   /* The following options are deprecated and provided here only for
      compatibility reasons.  */
@@ -1529,20 +1532,19 @@ allocate_tok (expressionS *tok, int ntok, int cidx)
 static bfd_boolean
 check_cpu_feature (insn_subclass_t sc)
 {
-  if (!(arc_features & ARC_CD)
-      && is_code_density_p (sc))
+  if (is_code_density_p (sc) && !(arc_features & ARC_CD))
     return FALSE;
 
-  if (!(arc_features & ARC_SPFP)
-      && is_spfp_p (sc))
+  if (is_spfp_p (sc) && !(arc_features & ARC_SPFP))
     return FALSE;
 
-  if (!(arc_features & ARC_DPFP)
-      && is_dpfp_p (sc))
+  if (is_dpfp_p (sc) && !(arc_features & ARC_DPFP))
     return FALSE;
 
-  if (!(arc_features & ARC_FPUDA)
-      && is_fpuda_p (sc))
+  if (is_fpuda_p (sc) && !(arc_features & ARC_FPUDA))
+    return FALSE;
+
+  if (is_nps400_p (sc) && !(arc_features & ARC_NPS400))
     return FALSE;
 
   return TRUE;
@@ -3341,6 +3343,9 @@ md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
       relaxation_state = 1;
       break;
 
+    case OPTION_NPS400:
+      arc_features |= ARC_NPS400;
+
     case OPTION_USER_MODE:
     case OPTION_LD_EXT_MASK:
     case OPTION_SWAP:
diff --git a/include/opcode/arc.h b/include/opcode/arc.h
index adbae74..c3a007c 100644
--- a/include/opcode/arc.h
+++ b/include/opcode/arc.h
@@ -70,6 +70,7 @@ typedef enum
     MPY7E,
     MPY8E,
     MPY9E,
+    NPS400,
     QUARKSE,
     SHFT1,
     SHFT2,
@@ -186,6 +187,7 @@ extern const struct arc_opcode arc_opcodes[];
 #define ARC_ATOMIC   0x0002    /* Mutual exclusive with LLOCK.  */
 #define ARC_MPY      0x0004
 #define ARC_MULT     0x0004
+#define ARC_NPS400   0x0008
 
 /* Floating point support.  */
 #define ARC_DPFP     0x0010
-- 
2.5.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]