This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFC] Fix PR19402, __builtin_powi[lf]


On Tue, 1 Feb 2005, Andrew Pinski wrote:

>
> On Feb 1, 2005, at 10:40 AM, Richard Guenther wrote:
>
> > On Mon, 31 Jan 2005, Richard Henderson wrote:
> >
> >> On Mon, Jan 31, 2005 at 02:12:51PM +0100, Richard Guenther wrote:
> >>> Any suggestions on how to do it "right" wrt libgcc?  I'm sure
> >>> I got the #ifdefery wrong there and maybe the machine modes.
> >>> And for sure I don't like the name.
> >
> > This is what I got now.  It passes basic tests, but I'm left
> > with a few hunks of changes to expand_binop and emit_libcall_block
> > that are probably not necessary if I can avoid ICEing some other way.
> > Also I'm unsure wether stabilizing arguments via save_expr is
> > necessary for expand_builtin_powi as implemented currently.
> >
> > Maybe someone can suggest something useful.
>
> Yes folding the builtin at the tree level instead of doing it just at
> expansion time (though this can come later).

Yes, I planned this as a followup.  All places where __builtin_pow[lf]
is folded need to be adjusted - also we should expand __builtin_powi[lf]
for small constant exponents (-1, 0, 1, 2 come to my mind) at the
tree level already.  We also might fold __builtin_pow(..., n) with
constant integer n to __builtin_powi and just handle __builtin_powi
at the various places during folding.

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]