[2/2,MIPS] Fix testcase for MIPSr6

Message ID 20200118142528.98549-2-syq@debian.org
State New
Headers show
Series
  • [1/2,MIPS] default output as r6 when default target as r6
Related show

Commit Message

YunQiang Su Jan. 18, 2020, 2:25 p.m.
The major changes include:
   1. disable microMIPS and MIPS16 for r6
   2. FP64 only support for 32r6, so Tag_GNU_MIPS_ABI_FP changes
   3. Encoding for jr changed: 03e00008 -> 03e00009
   4. Some insn removed: jalx, eva, lwl
   5. MIPSr6 supports NAN2008 only, so drop lagacy nan tests
---
 .../binutils-all/mips/mips-xpa-virt-1.d       |   8 +-
 .../binutils-all/mips/mips-xpa-virt-2.d       |   4 +-
 .../binutils-all/mips/mips-xpa-virt-3.d       |   4 +-
 binutils/testsuite/binutils-all/mips/mips.exp |  23 +-
 gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d   |   2 +-
 gas/testsuite/gas/mips/branch-section-1.d     |   2 +-
 gas/testsuite/gas/mips/branch-section-3.d     |   2 +-
 gas/testsuite/gas/mips/branch-weak-1.d        |   2 +-
 gas/testsuite/gas/mips/elf-rel.s              |  36 +-
 gas/testsuite/gas/mips/elfel-rel.d            |  12 +-
 gas/testsuite/gas/mips/mips.exp               | 971 ++++++++++--------
 gas/testsuite/gas/mips/mipsr6@cache.d         |   2 +-
 gas/testsuite/gas/mips/mipsr6@hwr-names.d     |   2 +-
 gas/testsuite/gas/mips/mipsr6@pref.d          |   2 +-
 gas/testsuite/gas/mips/option-pic-1.d         |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-4-01.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-11.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-4-41.d      |   1 +
 ld/testsuite/ld-mips-elf/attr-gnu-8-00.d      |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-8-01.d      |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-8-02.d      |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-8-10.d      |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-8-11.d      |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-8-20.d      |   2 +-
 ld/testsuite/ld-mips-elf/attr-gnu-8-22.d      |   2 +-
 ld/testsuite/ld-mips-elf/emit-relocs-1.d      |   2 +-
 .../ld-mips-elf/export-class-call16-n32.dd    |   8 +-
 .../ld-mips-elf/export-class-call16-n64.dd    |   8 +-
 .../ld-mips-elf/export-class-call16-o32.dd    |   8 +-
 ld/testsuite/ld-mips-elf/gp-disp-sym.s        |   2 +-
 ld/testsuite/ld-mips-elf/jalr3.dd             |   2 +-
 ld/testsuite/ld-mips-elf/jalr4.dd             |   8 +-
 ld/testsuite/ld-mips-elf/mips-elf.exp         | 310 +++---
 ld/testsuite/ld-mips-elf/n64-plt-1.dd         |   2 +-
 ld/testsuite/ld-mips-elf/n64-plt-4.dd         |   2 +-
 ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d   |   2 +-
 36 files changed, 785 insertions(+), 660 deletions(-)

-- 
2.25.0

Patch

diff --git a/binutils/testsuite/binutils-all/mips/mips-xpa-virt-1.d b/binutils/testsuite/binutils-all/mips/mips-xpa-virt-1.d
index 1bb38ac0c4..0202fd5a98 100644
--- a/binutils/testsuite/binutils-all/mips/mips-xpa-virt-1.d
+++ b/binutils/testsuite/binutils-all/mips/mips-xpa-virt-1.d
@@ -6,8 +6,8 @@ 
 .*: +file format .*mips.*
 
 Disassembly of section \.text:
-[0-9a-f]+ <[^>]*> 40020800 	mfc0	v0,c0_random
-[0-9a-f]+ <[^>]*> 40420800 	cfc0	v0,c0_random
-[0-9a-f]+ <[^>]*> 40620800 	0x40620800
-[0-9a-f]+ <[^>]*> 40620c00 	0x40620c00
+[0-9a-f]+ <[^>]*> 40020800 	(mfc0|mfhc0)	v0,c0_random
+[0-9a-f]+ <[^>]*> 40420800 	(cfc0|mfhc0)	v0,c0_random
+[0-9a-f]+ <[^>]*> 40620800 	(0x40620800|mfgc0[\t ]+v0,c0_random)
+[0-9a-f]+ <[^>]*> 40620c00 	(0x40620c00|mfhgc0[\t ]+v0,c0_random)
 	\.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips-xpa-virt-2.d b/binutils/testsuite/binutils-all/mips/mips-xpa-virt-2.d
index 58bd5fa9bf..311fa34ed2 100644
--- a/binutils/testsuite/binutils-all/mips/mips-xpa-virt-2.d
+++ b/binutils/testsuite/binutils-all/mips/mips-xpa-virt-2.d
@@ -8,6 +8,6 @@ 
 Disassembly of section \.text:
 [0-9a-f]+ <[^>]*> 40020800 	mfc0	v0,c0_random
 [0-9a-f]+ <[^>]*> 40420800 	mfhc0	v0,c0_random
-[0-9a-f]+ <[^>]*> 40620800 	0x40620800
-[0-9a-f]+ <[^>]*> 40620c00 	0x40620c00
+[0-9a-f]+ <[^>]*> 40620800 	(0x40620800|mfgc0[\t ]+v0,c0_random)
+[0-9a-f]+ <[^>]*> 40620c00 	(0x40620c00|mfhgc0[\t ]+v0,c0_random)
 	\.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips-xpa-virt-3.d b/binutils/testsuite/binutils-all/mips/mips-xpa-virt-3.d
index f42f7d71ae..23878fb452 100644
--- a/binutils/testsuite/binutils-all/mips/mips-xpa-virt-3.d
+++ b/binutils/testsuite/binutils-all/mips/mips-xpa-virt-3.d
@@ -7,7 +7,7 @@ 
 
 Disassembly of section \.text:
 [0-9a-f]+ <[^>]*> 40020800 	mfc0	v0,c0_random
-[0-9a-f]+ <[^>]*> 40420800 	cfc0	v0,c0_random
+[0-9a-f]+ <[^>]*> 40420800 	(cfc0|mfhc0)	v0,c0_random
 [0-9a-f]+ <[^>]*> 40620800 	mfgc0	v0,c0_random
-[0-9a-f]+ <[^>]*> 40620c00 	0x40620c00
+[0-9a-f]+ <[^>]*> 40620c00 	(0x40620c00|mfhgc0[\t ]+v0,c0_random)
 	\.\.\.
diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp
index 17011717ca..fb826e1799 100644
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -32,6 +32,7 @@  set has_newabi [expr [istarget *-*-irix6*] \
 		     || [istarget mips*-sde-elf*] \
 		     || [istarget mips*-mti-elf*] \
 		     || [istarget mips*-img-elf*]]
+set is_r6 [expr [istarget mipsisa*r6*-*]]
 
 run_dump_test "mips-ase-1"
 run_dump_test "mips-ase-2"
@@ -40,17 +41,19 @@  run_dump_test "mips-xpa-virt-1"
 run_dump_test "mips-xpa-virt-2"
 run_dump_test "mips-xpa-virt-3"
 run_dump_test "mips-xpa-virt-4"
-run_dump_test "mixed-mips16"
+if { !$is_r6 } {
+  run_dump_test "mixed-mips16"
+  run_dump_test "mixed-mips16-micromips"
+  run_dump_test "mips16-undecoded"
+  run_dump_test "mips16e2-undecoded"
+  run_dump_test "mips16-pcrel"
+  run_dump_test "mips16-extend-noinsn"
+  run_dump_test "mips16-extend-insn"
+  run_dump_test "mips16e2-extend-insn"
+  run_dump_test "mips16-alias"
+  run_dump_test "mips16-noalias"
+}
 run_dump_test "mixed-micromips"
-run_dump_test "mixed-mips16-micromips"
-run_dump_test "mips16-undecoded"
-run_dump_test "mips16e2-undecoded"
-run_dump_test "mips16-pcrel"
-run_dump_test "mips16-extend-noinsn"
-run_dump_test "mips16-extend-insn"
-run_dump_test "mips16e2-extend-insn"
-run_dump_test "mips16-alias"
-run_dump_test "mips16-noalias"
 
 run_dump_test "mips-note-2"
 run_dump_test "mips-note-2r"
diff --git a/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d b/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d
index 97fc8bf3f4..4a42b844a6 100644
--- a/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d
+++ b/gas/testsuite/gas/mips/attr-gnu-abi-msa-1.d
@@ -4,7 +4,7 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: 128-bit MSA
 
 #...
diff --git a/gas/testsuite/gas/mips/branch-section-1.d b/gas/testsuite/gas/mips/branch-section-1.d
index 7782d0c075..08c678d27e 100644
--- a/gas/testsuite/gas/mips/branch-section-1.d
+++ b/gas/testsuite/gas/mips/branch-section-1.d
@@ -12,6 +12,6 @@  Disassembly of section \.text:
 	\.\.\.
 
 Disassembly of section \.init:
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/branch-section-3.d b/gas/testsuite/gas/mips/branch-section-3.d
index b10fcde731..8276316553 100644
--- a/gas/testsuite/gas/mips/branch-section-3.d
+++ b/gas/testsuite/gas/mips/branch-section-3.d
@@ -13,6 +13,6 @@  Disassembly of section \.text:
 	\.\.\.
 
 Disassembly of section \.init:
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/branch-weak-1.d b/gas/testsuite/gas/mips/branch-weak-1.d
index 859a2ca69f..349b5d96c8 100644
--- a/gas/testsuite/gas/mips/branch-weak-1.d
+++ b/gas/testsuite/gas/mips/branch-weak-1.d
@@ -10,6 +10,6 @@  Disassembly of section \.text:
 [ 	]*[0-9a-f]+: R_MIPS_PC16	bar
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/gas/testsuite/gas/mips/elf-rel.s b/gas/testsuite/gas/mips/elf-rel.s
index 873bc5fd86..06c67a659b 100644
--- a/gas/testsuite/gas/mips/elf-rel.s
+++ b/gas/testsuite/gas/mips/elf-rel.s
@@ -12,12 +12,12 @@  l2	= l0+49150
 	lui	$at,%hi(l0-4)
 	lui	$at,%hi(l1+0x8000)
 l1:		
-	addi	$at,$at,%lo(l1)
-	addi	$at,$at,%lo(l1+0x10004)
-	addi	$at,$at,%lo(l1+0x10000)
-	addi	$at,$at,%lo(l1+4)
-	addi	$at,$at,%lo(l1+0x8000)
-	addi	$at,$at,%lo(l0-4)
+	addiu	$at,$at,%lo(l1)
+	addiu	$at,$at,%lo(l1+0x10004)
+	addiu	$at,$at,%lo(l1+0x10000)
+	addiu	$at,$at,%lo(l1+4)
+	addiu	$at,$at,%lo(l1+0x8000)
+	addiu	$at,$at,%lo(l0-4)
 
 	lui	$at,%hi(l2)
 	lui	$at,%hi(l2+4)
@@ -25,12 +25,12 @@  l1:
 	lui	$at,%hi(l2+0x10004)
 	lui	$at,%hi(l2-4)
 	lui	$at,%hi(l2+0x8000)
-	addi	$at,$at,%lo(l2)
-	addi	$at,$at,%lo(l2+4)
-	addi	$at,$at,%lo(l2+0x10000)
-	addi	$at,$at,%lo(l2+0x10004)
-	addi	$at,$at,%lo(l2+0x8000)
-	addi	$at,$at,%lo(l2-4)
+	addiu	$at,$at,%lo(l2)
+	addiu	$at,$at,%lo(l2+4)
+	addiu	$at,$at,%lo(l2+0x10000)
+	addiu	$at,$at,%lo(l2+0x10004)
+	addiu	$at,$at,%lo(l2+0x8000)
+	addiu	$at,$at,%lo(l2-4)
 
 	lui	$at,%hi((l2))
 	lui	$at,%hi(((l2+4)))
@@ -38,9 +38,9 @@  l1:
 	lui	$at,%hi(((((l2+0x10004)))))
 	lui	$at,%hi((((((l2-4))))))
 	lui	$at,%hi(((((((l2+0x8000)))))))
-	addi	$at,$at,%lo((l2))
-	addi	$at,$at,%lo(((l2+4)))
-	addi	$at,$at,%lo((((l2+0x10000))))
-	addi	$at,$at,%lo(((((l2+0x10004)))))
-	addi	$at,$at,%lo((((((l2+0x8000))))))
-	addi	$at,$at,%lo(((((((l2-4)))))))
+	addiu	$at,$at,%lo((l2))
+	addiu	$at,$at,%lo(((l2+4)))
+	addiu	$at,$at,%lo((((l2+0x10000))))
+	addiu	$at,$at,%lo(((((l2+0x10004)))))
+	addiu	$at,$at,%lo((((((l2+0x8000))))))
+	addiu	$at,$at,%lo(((((((l2-4)))))))
diff --git a/gas/testsuite/gas/mips/elfel-rel.d b/gas/testsuite/gas/mips/elfel-rel.d
index bac44edbef..c6b2b10cee 100644
--- a/gas/testsuite/gas/mips/elfel-rel.d
+++ b/gas/testsuite/gas/mips/elfel-rel.d
@@ -49,12 +49,12 @@  OFFSET [ ]+ TYPE              VALUE
 
 Contents of section \.text:
  0000 0000013c 0000013c 0100013c 0100013c  .*
- 0010 0000013c 0100013c 18002120 1c002120  .*
- 0020 18002120 1c002120 18802120 fcff2120  .*
+ 0010 0000013c 0100013c 18002124 1c002124  .*
+ 0020 18002124 1c002124 18802124 fcff2124  .*
  0030 0100013c 0100013c 0200013c 0200013c  .*
- 0040 0100013c 0100013c febf2120 02c02120  .*
- 0050 febf2120 02c02120 fe3f2120 fabf2120  .*
+ 0040 0100013c 0100013c febf2124 02c02124  .*
+ 0050 febf2124 02c02124 fe3f2124 fabf2124  .*
  0060 0100013c 0100013c 0200013c 0200013c  .*
- 0070 0100013c 0100013c febf2120 02c02120  .*
- 0080 febf2120 02c02120 fe3f2120 fabf2120  .*
+ 0070 0100013c 0100013c febf2124 02c02124  .*
+ 0080 febf2124 02c02124 fe3f2124 fabf2124  .*
 #pass
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 51d0d1fc5d..5d57ec547c 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -560,6 +560,7 @@  if { [istarget mips*-*-vxworks*] } {
     set has_newabi [expr [istarget *-*-irix6*] || [istarget mips*-*-linux*] \
                          || [istarget mips*-sde-elf*] || [istarget mips*-mti-elf*] \
                          || [istarget mips*-img-elf*]]
+    set is_r6 [expr [istarget mipsisa*r6*-*]]
 
     if { [istarget "mips*-*-*linux*"]
 	 || [istarget "mips*-sde-elf*"]
@@ -586,7 +587,8 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test "break20"
     run_dump_test "trap20"
 
-    run_dump_test_arches "beq"		[mips_arch_list_matching mips1]
+    #FIXME: why it different with/without -defsym r6 option?
+    run_dump_test_arches "beq"		[mips_arch_list_matching mips1 !mips32r6]
     run_dump_test_arches "bge"		[mips_arch_list_matching mips1]
     run_dump_test_arches "bgeu"		[mips_arch_list_matching mips1]
     run_dump_test_arches "blt"		[mips_arch_list_matching mips1]
@@ -619,100 +621,111 @@  if { [istarget mips*-*-vxworks*] } {
     # close below 4096 as this is the default obstack size limit that
     # we use and some space will have been already consumed.  The exact
     # amount depends on the host's programming model.
-    for { set count 960 } { $count <= 1024 } { incr count } {
-	run_list_test "branch-swap-2" "--defsym count=$count" \
-	    "MIPS branch swapping ($count)"
+
+    if { !$is_r6 } {
+        for { set count 960 } { $count <= 1024 } { incr count } {
+            run_list_test "branch-swap-2" "--defsym count=$count" \
+                "MIPS branch swapping ($count)"
+        }
     }
 
     run_dump_test_arches "branch-swap-3" [mips_arch_list_all]
     run_dump_test_arches "branch-swap-4" [mips_arch_list_all]
 
     run_dump_test "branch-section-1"
-    run_dump_test "branch-section-2"
-    run_dump_test "branch-section-3"
-    run_dump_test "branch-section-4"
-    run_dump_test "branch-extern-1"
-    run_dump_test "branch-extern-2"
-    run_dump_test "branch-extern-3"
-    run_dump_test "branch-extern-4"
-    run_dump_test "branch-weak-1"
-    run_dump_test "branch-weak-2"
-    run_dump_test "branch-weak-3"
-    run_dump_test "branch-weak-4"
-    run_dump_test "branch-weak-5"
-    run_dump_test "branch-weak-6"
-    run_dump_test "branch-weak-7"
-    run_dump_test "branch-local-1"
-    run_dump_test "branch-local-2"
-    run_dump_test "branch-local-ignore-2"
-    run_dump_test "branch-local-3"
-    run_dump_test "branch-local-ignore-3"
-    run_dump_test "branch-local-4"
-    run_dump_test "branch-local-5"
-    run_dump_test "branch-local-ignore-5"
-    run_dump_test "branch-local-6"
-    run_dump_test "branch-local-ignore-6"
-    run_dump_test "branch-local-7"
-    if $has_newabi {
-	run_dump_test "branch-local-n32-1"
-	run_dump_test "branch-local-n32-2"
-	run_dump_test "branch-local-ignore-n32-2"
-	run_dump_test "branch-local-n32-3"
-	run_dump_test "branch-local-ignore-n32-3"
-	run_dump_test "branch-local-n32-4"
-	run_dump_test "branch-local-n32-5"
-	run_dump_test "branch-local-ignore-n32-5"
-	run_dump_test "branch-local-n32-6"
-	run_dump_test "branch-local-ignore-n32-6"
-	run_dump_test "branch-local-n32-7"
-	run_dump_test "branch-local-n64-1"
-	run_dump_test "branch-local-n64-2"
-	run_dump_test "branch-local-ignore-n64-2"
-	run_dump_test "branch-local-n64-3"
-	run_dump_test "branch-local-ignore-n64-3"
-	run_dump_test "branch-local-n64-4"
-	run_dump_test "branch-local-n64-5"
-	run_dump_test "branch-local-ignore-n64-5"
-	run_dump_test "branch-local-n64-6"
-	run_dump_test "branch-local-ignore-n64-6"
-	run_dump_test "branch-local-n64-7"
-    }
-    run_dump_test "branch-addend"
-    run_dump_test "branch-addend-micromips"
-    if $has_newabi {
-	run_dump_test "branch-addend-n32"
-	run_dump_test "branch-addend-micromips-n32"
-	run_dump_test "branch-addend-n64"
-	run_dump_test "branch-addend-micromips-n64"
+    if { !$is_r6 } {
+        run_dump_test "branch-section-2"
+        run_dump_test "branch-section-3"
+        run_dump_test "branch-section-4"
+        run_dump_test "branch-extern-1"
+        run_dump_test "branch-extern-2"
+        run_dump_test "branch-extern-3"
+        run_dump_test "branch-extern-4"
     }
-    run_dump_test "branch-absolute"
-    run_dump_test "branch-absolute-addend"
-    if $has_newabi {
-	run_dump_test "branch-absolute-n32"
-	run_dump_test "branch-absolute-addend-n32"
-	run_dump_test "branch-absolute-n64"
-	run_dump_test "branch-absolute-addend-n64"
+    run_dump_test "branch-weak-1"
+    if { !$is_r6 } {
+        run_dump_test "branch-weak-2"
+        run_dump_test "branch-weak-3"
+        run_dump_test "branch-weak-4"
+        run_dump_test "branch-weak-5"
+        run_dump_test "branch-weak-6"
+        run_dump_test "branch-weak-7"
+        run_dump_test "branch-local-1"
+        run_dump_test "branch-local-2"
+        run_dump_test "branch-local-ignore-2"
+        run_dump_test "branch-local-3"
+        run_dump_test "branch-local-ignore-3"
+        run_dump_test "branch-local-4"
+        run_dump_test "branch-local-5"
+        run_dump_test "branch-local-ignore-5"
+        run_dump_test "branch-local-6"
+        run_dump_test "branch-local-ignore-6"
+        run_dump_test "branch-local-7"
+        if $has_newabi {
+            run_dump_test "branch-local-n32-1"
+            run_dump_test "branch-local-n32-2"
+            run_dump_test "branch-local-ignore-n32-2"
+            run_dump_test "branch-local-n32-3"
+            run_dump_test "branch-local-ignore-n32-3"
+            run_dump_test "branch-local-n32-4"
+            run_dump_test "branch-local-n32-5"
+            run_dump_test "branch-local-ignore-n32-5"
+            run_dump_test "branch-local-n32-6"
+            run_dump_test "branch-local-ignore-n32-6"
+            run_dump_test "branch-local-n32-7"
+            run_dump_test "branch-local-n64-1"
+            run_dump_test "branch-local-n64-2"
+            run_dump_test "branch-local-ignore-n64-2"
+            run_dump_test "branch-local-n64-3"
+            run_dump_test "branch-local-ignore-n64-3"
+            run_dump_test "branch-local-n64-4"
+            run_dump_test "branch-local-n64-5"
+            run_dump_test "branch-local-ignore-n64-5"
+            run_dump_test "branch-local-n64-6"
+            run_dump_test "branch-local-ignore-n64-6"
+            run_dump_test "branch-local-n64-7"
+        }
+
+        run_dump_test "branch-addend"
+        run_dump_test "branch-addend-micromips"
+        if $has_newabi {
+	    run_dump_test "branch-addend-n32"
+	    run_dump_test "branch-addend-micromips-n32"
+	    run_dump_test "branch-addend-n64"
+	    run_dump_test "branch-addend-micromips-n64"
+        }
+
+        run_dump_test "branch-absolute"
+        run_dump_test "branch-absolute-addend"
+        if $has_newabi {
+            run_dump_test "branch-absolute-n32"
+            run_dump_test "branch-absolute-addend-n32"
+            run_dump_test "branch-absolute-n64"
+            run_dump_test "branch-absolute-addend-n64"
+        }
     }
 
     run_dump_test_arches "nal-1" [mips_arch_list_matching mips1 !micromips]
     run_dump_test_arches "nal-2" [mips_arch_list_matching mips1 !micromips]
 
-    run_dump_test "compact-eh-eb-1"
-    run_dump_test "compact-eh-eb-2"
-    run_dump_test "compact-eh-eb-3"
-    run_dump_test "compact-eh-eb-4"
-    run_dump_test "compact-eh-eb-5"
-    run_dump_test "compact-eh-eb-6"
-    run_dump_test "compact-eh-eb-7"
-    run_dump_test "compact-eh-el-1"
-    run_dump_test "compact-eh-el-2"
-    run_dump_test "compact-eh-el-3"
-    run_dump_test "compact-eh-el-4"
-    run_dump_test "compact-eh-el-5"
-    run_dump_test "compact-eh-el-6"
-    run_dump_test "compact-eh-el-7"
-    run_list_test "compact-eh-err1"
-    run_list_test "compact-eh-err2"
+    if { !$is_r6 } {
+        run_dump_test "compact-eh-eb-1"
+        run_dump_test "compact-eh-eb-2"
+        run_dump_test "compact-eh-eb-3"
+        run_dump_test "compact-eh-eb-4"
+        run_dump_test "compact-eh-eb-5"
+        run_dump_test "compact-eh-eb-6"
+        run_dump_test "compact-eh-eb-7"
+        run_dump_test "compact-eh-el-1"
+        run_dump_test "compact-eh-el-2"
+        run_dump_test "compact-eh-el-3"
+        run_dump_test "compact-eh-el-4"
+        run_dump_test "compact-eh-el-5"
+        run_dump_test "compact-eh-el-6"
+        run_dump_test "compact-eh-el-7"
+        run_list_test "compact-eh-err1"
+        run_list_test "compact-eh-err2"
+    }
 
     run_dump_test "div"
 
@@ -735,33 +748,34 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "fix-rm7000-2" \
 					[mips_arch_list_matching mips3 !singlefloat \
 						!mips64r6]
-    run_dump_test_arches "24k-branch-delay-1" \
+    if { !$is_r6 } {
+        run_dump_test_arches "24k-branch-delay-1" \
 					[mips_arch_list_matching mips1]
-    run_dump_test_arches "24k-triple-stores-1" \
+        run_dump_test_arches "24k-triple-stores-1" \
 				[mips_arch_list_matching fpisa5 !octeon]
-    run_dump_test_arches "24k-triple-stores-2" \
+        run_dump_test_arches "24k-triple-stores-2" \
 					[mips_arch_list_matching mips2]
-    run_dump_test_arches "24k-triple-stores-2-llsc" \
+        run_dump_test_arches "24k-triple-stores-2-llsc" \
 					[mips_arch_list_matching mips2 !nollsc]
-    run_dump_test_arches "24k-triple-stores-3" \
+        run_dump_test_arches "24k-triple-stores-3" \
 					[mips_arch_list_matching mips2]
-    run_dump_test_arches "24k-triple-stores-4" \
+        run_dump_test_arches "24k-triple-stores-4" \
 					[mips_arch_list_matching mips2 !singlefloat]
-    run_dump_test_arches "24k-triple-stores-5" \
+        run_dump_test_arches "24k-triple-stores-5" \
 					[mips_arch_list_matching mips1]
-    run_dump_test_arches "24k-triple-stores-6" \
+        run_dump_test_arches "24k-triple-stores-6" \
 					[mips_arch_list_matching mips2 !singlefloat]
-    run_dump_test_arches "24k-triple-stores-7" \
+        run_dump_test_arches "24k-triple-stores-7" \
 					[mips_arch_list_matching mips2 !singlefloat]
-    run_dump_test_arches "24k-triple-stores-8" \
+        run_dump_test_arches "24k-triple-stores-8" \
 					[mips_arch_list_matching mips1]
-    run_dump_test_arches "24k-triple-stores-9" \
+        run_dump_test_arches "24k-triple-stores-9" \
 					[mips_arch_list_matching mips1]
-    run_dump_test_arches "24k-triple-stores-10" \
+        run_dump_test_arches "24k-triple-stores-10" \
 					[mips_arch_list_matching mips1]
-    run_dump_test_arches "24k-triple-stores-11" \
+        run_dump_test_arches "24k-triple-stores-11" \
 	    				[mips_arch_list_matching mips1]
-
+    }
     run_dump_test_arches "jal-svr4pic"	[mips_arch_list_matching mips1]
     run_dump_test_arches "jal-svr4pic-noreorder" \
 					[mips_arch_list_matching mips1]
@@ -903,118 +917,136 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "uld2-eb" [mips_arch_list_matching mips3 !mips32r6]
     run_dump_test_arches "uld2-el" [mips_arch_list_matching mips3 !mips32r6]
 
-    run_dump_test_arches "mips16"	[mips_arch_list_matching mips16-64]
-    if { $has_newabi } {
-	run_dump_test_arches "mips16-64" \
+    if { !$is_r6 } {
+        run_dump_test_arches "mips16"	[mips_arch_list_matching mips16-64]
+        if { $has_newabi } {
+            run_dump_test_arches "mips16-64" \
 					[mips_arch_list_matching mips16-64]
-    }
-    run_dump_test_arches "mips16-macro"	[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-macro-t" \
+        }
+        run_dump_test_arches "mips16-macro"	[mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16-macro-t" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-macro-e" \
+        run_dump_test_arches "mips16-macro-e" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-insn-t" \
+        run_dump_test_arches "mips16-insn-t" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-insn-e" \
+        run_dump_test_arches "mips16-insn-e" \
 					[mips_arch_list_matching mips16-32]
-    # Check MIPS16e extensions
-    run_dump_test_arches "mips16e"	[mips_arch_list_matching mips16e-32]
-    run_dump_test_arches "mips16e-64"	[mips_arch_list_matching mips16e-32]
-    # Check MIPS16e2 extensions.
-    run_dump_test_arches "mips16e2"	[mips_arch_list_matching mips16e2-32]
-    run_dump_test_arches "mips16e2-mt"	[mips_arch_list_matching mips16e2-32]
-    # Check MIPS16 ISA subset disassembly
-    run_dump_test_arches "mips16-sub"	[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16e-sub"	[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16e-64-sub" \
+        # Check MIPS16e extensions
+        run_dump_test_arches "mips16e"	[mips_arch_list_matching mips16e-32]
+        run_dump_test_arches "mips16e-64"	[mips_arch_list_matching mips16e-32]
+        # Check MIPS16e2 extensions.
+        run_dump_test_arches "mips16e2"	[mips_arch_list_matching mips16e2-32]
+        run_dump_test_arches "mips16e2-mt"	[mips_arch_list_matching mips16e2-32]
+        # Check MIPS16 ISA subset disassembly
+        run_dump_test_arches "mips16-sub"	[mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16e-sub"	[mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16e-64-sub" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16e2-sub"	[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16e2-mt-sub" \
+        run_dump_test_arches "mips16e2-sub"	[mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16e2-mt-sub" \
 					[mips_arch_list_matching mips16-32]
 
-    # Check jalx handling
-    run_dump_test "mips16-jalx"
-    run_dump_test "mips-jalx"
-    run_dump_test "mips-jalx-2"
-    run_dump_test "jalx-imm"
-    run_dump_test "jalx-addend"
-    run_dump_test "jalx-local"
-    if $has_newabi {
-	run_dump_test "jalx-imm-n32"
-	run_dump_test "jalx-addend-n32"
-	run_dump_test "jalx-local-n32"
-	run_dump_test "jalx-imm-n64"
-	run_dump_test "jalx-addend-n64"
-	run_dump_test "jalx-local-n64"
-    }
-
-    run_list_test "unaligned-jump-1" "-32" \
+        # Check jalx handling
+        run_dump_test "mips16-jalx"
+        run_dump_test "mips-jalx"
+        run_dump_test "mips-jalx-2"
+        run_dump_test "jalx-imm"
+        run_dump_test "jalx-addend"
+        run_dump_test "jalx-local"
+        if $has_newabi {
+            run_dump_test "jalx-imm-n32"
+            run_dump_test "jalx-addend-n32"
+            run_dump_test "jalx-local-n32"
+            run_dump_test "jalx-imm-n64"
+            run_dump_test "jalx-addend-n64"
+            run_dump_test "jalx-local-n64"
+        }
+    }
+
+    if { !$is_r6 } {
+        run_list_test "unaligned-jump-1" "-32" \
 				"MIPS jump to unaligned symbol 1"
-    run_list_test "unaligned-jump-2" "-32" \
+        run_list_test "unaligned-jump-2" "-32" \
 				"MIPS jump to unaligned symbol 2"
-    if $has_newabi {
-	run_dump_test "unaligned-jump-3"
-    }
-    run_list_test "unaligned-jump-mips16-1" "-32" \
+        if $has_newabi {
+	    run_dump_test "unaligned-jump-3"
+        }
+        run_list_test "unaligned-jump-mips16-1" "-32" \
 				"MIPS16 jump to unaligned symbol 1"
-    run_list_test "unaligned-jump-mips16-2" "-32" \
+        run_list_test "unaligned-jump-mips16-2" "-32" \
 				"MIPS16 jump to unaligned symbol 2"
-    if $has_newabi {
-	run_dump_test "unaligned-jump-mips16-3"
-    }
-    run_list_test "unaligned-jump-micromips-1" "-32" \
+        if $has_newabi {
+	    run_dump_test "unaligned-jump-mips16-3"
+        }
+        run_list_test "unaligned-jump-micromips-1" "-32" \
 				"microMIPS jump to unaligned symbol 1"
-    run_list_test "unaligned-jump-micromips-2" "-32" \
+        run_list_test "unaligned-jump-micromips-2" "-32" \
 				"microMIPS jump to unaligned symbol 2"
-    if $has_newabi {
-	run_dump_test "unaligned-jump-micromips-3"
+        if $has_newabi {
+	    run_dump_test "unaligned-jump-micromips-3"
+        }
     }
-    run_list_test "unaligned-branch-1" "-32" \
+    if { !$is_r6 } {
+        run_list_test "unaligned-branch-1" "-32" \
 				"MIPS branch to unaligned symbol 1"
-    run_list_test "unaligned-branch-2" "-32" \
+        run_list_test "unaligned-branch-2" "-32" \
 				"MIPS branch to unaligned symbol 2"
-    if $has_newabi {
-	run_dump_test "unaligned-branch-3"
     }
-    run_list_test "unaligned-branch-r6-1" "-32" \
+    if { !$is_r6 } {
+        if $has_newabi {
+            run_dump_test "unaligned-branch-3"
+        }
+    }
+    if { !$is_r6 } {
+        run_list_test "unaligned-branch-r6-1" "-32" \
 				"MIPSr6 branch to unaligned symbol 1"
+    }
     run_list_test "unaligned-branch-r6-2" "-32 -mips64r6" \
 				"MIPSr6 branch to unaligned symbol 2"
-    run_list_test "unaligned-branch-r6-3" "-32" \
+    if { !$is_r6 } {
+        run_list_test "unaligned-branch-r6-3" "-32" \
 				"MIPSr6 branch to unaligned symbol 3"
+    }
     run_list_test "unaligned-branch-r6-4" "-32 -mips64r6" \
 				"MIPSr6 branch to unaligned symbol 4"
     if $has_newabi {
-	run_dump_test "unaligned-branch-r6-5"
+        if { !$is_r6 } {
+	    run_dump_test "unaligned-branch-r6-5"
+        }
 	run_dump_test "unaligned-branch-r6-6"
     }
-    run_list_test "unaligned-branch-mips16-1" "-32" \
+    if { !$is_r6 } {
+        run_list_test "unaligned-branch-mips16-1" "-32" \
 				"MIPS16 branch to unaligned symbol 1"
-    run_list_test "unaligned-branch-mips16-2" "-32" \
+        run_list_test "unaligned-branch-mips16-2" "-32" \
 				"MIPS16 branch to unaligned symbol 2"
-    if $has_newabi {
-	run_dump_test "unaligned-branch-mips16-3"
-    }
-    run_list_test "unaligned-branch-micromips-1" "-32" \
+        if $has_newabi {
+	    run_dump_test "unaligned-branch-mips16-3"
+        }
+        run_list_test "unaligned-branch-micromips-1" "-32" \
 				"microMIPS branch to unaligned symbol 1"
-    run_list_test "unaligned-branch-micromips-2" "-32" \
+        run_list_test "unaligned-branch-micromips-2" "-32" \
 				"microMIPS branch to unaligned symbol 2"
-    if $has_newabi {
-	run_dump_test "unaligned-branch-micromips-3"
+        if $has_newabi {
+	    run_dump_test "unaligned-branch-micromips-3"
+        }
     }
 
     # Check MIPS16 HI16/LO16 relocations
-    run_dump_test "mips16-hilo"
-    run_dump_test "mips16e2-hilo"
-    if $has_newabi {
-	run_dump_test "mips16-hilo-n32"
-	run_dump_test "mips16e2-hilo-n32"
+    if { !$is_r6 } {
+        run_dump_test "mips16-hilo"
+        run_dump_test "mips16e2-hilo"
+        if $has_newabi {
+            run_dump_test "mips16-hilo-n32"
+            run_dump_test "mips16e2-hilo-n32"
+        }
+        run_dump_test "mips16-hilo-match"
+        run_dump_test "mips16-reloc-error"
+        run_dump_test "mips16e2-reloc-error"
+        run_dump_test "mips16-reg-error"
+        run_dump_test "mips16e2-imm-error"
     }
-    run_dump_test "mips16-hilo-match"
-    run_dump_test "mips16-reloc-error"
-    run_dump_test "mips16e2-reloc-error"
-    run_dump_test "mips16-reg-error"
-    run_dump_test "mips16e2-imm-error"
 
     run_dump_test "delay"
     run_dump_test "nodelay"
@@ -1038,14 +1070,14 @@  if { [istarget mips*-*-vxworks*] } {
 	run_dump_test_arches "virt64"	[mips_arch_list_matching mips64r2]
     }
 
-    run_dump_test_arches "mips32"	[mips_arch_list_matching mips32]
+    run_dump_test_arches "mips32"	[mips_arch_list_matching mips32 !mips32r6]
     run_dump_test_arches "mips32-imm"	[mips_arch_list_matching mips32]
 
     run_dump_test_arches "mips32-sf32"	[mips_arch_list_matching mips32]
     run_list_test_arches "mips32-sf32" "-32 -msoft-float" \
 					[mips_arch_list_matching mips32]
     run_dump_test_arches "mips32-cp2"	[mips_arch_list_matching mips32 \
-					    !octeon]
+					    !octeon !mips32r6]
 
     run_dump_test_arches "mips32r2"	[mips_arch_list_matching mips32r2]
     run_dump_test_arches "mips32r2-cp2"	[mips_arch_list_matching mips32r2 \
@@ -1068,9 +1100,12 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "mips64r2"	[mips_arch_list_matching mips64r2]
     run_list_test_arches "mips64r2-ill"	[mips_arch_list_matching mips64r2]
 
-    run_dump_test "set-arch"
+    if { !$is_r6 } {
+        # r6 add some "R_MIPS_PC16"
+        run_dump_test "set-arch"
+    }
 
-    if { !$addr32 } {
+    if { !$addr32 && !$is_r6 } {
 	run_dump_test "mips64-mips3d"
 	if { $has_newabi } {
 	    run_dump_test_arches "mips64-mips3d-incl" \
@@ -1100,9 +1135,11 @@  if { [istarget mips*-*-vxworks*] } {
 					[mips_arch_list_matching mips64r2 \
 					    !micromips !mips32r6]
 
-    run_dump_test_arches "eva"		[mips_arch_list_matching mips32r2 !octeon]
+    run_dump_test_arches "eva"		[mips_arch_list_matching mips32r2 !octeon !mips32r6]
 
-    run_list_test "illegal" "-32"
+    if { !$is_r6 } {
+        run_list_test "illegal" "-32"
+    }
     run_list_test "baddata1" "-32"
     run_list_test "jalr" ""
 
@@ -1140,13 +1177,15 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test "elf_arch_mips64r6"
 
     # Verify that ASE markings are handled properly.
-    run_dump_test "elf_ase_mips16"
-    run_dump_test "elf_ase_mips16-2"
-    run_dump_test "elf_ase_mips16e2"
-    run_dump_test "elf_ase_mips16e2-2"
+    if { !$is_r6 } {
+        run_dump_test "elf_ase_mips16"
+        run_dump_test "elf_ase_mips16-2"
+        run_dump_test "elf_ase_mips16e2"
+        run_dump_test "elf_ase_mips16e2-2"
 
-    run_dump_test "elf_ase_micromips"
-    run_dump_test "elf_ase_micromips-2"
+        run_dump_test "elf_ase_micromips"
+        run_dump_test "elf_ase_micromips-2"
+    }
 
     # Verify that machine markings are handled properly.
     run_dump_test "elf_mach_5900"
@@ -1172,34 +1211,44 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "elf-rel4" [mips_arch_list_matching gpr64 !mips16-32]
     run_dump_test "e32-rel4"
     run_dump_test "elf-rel5"
-    run_dump_test "elf-rel6"
-    if $has_newabi {
-	run_dump_test "elf-rel6-n32"
-	run_dump_test "elf-rel6-n64"
+    if { !$is_r6 } {
+        run_dump_test "elf-rel6"
+        if $has_newabi {
+            run_dump_test "elf-rel6-n32"
+            run_dump_test "elf-rel6-n64"
+        }
     }
     run_dump_test "elf-rel7"
     run_dump_test "elf-rel8"
-    run_dump_test "elf-rel8-mips16"
+    if { !$is_r6 } {
+        run_dump_test "elf-rel8-mips16"
+    }
     run_dump_test "elf-rel9"
-    run_dump_test "elf-rel9-mips16"
-    run_dump_test "elf-rel9-mips16e2"
+    if { !$is_r6 } {
+        run_dump_test "elf-rel9-mips16"
+        run_dump_test "elf-rel9-mips16e2"
+    }
     if $has_newabi {
 	run_dump_test "elf-rel10"
 	run_dump_test "elf-rel11"
     }
     run_dump_test "elf-rel12"
     run_dump_test "elf-rel13"
-    run_dump_test "elf-rel13-mips16"
+    if { !$is_r6 } {
+        run_dump_test "elf-rel13-mips16"
+    }
     run_dump_test "elf-rel14"
 
     if $has_newabi {
 	run_dump_test "elf-rel15"
 	run_dump_test "elf-rel16"
 
-	run_dump_test "elf-rel-got-n32"
-	run_dump_test "elf-rel-xgot-n32"
-	run_dump_test "elf-rel-got-n64"
-	run_dump_test "elf-rel-xgot-n64"
+        if { !$is_r6 } {
+	    run_dump_test "elf-rel-got-n32"
+	    run_dump_test "elf-rel-xgot-n32"
+	    run_dump_test "elf-rel-got-n64"
+	    run_dump_test "elf-rel-xgot-n64"
+        }
     }
     run_dump_test "elf-rel17"
     if $has_newabi {
@@ -1224,21 +1273,25 @@  if { [istarget mips*-*-vxworks*] } {
 
     if $has_newabi {
 	run_dump_test "elf-rel28-n32"
-	run_dump_test "elf-rel28-micromips-n32"
 	run_dump_test "elf-rel28-n64"
-	run_dump_test "elf-rel28-micromips-n64"
-	run_dump_test "elf-rel28-lldscd-n32"
-	run_dump_test "elf-rel28-lldscd-micromips-n32"
-	run_dump_test "elf-rel28-lldscd-n64"
-	run_dump_test "elf-rel28-lldscd-micromips-n64"
+        if { !$is_r6 } {
+	    run_dump_test "elf-rel28-micromips-n32"
+	    run_dump_test "elf-rel28-micromips-n64"
+	    run_dump_test "elf-rel28-lldscd-n32"
+	    run_dump_test "elf-rel28-lldscd-micromips-n32"
+	    run_dump_test "elf-rel28-lldscd-n64"
+	    run_dump_test "elf-rel28-lldscd-micromips-n64"
+        }
 	run_dump_test_arches "elf-rel29" [mips_arch_list_matching mips3]
     }
     run_list_test_arches "elf-rel30" "-32" [mips_arch_list_all]
 
-    run_dump_test "comdat-reloc"
+    if { !$is_r6 } {
+        run_dump_test "comdat-reloc"
 
-    run_dump_test "${tmips}mips${el}16-e"
-    run_dump_test "${tmips}mips${el}16-f"
+        run_dump_test "${tmips}mips${el}16-e"
+        run_dump_test "${tmips}mips${el}16-f"
+    }
 
     run_dump_test "elf-consthilo"
     run_dump_test "expr1"
@@ -1277,15 +1330,19 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "loc-swap-2"	[mips_arch_list_all]
     run_dump_test_arches "loc-swap-3"	[mips_arch_list_all]
 
-    run_dump_test "nan-legacy-1"
-    run_dump_test "nan-legacy-2"
-    run_dump_test "nan-legacy-3"
-    run_dump_test "nan-legacy-4"
-    run_dump_test "nan-legacy-5"
+    if { !$is_r6 } {
+        run_dump_test "nan-legacy-1"
+        run_dump_test "nan-legacy-2"
+        run_dump_test "nan-legacy-3"
+        run_dump_test "nan-legacy-4"
+        run_dump_test "nan-legacy-5"
+    }
 
     run_dump_test "nan-2008-1"
     run_dump_test "nan-2008-2"
-    run_dump_test "nan-2008-3"
+    if { !$is_r6 } {
+        run_dump_test "nan-2008-3"
+    }
     run_dump_test "nan-2008-4"
 
     run_list_test "nan-error-1"
@@ -1364,7 +1421,9 @@  if { [istarget mips*-*-vxworks*] } {
     if $has_newabi {
 	run_dump_test "ldstla-n64"
 	run_dump_test "ldstla-n64-shared"
-	run_dump_test "ldstla-n64-sym32"
+        if { !$is_r6 } {
+            run_dump_test "ldstla-n64-sym32"
+        }
     }
 
     run_dump_test "macro-warn-1"
@@ -1387,32 +1446,34 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test "at-1"
     run_list_test "at-2" "-32 -mips1" "MIPS at-2"
 
-    run_dump_test "loongson-2e"
-    run_dump_test "loongson-2f"
-    run_dump_test "loongson-2f-2"
-    run_dump_test "loongson-2f-3"
+    if { !$is_r6 } {
+        run_dump_test "loongson-2e"
+        run_dump_test "loongson-2f"
+        run_dump_test "loongson-2f-2"
+        run_dump_test "loongson-2f-3"
 
-    run_dump_test "loongson-3a"
-    run_dump_test "loongson-3a-2"
-    run_dump_test "loongson-3a-3"
+        run_dump_test "loongson-3a"
+        run_dump_test "loongson-3a-2"
+        run_dump_test "loongson-3a-3"
 
-    run_dump_test "loongson-2f-mmi"
-    run_dump_test "loongson-3a-mmi"
+        run_dump_test "loongson-2f-mmi"
+        run_dump_test "loongson-3a-mmi"
 
-    run_dump_test_arches "loongson-cam"		[mips_arch_list_matching gs464]
-    run_dump_test_arches "loongson-ext2"	[mips_arch_list_matching gs464]  
+        run_dump_test_arches "loongson-cam"        [mips_arch_list_matching gs464]
+        run_dump_test_arches "loongson-ext2"    [mips_arch_list_matching gs464]
 
-    if { $has_newabi } {
-	run_dump_test_arches "octeon"	[mips_arch_list_matching octeon]
-    }
-    run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
-    run_list_test_arches "octeon-ill"	[mips_arch_list_matching octeon]
-    if { $has_newabi } {
-	run_dump_test_arches "octeon-pref" \
-					[mips_arch_list_matching octeon]
+        if { $has_newabi } {
+            run_dump_test_arches "octeon"    [mips_arch_list_matching octeon]
+        }
+        run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
+        run_list_test_arches "octeon-ill"    [mips_arch_list_matching octeon]
+        if { $has_newabi } {
+            run_dump_test_arches "octeon-pref" \
+                        [mips_arch_list_matching octeon]
+        }
+        run_dump_test_arches "octeon2"	[mips_arch_list_matching octeon2]
+        run_dump_test_arches "octeon3"	[mips_arch_list_matching octeon3]
     }
-    run_dump_test_arches "octeon2"	[mips_arch_list_matching octeon2]
-    run_dump_test_arches "octeon3"	[mips_arch_list_matching octeon3]
 
     run_dump_test "smartmips"
     run_dump_test_arches "mips32-dsp"	[mips_arch_list_matching mips32r2 \
@@ -1433,34 +1494,35 @@  if { [istarget mips*-*-vxworks*] } {
 				[mips_arch_list_matching mips1 !micromips] \
 				[mips_arch_list_matching mips16-32]]]
 
-    run_dump_test "mips16-dwarf2"
-    if $has_newabi {
-	run_dump_test "mips16-dwarf2-n32"
+    if { !$is_r6 } {
+        run_dump_test "mips16-dwarf2"
+        if $has_newabi {
+	    run_dump_test "mips16-dwarf2-n32"
+        }
+        run_dump_test "mips16-stabs"
+
+        run_dump_test "mips16e-jrc"
+        run_dump_test "mips16e2-lui"
+        run_dump_test "mips16e2-mt-err"
+        run_dump_test "mips16e2-copy"
+        run_dump_test "mips16e2-copy-err"
+
+        run_dump_test "mips16-intermix"
+        run_dump_test "mips16-extend"
+        run_dump_test "mips16-extend-swap"
+        run_dump_test "mips16-sprel-swap"
+        run_dump_test "mips16-sdrasp"
+        run_dump_test "mips16-insn-length-noargs"
+
+        run_dump_test "mips16-branch-unextended-1"
+        run_dump_test "mips16-branch-unextended-2"
+        run_dump_test "mips16-relax-unextended-1"
+        run_dump_test "mips16-relax-unextended-2"
+        run_dump_test "mips16-jal-t"
+        run_dump_test "mips16-jal-e"
+
+        run_dump_test_arches "mips16-asmacro" [mips_arch_list_matching mips16-32]
     }
-    run_dump_test "mips16-stabs"
-
-    run_dump_test "mips16e-jrc"
-    run_dump_test "mips16e2-lui"
-    run_dump_test "mips16e2-mt-err"
-    run_dump_test "mips16e2-copy"
-    run_dump_test "mips16e2-copy-err"
-
-    run_dump_test "mips16-intermix"
-    run_dump_test "mips16-extend"
-    run_dump_test "mips16-extend-swap"
-    run_dump_test "mips16-sprel-swap"
-    run_dump_test "mips16-sdrasp"
-    run_dump_test "mips16-insn-length-noargs"
-
-    run_dump_test "mips16-branch-unextended-1"
-    run_dump_test "mips16-branch-unextended-2"
-    run_dump_test "mips16-relax-unextended-1"
-    run_dump_test "mips16-relax-unextended-2"
-    run_dump_test "mips16-jal-t"
-    run_dump_test "mips16-jal-e"
-
-    run_dump_test_arches "mips16-asmacro" [mips_arch_list_matching mips16-32]
-
     run_dump_test "vxworks1"
     run_dump_test "vxworks1-xgot"
     run_dump_test "vxworks1-el"
@@ -1468,11 +1530,13 @@  if { [istarget mips*-*-vxworks*] } {
 
     run_dump_test "noreorder"
     run_dump_test "align"
-    run_dump_test "align2"
-    run_dump_test "align2-el"
+    if { !$is_r6 } {
+        run_dump_test "align2"
+        run_dump_test "align2-el"
+        run_dump_test "insn-opts"
+    }
     run_dump_test "align3"
     run_dump_test "odd-float"
-    run_dump_test "insn-opts"
 
     run_list_test_arches "mips-macro-ill-sfp" "-32 -msingle-float" \
 					[mips_arch_list_matching mips2]
@@ -1486,7 +1550,9 @@  if { [istarget mips*-*-vxworks*] } {
 	"-32 -msingle-float -mdouble-float" \
 	[mips_arch_list_matching mips1 !singlefloat]
 
-    run_dump_test "mips16-vis-1"
+    if { !$is_r6 } {
+        run_dump_test "mips16-vis-1"
+    }
     run_dump_test "call-nonpic-1"
     run_dump_test "mips32-sync"
     run_dump_test_arches "mips32r2-sync" [lsort -dictionary -unique [concat \
@@ -1517,33 +1583,35 @@  if { [istarget mips*-*-vxworks*] } {
 	run_dump_test "reginfo-2-n32"
     }
 
-    run_dump_test "micromips"
-    run_dump_test "micromips-trap"
-    run_dump_test "micromips-compact"
-    run_dump_test "micromips-insn32"
-    run_dump_test "micromips-noinsn32"
-    run_list_test "micromips" "-mips32r2 -32 -mfp64 -minsn32" \
-	"microMIPS for MIPS32r2 (instructions invalid in insn32 mode)"
-    run_list_test "micromips-size-0" \
-	"-32 -march=mips64 -mmicromips" "microMIPS instruction size 0"
-    run_dump_test "micromips-size-1"
-    run_dump_test "micromips-branch-relax"
-    run_dump_test "micromips-branch-relax-pic"
-    run_dump_test "micromips-branch-relax-insn32"
-    run_dump_test "micromips-branch-relax-insn32-pic"
-    run_dump_test "micromips-branch-delay"
-    run_dump_test "micromips-warn-branch-delay"
-    run_dump_test "micromips-warn-branch-delay-1"
-    run_dump_test "micromips-branch-absolute"
-    run_dump_test "micromips-branch-absolute-addend"
-    if $has_newabi {
-	run_dump_test "micromips-branch-absolute-n32"
-	run_dump_test "micromips-branch-absolute-addend-n32"
-	run_dump_test "micromips-branch-absolute-n64"
-	run_dump_test "micromips-branch-absolute-addend-n64"
+    if { !$is_r6 } {
+        run_dump_test "micromips"
+        run_dump_test "micromips-trap"
+        run_dump_test "micromips-compact"
+        run_dump_test "micromips-insn32"
+        run_dump_test "micromips-noinsn32"
+        run_list_test "micromips" "-mips32r2 -32 -mfp64 -minsn32" \
+            "microMIPS for MIPS32r2 (instructions invalid in insn32 mode)"
+        run_list_test "micromips-size-0" \
+            "-32 -march=mips64 -mmicromips" "microMIPS instruction size 0"
+        run_dump_test "micromips-size-1"
+        run_dump_test "micromips-branch-relax"
+        run_dump_test "micromips-branch-relax-pic"
+        run_dump_test "micromips-branch-relax-insn32"
+        run_dump_test "micromips-branch-relax-insn32-pic"
+        run_dump_test "micromips-branch-delay"
+        run_dump_test "micromips-warn-branch-delay"
+        run_dump_test "micromips-warn-branch-delay-1"
+        run_dump_test "micromips-branch-absolute"
+        run_dump_test "micromips-branch-absolute-addend"
+        if $has_newabi {
+            run_dump_test "micromips-branch-absolute-n32"
+            run_dump_test "micromips-branch-absolute-addend-n32"
+            run_dump_test "micromips-branch-absolute-n64"
+            run_dump_test "micromips-branch-absolute-addend-n64"
+        }
+        run_dump_test "micromips-b16"
+        run_list_test "micromips-ill"
     }
-    run_dump_test "micromips-b16"
-    run_list_test "micromips-ill"
 
     run_dump_test_arches "mcu"		[mips_arch_list_matching mips32r2 \
 					    !octeon]
@@ -1597,7 +1665,9 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "ulh-reloc"	[mips_arch_list_matching mips2 !mips32r6]
 
     run_dump_test "l_d-reloc"
-    run_list_test "bltzal"
+    if { !$is_r6 } {
+        run_list_test "bltzal"
+    }
 
     run_dump_test_arches "msa"		[mips_arch_list_matching mips32r2]
     if { $has_newabi } {
@@ -1620,185 +1690,189 @@  if { [istarget mips*-*-vxworks*] } {
 	run_dump_test "pcrel-4-64"
     }
 
-    run_dump_test "pcrel-reloc-1"
+    if { !$is_r6 } {
+        run_dump_test "pcrel-reloc-1"
+        run_dump_test "pcrel-reloc-2"
+        run_dump_test "pcrel-reloc-3"
+        run_dump_test "pcrel-reloc-4"
+        run_dump_test "pcrel-reloc-5"
+        run_dump_test "pcrel-reloc-6"
+        run_list_test "pcrel-reloc-6" "-32 --defsym offset=4" \
+	    "MIPS local PC-relative relocations 6b"
+    }
     run_dump_test "pcrel-reloc-1-r6"
-    run_dump_test "pcrel-reloc-2"
     run_dump_test "pcrel-reloc-2-r6"
-    run_dump_test "pcrel-reloc-3"
     run_dump_test "pcrel-reloc-3-r6"
-    run_dump_test "pcrel-reloc-4"
     run_dump_test "pcrel-reloc-4-r6"
-    run_dump_test "pcrel-reloc-5"
     run_dump_test "pcrel-reloc-5-r6"
-    run_dump_test "pcrel-reloc-6"
-    run_list_test "pcrel-reloc-6" "-32 --defsym offset=4" \
-	"MIPS local PC-relative relocations 6b"
-
-    run_dump_test_arches "mips16-pcrel-0" [mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-1" [mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-2" [mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-3" [mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-4" [mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-5" [mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-pic-0" \
+
+    if { !$is_r6 } {
+        run_dump_test_arches "mips16-pcrel-0" [mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16-pcrel-1" [mips_arch_list_matching mips16-64]
+        run_dump_test_arches "mips16-pcrel-2" [mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16-pcrel-3" [mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16-pcrel-4" [mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16-pcrel-5" [mips_arch_list_matching mips16-32]
+        run_dump_test_arches "mips16-pcrel-pic-0" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-pic-1" \
+        run_dump_test_arches "mips16-pcrel-pic-1" \
 					[mips_arch_list_matching mips16-64]
-    if $has_newabi {
-	run_dump_test_arches "mips16-pcrel-n32-0" \
+        if $has_newabi {
+	    run_dump_test_arches "mips16-pcrel-n32-0" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-n32-1" \
+	    run_dump_test_arches "mips16-pcrel-n32-1" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-n64-sym32-0" \
+	    run_dump_test_arches "mips16-pcrel-n64-sym32-0" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-n64-sym32-1" \
+	    run_dump_test_arches "mips16-pcrel-n64-sym32-1" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-n64-0" \
+	    run_dump_test_arches "mips16-pcrel-n64-0" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-n64-1" \
+	    run_dump_test_arches "mips16-pcrel-n64-1" \
 					[mips_arch_list_matching mips16-64]
-    }
-    run_dump_test_arches "mips16-pcrel-delay-0" \
+        }
+        run_dump_test_arches "mips16-pcrel-delay-0" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-delay-1" \
+        run_dump_test_arches "mips16-pcrel-delay-1" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test "mips16-pcrel-relax-0"
-    run_dump_test "mips16-pcrel-relax-1"
-    run_dump_test "mips16-pcrel-relax-2"
-    run_dump_test "mips16-pcrel-relax-3"
-    run_dump_test_arches "mips16-pcrel-reloc-0" \
+        run_dump_test "mips16-pcrel-relax-0"
+        run_dump_test "mips16-pcrel-relax-1"
+        run_dump_test "mips16-pcrel-relax-2"
+        run_dump_test "mips16-pcrel-relax-3"
+        run_dump_test_arches "mips16-pcrel-reloc-0" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-reloc-1" \
+        run_dump_test_arches "mips16-pcrel-reloc-1" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-reloc-2" \
+        run_dump_test_arches "mips16-pcrel-reloc-2" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-reloc-3" \
+        run_dump_test_arches "mips16-pcrel-reloc-3" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-reloc-4" \
+        run_dump_test_arches "mips16-pcrel-reloc-4" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-reloc-5" \
+        run_dump_test_arches "mips16-pcrel-reloc-5" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-reloc-6" \
+        run_dump_test_arches "mips16-pcrel-reloc-6" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-reloc-7" \
+        run_dump_test_arches "mips16-pcrel-reloc-7" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-addend-0" \
+        run_dump_test_arches "mips16-pcrel-addend-0" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-addend-1" \
+        run_dump_test_arches "mips16-pcrel-addend-1" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-addend-2" \
+        run_dump_test_arches "mips16-pcrel-addend-2" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-addend-3" \
+        run_dump_test_arches "mips16-pcrel-addend-3" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-addend-4" \
+        run_dump_test_arches "mips16-pcrel-addend-4" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-addend-5" \
+        run_dump_test_arches "mips16-pcrel-addend-5" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-addend-6" \
+        run_dump_test_arches "mips16-pcrel-addend-6" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-addend-7" \
+        run_dump_test_arches "mips16-pcrel-addend-7" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-addend-8" \
+        run_dump_test_arches "mips16-pcrel-addend-8" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-addend-9" \
+        run_dump_test_arches "mips16-pcrel-addend-9" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-addend-pic-8" \
+        run_dump_test_arches "mips16-pcrel-addend-pic-8" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-addend-pic-9" \
+        run_dump_test_arches "mips16-pcrel-addend-pic-9" \
 					[mips_arch_list_matching mips16-64]
-    if $has_newabi {
-	run_dump_test_arches "mips16-pcrel-addend-n32-8" \
+        if $has_newabi {
+	    run_dump_test_arches "mips16-pcrel-addend-n32-8" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-addend-n32-9" \
+	    run_dump_test_arches "mips16-pcrel-addend-n32-9" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-addend-n64-sym32-8" \
+	    run_dump_test_arches "mips16-pcrel-addend-n64-sym32-8" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-addend-n64-sym32-9" \
+	    run_dump_test_arches "mips16-pcrel-addend-n64-sym32-9" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-addend-n64-8" \
+	    run_dump_test_arches "mips16-pcrel-addend-n64-8" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-addend-n64-9" \
+	    run_dump_test_arches "mips16-pcrel-addend-n64-9" \
 					[mips_arch_list_matching mips16-64]
-    }
-    run_dump_test_arches "mips16-pcrel-absolute" \
+        }
+        run_dump_test_arches "mips16-pcrel-absolute" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-absolute-1" \
+        run_dump_test_arches "mips16-pcrel-absolute-1" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-absolute-2" \
+        run_dump_test_arches "mips16-pcrel-absolute-2" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-absolute-3" \
+        run_dump_test_arches "mips16-pcrel-absolute-3" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-absolute-4" \
+        run_dump_test_arches "mips16-pcrel-absolute-4" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-absolute-5" \
+        run_dump_test_arches "mips16-pcrel-absolute-5" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-absolute-6" \
+        run_dump_test_arches "mips16-pcrel-absolute-6" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-absolute-7" \
+        run_dump_test_arches "mips16-pcrel-absolute-7" \
 					[mips_arch_list_matching mips16-64]
-    run_dump_test_arches "mips16-pcrel-absolute-pic-4" \
+        run_dump_test_arches "mips16-pcrel-absolute-pic-4" \
 					[mips_arch_list_matching mips16-32]
-    run_dump_test_arches "mips16-pcrel-absolute-pic-6" \
+        run_dump_test_arches "mips16-pcrel-absolute-pic-6" \
 					[mips_arch_list_matching mips16-64]
-    if $has_newabi {
-	run_dump_test_arches "mips16-pcrel-absolute-n32-4" \
+        if $has_newabi {
+	    run_dump_test_arches "mips16-pcrel-absolute-n32-4" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-n32-6" \
+	    run_dump_test_arches "mips16-pcrel-absolute-n32-6" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-n64-4" \
+	    run_dump_test_arches "mips16-pcrel-absolute-n64-4" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-n64-6" \
+	    run_dump_test_arches "mips16-pcrel-absolute-n64-6" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-n64-sym32-4" \
+	    run_dump_test_arches "mips16-pcrel-absolute-n64-sym32-4" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-n64-sym32-6" \
+	    run_dump_test_arches "mips16-pcrel-absolute-n64-sym32-6" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-pic-n32-4" \
+	    run_dump_test_arches "mips16-pcrel-absolute-pic-n32-4" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-pic-n32-6" \
+	    run_dump_test_arches "mips16-pcrel-absolute-pic-n32-6" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-pic-n64-4" \
+	    run_dump_test_arches "mips16-pcrel-absolute-pic-n64-4" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-pic-n64-6" \
+	    run_dump_test_arches "mips16-pcrel-absolute-pic-n64-6" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-pic-n64-sym32-4" \
+	    run_dump_test_arches "mips16-pcrel-absolute-pic-n64-sym32-4" \
 					[mips_arch_list_matching mips16-64]
-	run_dump_test_arches "mips16-pcrel-absolute-pic-n64-sym32-6" \
+	    run_dump_test_arches "mips16-pcrel-absolute-pic-n64-sym32-6" \
 					[mips_arch_list_matching mips16-64]
+        }
+        run_dump_test "mips16-branch-reloc-0"
+        run_dump_test "mips16-branch-reloc-1"
+        run_dump_test "mips16-branch-reloc-2"
+        run_dump_test "mips16-branch-reloc-3"
+        run_dump_test "mips16-branch-reloc-4"
+        run_dump_test "mips16-branch-reloc-5"
+        run_dump_test "mips16-branch-addend-0"
+        run_dump_test "mips16-branch-addend-1"
+        run_dump_test "mips16-branch-addend-2"
+        run_dump_test "mips16-branch-addend-3"
+        run_dump_test "mips16-branch-addend-4"
+        run_dump_test "mips16-branch-addend-5"
+        run_dump_test "mips16-branch-absolute"
+        run_dump_test "mips16-branch-absolute-1"
+        run_dump_test "mips16-branch-absolute-2"
+        run_dump_test "mips16-branch-absolute-addend"
+        run_dump_test "mips16-branch-absolute-addend-1"
+        if $has_newabi {
+	    run_dump_test "mips16-branch-absolute-n32"
+	    run_dump_test "mips16-branch-absolute-n32-1"
+	    run_dump_test "mips16-branch-absolute-n32-2"
+	    run_dump_test "mips16-branch-absolute-addend-n32"
+	    run_dump_test "mips16-branch-absolute-addend-n32-1"
+	    run_dump_test "mips16-branch-absolute-n64"
+	    run_dump_test "mips16-branch-absolute-n64-1"
+	    run_dump_test "mips16-branch-absolute-n64-2"
+	    run_dump_test "mips16-branch-absolute-addend-n64"
+	    run_dump_test "mips16-branch-absolute-addend-n64-1"
+        }
+        run_dump_test "mips16-absolute-reloc-0"
+        run_dump_test "mips16-absolute-reloc-1"
+        run_dump_test "mips16-absolute-reloc-2"
+        run_dump_test "mips16-absolute-reloc-3"
     }
-    run_dump_test "mips16-branch-reloc-0"
-    run_dump_test "mips16-branch-reloc-1"
-    run_dump_test "mips16-branch-reloc-2"
-    run_dump_test "mips16-branch-reloc-3"
-    run_dump_test "mips16-branch-reloc-4"
-    run_dump_test "mips16-branch-reloc-5"
-    run_dump_test "mips16-branch-addend-0"
-    run_dump_test "mips16-branch-addend-1"
-    run_dump_test "mips16-branch-addend-2"
-    run_dump_test "mips16-branch-addend-3"
-    run_dump_test "mips16-branch-addend-4"
-    run_dump_test "mips16-branch-addend-5"
-    run_dump_test "mips16-branch-absolute"
-    run_dump_test "mips16-branch-absolute-1"
-    run_dump_test "mips16-branch-absolute-2"
-    run_dump_test "mips16-branch-absolute-addend"
-    run_dump_test "mips16-branch-absolute-addend-1"
-    if $has_newabi {
-	run_dump_test "mips16-branch-absolute-n32"
-	run_dump_test "mips16-branch-absolute-n32-1"
-	run_dump_test "mips16-branch-absolute-n32-2"
-	run_dump_test "mips16-branch-absolute-addend-n32"
-	run_dump_test "mips16-branch-absolute-addend-n32-1"
-	run_dump_test "mips16-branch-absolute-n64"
-	run_dump_test "mips16-branch-absolute-n64-1"
-	run_dump_test "mips16-branch-absolute-n64-2"
-	run_dump_test "mips16-branch-absolute-addend-n64"
-	run_dump_test "mips16-branch-absolute-addend-n64-1"
-    }
-    run_dump_test "mips16-absolute-reloc-0"
-    run_dump_test "mips16-absolute-reloc-1"
-    run_dump_test "mips16-absolute-reloc-2"
-    run_dump_test "mips16-absolute-reloc-3"
 
     run_dump_test_arches "attr-gnu-4-0" "-32" \
 				    [mips_arch_list_matching mips1]
@@ -1922,7 +1996,7 @@  if { [istarget mips*-*-vxworks*] } {
 	run_dump_test_arches "attr-gnu-4-3" "-64" \
 				    [mips_arch_list_matching mips3]
     }
- 
+
     run_list_test_arches "attr-gnu-4-4" "-32 -mfp32" \
 				    [mips_arch_list_matching mips1 !mips32r6]
     run_list_test_arches "attr-gnu-4-4" "-32 -mfpxx" \
@@ -1991,30 +2065,35 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test_arches "attr-gnu-4-7" "-32 -mfp64 -mno-odd-spreg" \
 				    [mips_arch_list_matching mips32r2]
 
-    run_dump_test "attr-gnu-abi-fp-1"
+    if { !$is_r6 } {
+        run_dump_test "attr-gnu-abi-fp-1"
+    }
     run_dump_test "attr-gnu-abi-msa-1"
 
     run_dump_test "module-override"
     run_dump_test "module-defer-warn1"
-    run_list_test "module-defer-warn2" "-32"
+    ## mips32r2 or above support FP64, so no "Error: `fp=64' used with a 32-bit fpu"
+    run_list_test "module-defer-warn2" "-32 -mips32"
 
-    foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" \
-			  -msingle-float -msoft-float] {
-      foreach cmdopt [list -mfp32 -mfpxx -mfp64 "-mfp64 -mno-odd-spreg" \
-			   -msingle-float -msoft-float] {
-        run_dump_test "module${testopt}" \
-			    [list [list as $cmdopt] [list name ($cmdopt)]]
-      }
+    if { !$is_r6 } {
+        foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" \
+                           -msingle-float -msoft-float] {
+          foreach cmdopt [list -mfp32 -mfpxx -mfp64 "-mfp64 -mno-odd-spreg" \
+                           -msingle-float -msoft-float] {
+            run_dump_test "module${testopt}" \
+                           [list [list as $cmdopt] [list name ($cmdopt)]]
+          }
+        }
+        run_dump_test "module-set-mfpxx"
     }
 
-    run_dump_test "module-set-mfpxx"
     run_list_test_arches "fpxx-oddfpreg" "-32 -mfpxx" \
-			[mips_arch_list_matching mips2 !singlefloat]
+			[mips_arch_list_matching mips2 !singlefloat !mips32r6]
     run_list_test_arches "fpxx-oddfpreg" "-32 -mfpxx -mno-odd-spreg" \
-			[mips_arch_list_matching mips2 !singlefloat]
+			[mips_arch_list_matching mips2 !singlefloat !mips32r6]
     run_dump_test_arches "fpxx-oddfpreg" \
-			[mips_arch_list_matching oddspreg]
-    run_dump_test_arches "odd-spreg" "-mfp32" [mips_arch_list_matching oddspreg]
+			[mips_arch_list_matching oddspreg !mips32r6]
+    run_dump_test_arches "odd-spreg" "-mfp32" [mips_arch_list_matching oddspreg !mips32r6]
     run_dump_test_arches "odd-spreg" "-mfpxx" [mips_arch_list_matching oddspreg]
     run_dump_test_arches "odd-spreg" "-mfp64" [mips_arch_list_matching mips32r2]
     run_dump_test_arches "no-odd-spreg" "-mfp32" [mips_arch_list_matching mips1 \
@@ -2033,13 +2112,15 @@  if { [istarget mips*-*-vxworks*] } {
 	"MIPS invalid PIC option in VxWorks PIC"
     run_list_test "option-pic-vxworks-2" "-mvxworks-pic" \
 	"MIPS invalid switch to SVR4 PIC from VxWorks PIC"
-    run_dump_test "option-pic-relax-0"
-    run_dump_test "option-pic-relax-1"
-    run_dump_test "option-pic-relax-2"
-    run_dump_test "option-pic-relax-3"
-    run_dump_test "option-pic-relax-3a"
-    run_dump_test "option-pic-relax-4"
-    run_dump_test "option-pic-relax-5"
+    if { !$is_r6 } {
+        run_dump_test "option-pic-relax-0"
+        run_dump_test "option-pic-relax-1"
+        run_dump_test "option-pic-relax-2"
+        run_dump_test "option-pic-relax-3"
+        run_dump_test "option-pic-relax-3a"
+        run_dump_test "option-pic-relax-4"
+        run_dump_test "option-pic-relax-5"
+    }
 
     run_dump_test_arches "isa-override-1" "" [mips_arch_list_matching mips1]
     run_dump_test_arches "isa-override-2" "" [mips_arch_list_matching mips1]
@@ -2048,18 +2129,20 @@  if { [istarget mips*-*-vxworks*] } {
     run_dump_test "debug-label-end-2"
     run_dump_test "debug-label-end-3"
 
-    run_dump_test "org-1"
-    run_dump_test "org-2"
-    run_dump_test "org-3"
-    run_dump_test "org-4"
-    run_dump_test "org-5"
-    run_dump_test "org-6"
-    run_dump_test "org-7"
-    run_dump_test "org-8"
-    run_dump_test "org-9"
-    run_dump_test "org-10"
-    run_dump_test "org-11"
-    run_dump_test "org-12"
+    if { !$is_r6 } {
+        run_dump_test "org-1"
+        run_dump_test "org-2"
+        run_dump_test "org-3"
+        run_dump_test "org-4"
+        run_dump_test "org-5"
+        run_dump_test "org-6"
+        run_dump_test "org-7"
+        run_dump_test "org-8"
+        run_dump_test "org-9"
+        run_dump_test "org-10"
+        run_dump_test "org-11"
+        run_dump_test "org-12"
+    }
 
     run_dump_test_arches "stabs-symbol-type" [mips_arch_list_all]
 
@@ -2093,5 +2176,7 @@  if { [istarget mips*-*-vxworks*] } {
     } else {
 	run_dump_test "pr14798"
     }
-    run_dump_test "insn-isa-mode"
+    if { !$is_r6 } {
+        run_dump_test "insn-isa-mode"
+    }
 }
diff --git a/gas/testsuite/gas/mips/mipsr6@cache.d b/gas/testsuite/gas/mips/mipsr6@cache.d
index 803f5de05f..ca6e06066e 100644
--- a/gas/testsuite/gas/mips/mipsr6@cache.d
+++ b/gas/testsuite/gas/mips/mipsr6@cache.d
@@ -1,7 +1,7 @@ 
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS CACHE instruction
 #source: cache.s
-#as: -32
+#as: -32 --defsym r6=1
 
 # Check MIPS CACHE instruction assembly.
 
diff --git a/gas/testsuite/gas/mips/mipsr6@hwr-names.d b/gas/testsuite/gas/mips/mipsr6@hwr-names.d
index e44a120c38..3c1473fd88 100644
--- a/gas/testsuite/gas/mips/mipsr6@hwr-names.d
+++ b/gas/testsuite/gas/mips/mipsr6@hwr-names.d
@@ -1,6 +1,6 @@ 
 #objdump: -dr --prefix-addresses --show-raw-insn -mmips:isa32r6 -M gpr-names=numeric,hwr-names=mips32r6
 #name: MIPS HWR disassembly (mips32r6)
-#as: -32
+#as: -32 --defsym r6=1
 #source: hwr-names.s
 
 # Check objdump's handling of -M hwr-names=foo options.
diff --git a/gas/testsuite/gas/mips/mipsr6@pref.d b/gas/testsuite/gas/mips/mipsr6@pref.d
index a6446655a9..389b03334a 100644
--- a/gas/testsuite/gas/mips/mipsr6@pref.d
+++ b/gas/testsuite/gas/mips/mipsr6@pref.d
@@ -1,6 +1,6 @@ 
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: MIPS PREF instruction
-#as: -32 --defsym tpref=1
+#as: -32 --defsym tpref=1 --defsym r6=1
 #source: cache.s
 
 # Check MIPS PREF instruction assembly.
diff --git a/gas/testsuite/gas/mips/option-pic-1.d b/gas/testsuite/gas/mips/option-pic-1.d
index da32af6a6c..612414ae75 100644
--- a/gas/testsuite/gas/mips/option-pic-1.d
+++ b/gas/testsuite/gas/mips/option-pic-1.d
@@ -13,6 +13,6 @@  Disassembly of section \.text:
 [ 	]*[0-9a-f]+: R_MIPS_LO16	bar
 [0-9a-f]+ <[^>]*> 8f820000 	lw	v0,0\(gp\)
 [ 	]*[0-9a-f]+: R_MIPS_GOT16	bar
-[0-9a-f]+ <[^>]*> 03e00008 	jr	ra
+[0-9a-f]+ <[^>]*> 03e0000[89] 	jr	ra
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
index 24d051d5c4..2993d6d0b6 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-01.d
@@ -2,6 +2,7 @@ 
 #source: attr-gnu-4-1.s
 #ld: -r
 #readelf: -A
+#xfail: mipsisa32r6*-*-* mipsisa64r6*-*-*
 
 Attribute Section: gnu
 File Attributes
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
index ce94a818eb..a76da49fad 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-11.d
@@ -2,6 +2,7 @@ 
 #source: attr-gnu-4-1.s
 #ld: -r
 #readelf: -A
+#xfail: mipsisa32r6*-*-* mipsisa64r6*-*-*
 
 Attribute Section: gnu
 File Attributes
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
index 49f2137e0e..acebbeb7d2 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
@@ -1,6 +1,7 @@ 
 #source: attr-gnu-4-4.s -W
 #source: attr-gnu-4-1.s
 #ld: -r
+#xfail: mipsisa32r6*-*-* mipsisa64r6*-*-*
 #error: \A[^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n
 #error:   [^\n]*: warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses -mdouble-float\n
 #error:   [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
index 2f8e5f0925..34f766bae5 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-00.d
@@ -5,5 +5,5 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
 #pass
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
index e2cda3341e..26a835f979 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-01.d
@@ -5,6 +5,6 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: 128-bit MSA
 #pass
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
index 54b196fa38..aee5d4cf57 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-02.d
@@ -5,6 +5,6 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: \?\?\? \(2\)
 #pass
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
index f7c512beeb..de9ac3009a 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-10.d
@@ -5,6 +5,6 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: 128-bit MSA
 #pass
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
index be87af4bd1..c07721c426 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-11.d
@@ -5,6 +5,6 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: 128-bit MSA
 #pass
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
index 05f4da064a..47de4c7763 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-20.d
@@ -5,6 +5,6 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: \?\?\? \(2\)
 #pass
diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d b/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
index 908ce4f00a..ba267ebdd3 100644
--- a/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
+++ b/ld/testsuite/ld-mips-elf/attr-gnu-8-22.d
@@ -5,6 +5,6 @@ 
 
 Attribute Section: gnu
 File Attributes
-  Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\)
+  Tag_GNU_MIPS_ABI_FP: Hard float \((double precision|32-bit CPU, 64-bit FPU)\)
   Tag_GNU_MIPS_ABI_MSA: \?\?\? \(2\)
 #pass
diff --git a/ld/testsuite/ld-mips-elf/emit-relocs-1.d b/ld/testsuite/ld-mips-elf/emit-relocs-1.d
index 86305d314c..d305752aad 100644
--- a/ld/testsuite/ld-mips-elf/emit-relocs-1.d
+++ b/ld/testsuite/ld-mips-elf/emit-relocs-1.d
@@ -23,7 +23,7 @@  OFFSET   TYPE              VALUE *
 
 
 Contents of section \.text:
- 80000 03e00008 00000000 00000000 00000000  .*
+ 80000 03e0000[89] 00000000 00000000 00000000  .*
 Contents of section \.merge1:
  80400 666c7574 74657200                    flutter.*
 Contents of section \.merge2:
diff --git a/ld/testsuite/ld-mips-elf/export-class-call16-n32.dd b/ld/testsuite/ld-mips-elf/export-class-call16-n32.dd
index a033972a9d..011089a56b 100644
--- a/ld/testsuite/ld-mips-elf/export-class-call16-n32.dd
+++ b/ld/testsuite/ld-mips-elf/export-class-call16-n32.dd
@@ -21,21 +21,21 @@  Disassembly of section \.text:
 12340038:	00000000 	nop
 1234003c:	dfbc0000 	ld	gp,0\(sp\)
 12340040:	dfbf0008 	ld	ra,8\(sp\)
-12340044:	03e00008 	jr	ra
+12340044:	03e0000[89] 	jr	ra
 12340048:	27bd0010 	addiu	sp,sp,16
 	\.\.\.
 
 12340060 <protected_foo>:
-12340060:	03e00008 	jr	ra
+12340060:	03e0000[89] 	jr	ra
 12340064:	00000000 	nop
 	\.\.\.
 
 12340070 <hidden_foo>:
-12340070:	03e00008 	jr	ra
+12340070:	03e0000[89] 	jr	ra
 12340074:	00000000 	nop
 	\.\.\.
 
 12340080 <internal_foo>:
-12340080:	03e00008 	jr	ra
+12340080:	03e0000[89] 	jr	ra
 12340084:	00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/export-class-call16-n64.dd b/ld/testsuite/ld-mips-elf/export-class-call16-n64.dd
index 7b481aaa01..1694500b52 100644
--- a/ld/testsuite/ld-mips-elf/export-class-call16-n64.dd
+++ b/ld/testsuite/ld-mips-elf/export-class-call16-n64.dd
@@ -21,21 +21,21 @@  Disassembly of section \.text:
 123456789abc0038:	00000000 	nop
 123456789abc003c:	dfbc0000 	ld	gp,0\(sp\)
 123456789abc0040:	dfbf0008 	ld	ra,8\(sp\)
-123456789abc0044:	03e00008 	jr	ra
+123456789abc0044:	03e0000[89] 	jr	ra
 123456789abc0048:	67bd0010 	daddiu	sp,sp,16
 	\.\.\.
 
 123456789abc0060 <protected_foo>:
-123456789abc0060:	03e00008 	jr	ra
+123456789abc0060:	03e0000[89] 	jr	ra
 123456789abc0064:	00000000 	nop
 	\.\.\.
 
 123456789abc0070 <hidden_foo>:
-123456789abc0070:	03e00008 	jr	ra
+123456789abc0070:	03e0000[89] 	jr	ra
 123456789abc0074:	00000000 	nop
 	\.\.\.
 
 123456789abc0080 <internal_foo>:
-123456789abc0080:	03e00008 	jr	ra
+123456789abc0080:	03e0000[89] 	jr	ra
 123456789abc0084:	00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/export-class-call16-o32.dd b/ld/testsuite/ld-mips-elf/export-class-call16-o32.dd
index 616af2fe0c..2ea8be6229 100644
--- a/ld/testsuite/ld-mips-elf/export-class-call16-o32.dd
+++ b/ld/testsuite/ld-mips-elf/export-class-call16-o32.dd
@@ -23,21 +23,21 @@  Disassembly of section \.text:
 12340040:	00000000 	nop
 12340044:	8fbc0000 	lw	gp,0\(sp\)
 12340048:	8fbf0004 	lw	ra,4\(sp\)
-1234004c:	03e00008 	jr	ra
+1234004c:	03e0000[89] 	jr	ra
 12340050:	27bd0008 	addiu	sp,sp,8
 	\.\.\.
 
 12340060 <protected_foo>:
-12340060:	03e00008 	jr	ra
+12340060:	03e0000[89] 	jr	ra
 12340064:	00000000 	nop
 	\.\.\.
 
 12340070 <hidden_foo>:
-12340070:	03e00008 	jr	ra
+12340070:	03e0000[89] 	jr	ra
 12340074:	00000000 	nop
 	\.\.\.
 
 12340080 <internal_foo>:
-12340080:	03e00008 	jr	ra
+12340080:	03e0000[89] 	jr	ra
 12340084:	00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/gp-disp-sym.s b/ld/testsuite/ld-mips-elf/gp-disp-sym.s
index c6380ba1fb..3b06e717f5 100644
--- a/ld/testsuite/ld-mips-elf/gp-disp-sym.s
+++ b/ld/testsuite/ld-mips-elf/gp-disp-sym.s
@@ -2,4 +2,4 @@ 
   .text
 foo:
   lui    $t0, %hi(_gp_disp)
-  addi   $t0, $t0, %lo(_gp_disp)
+  addiu   $t0, $t0, %lo(_gp_disp)
diff --git a/ld/testsuite/ld-mips-elf/jalr3.dd b/ld/testsuite/ld-mips-elf/jalr3.dd
index 6b6d484120..5c9d83fdfd 100644
--- a/ld/testsuite/ld-mips-elf/jalr3.dd
+++ b/ld/testsuite/ld-mips-elf/jalr3.dd
@@ -9,6 +9,6 @@  Disassembly of section \.text:
    c:	00000000 	nop
 
 0+000010 <\$bar>:
-  10:	03e00008 	jr	ra
+  10:	03e0000[89] 	jr	ra
   14:	00000000 	nop
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/jalr4.dd b/ld/testsuite/ld-mips-elf/jalr4.dd
index 56ee0940b7..207a10283b 100644
--- a/ld/testsuite/ld-mips-elf/jalr4.dd
+++ b/ld/testsuite/ld-mips-elf/jalr4.dd
@@ -9,15 +9,15 @@  Disassembly of section \.text:
 [0-9a-f]+ <[^>]*> 00000000 	nop
 [0-9a-f]+ <[^>]*> 0320f809 	jalr	t9
 [0-9a-f]+ <[^>]*> 00000000 	nop
-[0-9a-f]+ <[^>]*> 03200009 	jalr	zero,t9
+[0-9a-f]+ <[^>]*> 03200009 	(jalr	zero,t9|jr	t9)
 [0-9a-f]+ <[^>]*> 00000000 	nop
-[0-9a-f]+ <[^>]*> 03200008 	jr	t9
+[0-9a-f]+ <[^>]*> 0320000[89] 	jr	t9
 [0-9a-f]+ <[^>]*> 00000000 	nop
 [0-9a-f]+ <[^>]*> 0320f809 	jalr	t9
 [0-9a-f]+ <[^>]*> 00000000 	nop
-[0-9a-f]+ <[^>]*> 03200009 	jalr	zero,t9
+[0-9a-f]+ <[^>]*> 03200009 	(jalr	zero,t9|jr	t9)
 [0-9a-f]+ <[^>]*> 00000000 	nop
-[0-9a-f]+ <[^>]*> 03200008 	jr	t9
+[0-9a-f]+ <[^>]*> 0320000[89] 	jr	t9
 [0-9a-f]+ <[^>]*> 00000000 	nop
 	\.\.\.
 	\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 3d62051755..00c4f86d85 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -137,6 +137,7 @@  set has_abi(eabi) [expr [istarget *-*-elf] \
 set irix [expr [istarget *-*-irix*]]
 set linux_gnu [expr [istarget mips*-*-linux*]]
 set embedded_elf [expr [istarget mips*-*-elf]]
+set is_r6 [expr [istarget mipsisa*r6*-*]]
 
 # Set defaults.
 set abi_asflags(o32) ""
@@ -148,10 +149,18 @@  set abi_ldflags(n32) ""
 set abi_ldflags(n64) ""
 set abi_ldflags(eabi) ""
 
+if { $has_abi(o32) && $is_r6 }  {
+    set abi_as64flags "-mips64r6"
+} elseif { $has_abi(o32) && !$is_r6 } {
+    set abi_as64flags "-mips3"
+} else {
+    set abi_as64flags ""
+}
+
 # Override as needed.
 if {[istarget *-*-openbsd*] } {
     set irixemul 0
-} elseif { [istarget mips64*-*-linux*] } {
+} elseif { [istarget mips*64*-*-linux*] } {
     if [istarget *el-*-*] {
 	set abi_asflags(o32) -32
 	set abi_ldflags(o32) -melf32ltsmip
@@ -249,7 +258,7 @@  if {[istarget *-*-openbsd*] } {
     set irixemul 1
 }
 
-if { $linux_gnu } {
+if { $linux_gnu && !$is_r6 } {
     run_ld_link_tests [list \
 	[list "Dummy shared library for MIPS16 PIC test 1" \
 	      "-shared -melf32btsmip" "" \
@@ -299,66 +308,71 @@  if { $linux_gnu } {
 }
 
 # Check MIPS16 markings being passed through link.
-run_dump_test "mips16-1"
+if { !$is_r6 } {
+    run_dump_test "mips16-1"
+}
 
 # MIPS branch offset final link checking.
 run_dump_test "branch-misc-1"
 run_dump_test "branch-misc-2"
-run_dump_test_o32 "branch-absolute"
-run_dump_test_o32 "branch-absolute-addend"
-run_dump_test_n32 "branch-absolute-n32"
-run_dump_test_n32 "branch-absolute-addend-n32"
-run_dump_test_n64 "branch-absolute-n64"
-run_dump_test_n64 "branch-absolute-addend-n64"
-
-run_dump_test_o32 "mips16-pcrel-0"
-run_dump_test_o32 "mips16-pcrel-1" noarch
-run_dump_test_o32 "mips16e2-pcrel-0" noarch
-run_dump_test_o32 "mips16e2-pcrel-1" noarch
-run_dump_test_o32 "mips16-pcrel-addend-2"
-run_dump_test_o32 "mips16-pcrel-addend-6"
-run_dump_test_o32 "mips16e2-pcrel-addend-2" noarch
-run_dump_test_o32 "mips16e2-pcrel-addend-6" noarch
-run_dump_test_n32 "mips16-pcrel-n32-0"
-run_dump_test_n32 "mips16-pcrel-n32-1"
-run_dump_test_n64 "mips16-pcrel-n64-sym32-0"
-run_dump_test_n64 "mips16-pcrel-n64-sym32-1"
-run_dump_test_n32 "mips16e2-pcrel-n32-0" noarch
-run_dump_test_n32 "mips16e2-pcrel-n32-1" noarch
-run_dump_test_n64 "mips16e2-pcrel-n64-sym32-0" noarch
-run_dump_test_n64 "mips16e2-pcrel-n64-sym32-1" noarch
-
-run_dump_test_o32 "mips16-branch-2"
-run_dump_test_o32 "mips16-branch-3"
-run_dump_test_o32 "mips16-branch-addend-2"
-run_dump_test_o32 "mips16-branch-addend-3"
-run_dump_test_o32 "mips16-branch-absolute"
-run_dump_test_o32 "mips16-branch-absolute-1"
-run_dump_test_o32 "mips16-branch-absolute-2"
-run_dump_test_o32 "mips16-branch-absolute-addend"
-run_dump_test_o32 "mips16-branch-absolute-addend-1"
-run_dump_test_n32 "mips16-branch-absolute-n32"
-run_dump_test_n32 "mips16-branch-absolute-n32-1"
-run_dump_test_n32 "mips16-branch-absolute-n32-2"
-run_dump_test_n32 "mips16-branch-absolute-addend-n32"
-run_dump_test_n32 "mips16-branch-absolute-addend-n32-1"
-run_dump_test_n64 "mips16-branch-absolute-n64"
-run_dump_test_n64 "mips16-branch-absolute-n64-1"
-run_dump_test_n64 "mips16-branch-absolute-n64-2"
-run_dump_test_n64 "mips16-branch-absolute-addend-n64"
-run_dump_test_n64 "mips16-branch-absolute-addend-n64-1"
-
-run_dump_test_o32 "micromips-branch-absolute"
-run_dump_test_o32 "micromips-branch-absolute-addend"
-run_dump_test_n32 "micromips-branch-absolute-n32"
-run_dump_test_n32 "micromips-branch-absolute-addend-n32"
-run_dump_test_n64 "micromips-branch-absolute-n64"
-run_dump_test_n64 "micromips-branch-absolute-addend-n64"
-
-# Jalx test
-run_dump_test "jalx-1"
 
-if { $linux_gnu } {
+if { !$is_r6 } {
+    run_dump_test_o32 "branch-absolute"
+    run_dump_test_o32 "branch-absolute-addend"
+    run_dump_test_n32 "branch-absolute-n32"
+    run_dump_test_n32 "branch-absolute-addend-n32"
+    run_dump_test_n64 "branch-absolute-n64"
+    run_dump_test_n64 "branch-absolute-addend-n64"
+
+    run_dump_test_o32 "mips16-pcrel-0"
+    run_dump_test_o32 "mips16-pcrel-1" noarch
+    run_dump_test_o32 "mips16e2-pcrel-0" noarch
+    run_dump_test_o32 "mips16e2-pcrel-1" noarch
+    run_dump_test_o32 "mips16-pcrel-addend-2"
+    run_dump_test_o32 "mips16-pcrel-addend-6"
+    run_dump_test_o32 "mips16e2-pcrel-addend-2" noarch
+    run_dump_test_o32 "mips16e2-pcrel-addend-6" noarch
+    run_dump_test_n32 "mips16-pcrel-n32-0"
+    run_dump_test_n32 "mips16-pcrel-n32-1"
+    run_dump_test_n64 "mips16-pcrel-n64-sym32-0"
+    run_dump_test_n64 "mips16-pcrel-n64-sym32-1"
+    run_dump_test_n32 "mips16e2-pcrel-n32-0" noarch
+    run_dump_test_n32 "mips16e2-pcrel-n32-1" noarch
+    run_dump_test_n64 "mips16e2-pcrel-n64-sym32-0" noarch
+    run_dump_test_n64 "mips16e2-pcrel-n64-sym32-1" noarch
+
+    run_dump_test_o32 "mips16-branch-2"
+    run_dump_test_o32 "mips16-branch-3"
+    run_dump_test_o32 "mips16-branch-addend-2"
+    run_dump_test_o32 "mips16-branch-addend-3"
+    run_dump_test_o32 "mips16-branch-absolute"
+    run_dump_test_o32 "mips16-branch-absolute-1"
+    run_dump_test_o32 "mips16-branch-absolute-2"
+    run_dump_test_o32 "mips16-branch-absolute-addend"
+    run_dump_test_o32 "mips16-branch-absolute-addend-1"
+    run_dump_test_n32 "mips16-branch-absolute-n32"
+    run_dump_test_n32 "mips16-branch-absolute-n32-1"
+    run_dump_test_n32 "mips16-branch-absolute-n32-2"
+    run_dump_test_n32 "mips16-branch-absolute-addend-n32"
+    run_dump_test_n32 "mips16-branch-absolute-addend-n32-1"
+    run_dump_test_n64 "mips16-branch-absolute-n64"
+    run_dump_test_n64 "mips16-branch-absolute-n64-1"
+    run_dump_test_n64 "mips16-branch-absolute-n64-2"
+    run_dump_test_n64 "mips16-branch-absolute-addend-n64"
+    run_dump_test_n64 "mips16-branch-absolute-addend-n64-1"
+
+    run_dump_test_o32 "micromips-branch-absolute"
+    run_dump_test_o32 "micromips-branch-absolute-addend"
+    run_dump_test_n32 "micromips-branch-absolute-n32"
+    run_dump_test_n32 "micromips-branch-absolute-addend-n32"
+    run_dump_test_n64 "micromips-branch-absolute-n64"
+    run_dump_test_n64 "micromips-branch-absolute-addend-n64"
+
+    # Jalx test
+    run_dump_test "jalx-1"
+}
+
+if { $linux_gnu && !$is_r6 } {
     run_ld_link_tests [list \
 	[list "Dummy shared library for JALX test 2" \
 	      "-shared -nostdlib -melf32btsmip" "" \
@@ -380,69 +394,75 @@  if { $linux_gnu } {
 	      "jalx-2"]]
 }
 
-run_dump_test_o32 "jalx-addend"
-run_dump_test_o32 "jalx-local"
-run_dump_test_o32 "bal-jalx-addend"
-run_dump_test_o32 "bal-jalx-addend-micromips"
-run_dump_test_o32 "bal-jalx-local"
-run_dump_test_o32 "bal-jalx-local-micromips"
-run_dump_test_o32 "bal-jalx-pic"
-run_dump_test_o32 "bal-jalx-pic-micromips"
-run_dump_test_o32 "bal-jalx-pic-ignore"
-run_dump_test_o32 "bal-jalx-pic-ignore-micromips"
-run_dump_test_n32 "jalx-addend-n32"
-run_dump_test_n32 "jalx-local-n32"
-run_dump_test_n32 "bal-jalx-addend-n32"
-run_dump_test_n32 "bal-jalx-addend-micromips-n32"
-run_dump_test_n32 "bal-jalx-local-n32"
-run_dump_test_n32 "bal-jalx-local-micromips-n32"
-run_dump_test_n32 "bal-jalx-pic-n32"
-run_dump_test_n32 "bal-jalx-pic-micromips-n32"
-run_dump_test_n32 "bal-jalx-pic-ignore-n32"
-run_dump_test_n32 "bal-jalx-pic-ignore-micromips-n32"
-run_dump_test_n64 "jalx-addend-n64"
-run_dump_test_n64 "jalx-local-n64"
-run_dump_test_n64 "bal-jalx-addend-n64"
-run_dump_test_n64 "bal-jalx-addend-micromips-n64"
-run_dump_test_n64 "bal-jalx-local-n64"
-run_dump_test_n64 "bal-jalx-local-micromips-n64"
-run_dump_test_n64 "bal-jalx-pic-n64"
-run_dump_test_n64 "bal-jalx-pic-micromips-n64"
-run_dump_test_n64 "bal-jalx-pic-ignore-n64"
-run_dump_test_n64 "bal-jalx-pic-ignore-micromips-n64"
-
-run_dump_test "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-2" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-3" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
-run_dump_test "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
-
-run_dump_test_n32 "unaligned-jalx-addend-0"
-run_dump_test_n32 "unaligned-jalx-addend-1"
-run_dump_test_n32 "unaligned-jalx-addend-2"
-run_dump_test_n32 "unaligned-jalx-addend-3"
-run_dump_test_n32 "unaligned-jalx-addend-mips16-0"
-run_dump_test_n32 "unaligned-jalx-addend-mips16-1"
-run_dump_test_n32 "unaligned-jalx-addend-micromips-0"
-run_dump_test_n32 "unaligned-jalx-addend-micromips-1"
+if { !$is_r6 } {
+    run_dump_test_o32 "jalx-addend"
+    run_dump_test_o32 "jalx-local"
+    run_dump_test_o32 "bal-jalx-addend"
+    run_dump_test_o32 "bal-jalx-addend-micromips"
+    run_dump_test_o32 "bal-jalx-local"
+    run_dump_test_o32 "bal-jalx-local-micromips"
+    run_dump_test_o32 "bal-jalx-pic"
+    run_dump_test_o32 "bal-jalx-pic-micromips"
+    run_dump_test_o32 "bal-jalx-pic-ignore"
+    run_dump_test_o32 "bal-jalx-pic-ignore-micromips"
+    run_dump_test_n32 "jalx-addend-n32"
+    run_dump_test_n32 "jalx-local-n32"
+    run_dump_test_n32 "bal-jalx-addend-n32"
+    run_dump_test_n32 "bal-jalx-addend-micromips-n32"
+    run_dump_test_n32 "bal-jalx-local-n32"
+    run_dump_test_n32 "bal-jalx-local-micromips-n32"
+    run_dump_test_n32 "bal-jalx-pic-n32"
+    run_dump_test_n32 "bal-jalx-pic-micromips-n32"
+    run_dump_test_n32 "bal-jalx-pic-ignore-n32"
+    run_dump_test_n32 "bal-jalx-pic-ignore-micromips-n32"
+    run_dump_test_n64 "jalx-addend-n64"
+    run_dump_test_n64 "jalx-local-n64"
+    run_dump_test_n64 "bal-jalx-addend-n64"
+    run_dump_test_n64 "bal-jalx-addend-micromips-n64"
+    run_dump_test_n64 "bal-jalx-local-n64"
+    run_dump_test_n64 "bal-jalx-local-micromips-n64"
+    run_dump_test_n64 "bal-jalx-pic-n64"
+    run_dump_test_n64 "bal-jalx-pic-micromips-n64"
+    run_dump_test_n64 "bal-jalx-pic-ignore-n64"
+    run_dump_test_n64 "bal-jalx-pic-ignore-micromips-n64"
+
+    run_dump_test "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-2" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-3" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
+    run_dump_test "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
+
+    run_dump_test_n32 "unaligned-jalx-addend-0"
+    run_dump_test_n32 "unaligned-jalx-addend-1"
+    run_dump_test_n32 "unaligned-jalx-addend-2"
+    run_dump_test_n32 "unaligned-jalx-addend-3"
+    run_dump_test_n32 "unaligned-jalx-addend-mips16-0"
+    run_dump_test_n32 "unaligned-jalx-addend-mips16-1"
+    run_dump_test_n32 "unaligned-jalx-addend-micromips-0"
+    run_dump_test_n32 "unaligned-jalx-addend-micromips-1"
+}
 
 run_dump_test_o32 "unaligned-branch" noarch
 
-run_dump_test_n32 "unaligned-branch-2"
-run_dump_test_n32 "unaligned-branch-ignore-2"
-run_dump_test_n32 "unaligned-branch-r6-1"
-run_dump_test_n32 "unaligned-branch-ignore-r6-1"
+if { !$is_r6 } {
+    run_dump_test_n32 "unaligned-branch-2"
+    run_dump_test_n32 "unaligned-branch-ignore-2"
+    run_dump_test_n32 "unaligned-branch-r6-1"
+    run_dump_test_n32 "unaligned-branch-ignore-r6-1"
+}
 run_dump_test_n32 "unaligned-branch-r6-2" noarch
-run_dump_test_n32 "unaligned-branch-mips16"
-run_dump_test_n32 "unaligned-branch-ignore-mips16"
-run_dump_test_n32 "unaligned-branch-micromips"
-run_dump_test_n32 "unaligned-branch-ignore-micromips"
-run_dump_test_n32 "unaligned-jump"
-run_dump_test_n32 "unaligned-jump-mips16"
-run_dump_test_n32 "unaligned-jump-micromips"
+if { !$is_r6 } {
+    run_dump_test_n32 "unaligned-branch-mips16"
+    run_dump_test_n32 "unaligned-branch-ignore-mips16"
+    run_dump_test_n32 "unaligned-branch-micromips"
+    run_dump_test_n32 "unaligned-branch-ignore-micromips"
+    run_dump_test_n32 "unaligned-jump"
+    run_dump_test_n32 "unaligned-jump-mips16"
+    run_dump_test_n32 "unaligned-jump-micromips"
+}
 
 run_dump_test_o32 "unaligned-lwpc-0" noarch
 run_dump_test_o32 "unaligned-lwpc-1" noarch
@@ -476,8 +496,10 @@  if { $embedded_elf } {
     run_dump_test_n32 "elf-rel-got-n32-embed" {{as -EB} {ld -EB}}
     run_dump_test_n32 "elf-rel-xgot-n32-embed" {{as -EB} {ld -EB}}
 } else {
-    run_dump_test_n32 "elf-rel-got-n32" {{as -EB} {ld -EB}}
-    run_dump_test_n32 "elf-rel-xgot-n32" {{as -EB} {ld -EB}}
+    if { !$is_r6 } {
+        run_dump_test_n32 "elf-rel-got-n32" {{as -EB} {ld -EB}}
+        run_dump_test_n32 "elf-rel-xgot-n32" {{as -EB} {ld -EB}}
+    }
 }
 if { $irix } {
     run_dump_test_n64 "elf-rel-got-n64-irix"
@@ -486,8 +508,10 @@  if { $irix } {
     run_dump_test_n64 "elf-rel-got-n64-embed" {{as -EB} {ld -EB}}
     run_dump_test_n64 "elf-rel-xgot-n64-embed" {{as -EB} {ld -EB}}
 } else {
-    run_dump_test_n64 "elf-rel-got-n64" {{as -EB} {ld -EB}}
-    run_dump_test_n64 "elf-rel-xgot-n64" {{as -EB} {ld -EB}}
+    if { !$is_r6 } {
+        run_dump_test_n64 "elf-rel-got-n64" {{as -EB} {ld -EB}}
+        run_dump_test_n64 "elf-rel-xgot-n64" {{as -EB} {ld -EB}}
+    }
 }
 
 run_dump_test_n32 "relax-jalr-n32" {{as -EB} {ld -EB}}
@@ -712,7 +736,9 @@  run_dump_test_o32 "reloc-2" [list [list objdump [expr { [istarget *el-*-*] \
 							? "--endian=little" \
 							: "--endian=big" }]]]
 run_dump_test "reloc-merge-lo16"
-run_dump_test "reloc-3"
+if { !$is_r6 } {
+    run_dump_test "reloc-3"
+}
 run_dump_test_n32 "reloc-3-n32" noarch
 run_dump_test "reloc-4"
 run_dump_test "reloc-5"
@@ -792,10 +818,12 @@  run_dump_test_n64 "undefweak-overflow" [list [list name (n64)]]
 
 run_dump_test_n32 "jalbal" noarch
 
-run_dump_test "mode-change-error-1"
+if { !$is_r6 } {
+    run_dump_test "mode-change-error-1"
 
 run_dump_test_o32 "mips16-hilo"
 run_dump_test_n32 "mips16-hilo-n32"
+}
 
 if { $linux_gnu } {
     run_dump_test_n32 "textrel-1"
@@ -857,7 +885,7 @@  run_dump_test_n32 "emit-relocs-1" {{as -EB} {ld -EB}}
 run_dump_test "hash1"
 run_dump_test "hash2"
 
-if { $linux_gnu && $has_abi(o32) } {
+if { $linux_gnu && $has_abi(o32) && !$is_r6 } {
     # The number of symbols that are always included in the symbol table
     # for these tests.
     #     the null symbol entry
@@ -1108,10 +1136,12 @@  run_dump_test_o32 "abiflags-strip8-ph"
 run_dump_test_o32 "abiflags-strip9-ph"
 run_dump_test_o32 "abiflags-strip10-ph"
 
-run_dump_test "nan-legacy"
+if { !$is_r6 } {
+    run_dump_test "nan-legacy"
+    run_dump_test "nan-mixed-1"
+    run_dump_test "nan-mixed-2"
+}
 run_dump_test "nan-2008"
-run_dump_test "nan-mixed-1"
-run_dump_test "nan-mixed-2"
 
 if { $linux_gnu && $has_abi(o32) } {
     run_ld_link_tests {
@@ -1135,7 +1165,9 @@  if { $linux_gnu } {
 }
 
 # MIPS16 and microMIPS interlinking test.
-run_dump_test "mips16-and-micromips"
+if { !$is_r6 } {
+    run_dump_test "mips16-and-micromips"
+}
 
 set abis {}
 if $has_abi(o32) {
@@ -1163,7 +1195,7 @@  if [check_shared_lib_support] {
 		"$abi_ldflags($abi) -shared -Ttext $loadaddr\
 		 -T export-class-call16.ld" \
 		"" \
-		"$abi_asflags($abi) -mips3 -KPIC" \
+		"$abi_asflags($abi) $abi_as64flags -KPIC" \
 		[list export-class-call16-${abi}.s export-class-call16-def.s] \
 		[list \
 		    "objdump -d export-class-call16-${suff}.dd" \
@@ -1297,7 +1329,7 @@  if { $linux_gnu && $has_abi(o32) } {
 	o32 109 1 umips-word compressed-plt-1e.s
 }
 
-if { $linux_gnu && $has_abi(n32) } {
+if { $linux_gnu && $has_abi(n32) && !$is_r6 } {
     build_mips_plt_lib n32
     run_mips_plt_test "n32 PLTs for mixed MIPS and MIPS16" \
 	n32 109 0 mips16
@@ -1378,7 +1410,7 @@  if { $linux_gnu && $has_abi(o32) } {
 }
 
 # PR ld/21334 GOT relocation in static binary test.
-if { $has_abi(o32) } {
+if { $has_abi(o32) && !$is_r6 } {
     run_ld_link_tests [list \
 	[list \
 	    "PR ld/21334 MIPS GOT16 relocation in static binary" \
@@ -1394,7 +1426,7 @@  run_dump_test_o32 "lsi-4010-isa" noarch
 
 # PIC branch relaxation with offset tests.  We need to use our version
 # of `prune_warnings' to get rid of GAS branch relaxation noise.
-if { $has_abi(o32) } {
+if { $has_abi(o32) && !$is_r6 } {
     rename prune_warnings mips_old_prune_warnings
     proc prune_warnings { msg } {
 	set msg1 "Assembler messages:"
@@ -1581,7 +1613,7 @@  proc run_mips_undefweak_test { name abi args } {
     }
 }
 
-if $has_abi(o32) {
+if { $has_abi(o32) && !$is_r6 } {
     run_mips_undefweak_test "SVR4 executable" \
 						    o32
     run_mips_undefweak_test "SVR4 executable (hidden)" \
@@ -1621,7 +1653,7 @@  if $has_abi(o32) {
     run_mips_undefweak_test "shared library (microMIPS, large GOT, hidden)" \
 						    o32 dso umips xgot hidden
 }
-if $has_abi(n32) {
+if { $has_abi(n32) && !$is_r6 } {
     run_mips_undefweak_test "shared library (n32)" \
 						    n32 dso
     run_mips_undefweak_test "shared library (n32, hidden)" \
@@ -1631,7 +1663,7 @@  if $has_abi(n32) {
     run_mips_undefweak_test "shared library (n32, microMIPS, hidden)" \
 						    n32 dso umips hidden
 }
-if $has_abi(n64) {
+if { $has_abi(n64) && !$is_r6 } {
     run_mips_undefweak_test "shared library (n64)" \
 						    n64 dso
     run_mips_undefweak_test "shared library (n64, hidden)" \
@@ -1649,11 +1681,13 @@  run_dump_test "pic-reloc-2"
 run_dump_test "pic-reloc-3"
 run_dump_test "pic-reloc-4"
 run_dump_test_o32 "pic-reloc-5"
-run_dump_test_o32 "pic-reloc-5" [list [list name (microMIPS)] \
+if { !$is_r6 } {
+    run_dump_test_o32 "pic-reloc-5" [list [list name (microMIPS)] \
 				      [list as "-mmicromips"]]
-run_dump_test_o32 "pic-reloc-6"
-run_dump_test_n64 "pic-reloc-7"
-run_dump_test_n64 "pic-reloc-7" [list [list name (microMIPS)] \
+    run_dump_test_o32 "pic-reloc-6"
+    run_dump_test_n64 "pic-reloc-7" [list [list name (microMIPS)] \
 				      [list as "-mmicromips"]]
 
+}
+run_dump_test_n64 "pic-reloc-7"
 run_dump_test_o32 "reloc-pcrel-r6"
diff --git a/ld/testsuite/ld-mips-elf/n64-plt-1.dd b/ld/testsuite/ld-mips-elf/n64-plt-1.dd
index 4c24a9a16c..51d654a343 100644
--- a/ld/testsuite/ld-mips-elf/n64-plt-1.dd
+++ b/ld/testsuite/ld-mips-elf/n64-plt-1.dd
@@ -15,7 +15,7 @@  Disassembly of section \.plt:
 00000000100002a0 <bar@plt>:
     100002a0:	3c0f7fff 	lui	t3,0x7fff
     100002a4:	ddf97ff8 	ld	t9,32760\(t3\)
-    100002a8:	03200008 	jr	t9
+    100002a8:	0320000[89] 	jr	t9
     100002ac:	25f87ff8 	addiu	t8,t3,32760
 
 Disassembly of section \.text:
diff --git a/ld/testsuite/ld-mips-elf/n64-plt-4.dd b/ld/testsuite/ld-mips-elf/n64-plt-4.dd
index 01c5025615..71fee33c4e 100644
--- a/ld/testsuite/ld-mips-elf/n64-plt-4.dd
+++ b/ld/testsuite/ld-mips-elf/n64-plt-4.dd
@@ -15,7 +15,7 @@  ffffffff1000029c:	2718fffe 	addiu	t8,t8,-2
 ffffffff100002a0 <bar@plt>:
 ffffffff100002a0:	3c0f8000 	lui	t3,0x8000
 ffffffff100002a4:	ddf98010 	ld	t9,-32752\(t3\)
-ffffffff100002a8:	03200008 	jr	t9
+ffffffff100002a8:	0320000[89] 	jr	t9
 ffffffff100002ac:	25f88010 	addiu	t8,t3,-32752
 
 Disassembly of section \.text:
diff --git a/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d b/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
index 3baf22851a..e3cc14ec79 100644
--- a/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
+++ b/ld/testsuite/ld-mips-elf/pic-and-nonpic-2.d
@@ -17,6 +17,6 @@  Disassembly of section \.text:
    4101c:	27391020 	addiu	t9,t9,4128
 
 00041020 <foo2>:
-   41020:	03e00008 	jr	ra
+   41020:	03e0000[89] 	jr	ra
    41024:	00000000 	nop
 	\.\.\.