diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-05-25 20:00:59 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-05-25 20:00:59 +0000 |
commit | 1084128584fe3cb13ba54924a80d1647b7f73387 (patch) | |
tree | a6b2476cc75872ea15f87872782af87262afe2cb /gcc/builtins.c | |
parent | c132505efe4f642232b69b6e2dca1349148d9b74 (diff) | |
download | gcc-1084128584fe3cb13ba54924a80d1647b7f73387.zip gcc-1084128584fe3cb13ba54924a80d1647b7f73387.tar.gz gcc-1084128584fe3cb13ba54924a80d1647b7f73387.tar.bz2 |
builtins.def: Encode additional information, such as names and types, here.
* builtins.def: Encode additional information, such as names and
types, here.
* builtin-types.def: New file.
* builtins.c (built_in_names): Adjust use of DEF_BUILTIN.
(built_in_decls): Likewise. Don't explicitly initialize global
data to NULL.
(expand_builtin_mathfn): Handle float and long double variants of
math builtins.
(expand_builtin): Likewise.
* c-common.c (c_common_nodes_and_builtins): Make it table-driven.
(expand_tree_builtin): Handle long, long long, float, and long
double variants of math functions.
* c-common.h (c_tree_index): Remove some unused nodes.
(void_ftype): Remove.
(void_type_ptr): Likewise.
(int_ftype_int): Likewise.
(ptr_ftype_sizetype): Likewise.
* c-decl.c (init_decl_processing): Remove creation of DWARF
builtins.
* defaults.h (MD_INIT_BUILTINS): Provide default definition.
* tree.h (built_in_function): Adjust definition of DEF_BUILTIN.
* Makefile.in (c-common.o): Depend on builtin-types.def.
* decl.c (init_decl_processing): Tweak.
From-SVN: r42583
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 7b4cd75..0d71b29 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA. */ const char *const built_in_class_names[4] = {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"}; -#define DEF_BUILTIN(x) STRINGX(x), +#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA) STRINGX(X), const char *const built_in_names[(int) END_BUILTINS] = { #include "builtins.def" @@ -66,12 +66,7 @@ const char *const built_in_names[(int) END_BUILTINS] = /* Setup an array of _DECL trees, make sure each element is initialized to NULL_TREE. */ -#define DEF_BUILTIN(x) NULL_TREE, -tree built_in_decls[(int) END_BUILTINS] = -{ -#include "builtins.def" -}; -#undef DEF_BUILTIN +tree built_in_decls[(int) END_BUILTINS]; tree (*lang_type_promotes_to) PARAMS ((tree)); @@ -1409,11 +1404,17 @@ expand_builtin_mathfn (exp, target, subtarget) switch (DECL_FUNCTION_CODE (fndecl)) { - case BUILT_IN_SIN: + case BUILT_IN_SIN: + case BUILT_IN_SINF: + case BUILT_IN_SINL: builtin_optab = sin_optab; break; - case BUILT_IN_COS: + case BUILT_IN_COS: + case BUILT_IN_COSF: + case BUILT_IN_COSL: builtin_optab = cos_optab; break; - case BUILT_IN_FSQRT: + case BUILT_IN_FSQRT: + case BUILT_IN_SQRTF: + case BUILT_IN_SQRTL: builtin_optab = sqrt_optab; break; default: abort (); @@ -3300,7 +3301,8 @@ expand_builtin (exp, target, subtarget, mode, ignore) set of builtins. */ if (! optimize && ! CALLED_AS_BUILT_IN (fndecl) && (fcode == BUILT_IN_SIN || fcode == BUILT_IN_COS - || fcode == BUILT_IN_FSQRT || fcode == BUILT_IN_MEMSET + || fcode == BUILT_IN_FSQRT || fcode == BUILT_IN_SQRTF + || fcode == BUILT_IN_SQRTL || fcode == BUILT_IN_MEMSET || fcode == BUILT_IN_MEMCPY || fcode == BUILT_IN_MEMCMP || fcode == BUILT_IN_BCMP || fcode == BUILT_IN_BZERO || fcode == BUILT_IN_INDEX || fcode == BUILT_IN_RINDEX @@ -3319,24 +3321,41 @@ expand_builtin (exp, target, subtarget, mode, ignore) switch (fcode) { case BUILT_IN_ABS: + case BUILT_IN_LABS: + case BUILT_IN_LLABS: + case BUILT_IN_IMAXABS: case BUILT_IN_FABS: + case BUILT_IN_FABSF: + case BUILT_IN_FABSL: /* build_function_call changes these into ABS_EXPR. */ abort (); case BUILT_IN_CONJ: + case BUILT_IN_CONJF: + case BUILT_IN_CONJL: case BUILT_IN_CREAL: + case BUILT_IN_CREALF: + case BUILT_IN_CREALL: case BUILT_IN_CIMAG: + case BUILT_IN_CIMAGF: + case BUILT_IN_CIMAGL: /* expand_tree_builtin changes these into CONJ_EXPR, REALPART_EXPR and IMAGPART_EXPR. */ abort (); case BUILT_IN_SIN: + case BUILT_IN_SINF: + case BUILT_IN_SINL: case BUILT_IN_COS: + case BUILT_IN_COSF: + case BUILT_IN_COSL: /* Treat these like sqrt only if unsafe math optimizations are allowed, because of possible accuracy problems. */ if (! flag_unsafe_math_optimizations) break; case BUILT_IN_FSQRT: + case BUILT_IN_SQRTF: + case BUILT_IN_SQRTL: target = expand_builtin_mathfn (exp, target, subtarget); if (target) return target; |