From 9f9d82aa236437d25dc059a763e8fdd9bcd66e7f Mon Sep 17 00:00:00 2001 From: Catherine Moore Date: Wed, 8 Jan 2014 17:26:05 -0500 Subject: 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 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.h | 4 +++- gcc/config/mips/mips.md | 7 ++++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/mips/umips-branch-3.c | 10 ++++++++++ gcc/testsuite/gcc.target/mips/umips-branch-4.c | 12 ++++++++++++ 6 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/mips/umips-branch-3.c create mode 100644 gcc/testsuite/gcc.target/mips/umips-branch-4.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2826bca..8bd7ef3 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 acbf6a3..bc9d301 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 813413ee..fb47a89 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 484d6fc..d1b72ec 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 0000000..8717362 --- /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 0000000..b346d11 --- /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" } } */ -- cgit v1.1