]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/52775 (Change default for using FCFID instruction)
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Fri, 13 Apr 2012 21:55:15 +0000 (21:55 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Fri, 13 Apr 2012 21:55:15 +0000 (21:55 +0000)
[gcc]
2012-04-12  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/52775
* config/rs6000/rs6000.h (TARGET_FCFID): Add TARGET_PPC_GPOPT to
the list of options to enable the FCFID instruction.
(TARGET_EXTRA_BUILTINS): Adjust comment.

[gcc/testsuite]
2012-04-12  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/52775
* gcc.target/powerpc/pr52775.c: New file.

From-SVN: r186438

gcc/ChangeLog
gcc/config/rs6000/rs6000.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr52775.c [new file with mode: 0644]

index 3733e426ef4845fcad265e1bc99deab6a50364ed..8c2998f07d4ef01ba937408b814ba91ac809843d 100644 (file)
@@ -1,3 +1,12 @@
+2012-04-13  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       Backport from mainline
+       2012-04-12  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR target/52775
+       * config/rs6000/rs6000.h (TARGET_FCFID): Add TARGET_PPC_GPOPT to
+       the list of options to enable the FCFID instruction.
+
 2012-04-12  Richard Earnshaw  <rearnsha@arm.com>
 
        PR target/49448
index a8d42398ec5a87187e8d12e32024615ee09be6f6..0eae3265a0f3d8fa3bc85d862498090f4d863fc3 100644 (file)
@@ -469,10 +469,11 @@ extern int rs6000_vector_align[];
 /* ISA 2.01 allowed FCFID to be done in 32-bit, previously it was 64-bit only.
    Enable 32-bit fcfid's on any of the switches for newer ISA machines or
    XILINX.  */
-#define TARGET_FCFID   (TARGET_POWERPC64 \
-                        || TARGET_POPCNTB      /* ISA 2.02 */ \
-                        || TARGET_CMPB         /* ISA 2.05 */ \
-                        || TARGET_POPCNTD      /* ISA 2.06 */ \
+#define TARGET_FCFID   (TARGET_POWERPC64                               \
+                        || TARGET_PPC_GPOPT    /* 970/power4 */        \
+                        || TARGET_POPCNTB      /* ISA 2.02 */          \
+                        || TARGET_CMPB         /* ISA 2.05 */          \
+                        || TARGET_POPCNTD      /* ISA 2.06 */          \
                         || TARGET_XILINX_FPU)
 
 #define TARGET_FCTIDZ  TARGET_FCFID
index a3a5f18e1180c65a2bec60c6ccf28678473172eb..2819865ee750eefbc0539c0ebd590c143f6e6410 100644 (file)
@@ -1,3 +1,11 @@
+2012-04-13  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       Backport from mainline
+       2012-04-12  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR target/52775
+       * gcc.target/powerpc/pr52775.c: New file.
+
 2012-04-03  Jason Merrill  <jason@redhat.com>
 
        PR c++/52796
diff --git a/gcc/testsuite/gcc.target/powerpc/pr52775.c b/gcc/testsuite/gcc.target/powerpc/pr52775.c
new file mode 100644 (file)
index 0000000..4027819
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-options "-O1 -mcpu=power4" } */
+/* { dg-final { scan-assembler-times "fcfid" 2 } } */
+
+double
+int_to_double (int *p)
+{
+  return (double)*p;
+}
+
+double
+long_long_to_double (long long *p)
+{
+  return (double)*p;
+}