OSDN Git Service

[gcc]
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Apr 2012 21:00:07 +0000 (21:00 +0000)
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Apr 2012 21:00:07 +0000 (21:00 +0000)
2012-04-12  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.
(TARGET_EXTRA_BUILTINS): Adjust comment.

[gcc/testsuite]
012-04-12  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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@186392 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 6f030d0..62e8e9d 100644 (file)
@@ -1,3 +1,13 @@
+2012-04-12  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.
+       (TARGET_EXTRA_BUILTINS): Adjust comment.
+
 2012-04-12  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52943
@@ -35,7 +45,7 @@
        generate REG_CFA_* notes for the stack pointer.
        (tilepro_expand_epilogue): Restore stack pointer by adjusting it
        by EH_RETURN_STACKADJ_RTX.
-       
+
 2012-04-06  Matt Turner  <mattst88@gmail.com>
 
        * doc/install.texi: Correct typo "-mno-lsc" -> "-mno-llsc".
index 6bd2b8d..63cbdc8 100644 (file)
@@ -467,10 +467,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
@@ -492,7 +493,7 @@ extern int rs6000_vector_align[];
 
 #define TARGET_EXTRA_BUILTINS  (!TARGET_SPE && !TARGET_PAIRED_FLOAT     \
                                 && ((TARGET_POWERPC64                   \
-                                     || TARGET_PPC_GPOPT /* 970 */      \
+                                     || TARGET_PPC_GPOPT /* 970/power4 */ \
                                      || TARGET_POPCNTB   /* ISA 2.02 */ \
                                      || TARGET_CMPB      /* ISA 2.05 */ \
                                      || TARGET_POPCNTD   /* ISA 2.06 */ \
index 032a013..1bb8439 100644 (file)
@@ -1,3 +1,11 @@
+2012-04-12  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-12  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52943
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;
+}