gas/
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 28 May 2013 22:19:34 +0000 (22:19 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Tue, 28 May 2013 22:19:34 +0000 (22:19 +0000)
* config/tc-mips.c (macro) <ld>: Don't use $zero for address
calculation.

gas/testsuite/
* gas/mips/ld-zero.d: New test.
* gas/mips/ld-zero-2.d: New test.
* gas/mips/ld-zero-3.d: New test.
* gas/mips/ld-zero-q.d: New test.
* gas/mips/ld-zero-u.d: New test.
* gas/mips/ecoff@ld-zero-3.d: New test.
* gas/mips/micromips@ld-zero-2.d: New test.
* gas/mips/micromips@ld-zero-3.d: New test.
* gas/mips/ld-zero.s: New test source.
* gas/mips/ld-zero-2.s: New test source.
* gas/mips/ld-zero-3.s: New test source.
* gas/mips/ld-zero-q.s: New test source.
* gas/mips/ld-zero-u.s: New test source.
* gas/mips/mips.exp: Run the new tests.

17 files changed:
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/ecoff@ld-zero-3.d [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-3.d [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-3.s [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-q.d [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-q.s [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-u.d [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero-u.s [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero.d [new file with mode: 0644]
gas/testsuite/gas/mips/ld-zero.s [new file with mode: 0644]
gas/testsuite/gas/mips/micromips@ld-zero-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/micromips@ld-zero-3.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index b8fa3a5b1b09b9f43dd9ab666f073d064980e905..b9731852961b2d57e87a9649f8eb14bc4d5ea62f 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-28  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>
+
+       * config/tc-mips.c (macro) <ld>: Don't use $zero for address
+       calculation.
+
 2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
 
        * config/tc-aarch64.c (reloc_table): Update to use
index 9b191bbe8b2c7a16456b15c9a4b4b42564947aed..1f16dc9cfeffee78f4ad0dd408154d48338cd7bc 100644 (file)
@@ -8286,7 +8286,8 @@ macro (struct mips_cl_insn *ip)
       goto ld_st;
 
     ld:
-      if (breg == treg + lp)
+      /* We don't want to use $0 as tempreg.  */
+      if (breg == treg + lp || treg + lp == ZERO)
        goto ld_st;
       else
        tempreg = treg + lp;
index 6bd45d5a3b7fefa14bff801daf8b8af86afbf48c..5253912a9a050b39ea608cd0ab4948c3308e2592 100644 (file)
@@ -1,3 +1,20 @@
+2013-05-28  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * gas/mips/ld-zero.d: New test.
+       * gas/mips/ld-zero-2.d: New test.
+       * gas/mips/ld-zero-3.d: New test.
+       * gas/mips/ld-zero-q.d: New test.
+       * gas/mips/ld-zero-u.d: New test.
+       * gas/mips/ecoff@ld-zero-3.d: New test.
+       * gas/mips/micromips@ld-zero-2.d: New test.
+       * gas/mips/micromips@ld-zero-3.d: New test.
+       * gas/mips/ld-zero.s: New test source.
+       * gas/mips/ld-zero-2.s: New test source.
+       * gas/mips/ld-zero-3.s: New test source.
+       * gas/mips/ld-zero-q.s: New test source.
+       * gas/mips/ld-zero-u.s: New test source.
+       * gas/mips/mips.exp: Run the new tests.
+
 2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
 
        * gas/aarch64/tls.d: Update.
diff --git a/gas/testsuite/gas/mips/ecoff@ld-zero-3.d b/gas/testsuite/gas/mips/ecoff@ld-zero-3.d
new file mode 100644 (file)
index 0000000..4f682b1
--- /dev/null
@@ -0,0 +1,4 @@
+#objdump: -dr --prefix-addresses
+#name: MIPS III load $zero
+#source: ld-zero-3.s
+#dump: ld-zero-3.d
diff --git a/gas/testsuite/gas/mips/ld-zero-2.d b/gas/testsuite/gas/mips/ld-zero-2.d
new file mode 100644 (file)
index 0000000..ddab515
--- /dev/null
@@ -0,0 +1,11 @@
+#objdump: -dr --prefix-addresses
+#as: -32
+#name: MIPS II load $zero
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> ll   zero,22136\(at\)
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/ld-zero-2.s b/gas/testsuite/gas/mips/ld-zero-2.s
new file mode 100644 (file)
index 0000000..3bf4ca4
--- /dev/null
@@ -0,0 +1,7 @@
+       .text
+foo:
+       ll      $0, 0x12345678($2)
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/ld-zero-3.d b/gas/testsuite/gas/mips/ld-zero-3.d
new file mode 100644 (file)
index 0000000..e8ae74d
--- /dev/null
@@ -0,0 +1,17 @@
+#objdump: -dr --prefix-addresses
+#as: -mabi=o64
+#name: MIPS III load $zero
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lwu  zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> ld   zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lld  zero,22136\(at\)
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/ld-zero-3.s b/gas/testsuite/gas/mips/ld-zero-3.s
new file mode 100644 (file)
index 0000000..7ca414c
--- /dev/null
@@ -0,0 +1,9 @@
+       .text
+foo:
+       lwu     $0, 0x12345678($2)
+       ld      $0, 0x12345678($2)
+       lld     $0, 0x12345678($2)
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/ld-zero-q.d b/gas/testsuite/gas/mips/ld-zero-q.d
new file mode 100644 (file)
index 0000000..1e92462
--- /dev/null
@@ -0,0 +1,11 @@
+#objdump: -dr --prefix-addresses
+#as: -32
+#name: MIPS R5900 load $zero
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lq   zero,22136\(at\)
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/ld-zero-q.s b/gas/testsuite/gas/mips/ld-zero-q.s
new file mode 100644 (file)
index 0000000..972eb1c
--- /dev/null
@@ -0,0 +1,7 @@
+       .text
+foo:
+       lq      $0, 0x12345678($2)
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/ld-zero-u.d b/gas/testsuite/gas/mips/ld-zero-u.d
new file mode 100644 (file)
index 0000000..a54f9f2
--- /dev/null
@@ -0,0 +1,15 @@
+#objdump: -dr --prefix-addresses
+#as: -32
+#name: microMIPS load $zero
+
+.*: +file format .*mips.*
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> ori  at,at,0x5000
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lwp  zero,1656\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> ori  at,at,0x5000
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> ldp  zero,1656\(at\)
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/ld-zero-u.s b/gas/testsuite/gas/mips/ld-zero-u.s
new file mode 100644 (file)
index 0000000..c31e855
--- /dev/null
@@ -0,0 +1,8 @@
+       .text
+foo:
+       lwp     $0, 0x12345678($2)
+       ldp     $0, 0x12345678($2)
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/ld-zero.d b/gas/testsuite/gas/mips/ld-zero.d
new file mode 100644 (file)
index 0000000..6ee9260
--- /dev/null
@@ -0,0 +1,23 @@
+#objdump: -dr --prefix-addresses
+#as: -32
+#name: MIPS load $zero
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lb   zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lbu  zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lh   zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lhu  zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lw   zero,22136\(at\)
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/ld-zero.s b/gas/testsuite/gas/mips/ld-zero.s
new file mode 100644 (file)
index 0000000..b8af6fe
--- /dev/null
@@ -0,0 +1,11 @@
+       .text
+foo:
+       lb      $0, 0x12345678($2)
+       lbu     $0, 0x12345678($2)
+       lh      $0, 0x12345678($2)
+       lhu     $0, 0x12345678($2)
+       lw      $0, 0x12345678($2)
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+       .align  4, 0
+       .space  16
diff --git a/gas/testsuite/gas/mips/micromips@ld-zero-2.d b/gas/testsuite/gas/mips/micromips@ld-zero-2.d
new file mode 100644 (file)
index 0000000..7fcdc44
--- /dev/null
@@ -0,0 +1,13 @@
+#objdump: -dr --prefix-addresses
+#as: -32
+#name: MIPS II load $zero
+#source: ld-zero-2.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> ori  at,at,0x5000
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> ll   zero,1656\(at\)
+       \.\.\.
diff --git a/gas/testsuite/gas/mips/micromips@ld-zero-3.d b/gas/testsuite/gas/mips/micromips@ld-zero-3.d
new file mode 100644 (file)
index 0000000..49c005b
--- /dev/null
@@ -0,0 +1,21 @@
+#objdump: -dr --prefix-addresses
+#as: -32
+#name: MIPS III load $zero
+#source: ld-zero-3.s
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> ori  at,at,0x5000
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lwu  zero,1656\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> addu at,v0,at
+[0-9a-f]+ <[^>]*> lw   zero,22136\(at\)
+[0-9a-f]+ <[^>]*> lw   at,22140\(at\)
+[0-9a-f]+ <[^>]*> lui  at,0x1234
+[0-9a-f]+ <[^>]*> ori  at,at,0x5000
+[0-9a-f]+ <[^>]*> addu at,at,v0
+[0-9a-f]+ <[^>]*> lld  zero,1656\(at\)
+       \.\.\.
index aef771a65ddfc364cfe5172f76e6e59497679bee..1107fb6b7bce5c796c8c1d590fcf7319e6bd8a07 100644 (file)
@@ -698,6 +698,11 @@ if { [istarget mips*-*-vxworks*] } {
                                        [mips_arch_list_matching mips3 !singlefloat]
        }
     }
+    run_dump_test_arches "ld-zero"     [mips_arch_list_matching mips1]
+    run_dump_test_arches "ld-zero-2"   [mips_arch_list_matching mips2 !nollsc]
+    run_dump_test_arches "ld-zero-3"   [mips_arch_list_matching mips3 !nollsc]
+    run_dump_test_arches "ld-zero-u"   [mips_arch_list_matching micromips]
+    run_dump_test_arches "ld-zero-q"   [mips_arch_list_matching r5900]
     if $elf { run_dump_test "ld-svr4pic" }
     if $elf { run_dump_test "ld-xgot" }
     run_dump_test_arches "li"          [mips_arch_list_matching mips1]