[10/21] Add the m6201 architecture

Message ID 20250402121759.1962001-11-jovan.dmitrovic@htecgroup.com
State New
Headers
Series Integrate MIPS-Specific Support |

Commit Message

Jovan Dmitrovic April 2, 2025, 12:18 p.m. UTC
  From: Matthew Fortune <matthew.fortune@imgtec.com>

Support for the m6201 architecture has been added.
The specifications include that the m6201 is based
on the MIPS32R6 architecture, with the MCU (MicroController) ASE.

Cherry-picked 047d526
from https://github.com/MIPS/binutils-gdb

Signed-off-by: Matthew Fortune <matthew.fortune@mips.com>
Signed-off-by: Faraz Shahbazker <fshahbazker@wavecomp.com>
Signed-off-by: Milica Matic <milica.matic@htecgroup.com>

gas/
	* config/tc-mips.c (mips_cpu_info_table): Add m6201.
	* doc/c-mips.texi: Add documentation for m6201.

gas/testsuite/
	* gas/mips/elf_mach_6201.d: New test.
	* gas/mips/mips.exp: Run the new test.
---
 gas/config/tc-mips.c                   |  2 ++
 gas/doc/c-mips.texi                    |  1 +
 gas/testsuite/gas/mips/elf_mach_6201.d | 22 ++++++++++++++++++++++
 gas/testsuite/gas/mips/mips.exp        |  1 +
 4 files changed, 26 insertions(+)
 create mode 100644 gas/testsuite/gas/mips/elf_mach_6201.d
  

Patch

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index ce58bae8a7f..0019e7d6214 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -20423,6 +20423,8 @@  static const struct mips_cpu_info mips_cpu_info_table[] =
   { "m5101",          0, ASE_MCU,		ISA_MIPS32R5, CPU_MIPS32R5 },
   /* P5600 with EVA and Virtualization ASEs, other ASEs are optional.  */
   { "p5600",          0, ASE_VIRT | ASE_EVA | ASE_XPA,	ISA_MIPS32R5, CPU_MIPS32R5 },
+  /* M6200 family */
+  { "m6201",          0, ASE_MCU,		ISA_MIPS32R6, CPU_MIPS32R6 },
 
   /* MIPS 64 */
   { "5kc",            0, 0,			ISA_MIPS64,   CPU_MIPS64 },
diff --git a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi
index 8ed41e1d2f4..e4979e39d78 100644
--- a/gas/doc/c-mips.texi
+++ b/gas/doc/c-mips.texi
@@ -449,6 +449,7 @@  interaptiv-mr2,
 m5100,
 m5101,
 p5600,
+m6201,
 5kc,
 5kf,
 20kc,
diff --git a/gas/testsuite/gas/mips/elf_mach_6201.d b/gas/testsuite/gas/mips/elf_mach_6201.d
new file mode 100644
index 00000000000..7a12a04d70f
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf_mach_6201.d
@@ -0,0 +1,22 @@ 
+#readelf: -Ah
+#name: ELF m6201 markings
+#as: -32 -march=m6201
+#source: empty.s
+
+ELF Header:
+#...
+  Flags: +0x9......., .*mips32r6.*
+#...
+
+MIPS ABI Flags Version: 0
+
+ISA: MIPS32r6
+GPR size: 32
+CPR1 size: 64
+CPR2 size: 0
+FP ABI: .*
+ISA Extension: None
+ASEs:
+	MCU \(MicroController\) ASE
+FLAGS 1: .*
+FLAGS 2: .*
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 5c34e69add1..a5306642808 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1189,6 +1189,7 @@  if { [istarget mips*-*-vxworks*] } {
     # Verify that machine markings are handled properly.
     run_dump_test "elf_mach_5900"
     run_dump_test "elf_mach_interaptiv-mr2"
+    run_dump_test "elf_mach_6201"
     run_dump_test "elf_mach_p6600"
     run_dump_test "elf_mach_i6400"
     run_dump_test "elf_mach_i6500"