2012/2/24 Georg-Johann Lay <a...@gjlay.de>: > http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00843.html > > Georg-Johann Lay wrote: >> This patch introduces a new file builtins.def that is used as central >> registry >> to hold built-ins' information. >> >> The file is used by defining DEF_BUILTIN macre and then including the file as >> described in the head comment of builtins.def. >> >> Up to here it's all code clean-up and no functional change. >> >> Moreover there are some minor changes and ICE fixes: >> >> * Fold __builtin_avr_swap to rotate <<< 4 >> * Don't fold __builtin_avr_insert_bits if first arg is non-const (was ICE) >> * Don't expand __builtin_avr_delay_cycles if arg is not-const (was ICE) >> >> Ok for trunk? >> >> Johann >> >> gcc/testsuite/ >> * gcc.target/avr/torture/builtins-1.c: New test. >> * gcc.target/avr/torture/builtins-error.c: New test. >> gcc/ >> * config/avr/builtins.def: New file. >> * config/avr/t-avr (avr.o, avr-c.o): Depend on it. >> * config/avr/avr.c (enum avr_builtin_id): Use it. >> (avr_init_builtins): Use it. And use avr_bdesc. >> (bdesc_1arg): Remove. >> (bdesc_2arg): Remove. >> (bdesc_3arg): Remove. >> (struct avr_builtin_description): Add field n_args. >> (avr_bdesc): New static variable using builtins.def. >> (avr_expand_builtin): Use it. >> Don't call avr_expand_delay_cycles if op0 is not CONST_INT. >> (avr_fold_builtin): Fold AVR_BUILTIN_SWAP. >> Don't fold AVR_BUILTIN_INSERT_BITS if arg0 is not INTEGER_CST. > >
Approved. Denis.