[MIPS] Add Loongson 2K1000 proccessor support.
authorChenghua Xu <paul.hua.gm@gmail.com>
Wed, 29 Aug 2018 12:55:25 +0000 (20:55 +0800)
committerChenghua Xu <paul.hua.gm@gmail.com>
Wed, 29 Aug 2018 12:55:25 +0000 (20:55 +0800)
bfd/
* archures.c (bfd_architecture): New machine
bfd_mach_mips_gs264e.
* bfd-in2.h (bfd_architecture): Likewise.
* cpu-mips.c (enum I_xxx): Likewise.
(arch_info_struct): Likewise.
* elfxx-mips.c (_bfd_elf_mips_mach): Handle
E_MIPS_MACH_GS264E.
(mips_set_isa_flags): Likewise.
(mips_mach_extensions): Map bfd_mach_mips_gs264e to
bfd_mach_mips_gs464e extension.

binutils/
* NEWS: Mention Loongson 2K1000 proccessor support.
* readelf.c (get_machine_flags): Handle gs264e.

elfcpp/
* mips.c (EF_MIPS_MACH): New E_MIPS_MACH_GS264E.

gas/
* config/tc-mips.c (ISA_HAS_ODD_SINGLE_FPR): Exclude CPU_GS264E.
(mips_cpu_info_table): Add gs264e descriptors.
* doc/as.texi (march table): Add gs264e.

include/
* elf/mips.h (E_MIPS_MACH_XXX): New E_MIPS_MACH_GS264E.
* opcode/mips.h (CPU_XXX): New CPU_GS264E.

ld/
* testsuite/ld-mips-elf/mips-elf-flags.exp: Run good_combination
gs264e and gs464e.

opcodes/
* mips-dis.c (mips_arch_choices): Add gs264e descriptors.

21 files changed:
bfd/ChangeLog
bfd/archures.c
bfd/bfd-in2.h
bfd/cpu-mips.c
bfd/elfxx-mips.c
binutils/ChangeLog
binutils/NEWS
binutils/readelf.c
elfcpp/ChangeLog
elfcpp/mips.h
gas/ChangeLog
gas/config/tc-mips.c
gas/doc/c-mips.texi
gold/mips.cc
include/ChangeLog
include/elf/mips.h
include/opcode/mips.h
ld/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf-flags.exp
opcodes/ChangeLog
opcodes/mips-dis.c

index 70957e18a4df3e55aa907850edb6c86855d68f37..e516b8ad7ed8d1fd7e2ad40e1fac94796cb8e1dd 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+       * archures.c (bfd_architecture): New machine
+       bfd_mach_mips_gs264e.
+       * bfd-in2.h (bfd_architecture): Likewise.
+       * cpu-mips.c (enum I_xxx): Likewise.
+       (arch_info_struct): Likewise.
+       * elfxx-mips.c (_bfd_elf_mips_mach): Handle
+       E_MIPS_MACH_GS264E.
+       (mips_set_isa_flags): Likewise.
+       (mips_mach_extensions): Map bfd_mach_mips_gs264e to
+       bfd_mach_mips_gs464e extension.
+
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * archures.c (bfd_architecture): New machine
index 2fd9bdac574060abb6f9894ba2177eb0653b5a5e..300e17e9eb215ffc3deaab9ba7ad8612af26f2c7 100644 (file)
@@ -177,6 +177,7 @@ DESCRIPTION
 .#define bfd_mach_mips_loongson_2f     3002
 .#define bfd_mach_mips_gs464           3003
 .#define bfd_mach_mips_gs464e          3004
+.#define bfd_mach_mips_gs264e          3005
 .#define bfd_mach_mips_sb1             12310201 {* octal 'SB', 01.  *}
 .#define bfd_mach_mips_octeon          6501
 .#define bfd_mach_mips_octeonp         6601
index 6819416a3c1119814d8892830fc0f17bd8fc3445..1412f8934f243db27616ad4392c06c7712472b94 100644 (file)
@@ -2071,6 +2071,7 @@ enum bfd_architecture
 #define bfd_mach_mips_loongson_2f      3002
 #define bfd_mach_mips_gs464            3003
 #define bfd_mach_mips_gs464e           3004
+#define bfd_mach_mips_gs264e           3005
 #define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01.  */
 #define bfd_mach_mips_octeon           6501
 #define bfd_mach_mips_octeonp          6601
index 2617c79b2dd762173bfc4e6646b3b08f6e957945..339b1114e1ec18a579ff7282176021d72366d265 100644 (file)
@@ -100,6 +100,7 @@ enum
   I_loongson_2f,
   I_gs464,
   I_gs464e,
+  I_gs264e,
   I_mipsocteon,
   I_mipsocteonp,
   I_mipsocteon2,
@@ -153,6 +154,7 @@ static const bfd_arch_info_type arch_info_struct[] =
   N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f",      FALSE, NN(I_loongson_2f)),
   N (64, 64, bfd_mach_mips_gs464, "mips:gs464",          FALSE, NN(I_gs464)),
   N (64, 64, bfd_mach_mips_gs464e, "mips:gs464e",        FALSE, NN(I_gs464e)),
+  N (64, 64, bfd_mach_mips_gs264e, "mips:gs264e",        FALSE, NN(I_gs264e)),
   N (64, 64, bfd_mach_mips_octeon,"mips:octeon",  FALSE, NN(I_mipsocteon)),
   N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+",  FALSE, NN(I_mipsocteonp)),
   N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2",  FALSE, NN(I_mipsocteon2)),
index 25c2d9cedc7f51afea85028d95020a8e8f3909b3..14621cd09ed12d73266e8b2843d7bc3d7434b997 100644 (file)
@@ -6793,6 +6793,9 @@ _bfd_elf_mips_mach (flagword flags)
     case E_MIPS_MACH_GS464E:
       return bfd_mach_mips_gs464e;
 
+    case E_MIPS_MACH_GS264E:
+      return bfd_mach_mips_gs264e;
+
     case E_MIPS_MACH_OCTEON3:
       return bfd_mach_mips_octeon3;
 
@@ -11995,6 +11998,10 @@ mips_set_isa_flags (bfd *abfd)
       val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_GS464E;
       break;
 
+    case bfd_mach_mips_gs264e:
+      val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_GS264E;
+      break;
+
     case bfd_mach_mips_octeon:
     case bfd_mach_mips_octeonp:
       val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON;
@@ -14000,6 +14007,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
   { bfd_mach_mips_octeon2, bfd_mach_mips_octeonp },
   { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
   { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
+  { bfd_mach_mips_gs264e, bfd_mach_mips_gs464e },
   { bfd_mach_mips_gs464e, bfd_mach_mips_gs464 },
   { bfd_mach_mips_gs464, bfd_mach_mipsisa64r2 },
 
index ed5760e466b75bdaf9739accfc2bd183124e33b7..cfc0c27ea828d76aedb5761e2ca1900fb33ab18d 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+       * NEWS: Mention Loongson 2K1000 proccessor support.
+       * readelf.c (get_machine_flags): Handle gs264e.
+
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * NEWS: Mention Loongson 3A2000/3A3000 proccessor support.
index 775436df18fe3325926b3717c466e7f2bcc3a0de..de70c3a23cbf7123a6cdd6aa254545c3563b8b6e 100644 (file)
@@ -1,5 +1,10 @@
 -*- text -*-
 
+* The MIPS port now supports the Loongson 2K1000 processor which implements
+  the MIPS64r2 ISA, the Loongson-mmi ASE, Loongson-cam ASE, Loongson-ext ASE,
+  Loongson-ext2 ASE and MSA ASE instructions. Add -march=gs264e option for
+  Loongson 2K1000 processor.
+
 * The MIPS port now supports the Loongson 3A2000/3A3000 processor which
   implements the MIPS64r2 ISA, the Loongson-mmi ASE, Loongson-cam ASE,
   Loongson-ext ASE and Loongson-ext2 ASE instructions. Add -march=gs464e
index 16f759ee98b84b7b438a3e6e8daf60492af77ee8..194f1c3e0cf3bc38b39714260a691b7f0fa601cb 100644 (file)
@@ -3406,6 +3406,7 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
            case E_MIPS_MACH_LS2F: strcat (buf, ", loongson-2f"); break;
            case E_MIPS_MACH_GS464: strcat (buf, ", gs464"); break;
            case E_MIPS_MACH_GS464E: strcat (buf, ", gs464e"); break;
+           case E_MIPS_MACH_GS264E: strcat (buf, ", gs264e"); break;
            case E_MIPS_MACH_OCTEON: strcat (buf, ", octeon"); break;
            case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break;
            case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
index c74429956683cb56b19c6facdd2f095b56394ea0..ecae362353affe116fd6e591b166230b4713c7be 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+       * mips.c (EF_MIPS_MACH): New E_MIPS_MACH_GS264E.
+
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * mips.c (EF_MIPS_MACH): New E_MIPS_MACH_GS464E.
index 277300f8f60e52c1bc408ec41c68d2406e59b874..c724fd0ab439a62b4d2762ba8669be622434ea59 100644 (file)
@@ -237,6 +237,7 @@ enum
   E_MIPS_MACH_LS2F = 0x00A10000,
   E_MIPS_MACH_GS464 = 0x00A20000,
   E_MIPS_MACH_GS464E = 0x00A30000,
+  E_MIPS_MACH_GS264E = 0x00A40000,
 };
 
 // MIPS architecture
index a9413fa7ef55dafcd99f719f77c6f8b8528b75b1..8bb6ae8b5a76e67601ed66ffb6027a11dda89fb1 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+       * config/tc-mips.c (ISA_HAS_ODD_SINGLE_FPR): Exclude CPU_GS264E.
+       (mips_cpu_info_table): Add gs264e descriptors.
+       * doc/as.texi (march table): Add gs264e.
+
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * config/tc-mips.c (ISA_HAS_ODD_SINGLE_FPR): Exclude CPU_GS464E.
index 9c0a1fd88c0d19de0f0428df54ddc4efcb610418..c9fc6c6ec152e3086156d4c886542ebc5ede1bef 100644 (file)
@@ -423,7 +423,8 @@ static int mips_32bitmode = 0;
     || (ISA) == ISA_MIPS64R6           \
     || (CPU) == CPU_R5900)             \
    && ((CPU) != CPU_GS464              \
-    || (CPU) != CPU_GS464E))
+    || (CPU) != CPU_GS464E             \
+    || (CPU) != CPU_GS264E))
 
 /* Return true if ISA supports move to/from high part of a 64-bit
    floating-point register. */
@@ -19817,6 +19818,8 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
      ISA_MIPS64R2,     CPU_GS464 },
   { "gs464e",         0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT
      | ASE_LOONGSON_EXT2,      ISA_MIPS64R2,   CPU_GS464E },
+  { "gs264e",         0, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT
+     | ASE_LOONGSON_EXT2 | ASE_MSA | ASE_MSA64,        ISA_MIPS64R2,   CPU_GS264E },
 
   /* Cavium Networks Octeon CPU core */
   { "octeon",        0, 0,                     ISA_MIPS64R2, CPU_OCTEON },
index 2682e3650246d8d4835dd62f6a72995f785162c0..7751ce01d6c1f878d92df9792127c29771dcb72f 100644 (file)
@@ -439,6 +439,7 @@ loongson2e,
 loongson2f,
 gs464,
 gs464e,
+gs264e,
 octeon,
 octeon+,
 octeon2,
index 12aa7de5abae306bb52723c62dd4511fc361087e..0123fd7f549df24c5daafd25c5fba6bbdc1df186 100644 (file)
@@ -3984,6 +3984,7 @@ class Target_mips : public Sized_target<size, big_endian>
     mach_mips_loongson_2f     = 3002,
     mach_mips_gs464           = 3003,
     mach_mips_gs464e          = 3004,
+    mach_mips_gs264e          = 3005,
     mach_mips_sb1             = 12310201, // octal 'SB', 01
     mach_mips_octeon          = 6501,
     mach_mips_octeonp         = 6601,
@@ -4149,6 +4150,7 @@ class Target_mips : public Sized_target<size, big_endian>
     this->add_extension(mach_mips_octeon2, mach_mips_octeonp);
     this->add_extension(mach_mips_octeonp, mach_mips_octeon);
     this->add_extension(mach_mips_octeon, mach_mipsisa64r2);
+    this->add_extension(mach_mips_gs264e, mach_mips_gs464e);
     this->add_extension(mach_mips_gs464e, mach_mips_gs464);
     this->add_extension(mach_mips_gs464, mach_mipsisa64r2);
 
@@ -8866,6 +8868,9 @@ Target_mips<size, big_endian>::elf_mips_mach(elfcpp::Elf_Word flags)
     case elfcpp::E_MIPS_MACH_GS464E:
       return mach_mips_gs464e;
 
+    case elfcpp::E_MIPS_MACH_GS264E:
+      return mach_mips_gs264e;
+
     case elfcpp::E_MIPS_MACH_OCTEON3:
       return mach_mips_octeon3;
 
@@ -12533,6 +12538,8 @@ Target_mips<size, big_endian>::elf_mips_mach_name(elfcpp::Elf_Word e_flags)
       return "mips:gs464";
     case elfcpp::E_MIPS_MACH_GS464E:
       return "mips:gs464e";
+    case elfcpp::E_MIPS_MACH_GS264E:
+      return "mips:gs264e";
     case elfcpp::E_MIPS_MACH_OCTEON:
       return "mips:octeon";
     case elfcpp::E_MIPS_MACH_OCTEON2:
index 623c9548ba975bd61154fd3bdb6f21647d703fe7..6c19b1dadb84c6a4ce7fdad79683f9061bab3a77 100644 (file)
@@ -1,5 +1,9 @@
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
+       * elf/mips.h (E_MIPS_MACH_XXX): New E_MIPS_MACH_GS264E.
+       * opcode/mips.h (CPU_XXX): New CPU_GS264E.
+
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * elf/mips.h (E_MIPS_MACH_XXX): New E_MIPS_MACH_GS464E.
        * opcode/mips.h (CPU_XXX): New CPU_GS464E.
index e27b6af69b596d759d623d20b8f8822305e1c7d9..3858ee38d420ef99a7db6d78c801341eb25ccf81 100644 (file)
@@ -301,6 +301,7 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
 #define E_MIPS_MACH_LS2F        0x00A10000
 #define E_MIPS_MACH_GS464       0x00A20000
 #define E_MIPS_MACH_GS464E     0x00A30000
+#define E_MIPS_MACH_GS264E     0x00A40000
 \f
 /* Processor specific section indices.  These sections do not actually
    exist.  Symbols with a st_shndx field corresponding to one of these
index 4ad65c9fab18eee090fd0998a6a2199665f5f66c..fe8d16b1a5751b425155a9ac708869fdda302258 100644 (file)
@@ -1374,6 +1374,7 @@ static const unsigned int mips_isa_table[] = {
 #define CPU_LOONGSON_2F 3002
 #define CPU_GS464      3003
 #define CPU_GS464E     3004
+#define CPU_GS264E     3005
 #define CPU_OCTEON     6501
 #define CPU_OCTEONP    6601
 #define CPU_OCTEON2    6502
index 9d1e02fb996845d0177ef6bc5f3afd4846f14dcd..be694986da1f58681156bba604363378720f2bab 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+       * testsuite/ld-mips-elf/mips-elf-flags.exp: Run good_combination
+       gs264e and gs464e.
+
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * testsuite/ld-mips-elf/mips-elf-flags.exp: Run good_combination
index dcd33ba7632397fe4a346846d08ae5e872caff77..385dca937bc71e623d53d90ef04cf6f0f0dc44cc 100644 (file)
@@ -320,3 +320,7 @@ good_combination { "-march=gs464 -32" "-march=gs464e -32" } \
                 { gs464e o32 }                                 \
                 MIPS64r2 "None"                                \
                 { "Loongson MMI ASE" "Loongson CAM ASE" "Loongson EXT ASE" "Loongson EXT2 ASE" }
+good_combination { "-march=gs264e -32" "-march=gs464e -32" }   \
+                { gs264e o32 }                                 \
+                MIPS64r2 "None"                                \
+                { "Loongson MMI ASE" "Loongson CAM ASE" "Loongson EXT ASE" "Loongson EXT2 ASE" }
index 6f338f809fd4159cc298104799ed2ad249b4f16f..f536bc436863b0200109cac027b90f324710f396 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+       * mips-dis.c (mips_arch_choices): Add gs264e descriptors.
+
 2018-08-29  Chenghua Xu  <paul.hua.gm@gmail.com>
 
        * mips-dis.c (mips_arch_choices): Add gs464e descriptors.
index 0f5799d49b706fcaf32e09480fef11dbdcb16455..69919486fe46b3bb7902f15c7836697e5043110e 100644 (file)
@@ -645,6 +645,11 @@ const struct mips_arch_choice mips_arch_choices[] =
     | ASE_LOONGSON_EXT2, mips_cp0_names_numeric, NULL, 0, mips_cp1_names_mips3264,
     mips_hwr_names_numeric },
 
+  { "g264e",   1, bfd_mach_mips_gs464e, CPU_GS264E,
+    ISA_MIPS64R2, ASE_LOONGSON_MMI | ASE_LOONGSON_CAM | ASE_LOONGSON_EXT
+    | ASE_LOONGSON_EXT2 | ASE_MSA | ASE_MSA64, mips_cp0_names_numeric, NULL,
+    0, mips_cp1_names_mips3264, mips_hwr_names_numeric },
+
   { "octeon",   1, bfd_mach_mips_octeon, CPU_OCTEON,
     ISA_MIPS64R2 | INSN_OCTEON, 0, mips_cp0_names_numeric, NULL, 0,
     mips_cp1_names_mips3264, mips_hwr_names_numeric },
This page took 0.05435 seconds and 4 git commands to generate.