Commit 257aecb4 by Richard Sandiford Committed by Richard Sandiford

Use macros to define built-in operator lists

No functional change.  This should be a slight readability improvement
on its own, but becomes more important with the next patch.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* match.pd: Use macros to define built-in operator lists.

From-SVN: r229310
parent 0eb72c5d
2015-10-26 Richard Sandiford <richard.sandiford@arm.com>
* match.pd: Use macros to define built-in operator lists.
2015-10-20 Richard Sandiford <richard.sandiford@arm.com> 2015-10-20 Richard Sandiford <richard.sandiford@arm.com>
Richard Biener <rguenther@suse.de> Richard Biener <rguenther@suse.de>
...@@ -47,39 +47,40 @@ along with GCC; see the file COPYING3. If not see ...@@ -47,39 +47,40 @@ along with GCC; see the file COPYING3. If not see
(define_operator_list simple_comparison lt le eq ne ge gt) (define_operator_list simple_comparison lt le eq ne ge gt)
(define_operator_list swapped_simple_comparison gt ge eq ne le lt) (define_operator_list swapped_simple_comparison gt ge eq ne le lt)
(define_operator_list LOG BUILT_IN_LOGF BUILT_IN_LOG BUILT_IN_LOGL) /* Define an operand list for math function FN, with float, double and
(define_operator_list EXP BUILT_IN_EXPF BUILT_IN_EXP BUILT_IN_EXPL) long double variants (in that order). */
(define_operator_list LOG2 BUILT_IN_LOG2F BUILT_IN_LOG2 BUILT_IN_LOG2L) #define DEFINE_MATH_FN(FN) \
(define_operator_list EXP2 BUILT_IN_EXP2F BUILT_IN_EXP2 BUILT_IN_EXP2L) (define_operator_list FN BUILT_IN_##FN##F BUILT_IN_##FN BUILT_IN_##FN##L)
(define_operator_list LOG10 BUILT_IN_LOG10F BUILT_IN_LOG10 BUILT_IN_LOG10L)
(define_operator_list EXP10 BUILT_IN_EXP10F BUILT_IN_EXP10 BUILT_IN_EXP10L) DEFINE_MATH_FN (LOG)
(define_operator_list POW BUILT_IN_POWF BUILT_IN_POW BUILT_IN_POWL) DEFINE_MATH_FN (EXP)
(define_operator_list POW10 BUILT_IN_POW10F BUILT_IN_POW10 BUILT_IN_POW10L) DEFINE_MATH_FN (LOG2)
(define_operator_list SQRT BUILT_IN_SQRTF BUILT_IN_SQRT BUILT_IN_SQRTL) DEFINE_MATH_FN (EXP2)
(define_operator_list CBRT BUILT_IN_CBRTF BUILT_IN_CBRT BUILT_IN_CBRTL) DEFINE_MATH_FN (LOG10)
(define_operator_list SIN BUILT_IN_SINF BUILT_IN_SIN BUILT_IN_SINL) DEFINE_MATH_FN (EXP10)
(define_operator_list COS BUILT_IN_COSF BUILT_IN_COS BUILT_IN_COSL) DEFINE_MATH_FN (POW)
(define_operator_list TAN BUILT_IN_TANF BUILT_IN_TAN BUILT_IN_TANL) DEFINE_MATH_FN (POW10)
(define_operator_list ATAN BUILT_IN_ATANF BUILT_IN_ATAN BUILT_IN_ATANL) DEFINE_MATH_FN (SQRT)
(define_operator_list COSH BUILT_IN_COSHF BUILT_IN_COSH BUILT_IN_COSHL) DEFINE_MATH_FN (CBRT)
(define_operator_list CEXP BUILT_IN_CEXPF BUILT_IN_CEXP BUILT_IN_CEXPL) DEFINE_MATH_FN (SIN)
(define_operator_list CEXPI BUILT_IN_CEXPIF BUILT_IN_CEXPI BUILT_IN_CEXPIL) DEFINE_MATH_FN (COS)
(define_operator_list CPROJ BUILT_IN_CPROJF BUILT_IN_CPROJ BUILT_IN_CPROJL) DEFINE_MATH_FN (TAN)
(define_operator_list CCOS BUILT_IN_CCOSF BUILT_IN_CCOS BUILT_IN_CCOSL) DEFINE_MATH_FN (ATAN)
(define_operator_list CCOSH BUILT_IN_CCOSHF BUILT_IN_CCOSH BUILT_IN_CCOSHL) DEFINE_MATH_FN (COSH)
(define_operator_list HYPOT BUILT_IN_HYPOTF BUILT_IN_HYPOT BUILT_IN_HYPOTL) DEFINE_MATH_FN (CEXP)
(define_operator_list COPYSIGN BUILT_IN_COPYSIGNF DEFINE_MATH_FN (CEXPI)
BUILT_IN_COPYSIGN DEFINE_MATH_FN (CPROJ)
BUILT_IN_COPYSIGNL) DEFINE_MATH_FN (CCOS)
(define_operator_list CABS BUILT_IN_CABSF BUILT_IN_CABS BUILT_IN_CABSL) DEFINE_MATH_FN (CCOSH)
(define_operator_list TRUNC BUILT_IN_TRUNCF BUILT_IN_TRUNC BUILT_IN_TRUNCL) DEFINE_MATH_FN (HYPOT)
(define_operator_list FLOOR BUILT_IN_FLOORF BUILT_IN_FLOOR BUILT_IN_FLOORL) DEFINE_MATH_FN (COPYSIGN)
(define_operator_list CEIL BUILT_IN_CEILF BUILT_IN_CEIL BUILT_IN_CEILL) DEFINE_MATH_FN (CABS)
(define_operator_list ROUND BUILT_IN_ROUNDF BUILT_IN_ROUND BUILT_IN_ROUNDL) DEFINE_MATH_FN (TRUNC)
(define_operator_list NEARBYINT BUILT_IN_NEARBYINTF DEFINE_MATH_FN (FLOOR)
BUILT_IN_NEARBYINT DEFINE_MATH_FN (CEIL)
BUILT_IN_NEARBYINTL) DEFINE_MATH_FN (ROUND)
(define_operator_list RINT BUILT_IN_RINTF BUILT_IN_RINT BUILT_IN_RINTL) DEFINE_MATH_FN (NEARBYINT)
DEFINE_MATH_FN (RINT)
/* Simplifications of operations with one constant operand and /* Simplifications of operations with one constant operand and
simplifications to constants or single values. */ simplifications to constants or single values. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment