]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
arc: Add nps400 machine type, and assembler flag.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 15 Mar 2016 21:51:50 +0000 (21:51 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 21 Mar 2016 16:44:49 +0000 (16:44 +0000)
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 (decode_ARC_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.

14 files changed:
bfd/ChangeLog
bfd/archures.c
bfd/bfd-in2.h
bfd/cpu-arc.c
bfd/elf32-arc.c
binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/config/tc-arc.c
include/ChangeLog
include/elf/arc.h
include/opcode/arc.h
opcodes/ChangeLog
opcodes/arc-dis.c

index 2ee95c6b6a8b9235d29d49602229989cce3e0055..43c9c285df032d6a6daf40af7c819ffd44a098db 100644 (file)
@@ -1,3 +1,12 @@
+2016-03-21  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-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * elf32-arc.c (arc_elf_print_private_bfd_data): Remove use of
index 12e3342f3bee152a30202aa2f0eae81c4307d652..7ff1e82577a12032f4ca5ce7ae3eabae0f5cc66a 100644 (file)
@@ -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
index 13f2d6ecba59f667093771c76381f64a189ff0fa..f02e2aa29b581389c07387ae956b785ae7ba73da 100644 (file)
@@ -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
index 07a052b8a5072678cdf2f8560b5650ec40d42ade..472af8d96cc4453ce55759ecc9c04c9fa2e8b633 100644 (file)
@@ -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),
 };
 
index ec818524f282c2e54bf1cbb1a07a356344da51dc..488b86fccc01ff2ac79c5c765adb14a773a4b503 100644 (file)
@@ -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;
index c71ba3f36579f443109e904f18fd69c2a033f3fd..805c6d81385e6380f2ea910a72e02ec682174fe6 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * readelf.c (decode_ARC_machine_flags): Handle nps400.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * readelf.c (get_machine_flags): Move arc processing into...
index fe23d458a5e81a673da97d1daf23358f7220b823..5755b6b1503646ed24ae74b749d0bcc0861269e3 100644 (file)
@@ -2306,6 +2306,9 @@ decode_ARC_machine_flags (unsigned e_flags, unsigned e_machine, char buf[])
     case E_ARC_MACH_ARC700:
       strcat (buf, ", ARC700");
       break;
+    case E_ARC_MACH_NPS400:
+      strcat (buf, ", NPS400");
+      break;
 
       /* The only times we should end up here are (a) A corrupt ELF, (b) A
          new ELF with new architecture being read by an old version of
index c6aa311b441a30006edc6f15c004dd363d121bfb..3450988b606fb31f844c88afad28becedd28920d 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * config/tc-arc.c (cpu_types): Add nps400 entry.
+       (check_zol): Handle nps400.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * config/tc-arc.c (arc_select_cpu): Remove use of
index 65eb0e9025a79182d00439cd7f5493655196aa6a..2bf7f133a24a6b3e49f700133c9f2709bd7f2623 100644 (file)
@@ -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"),
index c8d14d638eeacd06b455e37b6713f65cc74c5e6b..3ac5b728adb98a29e3b25a2d208eb2264b4af2e8 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * elf/arc.h (E_ARC_MACH_NPS400): Define.
+       * opcode/arc.h (ARC_OPCODE_NPS400): Define.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * elf/arc.h (EF_ARC_CPU_GENERIC): Delete.  Update related comment.
index 47381f3608580bbea623c41732bb69cba3236b2d..2aed25d02cbbb7f4d53779e0717d0093170f441b 100644 (file)
@@ -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
 
index d33b878c508d836b59c7bd59fba1875c005186ce..85ea735c34d4feed3983e78b9cb334eec8b24d26 100644 (file)
@@ -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
index d7180b3cfa20fe5dc548976cef6f1b0a5cf794eb..f001f036554867bb352c884d431ae6f66d1e5849 100644 (file)
@@ -1,3 +1,7 @@
+2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * arc-dis.c (print_insn_arc): Handle nps400.
+
 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * arc-opc.c (BASE): Delete.
index 7320c9f195e789035f0c57d7b17fcccf1b0d60a1..aeb3ba68cffe051b6552a66746d53b670a49e4e8 100644 (file)
@@ -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;