Add gencfn-macros.c
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 17 Nov 2015 18:41:55 +0000 (18:41 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 17 Nov 2015 18:41:55 +0000 (18:41 +0000)
commit6bac43d760cdced2775cb17add346f757ee6f045
tree5e9bc873dd49d3dfdd8631708321cbf4a109a760
parent4959a752881b69064fb988df23c10e14827099e9
Add gencfn-macros.c

This patch automatically generates case macros such as:

        CASE_CFN_SQRT

for each {F,,L} floating-point built-in function and each {,L,LL,IMAX}
integer built-in function.  The macros match the same built-in
functions as CASE_FLT_FN and CASE_INT_FN but in addition include
the associated internal function, if any.

The idea is to make sure that users of combined_fn don't need to know
which built-in functions have internal-function equivalents.  If we add
a new function to internal-fn.def, all combined_fn users should pick it
up automatically.

The generator wants to use "hash_set <nofree_string_hash>",
so the patch follows hash_map in using the types given by the
traits as the key.  This is a no-op for current users of hash_set.

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

gcc/
* Makefile.in (HASH_TABLE_H): Add GGC_H.
(MOSTLYCLEANFILES, generated_files): Add case-fn-macros.h.
(s-case-cfn-macros, case-cfn-macros.h, build/gencfn-macros.o)
(build/gencfn-macros$(build_exeext): New rules.
(genprogerr): Add cfn-macros.
* hash-set.h (hash_set): Use the traits value_type as the key.
* gencfn-macros.c: New file.

From-SVN: r230476
gcc/ChangeLog
gcc/Makefile.in
gcc/gencfn-macros.c [new file with mode: 0644]
gcc/hash-set.h