[patch] builtins.c: Change the prototype of targetm.fold_builtin. (Take 2)

Roger Sayle roger@eyesopen.com
Sun Mar 20 15:55:00 GMT 2005


On Sun, 20 Mar 2005, Kazu Hirata wrote:
> 2005-03-20  Kazu Hirata  <kazu@cs.umass.edu>
>
> 	* builtins.c (fold_builtin_1): Update a call to
> 	targetm.fold_builtin.
> 	* hooks.c (hook_tree_tree_bool_null): Rename to
> 	hook_tree_tree_tree_bool_null.  Take one more argument of type
> 	tree.
> 	* hooks.h: Update the prototype of hook_tree_tree_bool_null.
> 	* target-def.h (TARGET_FOLD_BUILTIN): Define it as
> 	hook_tree_tree_tree_bool_null.
> 	* target.h (gcc_target): Update the prototype of fold_builtin.
> 	* config/alpha/alpha.c (alpha_fold_builtin): Take decomposed
> 	arguments of CALL_EXPR.
> 	* doc/tm.texi (TARGET_FOLD_BUILTIN): Update.  Mention the
> 	new prototype.


Thanks also to Joseph.  This is OK for mainline.  It's rare for me to
invoke my uber-backend authority without a chance for the specific
target maintainer to comment, but I think I speak for RTH that the
the above change to alpha.c is obvious.


I am a bit surprised that alpha is the only backend to constant fold
its builtin intrinsics at the tree-level.  I would have thought that
there'd be enough interest in altivec or mmx/sse that compile-time
evaluation of their target builtins with constant arguments would
have been added to GCC by now.  It might just be a communication issue,
and if so, this post might make this functionality more widely known
to interested backend maintainers.

Perhaps "have target builtins" and "folds target builtins" could be
added as columns to the table in backends.html, and/or "constant fold
target builtins in more backends" should be added to one of GCC's
(beginner?) project lists or Wiki?


Roger
--



More information about the Gcc-patches mailing list