PATCH: Table-ize builtins

Gabriel Dos Reis gdr@codesourcery.com
Sun May 27 17:43:00 GMT 2001


Richard Henderson <rth@redhat.com> writes:

| On Sun, May 27, 2001 at 05:25:08PM +0200, Gabriel Dos Reis wrote:
| > Is a patch to that effect will be accepted for GCC-3.0?
| 
| Yes.

I've just fired a bootstrap with the below.  OK to commit if testsuite
reveals no regression?

-- Gaby

gcc/

2001-05-28  Gabriel Dos Reis  <gdr@codesourcery.com>

	* c-common.c (c_common_nodes_and_builtins): Change __builtin_fsqrt
	to __builtin_sqrt.
	* extend.texi (Other Builtins): Update documentation about
	__builtin_sqrt. 

libstdc++-v3/

2001-05-28  Gabriel Dos Reis  <gdr@codesourcery.com>

	* include/c_std/bits/std_cmath.h (sqrt): Change __builtin_fsqrt to
	__builtin_sqrt. 

Index: gcc/c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.226.2.2
diff -p -r1.226.2.2 c-common.c
*** c-common.c	2001/05/13 07:09:51	1.226.2.2
--- c-common.c	2001/05/28 00:22:30
*************** c_common_nodes_and_builtins ()
*** 3357,3363 ****
    builtin_function_2 ("__builtin_sqrtf", "sqrtf",
  		      float_ftype_float, float_ftype_float,
  		      BUILT_IN_FSQRT, BUILT_IN_NORMAL, 1, 0, 0);
!   builtin_function_2 ("__builtin_fsqrt", "sqrt",
  		      double_ftype_double, double_ftype_double,
  		      BUILT_IN_FSQRT, BUILT_IN_NORMAL, 1, 0, 0);
    builtin_function_2 ("__builtin_sqrtl", "sqrtl",
--- 3357,3363 ----
    builtin_function_2 ("__builtin_sqrtf", "sqrtf",
  		      float_ftype_float, float_ftype_float,
  		      BUILT_IN_FSQRT, BUILT_IN_NORMAL, 1, 0, 0);
!   builtin_function_2 ("__builtin_sqrt", "sqrt",
  		      double_ftype_double, double_ftype_double,
  		      BUILT_IN_FSQRT, BUILT_IN_NORMAL, 1, 0, 0);
    builtin_function_2 ("__builtin_sqrtl", "sqrtl",
Index: gcc/extend.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/extend.texi,v
retrieving revision 1.92.2.13
diff -p -r1.92.2.13 extend.texi
*** extend.texi	2001/05/23 18:45:42	1.92.2.13
--- extend.texi	2001/05/28 00:22:33
*************** The following ISO C89 functions are reco
*** 3796,3803 ****
  @code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
  @code{strpbrk}, @code{strrchr}, @code{strspn}, and @code{strstr}.  All
  of these functions have corresponding versions prefixed with
! @code{__builtin_}, except that the version for @code{sqrt} is called
! @code{__builtin_fsqrt}.
  
  GNU CC provides builtin versions of the ISO C99 floating point
  comparison macros (that avoid raising exceptions for unordered
--- 3796,3802 ----
  @code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
  @code{strpbrk}, @code{strrchr}, @code{strspn}, and @code{strstr}.  All
  of these functions have corresponding versions prefixed with
! @code{__builtin_}.
  
  GNU CC provides builtin versions of the ISO C99 floating point
  comparison macros (that avoid raising exceptions for unordered

Index: libstdc++-v3/include/c_std/bits/std_cmath.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cmath.h,v
retrieving revision 1.6.2.4
diff -p -r1.6.2.4 std_cmath.h
*** std_cmath.h	2001/05/26 07:00:53	1.6.2.4
--- std_cmath.h	2001/05/28 00:22:36
*************** namespace std 
*** 522,528 ****
  
    inline double
    sqrt(double __x)
!   { return __builtin_fsqrt(__x); }
  
    inline long double
    sqrt(long double __x)
--- 522,528 ----
  
    inline double
    sqrt(double __x)
!   { return __builtin_sqrt(__x); }
  
    inline long double
    sqrt(long double __x)



More information about the Gcc-patches mailing list