aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAndrew Bennett <andrew.bennett@imgtec.com>2014-04-23 11:24:30 +0100
committerAndrew Bennett <andrew.bennett@imgtec.com>2014-04-23 13:01:18 +0100
commit7d64c587c15f290d228ca550bb288d53f0eb2ac4 (patch)
tree72600357f6d2371bd27de80b4e69a4216855293a /gas
parentcd0449ab05e9045682a81bf521bd0c8732c98feb (diff)
downloadgdb-7d64c587c15f290d228ca550bb288d53f0eb2ac4.zip
gdb-7d64c587c15f290d228ca550bb288d53f0eb2ac4.tar.gz
gdb-7d64c587c15f290d228ca550bb288d53f0eb2ac4.tar.bz2
Add support for the MIPS eXtended Physical Address (XPA) ASE.
ChangeLog: binutils/ * doc/binutils.texi: Document the disassemble MIPS XPA instructions command line option. gas/ * config/tc-mips.c (options): Add OPTION_XPA and OPTION_NO_XPA. (md_longopts): Add xpa and no-xpa command line options. (mips_ases): Add MIPS XPA ASE. (mips_cpu_info_table): Update p5600 entry to allow the XPA ASE. * doc/as.texinfo: Document the MIPS XPA command line options. * doc/c-mips.texi: Document the MIPS XPA command line options, and assembler directives. gas/testsuite/ * gas/mips/mips.exp: Add xpa tests. * gas/mips/xpa.s: New test. * gas/mips/xpa.d: Likewise. include/ * opcode/mips.h (ASE_XPA): New define. opcodes/ * mips-dis.c (mips_arch_choices): Update mips32r2 and mips64r2 to allow the MIPS XPA ASE. (parse_mips_dis_option): Process the -Mxpa option. * mips-opc.c (XPA): New define. (mips_builtin_opcodes): Add MIPS XPA instructions and move the locations of the ctc0 and cfc0 instructions.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-mips.c15
-rw-r--r--gas/doc/as.texinfo7
-rw-r--r--gas/doc/c-mips.texi13
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/mips/mips.exp2
-rw-r--r--gas/testsuite/gas/mips/xpa.d24
-rw-r--r--gas/testsuite/gas/mips/xpa.s29
8 files changed, 104 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index dd67c862..5c5137a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2014-04-23 Andrew Bennett <andrew.bennett@imgtec.com>
+
+ * config/tc-mips.c (options): Add OPTION_XPA and OPTION_NO_XPA.
+ (md_longopts): Add xpa and no-xpa command line options.
+ (mips_ases): Add MIPS XPA ASE.
+ (mips_cpu_info_table): Update p5600 entry to allow the XPA ASE.
+ * doc/as.texinfo: Document the MIPS XPA command line options.
+ * doc/c-mips.texi: Document the MIPS XPA command line options,
+ and assembler directives.
+
2014-04-22 Sandra Loosemore <sandra@codesourcery.com>
* config/tc-nios2.c (nios2_consume_arg): Add case for 'E' to
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 47de8d3..960169e 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1338,6 +1338,8 @@ enum options
OPTION_NO_DSPR2,
OPTION_EVA,
OPTION_NO_EVA,
+ OPTION_XPA,
+ OPTION_NO_XPA,
OPTION_MICROMIPS,
OPTION_NO_MICROMIPS,
OPTION_MCU,
@@ -1447,6 +1449,8 @@ struct option md_longopts[] =
{"mno-virt", no_argument, NULL, OPTION_NO_VIRT},
{"mmsa", no_argument, NULL, OPTION_MSA},
{"mno-msa", no_argument, NULL, OPTION_NO_MSA},
+ {"mxpa", no_argument, NULL, OPTION_XPA},
+ {"mno-xpa", no_argument, NULL, OPTION_NO_XPA},
/* Old-style architecture options. Don't add more of these. */
{"m4650", no_argument, NULL, OPTION_M4650},
@@ -1599,7 +1603,11 @@ static const struct mips_ase mips_ases[] = {
{ "msa", ASE_MSA, ASE_MSA64,
OPTION_MSA, OPTION_NO_MSA,
- 2, 2, 2, 2 }
+ 2, 2, 2, 2 },
+
+ { "xpa", ASE_XPA, 0,
+ OPTION_XPA, OPTION_NO_XPA,
+ 2, 2, -1, -1 }
};
/* The set of ASEs that require -mfp64. */
@@ -17903,7 +17911,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
{ "1004kf", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
{ "1004kf1_1", 0, ASE_DSP | ASE_MT, ISA_MIPS32R2, CPU_MIPS32R2 },
/* P5600 with EVA and Virtualization ASEs, other ASEs are optional. */
- { "p5600", 0, ASE_VIRT | ASE_EVA, ISA_MIPS32R2, CPU_MIPS32R2 },
+ { "p5600", 0, ASE_VIRT | ASE_EVA | ASE_XPA, ISA_MIPS32R2, CPU_MIPS32R2 },
/* MIPS 64 */
{ "5kc", 0, 0, ISA_MIPS64, CPU_MIPS64 },
@@ -18161,6 +18169,9 @@ MIPS options:\n\
-mmsa generate MSA instructions\n\
-mno-msa do not generate MSA instructions\n"));
fprintf (stream, _("\
+-mxpa generate eXtended Physical Address (XPA) instructions\n\
+-mno-xpa do not generate eXtended Physical Address (XPA) instructions\n"));
+ fprintf (stream, _("\
-mvirt generate Virtualization instructions\n\
-mno-virt do not generate Virtualization instructions\n"));
fprintf (stream, _("\
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index 7432fba..d16bbf6 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -413,6 +413,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
[@b{-mdsp}] [@b{-mno-dsp}]
[@b{-mdspr2}] [@b{-mno-dspr2}]
[@b{-mmsa}] [@b{-mno-msa}]
+ [@b{-mxpa}] [@b{-mno-xpa}]
[@b{-mmt}] [@b{-mno-mt}]
[@b{-mmcu}] [@b{-mno-mcu}]
[@b{-minsn32}] [@b{-mno-insn32}]
@@ -1357,6 +1358,12 @@ Generate code for the MIPS SIMD Architecture Extension.
This tells the assembler to accept MSA instructions.
@samp{-mno-msa} turns off this option.
+@item -mxpa
+@itemx -mno-xpa
+Generate code for the MIPS eXtended Physical Address (XPA) Extension.
+This tells the assembler to accept XPA instructions.
+@samp{-mno-xpa} turns off this option.
+
@item -mmt
@itemx -mno-mt
Generate code for the MT Application Specific Extension.
diff --git a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi
index 3778ae2..0c5e82d 100644
--- a/gas/doc/c-mips.texi
+++ b/gas/doc/c-mips.texi
@@ -183,6 +183,12 @@ Generate code for the MIPS SIMD Architecture Extension.
This tells the assembler to accept MSA instructions.
@samp{-mno-msa} turns off this option.
+@item -mxpa
+@itemx -mno-xpa
+Generate code for the MIPS eXtended Physical Address (XPA) Extension.
+This tells the assembler to accept XPA instructions.
+@samp{-mno-xpa} turns off this option.
+
@item -mvirt
@itemx -mno-virt
Generate code for the Virtualization Application Specific Extension.
@@ -879,6 +885,13 @@ from the Virtualization Application Specific Extension from that point
on in the assembly. The @code{.set novirt} directive prevents Virtualization
instructions from being accepted.
+@cindex MIPS eXtended Physical Address (XPA) instruction generation override
+@kindex @code{.set xpa}
+@kindex @code{.set noxpa}
+The directive @code{.set xpa} makes the assembler accept instructions
+from the XPA Extension from that point on in the assembly. The
+@code{.set noxpa} directive prevents XPA instructions from being accepted.
+
Traditional MIPS assemblers do not support these directives.
@node MIPS Floating-Point
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 9b3d9c3..492450b 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2014-04-23 Andrew Bennett <andrew.bennett@imgtec.com>
+
+ * gas/mips/mips.exp: Add xpa tests.
+ * gas/mips/xpa.s: New test.
+ * gas/mips/xpa.d: Likewise.
+
2014-04-22 Sandra Loosemore <sandra@codesourcery.com>
* gas/nios2/selftest.s: New.
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 628f482..b0d8ac2 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1170,6 +1170,8 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test_arches "msa-relax" [mips_arch_list_matching mips32r2]
run_dump_test_arches "msa-branch" [mips_arch_list_matching mips32r2]
+ run_dump_test_arches "xpa" [mips_arch_list_matching mips32r2 !micromips]
+
run_dump_test "pcrel-1"
run_dump_test "pcrel-2"
run_list_test "pcrel-3" "" "Invalid cross-section PC-relative references"
diff --git a/gas/testsuite/gas/mips/xpa.d b/gas/testsuite/gas/mips/xpa.d
new file mode 100644
index 0000000..f1047c9
--- /dev/null
+++ b/gas/testsuite/gas/mips/xpa.d
@@ -0,0 +1,24 @@
+#objdump: -dr --prefix-addresses --show-raw-insn -Mxpa,cp0-names=mips32r2
+#name: XPA instructions
+#as: -32 -mxpa
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> 40420800 mfhc0 v0,c0_random
+[0-9a-f]+ <[^>]*> 40428000 mfhc0 v0,c0_config
+[0-9a-f]+ <[^>]*> 40420002 mfhc0 v0,c0_mvpconf0
+[0-9a-f]+ <[^>]*> 40420007 mfhc0 v0,\$0,7
+[0-9a-f]+ <[^>]*> 40c20800 mthc0 v0,c0_random
+[0-9a-f]+ <[^>]*> 40c28000 mthc0 v0,c0_config
+[0-9a-f]+ <[^>]*> 40c20002 mthc0 v0,c0_mvpconf0
+[0-9a-f]+ <[^>]*> 40c20007 mthc0 v0,\$0,7
+[0-9a-f]+ <[^>]*> 40620c00 mfhgc0 v0,c0_random
+[0-9a-f]+ <[^>]*> 40628400 mfhgc0 v0,c0_config
+[0-9a-f]+ <[^>]*> 40620402 mfhgc0 v0,c0_mvpconf0
+[0-9a-f]+ <[^>]*> 40620407 mfhgc0 v0,\$0,7
+[0-9a-f]+ <[^>]*> 40620e00 mthgc0 v0,c0_random
+[0-9a-f]+ <[^>]*> 40628600 mthgc0 v0,c0_config
+[0-9a-f]+ <[^>]*> 40620602 mthgc0 v0,c0_mvpconf0
+[0-9a-f]+ <[^>]*> 40620607 mthgc0 v0,\$0,7
+ ...
diff --git a/gas/testsuite/gas/mips/xpa.s b/gas/testsuite/gas/mips/xpa.s
new file mode 100644
index 0000000..4d91f75
--- /dev/null
+++ b/gas/testsuite/gas/mips/xpa.s
@@ -0,0 +1,29 @@
+ .text
+ .set noat
+ .set noreorder
+ .set nomacro
+test_xpa:
+
+ mfhc0 $2, $1
+ mfhc0 $2, $16
+ mfhc0 $2, $0, 2
+ mfhc0 $2, $0, 7
+
+ mthc0 $2, $1
+ mthc0 $2, $16
+ mthc0 $2, $0, 2
+ mthc0 $2, $0, 7
+
+ mfhgc0 $2, $1
+ mfhgc0 $2, $16
+ mfhgc0 $2, $0, 2
+ mfhgc0 $2, $0, 7
+
+ mthgc0 $2, $1
+ mthgc0 $2, $16
+ mthgc0 $2, $0, 2
+ mthgc0 $2, $0, 7
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 2
+ .space 8