]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/61195 (single precision fmov does not need to switch mode)
authorChristian Bruel <christian.bruel@st.com>
Mon, 19 May 2014 08:04:22 +0000 (10:04 +0200)
committerChristian Bruel <chrbr@gcc.gnu.org>
Mon, 19 May 2014 08:04:22 +0000 (10:04 +0200)
PR target/61195
* config/sh/sh.md (movsf_ie): Unset fp_mode for fmov

From-SVN: r210608

gcc/ChangeLog
gcc/config/sh/sh.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/pr61195.c [new file with mode: 0644]

index e592f85be1aa3f97ac221e74b3e8db9567b6741d..d938d1d17a704708b7cffc340e38965c64504cba 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-19  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/61195
+       * config/sh/sh.md (movsf_ie): Unset fp_mode for fmov.
+
 2014-05-19  Richard Sandiford  <r.sandiford@uk.ibm.com>
 
        PR target/61084
index f77f572d0e5fd4e02631cece2ee3c4c98db946ac..0250f9231ec2f5546335a2c703ffa89bbf11a35a 100644 (file)
@@ -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" "")
index 753fdcf71b1f260220d1ea4f75983ccc2e1f4eb0..846ad6d446c600b5c665a3d10d95a612325d22a1 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-19  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/61195
+       * gcc.target/sh/pr61195.c: New test.
+
 2014-05-18  Wei Mi  <wmi@google.com>
 
        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 (file)
index 0000000..f3fb10b
--- /dev/null
@@ -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;
+}