This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Add cubic root to negate_mathfn_p in fold-const.c
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Aug 2005 17:51:26 +0200 (CEST)
- Subject: Re: [patch] Add cubic root to negate_mathfn_p in fold-const.c
- References: <tkrat.1c9aade663386ddb@igpm.rwth-aachen.de>
On 16 Aug, Volker Reichelt wrote:
> The following patch adds the three variants of the cubic root to
> negate_mathfn_p in fold-const.c as -cbrt(x) == cbrt(-x) for all x.
I just noticed that some more odd functions are missing, at least
SINH, ASINH, TANH, ATANH.
I'm not quite sure about TRUNC, ROUND, RINT, and NEARBYINT.
Some short experiments suggest that they are odd functions, but I'm
not sure if this holds true for special cases and for all rounding
directions. Any comments?
Anyway, with the functions above, it's probably time to use the following
macros from tree_expr_nonnegative_p also in negate_mathfn_p:
#define CASE_BUILTIN_F(BUILT_IN_FN) \
case BUILT_IN_FN: case BUILT_IN_FN##F: case BUILT_IN_FN##L:
#define CASE_BUILTIN_I(BUILT_IN_FN) \
case BUILT_IN_FN: case BUILT_IN_FN##L: case BUILT_IN_FN##LL:
I'll move them to the top of the file in a new patch.
Regards,
Volker