This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add cubic root to negate_mathfn_p in fold-const.c


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]