aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2004-03-06 17:47:58 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2004-03-06 17:47:58 +0000
commit82b4201fd50bcfed39fe109308b5639ca97eb45f (patch)
tree824842680cdc4f64bb5553896090ab68f59a879f /gcc/tree.h
parent0c2cc7b37aca08ebab5341b409418c98d583507a (diff)
downloadgcc-82b4201fd50bcfed39fe109308b5639ca97eb45f.zip
gcc-82b4201fd50bcfed39fe109308b5639ca97eb45f.tar.gz
gcc-82b4201fd50bcfed39fe109308b5639ca97eb45f.tar.bz2
tree.h (BUILTIN_EXP10_P, [...]): New macros.
* tree.h (BUILTIN_EXP10_P, BUILTIN_EXPONENT_P, BUILTIN_SQRT_P, BUILTIN_CBRT_P, BUILTIN_ROOT_P): New macros. * builtins.c (fold_builtin_logarithm, fold_builtin): Use new macros. * fold-const.c (fold_mathfn_compare, fold): Likewise. From-SVN: r79023
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index bb36c92..0a1e3fb 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -101,6 +101,24 @@ enum built_in_function
/* Names for the above. */
extern const char *const built_in_names[(int) END_BUILTINS];
+/* Helper macros for math builtins. */
+
+#define BUILTIN_EXP10_P(FN) \
+ ((FN) == BUILT_IN_EXP10 || (FN) == BUILT_IN_EXP10F || (FN) == BUILT_IN_EXP10L \
+ || (FN) == BUILT_IN_POW10 || (FN) == BUILT_IN_POW10F || (FN) == BUILT_IN_POW10L)
+
+#define BUILTIN_EXPONENT_P(FN) (BUILTIN_EXP10_P (FN) \
+ || (FN) == BUILT_IN_EXP || (FN) == BUILT_IN_EXPF || (FN) == BUILT_IN_EXPL \
+ || (FN) == BUILT_IN_EXP2 || (FN) == BUILT_IN_EXP2F || (FN) == BUILT_IN_EXP2L)
+
+#define BUILTIN_SQRT_P(FN) \
+ ((FN) == BUILT_IN_SQRT || (FN) == BUILT_IN_SQRTF || (FN) == BUILT_IN_SQRTL)
+
+#define BUILTIN_CBRT_P(FN) \
+ ((FN) == BUILT_IN_CBRT || (FN) == BUILT_IN_CBRTF || (FN) == BUILT_IN_CBRTL)
+
+#define BUILTIN_ROOT_P(FN) (BUILTIN_SQRT_P (FN) || BUILTIN_CBRT_P (FN))
+
/* An array of _DECL trees for the above. */
extern GTY(()) tree built_in_decls[(int) END_BUILTINS];
extern GTY(()) tree implicit_built_in_decls[(int) END_BUILTINS];