re PR target/27946 (double to long long and back to double stores to the stack)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Fri, 21 Mar 2008 22:16:49 +0000 (22:16 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 21 Mar 2008 22:16:49 +0000 (15:16 -0700)
2008-03-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR target/27947
        * config/rs6000/rs6000.md (floatdidf2): Discouraging fprs and
        encouraging but not allowing gprs for input;
        change the input constraint to !f#r.
        (fix_truncdfdi2): Discouraging fprs and encouraging but not allowing
        gprs for output;
        change the output constraint to !f#r.

2008-03-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR target/27947
        * gcc.target/powerpc/ppc64-double-1.c: New testcase.

From-SVN: r133438

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/ppc64-double-1.c [new file with mode: 0644]

index 3d2ad8ff0269e946897dcf9a8aefa8153ce7733f..b26a46ac24ed96e214d0baedb4b43e4cb5913541 100644 (file)
@@ -1,3 +1,13 @@
+2008-03-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR target/27947
+       * config/rs6000/rs6000.md (floatdidf2): Discouraging fprs and
+       encouraging but not allowing gprs for input;
+       change the input constraint to !f#r.
+       (fix_truncdfdi2): Discouraging fprs and encouraging but not allowing
+       gprs for output;
+       change the output constraint to !f#r.
+
 2008-03-21  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/13958
index 777a1ecf46ddacc1f5c64bf3c29caa3d7e535151..cac5fd1f36b3a7c081deafdd6dfe7548f4793c86 100644 (file)
 
 (define_insn "floatdidf2"
   [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
-       (float:DF (match_operand:DI 1 "gpc_reg_operand" "*f")))]
+       (float:DF (match_operand:DI 1 "gpc_reg_operand" "!f#r")))]
   "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
   "fcfid %0,%1"
   [(set_attr "type" "fp")])
   "")
 
 (define_insn "fix_truncdfdi2"
-  [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
+  [(set (match_operand:DI 0 "gpc_reg_operand" "=!f#r")
        (fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))]
   "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
   "fctidz %0,%1"
 ;; from double rounding.
 (define_insn_and_split "floatdisf2_internal1"
   [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
-        (float:SF (match_operand:DI 1 "gpc_reg_operand" "*f")))
+        (float:SF (match_operand:DI 1 "gpc_reg_operand" "!f#r")))
    (clobber (match_scratch:DF 2 "=f"))]
   "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
   "#"
index ad3e1abf2f4a877c43a2489d989566a5552705ea..9b650a55e00bca6f1fc75da0760a47cac1065c5c 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR target/27947
+       * gcc.target/powerpc/ppc64-double-1.c: New testcase.
+
 2008-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR libfortran/32972
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc64-double-1.c b/gcc/testsuite/gcc.target/powerpc/ppc64-double-1.c
new file mode 100644 (file)
index 0000000..6672b10
--- /dev/null
@@ -0,0 +1,11 @@
+// { dg-do compile }
+// { dg-options "-O2 -mpowerpc64" }
+// { dg-final { scan-assembler-not "stfd"  }  }
+
+// The register allocator should have allocated the temporary long long value in a floating point register.
+
+double
+d2ll2d (double d)
+{
+        return (double)(long long)d;
+}