aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386
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/i386
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/i386')
-rw-r--r--gcc/config/i386/cygming.h3
-rw-r--r--gcc/config/i386/djgpp.h3
-rw-r--r--gcc/config/i386/i386-interix.h3
-rw-r--r--gcc/config/i386/i386-protos.h2
-rw-r--r--gcc/config/i386/i386.c8
-rw-r--r--gcc/config/i386/i386.md4
6 files changed, 21 insertions, 2 deletions
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 2718764..9cb66d6 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -171,6 +171,9 @@ along with GCC; see the file COPYING3. If not see
#undef MATH_LIBRARY
#define MATH_LIBRARY ""
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
#define SIZE_TYPE (TARGET_64BIT ? "long long unsigned int" : "unsigned int")
#define PTRDIFF_TYPE (TARGET_64BIT ? "long long int" : "int")
diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h
index 05f9dfd..9c503ac 100644
--- a/gcc/config/i386/djgpp.h
+++ b/gcc/config/i386/djgpp.h
@@ -127,6 +127,9 @@ along with GCC; see the file COPYING3. If not see
in libgcc, nor call one in main(). */
#define HAS_INIT_SECTION
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
/* Definitions for types and sizes. Wide characters are 16-bits long so
Win32 compiler add-ons will be wide character compatible. */
#undef WCHAR_TYPE_SIZE
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index c74e008..b99f4d9 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -143,6 +143,9 @@ do { \
#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
+#undef TARGET_LIBC_HAS_FUNCTION
+#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
/* The following are needed for us to be able to use winnt.c, but are not
otherwise meaningful to Interix. (The functions that use these are
never called because we don't do DLLs.) */
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 0966789..3ab2f3a 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -173,6 +173,8 @@ extern int ix86_mode_after (int, int, rtx);
extern int ix86_mode_entry (int);
extern int ix86_mode_exit (int);
+extern bool ix86_libc_has_function (enum function_class fn_class);
+
#ifdef HARD_CONST
extern void ix86_emit_mode_set (int, int, HARD_REG_SET);
#endif
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6d2a158..1d186e2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5729,6 +5729,14 @@ ix86_function_type_abi (const_tree fntype)
return ix86_abi;
}
+/* We add this as a workaround in order to use libc_has_function
+ hook in i386.md. */
+bool
+ix86_libc_has_function (enum function_class fn_class)
+{
+ return targetm.libc_has_function (fn_class);
+}
+
static bool
ix86_function_ms_hook_prologue (const_tree fn)
{
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 35bb09c..de93897 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -14909,7 +14909,7 @@
[(use (match_operand:SI 0 "register_operand"))
(use (match_operand:XF 1 "register_operand"))]
"TARGET_USE_FANCY_MATH_387
- && TARGET_C99_FUNCTIONS"
+ && ix86_libc_has_function (function_c99_misc)"
{
rtx mask = GEN_INT (0x45);
rtx val = GEN_INT (0x05);
@@ -14935,7 +14935,7 @@
[(use (match_operand:SI 0 "register_operand"))
(use (match_operand:MODEF 1 "nonimmediate_operand"))]
"TARGET_USE_FANCY_MATH_387
- && TARGET_C99_FUNCTIONS
+ && ix86_libc_has_function (function_c99_misc)
&& !(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
{
rtx mask = GEN_INT (0x45);