From: Michael Meissner Date: Fri, 13 Apr 2012 21:55:15 +0000 (+0000) Subject: re PR target/52775 (Change default for using FCFID instruction) X-Git-Tag: releases/gcc-4.6.4~588 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=587c710620e45ea354cd73d783aa5ca181e59581;p=thirdparty%2Fgcc.git re PR target/52775 (Change default for using FCFID instruction) [gcc] 2012-04-12 Michael Meissner 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 PR target/52775 * gcc.target/powerpc/pr52775.c: New file. From-SVN: r186438 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3733e426ef48..8c2998f07d4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2012-04-13 Michael Meissner + + Backport from mainline + 2012-04-12 Michael Meissner + + 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 PR target/49448 diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index a8d42398ec5a..0eae3265a0f3 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a3a5f18e1180..2819865ee750 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2012-04-13 Michael Meissner + + Backport from mainline + 2012-04-12 Michael Meissner + + PR target/52775 + * gcc.target/powerpc/pr52775.c: New file. + 2012-04-03 Jason Merrill 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 index 000000000000..4027819ee632 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr52775.c @@ -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; +}