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]

[PATCHv3 5/7] arc: Add nps400 machine type, and assembler flag.


This commit introduces the nps400 machine type as a variant of arc.
There's a new flag in the assembler to select this machine type.  All
other changes are just adding handling of the new machine type into the
relevant places.

The nps400 is an arc700 variant with some vendor specific instructions
added into the instruction set.  This commit does not add any of the new
instructions, this is just laying the groundwork for future commits.
However, in preparation for these new instructions a new opcode define for
nps400 has been added to include/opcode/arc.h, this new opcode define is
used in the assembler and disassembler along with the existing define
for arc700 such that when assembling and disassembling for nps400 the
user will have access to all arc700 instructions and all the nps400
vendor extension instructions.

bfd/ChangeLog:

	* archures.c (bfd_mach_arc_nps400): Define.
	* bfd-in2.h: Regenerate.
	* cpu-arc.c (arch_info_struct): New entry for nps400, renumber
	some existing entries to make space.
	* elf32-arc.c (arc_elf_object_p): Add nps400 case.
	(arc_elf_final_write_processing): Likewise.

binutils/ChangeLog:

	* readelf.c (get_machine_flags): Handle nps400.

gas/ChangeLog:

	* config/tc-arc.c (cpu_types): Add nps400 entry.
	(check_zol): Handle nps400.

include/ChangeLog:

	* elf/arc.h (E_ARC_MACH_NPS400): Define.
	* opcode/arc.h (ARC_OPCODE_NPS400): Define.

opcodes/ChangeLog:

	* arc-dis.c (print_insn_arc): Handle nps400.
---
 bfd/ChangeLog        | 9 +++++++++
 bfd/archures.c       | 1 +
 bfd/bfd-in2.h        | 1 +
 bfd/cpu-arc.c        | 5 +++--
 bfd/elf32-arc.c      | 6 ++++++
 binutils/ChangeLog   | 4 ++++
 binutils/readelf.c   | 6 ++++++
 gas/ChangeLog        | 5 +++++
 gas/config/tc-arc.c  | 3 +++
 include/ChangeLog    | 5 +++++
 include/elf/arc.h    | 1 +
 include/opcode/arc.h | 1 +
 opcodes/ChangeLog    | 4 ++++
 opcodes/arc-dis.c    | 4 ++++
 14 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 20c1904..0c82aea 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,14 @@
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* archures.c (bfd_mach_arc_nps400): Define.
+	* bfd-in2.h: Regenerate.
+	* cpu-arc.c (arch_info_struct): New entry for nps400, renumber
+	some existing entries to make space.
+	* elf32-arc.c (arc_elf_object_p): Add nps400 case.
+	(arc_elf_final_write_processing): Likewise.
+
+2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* elf32-arc.c (arc_elf_print_private_bfd_data): Remove use of
 	EF_ARC_CPU_GENERIC.
 	(arc_elf_final_write_processing): Don't bother setting cpu field
diff --git a/bfd/archures.c b/bfd/archures.c
index 12e3342..7ff1e82 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -359,6 +359,7 @@ DESCRIPTION
 .#define bfd_mach_arc_arc601    4
 .#define bfd_mach_arc_arc700    3
 .#define bfd_mach_arc_arcv2     5
+.#define bfd_mach_arc_nps400    6
 . bfd_arch_m32c,     {* Renesas M16C/M32C.  *}
 .#define bfd_mach_m16c        0x75
 .#define bfd_mach_m32c        0x78
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 13f2d6e..f02e2aa 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2174,6 +2174,7 @@ enum bfd_architecture
 #define bfd_mach_arc_arc601    4
 #define bfd_mach_arc_arc700    3
 #define bfd_mach_arc_arcv2     5
+#define bfd_mach_arc_nps400    6
  bfd_arch_m32c,     /* Renesas M16C/M32C.  */
 #define bfd_mach_m16c        0x75
 #define bfd_mach_m32c        0x78
diff --git a/bfd/cpu-arc.c b/bfd/cpu-arc.c
index 07a052b..472af8d 100644
--- a/bfd/cpu-arc.c
+++ b/bfd/cpu-arc.c
@@ -47,8 +47,9 @@ static const bfd_arch_info_type arch_info_struct[] =
   ARC (bfd_mach_arc_arc601, "ARC601", FALSE, &arch_info_struct[3]),
   ARC (bfd_mach_arc_arc700, "ARC700", FALSE, &arch_info_struct[4]),
   ARC (bfd_mach_arc_arc700, "A7",     FALSE, &arch_info_struct[5]),
-  ARC (bfd_mach_arc_arcv2,  "ARCv2",  FALSE, &arch_info_struct[6]),
-  ARC (bfd_mach_arc_arcv2,  "EM",     FALSE, &arch_info_struct[7]),
+  ARC (bfd_mach_arc_nps400, "NPS400", FALSE, &arch_info_struct[6]),
+  ARC (bfd_mach_arc_arcv2,  "ARCv2",  FALSE, &arch_info_struct[7]),
+  ARC (bfd_mach_arc_arcv2,  "EM",     FALSE, &arch_info_struct[8]),
   ARC (bfd_mach_arc_arcv2,  "HS",     FALSE, NULL),
 };
 
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index ec81852..488b86f 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -610,6 +610,9 @@ arc_elf_object_p (bfd * abfd)
 	  case E_ARC_MACH_ARC700:
 	    mach = bfd_mach_arc_arc700;
 	    break;
+	  case E_ARC_MACH_NPS400:
+	    mach = bfd_mach_arc_nps400;
+	    break;
 	  case EF_ARC_CPU_ARCV2HS:
 	  case EF_ARC_CPU_ARCV2EM:
 	    mach = bfd_mach_arc_arcv2;
@@ -659,6 +662,9 @@ arc_elf_final_write_processing (bfd * abfd,
     case bfd_mach_arc_arc700:
       emf = EM_ARC_COMPACT;
       break;
+    case bfd_mach_arc_nps400:
+      emf = EM_ARC_COMPACT;
+      break;
     case bfd_mach_arc_arcv2:
       emf = EM_ARC_COMPACT2;
       break;
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 1ac9384..de99ad2 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,9 @@
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* readelf.c (get_machine_flags): Handle nps400.
+
+2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* readelf.c (get_machine_flags): Remove use of EF_ARC_CPU_GENERIC.
 
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
diff --git a/binutils/readelf.c b/binutils/readelf.c
index b764234..920eca5 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2785,6 +2785,9 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
 	    case E_ARC_MACH_ARC700:
 	      strcat (buf, ", ARC700");
 	      break;
+	    case E_ARC_MACH_NPS400:
+	      strcat (buf, ", NPS400");
+	      break;
 	    default:
 	      strcat (buf, ", unrecognized cpu flag for ARCv2");
 	      break;
@@ -2819,6 +2822,9 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
 	    case E_ARC_MACH_ARC700:
 	      strcat (buf, ", ARC 700");
 	      break;
+	    case E_ARC_MACH_NPS400:
+	      strcat (buf, ", NPS400");
+	      break;
 	    default:
 	      strcat (buf, ", Generic ARCompact");
 	      break;
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 16d7f34..8df40e9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* config/tc-arc.c (cpu_types): Add nps400 entry.
+	(check_zol): Handle nps400.
+
+2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* config/tc-arc.c (arc_select_cpu): Remove use of
 	EF_ARC_CPU_GENERIC.
 
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 65eb0e9..2bf7f13 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -342,6 +342,8 @@ static const struct cpu_type
     E_ARC_MACH_ARC600,  0x00},
   { "arc700", ARC_OPCODE_ARC700,  bfd_mach_arc_arc700,
     E_ARC_MACH_ARC700,  0x00},
+  { "nps400", ARC_OPCODE_ARC700 | ARC_OPCODE_NPS400, bfd_mach_arc_nps400,
+    E_ARC_MACH_NPS400,  0x00},
   { "arcem",  ARC_OPCODE_ARCv2EM, bfd_mach_arc_arcv2,
     EF_ARC_CPU_ARCV2EM, ARC_CD},
   { "archs",  ARC_OPCODE_ARCv2HS, bfd_mach_arc_arcv2,
@@ -3655,6 +3657,7 @@ check_zol (symbolS *s)
 end of the ZOL label @%s"), S_GET_NAME (s));
 
       /* Fall through.  */
+    case bfd_mach_arc_nps400:
     case bfd_mach_arc_arc700:
       if (arc_last_insns[0].has_delay_slot)
 	as_bad (_("An illegal use of delay slot detected at the end of the ZOL label @%s"),
diff --git a/include/ChangeLog b/include/ChangeLog
index 102d1c0..d531748 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,5 +1,10 @@
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* elf/arc.h (E_ARC_MACH_NPS400): Define.
+	* opcode/arc.h (ARC_OPCODE_NPS400): Define.
+
+2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* elf/arc.h (EF_ARC_CPU_GENERIC): Delete.  Update related comment.
 
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
diff --git a/include/elf/arc.h b/include/elf/arc.h
index 47381f3..2aed25d 100644
--- a/include/elf/arc.h
+++ b/include/elf/arc.h
@@ -48,6 +48,7 @@ END_RELOC_NUMBERS (R_ARC_max)
 #define E_ARC_MACH_ARC600	0x00000002
 #define E_ARC_MACH_ARC601	0x00000004
 #define E_ARC_MACH_ARC700	0x00000003
+#define E_ARC_MACH_NPS400	0x00000007
 #define EF_ARC_CPU_ARCV2EM      0x00000005
 #define EF_ARC_CPU_ARCV2HS      0x00000006
 
diff --git a/include/opcode/arc.h b/include/opcode/arc.h
index d33b878..85ea735 100644
--- a/include/opcode/arc.h
+++ b/include/opcode/arc.h
@@ -132,6 +132,7 @@ extern const unsigned arc_num_opcodes;
 #define ARC_OPCODE_ARC700   0x0002  /* ARC 700 specific insns.  */
 #define ARC_OPCODE_ARCv2EM  0x0004  /* ARCv2 EM specific insns.  */
 #define ARC_OPCODE_ARCv2HS  0x0008  /* ARCv2 HS specific insns.  */
+#define ARC_OPCODE_NPS400   0x0010  /* NPS400 specific insns.  */
 
 /* CPU extensions.  */
 #define ARC_EA       0x0001
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index e367f65..f9c5f77 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
 2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* arc-dis.c (print_insn_arc): Handle nps400.
+
+2016-03-15  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* arc-opc.c (BASE): Delete.
 
 2016-03-07  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
index 7320c9f..aeb3ba6 100644
--- a/opcodes/arc-dis.c
+++ b/opcodes/arc-dis.c
@@ -132,6 +132,10 @@ print_insn_arc (bfd_vma memaddr,
 
   switch (info->mach)
     {
+    case bfd_mach_arc_nps400:
+      isa_mask = ARC_OPCODE_ARC700 | ARC_OPCODE_NPS400;
+      break;
+
     case bfd_mach_arc_arc700:
       isa_mask = ARC_OPCODE_ARC700;
       break;
-- 
2.5.1


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