]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
umips-branch-3.c: New test.
authorCatherine Moore <clm@codesourcery.com>
Wed, 8 Jan 2014 22:26:05 +0000 (17:26 -0500)
committerCatherine Moore <clm@gcc.gnu.org>
Wed, 8 Jan 2014 22:26:05 +0000 (17:26 -0500)
2014-01-08  Catherine Moore  <clm@codesourcery.com>

gcc/testsuite/
* gcc.target/mips/umips-branch-3.c: New test.
* gcc.target/mips/umips-branch-4.c: New test.

gcc/
* config/mips/mips.md (simple_return): Attempt to use JRC for microMIPS.
* config/mips/mips.h (MIPS_CALL): Attempt to use JALS for microMIPS.

From-SVN: r206447

gcc/ChangeLog
gcc/config/mips/mips.h
gcc/config/mips/mips.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/umips-branch-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/mips/umips-branch-4.c [new file with mode: 0644]

index 2826bca98bd2efc52d5c85b613a77b2082593bc0..8bd7ef398360d0720245f12bbcb1b1255482477a 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-08  Catherine Moore  <clm@codesourcery.com>
+
+       * config/mips/mips.md (simple_return): Attempt to use JRC for microMIPS.
+       * config/mips/mips.h (MIPS_CALL): Attempt to use JALS for microMIPS.
+
 2014-01-08  Richard Sandiford  <rdsandiford@googlemail.com>
 
        PR rtl-optimization/59137
index acbf6a31d7fc127060ed6aa54d0ec0ebe5d8da17..bc9d301291c699a27af8ff6bac64da044b6050b1 100644 (file)
@@ -2529,7 +2529,9 @@ typedef struct mips_args {
       : TARGET_MICROMIPS && !TARGET_INTERLINK_COMPRESSED       \
       ? "%*" INSN "r%!\t%" #TARGET_OPNO "%/"                   \
       : "%*" INSN "r\t%" #TARGET_OPNO "%/")                    \
-   : MIPS_ABSOLUTE_JUMP ("%*" INSN "\t%" #TARGET_OPNO "%/"))
+   : TARGET_MICROMIPS && !TARGET_INTERLINK_COMPRESSED          \
+     ? MIPS_ABSOLUTE_JUMP ("%*" INSN "%!\t%" #TARGET_OPNO "%/")        \
+     : MIPS_ABSOLUTE_JUMP ("%*" INSN "\t%" #TARGET_OPNO "%/")) \
 
 /* Similar to MIPS_CALL, but this is for MICROMIPS "j" to generate
    "jrc" when nop is in the delay slot of "jr".  */
index 813413ee3fc63622192d46aa1e7dd2645de65135..fb47a890c4c43957d30ec973c34a376eba599004 100644 (file)
 (define_insn "*<optab>"
   [(any_return)]
   ""
-  "%*j\t$31%/"
+  {
+    if (TARGET_MICROMIPS)
+      return "%*jr%:\t$31";
+    else
+      return "%*j\t$31%/";
+  }
   [(set_attr "type"    "jump")
    (set_attr "mode"    "none")])
 
index 484d6fc6a0f9eb2edd5e9c0d736c6946978917ad..d1b72ecdc682767b770aa208cc301992cabfc16a 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-08  Catherine Moore  <clm@codesourcery.com>
+
+       * gcc.target/mips/umips-branch-3.c: New test.
+       * gcc.target/mips/umips-branch-4.c: New test.
+
 2014-01-08  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.dg/tree-ssa/reassoc-32.c, gcc.dg/tree-ssa/reassoc-33.c,
diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-3.c b/gcc/testsuite/gcc.target/mips/umips-branch-3.c
new file mode 100644 (file)
index 0000000..8717362
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-options "(-mmicromips)" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+
+void MICROMIPS
+foo (void)
+{
+  return;
+}
+
+/* { dg-final { scan-assembler "\tjrc\t\\\$31\n" } } */
diff --git a/gcc/testsuite/gcc.target/mips/umips-branch-4.c b/gcc/testsuite/gcc.target/mips/umips-branch-4.c
new file mode 100644 (file)
index 0000000..b346d11
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-options "(-mmicromips)" } */
+
+void foo (void);
+
+int MICROMIPS
+a (void)
+{
+  foo ();
+  return 0;
+}
+
+/* { dg-final { scan-assembler "\tjals\tfoo\n\tnop" } } */