Replace match.pd DEFINE_MATH_FNs with auto-generated lists
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 17 Nov 2015 18:49:10 +0000 (18:49 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 17 Nov 2015 18:49:10 +0000 (18:49 +0000)
commitb1dc4a20a797ed2718fb2ba3431753ce84db86b2
treef6a69b77920259ec90eb2b68484d7e14ca6135ff
parentfa74b47a8c825cbdde6f97591befb474b739006f
Replace match.pd DEFINE_MATH_FNs with auto-generated lists

This patch autogenerates the operator lists for maths functions
like SQRT, adding an additional entry for internal functions.
E.g.:

        (define_operator_list SQRT
            BUILT_IN_SQRTF
            BUILT_IN_SQRT
            BUILT_IN_SQRTL
            IFN_SQRT)

and:

        (define_operator_list CABS
            BUILT_IN_CABSF
            BUILT_IN_CABS
            BUILT_IN_CABSL
            null)

(since there's no internal function for CABS).

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

gcc/
* Makefile.in (MOSTLYCLEANFILES): Add cfn-operators.pd.
(generated_files): Likewise.
(s-cfn-operators, cfn-operators.pd): New rules.
(s-match): Depend on cfn-operators.pd.
* gencfn-macros.c: Expand comment to describe -o behavior.
(print_define_operator_list): New function.
(main): Accept -o.  Call print_define_operator_list.
* genmatch.c (main): Add the current directory to the include path.
* match.pd (DEFINE_MATH_FN): Delete.  Include cfn-operators.pd
instead.

From-SVN: r230486
gcc/ChangeLog
gcc/Makefile.in
gcc/gencfn-macros.c
gcc/genmatch.c
gcc/match.pd