From: Catherine Moore Date: Wed, 8 Jan 2014 22:26:05 +0000 (-0500) Subject: umips-branch-3.c: New test. X-Git-Tag: releases/gcc-4.9.0~1768 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f9d82aa236437d25dc059a763e8fdd9bcd66e7f;p=thirdparty%2Fgcc.git umips-branch-3.c: New test. 2014-01-08 Catherine Moore 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2826bca98bd2..8bd7ef398360 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-01-08 Catherine Moore + + * 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 PR rtl-optimization/59137 diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index acbf6a31d7fc..bc9d301291c6 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -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". */ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 813413ee3fc6..fb47a890c4c4 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -6161,7 +6161,12 @@ (define_insn "*" [(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")]) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 484d6fc6a0f9..d1b72ecdc682 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-01-08 Catherine Moore + + * gcc.target/mips/umips-branch-3.c: New test. + * gcc.target/mips/umips-branch-4.c: New test. + 2014-01-08 Richard Sandiford * 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 index 000000000000..8717362e044b --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-3.c @@ -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 index 000000000000..b346d11723fa --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/umips-branch-4.c @@ -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" } } */