This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH, i386: add __builtin_huge_valq
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com, jh at suse dot cz, ubizjak at gmail dot com
- Date: Thu, 11 Dec 2008 14:08:18 +1100
- Subject: PATCH, i386: add __builtin_huge_valq
This patch adds __builtin_huge_valq, which makes the huge_val family of
built-ins consistent with the inf builtins on x86. While documenting
it, I added index entries for it and for infq.
Tested with a bootstrap on x86_64-linux and a `make info dvi' for the
doco changes. Okay for stage 1?
Cheers, Ben
2008-12-11 Ben Elliston <bje@au.ibm.com>
* config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_HUGE_VALQ.
(ix86_init_builtins): Add built-in function __builtin_huge_valq.
(ix86_expand_builtin): Handle IX86_BUILTIN_HUGE_VALQ.
* doc/extend.texi (X86 Built-in Functions): Add index entries for
__builtin_infq and __builtin_huge_valq.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 142662)
+++ config/i386/i386.c (working copy)
@@ -19643,6 +19643,7 @@ enum ix86_builtins
/* TFmode support builtins. */
IX86_BUILTIN_INFQ,
+ IX86_BUILTIN_HUGE_VALQ,
IX86_BUILTIN_FABSQ,
IX86_BUILTIN_COPYSIGNQ,
@@ -22838,6 +22839,11 @@ ix86_init_builtins (void)
NULL, NULL_TREE);
ix86_builtins[(int) IX86_BUILTIN_INFQ] = decl;
+ decl = add_builtin_function ("__builtin_huge_valq", ftype,
+ IX86_BUILTIN_HUGE_VALQ, BUILT_IN_MD,
+ NULL, NULL_TREE);
+ ix86_builtins[(int) IX86_BUILTIN_HUGE_VALQ] = decl;
+
/* We will expand them to normal call if SSE2 isn't available since
they are used by libgcc. */
ftype = build_function_type_list (float128_type_node,
@@ -24303,6 +24309,7 @@ ix86_expand_builtin (tree exp, rtx targe
return ix86_expand_vec_set_builtin (exp);
case IX86_BUILTIN_INFQ:
+ case IX86_BUILTIN_HUGE_VALQ:
{
REAL_VALUE_TYPE inf;
rtx tmp;
Index: doc/extend.texi
===================================================================
--- doc/extend.texi (revision 142662)
+++ doc/extend.texi (working copy)
@@ -7723,6 +7723,11 @@ The following floating point built-in fu
@table @code
@item __float128 __builtin_infq (void)
Similar to @code{__builtin_inf}, except the return type is @code{__float128}.
+@findex __builtin_infq
+
+@item __float128 __builtin_huge_valq (void)
+Similar to @code{__builtin_huge_val}, except the return type is @code{__float128}.
+@findex __builtin_huge_valq
@end table
The following built-in functions are made available by @option{-mmmx}.