From: Christian Bruel Date: Mon, 19 May 2014 08:04:22 +0000 (+0200) Subject: re PR target/61195 (single precision fmov does not need to switch mode) X-Git-Tag: releases/gcc-5.1.0~7470 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72d82e7ab1ef3c39568e6763b393826c77e8237a;p=thirdparty%2Fgcc.git re PR target/61195 (single precision fmov does not need to switch mode) PR target/61195 * config/sh/sh.md (movsf_ie): Unset fp_mode for fmov From-SVN: r210608 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e592f85be1aa..d938d1d17a70 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-19 Christian Bruel + + PR target/61195 + * config/sh/sh.md (movsf_ie): Unset fp_mode for fmov. + 2014-05-19 Richard Sandiford PR target/61084 diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index f77f572d0e5f..0250f9231ec2 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -8357,9 +8357,29 @@ label: (const_int 2) (const_int 2) (const_int 0)]) - (set (attr "fp_mode") (if_then_else (eq_attr "fmovd" "yes") - (const_string "single") - (const_string "single")))]) + (set_attr_alternative "fp_mode" + [(if_then_else (eq_attr "fmovd" "yes") + (const_string "single") (const_string "none")) + (const_string "none") + (const_string "single") + (const_string "single") + (const_string "none") + (if_then_else (eq_attr "fmovd" "yes") + (const_string "single") (const_string "none")) + (if_then_else (eq_attr "fmovd" "yes") + (const_string "single") (const_string "none")) + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none") + (const_string "none")])]) (define_split [(set (match_operand:SF 0 "register_operand" "") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 753fdcf71b1f..846ad6d446c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-05-19 Christian Bruel + + PR target/61195 + * gcc.target/sh/pr61195.c: New test. + 2014-05-18 Wei Mi PR target/58066 diff --git a/gcc/testsuite/gcc.target/sh/pr61195.c b/gcc/testsuite/gcc.target/sh/pr61195.c new file mode 100644 index 000000000000..f3fb10b7bf4a --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr61195.c @@ -0,0 +1,19 @@ +/* Verify that we don't switch mode for single moves. */ +/* { dg-do compile } */ +/* { dg-require-effective-target hard_float } */ +/* { dg-skip-if "" { *-*-* } { "mfmovd" } { "" } } */ +/* { dg-final { scan-assembler-not "fpscr" } } */ + +float *g; + +float +foo(float f) +{ + return f; +} + +float +foo1(void) +{ + return *g; +}