[PATCH][stage2 project] Use libgccm for SSE2 ABI math intrinsics
Richard Guenther
rguenther@suse.de
Wed Jan 18 11:18:00 GMT 2006
On Tue, 17 Jan 2006, Roger Sayle wrote:
>
> On Tue, 17 Jan 2006, Richard Guenther wrote:
> > Any help on this issue appreciated.
>
> I still think that messing with the DECLs in the __built_in_decls
> and __implicit_built_in_decls arrays is asking for a world of pain.
> This will interfere with duplicate_decl and DECL_ANTICIPATED processing
> in the front-ends, and do funny things in code where these functions
> are used as function pointers.
>
> I think a better strategy is to leave these decls alone during the
> front-end and tree-ssa passes, but instead introduce a target hook
> that can be used during RTL expansion, to intercept the processing
> in expand_builtin. targetm.intercept_builtin can then decide whether
> SSE registers are available, whether we care about errno, etc, etc...
Hm, this sounds like a good idea. Hopefully expand_builtin time is
early enough to make the ABI changes work. And I'd rather call the
target hook targetm.expand_builtin.
> An initial implementation of intercept_builtin probably builds the
> same decl that your patch_sse_builtin does, and then calls expand_call
> on it. Much like target specific optabs are introduced only at RTL
> expansion, we do the same thing with tweaking ABI conventions and
> DECL_ASSEMBLER name, thus allowing simultaneous use of the original
> "double sin(double);" in "double (*foo)(double) = sin;", etc...
>
> What do you think?
It sounds even generally useful, so I'll try to come up with a patch
and see if it works.
Thanks for the input!
Richard.
More information about the Gcc-patches
mailing list