This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Making __builtin_signbit type-generic
- From: FX <fxcoudert at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Mon, 6 Jul 2015 16:09:06 +0200
- Subject: Re: Making __builtin_signbit type-generic
- Authentication-results: sourceware.org; auth=none
- References: <D9081920-A2FB-4B1C-8E15-E40BAEDFB43D at gmail dot com> <CAFULd4azmJer-X7fhg4sDiN45pLZs0H1vcfeOQCkL3SxE7JuXg at mail dot gmail dot com>
> Please look at builtins.def, grep for TYPEGENERIC.
Sure, I can define it as TYPEGENERIC in the builtins.def, like this:
Index: builtins.def
===================================================================
--- builtins.def (revision 225434)
+++ builtins.def (working copy)
@@ -489,7 +489,7 @@ DEF_C99_BUILTIN (BUILT_IN_SCALBLN
DEF_C99_BUILTIN (BUILT_IN_SCALBN, "scalbn", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_SCALBNF, "scalbnf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_SCALBNL, "scalbnl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
-DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBIT, "signbit", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBIT, "signbit", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITF, "signbitf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITL, "signbitl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITD32, "signbitd32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LEAF_LIST)
But does that mean the middle-end will handle it completely?
FX