aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000
diff options
context:
space:
mode:
authorAlexander Ivchenko <alexander.ivchenko@intel.com>2013-08-19 12:21:26 +0000
committerKirill Yukhin <kyukhin@gcc.gnu.org>2013-08-19 12:21:26 +0000
commitd33d9e47d4392e7cb82d8cd585807cf72872e11d (patch)
tree0bbcf0fb24fd01d341f129c6ba255ea19c0fa62c /gcc/config/rs6000
parent89138a6e3edb518628a85ce4bcb59fd6a34df208 (diff)
downloadgcc-d33d9e47d4392e7cb82d8cd585807cf72872e11d.zip
gcc-d33d9e47d4392e7cb82d8cd585807cf72872e11d.tar.gz
gcc-d33d9e47d4392e7cb82d8cd585807cf72872e11d.tar.bz2
target.def (TARGET_LIBC_HAS_FUNCTION): New target hook.
* target.def (TARGET_LIBC_HAS_FUNCTION): New target hook. * builtins.c (default_libc_has_function): New. (gnu_libc_has_function): Ditto. (no_c99_libc_has_function): Ditto. (expand_builtin_cexpi): Using new target hook TARGET_LIBC_HAS_FUNCTION instead of TARGET_HAS_SINCOS and TARGET_C99_FUNCTIONS. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. * builtins.def (DEF_C94_BUILTIN): Likewise. (DEF_C99_BUILTIN): Likewise. (DEF_C99_C90RES_BUILTIN): Likewise. (DEF_C99_COMPL_BUILTIN): New define. Change all complex c99 builtin definitions to using this define. * config/darwin-protos.h (darwin_libc_has_function): New. * config/darwin.c: (darwin_libc_has_function: Ditto. * config/alpha/linux.h: Remove TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS. Redefine TARGET_LIBC_HAS_FUNCTION. * config/darwin.h: Ditto. * config/elfos.h: Ditto. * config/freebsd.h: Ditto. * config/i386/cygming.h: Ditto. * config/i386/djgpp.h: Ditto. * config/i386/i386-interix.h: Ditto. * config/microblaze/microblaze.h: Ditto. * config/mmix/mmix.h: Ditto. * config/gnu-user.h: Ditto. * config/ia64/hpux.h: Ditto. * config/pa/pa-hpux.h: Ditto. * config/pdp11/pdp11.h: Ditto. * config/picochip/picochip.h: Ditto. * config/linux.h: Ditto. * config/netbsd.h: Ditto. * config/openbsd.h: Ditto. * config/rs6000/aix43.h: Ditto. * config/rs6000/aix51.h: Ditto. * config/rs6000/aix52.h: Ditto. * config/rs6000/aix53.h: Ditto. * config/rs6000/aix61.h: Ditto. * config/rs6000/darwin.h: Ditto. * config/rs6000/linux.h: Ditto. * config/rs6000/linux64.h: Ditto. * config/s390/tpf.h: Ditto. * config/sol2-10.h: Ditto. * config/sol2.h: Ditto. * config/vms/vms.h: Ditto. * config/vxworks.h: Ditto. * config/linux-android.c (linux_android_libc_has_function): New linux-specific implementation of TARGET_LIBC_HAS_FUNCTION. * config/linux-protos.h (linux_android_libc_has_function): New declaration. * config/i386/i386.c (ix86_libc_has_function): New. * config/i386/i386-protos.h (ix86_libc_has_function): New declaration. * config/i386/i386.md ("isinfxf2"): Change condition for TARGET_LIBC_HAS_FUNCTION. ("isinf<mode>2): Likewise. * convert.c (convert_to_integer): Using new target hook TARGET_LIBC_HAS_FUNCTION istead of TARGET_HAS_SINCOS and TARGET_C99_FUNCTIONS. * fortran/f95-lang.c (gfc_init_builtin_functions): Ditto. * tree-ssa-math-opts.c (execute_cse_sincos): Ditto. * coretypes.h (function_class): New enum for different classes of functions. * defaults.h: Remove TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS. * doc/tm.texi.in (TARGET_C99_FUNCTIONS): Remove documentation. (TARGET_HAS_SINCOS): Likewise. (TARGET_LIBC_HAS_FUNCTION): New. * doc/tm.texi: Regenerated. * targhooks.h (default_libc_has_function): New declaration. (no_c99_libc_has_function): Ditto. (gnu_libc_has_function): Ditto. * system.h: Add the poisoning of TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS. From-SVN: r201838
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r--gcc/config/rs6000/aix43.h3
-rw-r--r--gcc/config/rs6000/aix51.h3
-rw-r--r--gcc/config/rs6000/aix52.h4
-rw-r--r--gcc/config/rs6000/aix53.h4
-rw-r--r--gcc/config/rs6000/aix61.h4
-rw-r--r--gcc/config/rs6000/darwin.h6
-rw-r--r--gcc/config/rs6000/linux.h11
-rw-r--r--gcc/config/rs6000/linux64.h11
8 files changed, 16 insertions, 30 deletions
diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h
index 70db7f7..b27c046 100644
--- a/gcc/config/rs6000/aix43.h
+++ b/gcc/config/rs6000/aix43.h
@@ -159,3 +159,6 @@ do { \
#define TARGET_USES_AIX64_OPT 1
#define TARGET_AIX_VERSION 43
+
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h
index 669dbbe03..3837bfdc0 100644
--- a/gcc/config/rs6000/aix51.h
+++ b/gcc/config/rs6000/aix51.h
@@ -163,3 +163,6 @@ do { \
#define TARGET_USE_JCR_SECTION 0
#define TARGET_AIX_VERSION 51
+
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
diff --git a/gcc/config/rs6000/aix52.h b/gcc/config/rs6000/aix52.h
index c57271a..5195471 100644
--- a/gcc/config/rs6000/aix52.h
+++ b/gcc/config/rs6000/aix52.h
@@ -166,10 +166,6 @@ do { \
#undef LD_INIT_SWITCH
#define LD_INIT_SWITCH "-binitfini"
-/* AIX 5.2 has the float and long double forms of math functions. */
-#undef TARGET_C99_FUNCTIONS
-#define TARGET_C99_FUNCTIONS 1
-
#ifndef _AIX52
extern long long int atoll(const char *);
#endif
diff --git a/gcc/config/rs6000/aix53.h b/gcc/config/rs6000/aix53.h
index b1b0759..b3bd73a 100644
--- a/gcc/config/rs6000/aix53.h
+++ b/gcc/config/rs6000/aix53.h
@@ -166,10 +166,6 @@ do { \
#undef LD_INIT_SWITCH
#define LD_INIT_SWITCH "-binitfini"
-/* AIX 5.2 has the float and long double forms of math functions. */
-#undef TARGET_C99_FUNCTIONS
-#define TARGET_C99_FUNCTIONS 1
-
#ifndef _AIX52
extern long long int atoll(const char *);
#endif
diff --git a/gcc/config/rs6000/aix61.h b/gcc/config/rs6000/aix61.h
index cd341b9..b077814 100644
--- a/gcc/config/rs6000/aix61.h
+++ b/gcc/config/rs6000/aix61.h
@@ -190,10 +190,6 @@ do { \
#undef LD_INIT_SWITCH
#define LD_INIT_SWITCH "-binitfini"
-/* AIX 5.2 has the float and long double forms of math functions. */
-#undef TARGET_C99_FUNCTIONS
-#define TARGET_C99_FUNCTIONS 1
-
#ifndef _AIX52
extern long long int atoll(const char *);
#endif
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 0cf2f4c..d5919c4 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -386,10 +386,8 @@ extern int darwin_emit_branch_islands;
#define OFFS_ASSIGNIVAR_FAST 0xFFFEFEC0
/* Old versions of Mac OS/Darwin don't have C99 functions available. */
-#undef TARGET_C99_FUNCTIONS
-#define TARGET_C99_FUNCTIONS \
- (TARGET_64BIT \
- || strverscmp (darwin_macosx_version_min, "10.3") >= 0)
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION darwin_libc_has_function
/* When generating kernel code or kexts, we don't use Altivec by
default, as kernel code doesn't save/restore those registers. */
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index f7f2d80..c941942 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -32,13 +32,10 @@
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
#endif
-/* glibc has float and long double forms of math functions. */
-#undef TARGET_C99_FUNCTIONS
-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
-
-/* Whether we have sincos that follows the GNU extension. */
-#undef TARGET_HAS_SINCOS
-#define TARGET_HAS_SINCOS (OPTION_GLIBC)
+/* Determine what functions are present at the runtime;
+ this includes full c99 runtime and sincos. */
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION linux_android_libc_has_function
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 79f0f0b..63e656d 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -292,13 +292,10 @@ extern int dot_symbols;
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
#endif
-/* glibc has float and long double forms of math functions. */
-#undef TARGET_C99_FUNCTIONS
-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
-
-/* Whether we have sincos that follows the GNU extension. */
-#undef TARGET_HAS_SINCOS
-#define TARGET_HAS_SINCOS (OPTION_GLIBC)
+/* Determine what functions are present at the runtime;
+ this includes full c99 runtime and sincos. */
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION linux_android_libc_has_function
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \