diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2004-04-14 14:29:35 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2004-04-14 14:29:35 +0000 |
commit | a69934e07eb54b76012e32a6aee54fe6af1faaa9 (patch) | |
tree | 1099c5b0ee54972c5f4fe6788abcafa2379973c7 /gcc/fold-const.c | |
parent | 74b9f2d5c81c1799cc8bf2a1b41c5fbad88a0127 (diff) | |
download | gcc-a69934e07eb54b76012e32a6aee54fe6af1faaa9.zip gcc-a69934e07eb54b76012e32a6aee54fe6af1faaa9.tar.gz gcc-a69934e07eb54b76012e32a6aee54fe6af1faaa9.tar.bz2 |
builtins.c (fold_builtin_cabs, [...]): Use `mathfn_built_in' to determine the new builtin.
* builtins.c (fold_builtin_cabs, fold_builtin): Use
`mathfn_built_in' to determine the new builtin.
* fold-const.c (fold): Likewise.
From-SVN: r80680
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 53 |
1 files changed, 4 insertions, 49 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 75ef65c..d67944a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -6509,25 +6509,7 @@ fold (tree expr) && operand_equal_p (TREE_VALUE (TREE_OPERAND (arg0, 1)), TREE_VALUE (TREE_OPERAND (arg1, 1)), 0)) { - tree sinfn; - - switch (fcode0) - { - case BUILT_IN_TAN: - case BUILT_IN_COS: - sinfn = implicit_built_in_decls[BUILT_IN_SIN]; - break; - case BUILT_IN_TANF: - case BUILT_IN_COSF: - sinfn = implicit_built_in_decls[BUILT_IN_SINF]; - break; - case BUILT_IN_TANL: - case BUILT_IN_COSL: - sinfn = implicit_built_in_decls[BUILT_IN_SINL]; - break; - default: - sinfn = NULL_TREE; - } + tree sinfn = mathfn_built_in (type, BUILT_IN_SIN); if (sinfn != NULL_TREE) return build_function_call_expr (sinfn, @@ -6588,16 +6570,7 @@ fold (tree expr) if (! optimize_size && operand_equal_p (arg0, arg1, 0)) { - tree powfn; - - if (type == double_type_node) - powfn = implicit_built_in_decls[BUILT_IN_POW]; - else if (type == float_type_node) - powfn = implicit_built_in_decls[BUILT_IN_POWF]; - else if (type == long_double_type_node) - powfn = implicit_built_in_decls[BUILT_IN_POWL]; - else - powfn = NULL_TREE; + tree powfn = mathfn_built_in (type, BUILT_IN_POW); if (powfn) { @@ -6831,16 +6804,7 @@ fold (tree expr) && operand_equal_p (TREE_VALUE (TREE_OPERAND (arg0, 1)), TREE_VALUE (TREE_OPERAND (arg1, 1)), 0)) { - tree tanfn; - - if (fcode0 == BUILT_IN_SIN) - tanfn = implicit_built_in_decls[BUILT_IN_TAN]; - else if (fcode0 == BUILT_IN_SINF) - tanfn = implicit_built_in_decls[BUILT_IN_TANF]; - else if (fcode0 == BUILT_IN_SINL) - tanfn = implicit_built_in_decls[BUILT_IN_TANL]; - else - tanfn = NULL_TREE; + tree tanfn = mathfn_built_in (type, BUILT_IN_TAN); if (tanfn != NULL_TREE) return build_function_call_expr (tanfn, @@ -6854,16 +6818,7 @@ fold (tree expr) && operand_equal_p (TREE_VALUE (TREE_OPERAND (arg0, 1)), TREE_VALUE (TREE_OPERAND (arg1, 1)), 0)) { - tree tanfn; - - if (fcode0 == BUILT_IN_COS) - tanfn = implicit_built_in_decls[BUILT_IN_TAN]; - else if (fcode0 == BUILT_IN_COSF) - tanfn = implicit_built_in_decls[BUILT_IN_TANF]; - else if (fcode0 == BUILT_IN_COSL) - tanfn = implicit_built_in_decls[BUILT_IN_TANL]; - else - tanfn = NULL_TREE; + tree tanfn = mathfn_built_in (type, BUILT_IN_TAN); if (tanfn != NULL_TREE) { |