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: implement __builtin_copysign


On Fri, 28 Jan 2005, Richard Henderson wrote:
> On Thu, Jan 27, 2005 at 11:00:40PM -0500, Kaveh R. Ghazi wrote:
> > Thoughts on doing this at the tree level like my signbit patch?
> > (Queued for 4.1)
> >
> > http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02499.html
>
> Unsure.  I'm not 100% convinced that your signbit patch is the
> right way to go either.  I'm not convinced that exposing this at
> the tree level -- at least the way we currently do it, is at all
> helpful.
>
> I can definitely see reusing some of the tree expanders to do
> this (e.g. extract_bit_field) instead of playing with subregs
> directly.

There's already an expand_builtin_signbit that uses extract_bit_field
that does exactly this.  Unfortunately, convincing the RTL expanders
to manipulate the signbit of floating point types wider than the
widest integer mode proved too tricky.

Certainly for copysign and similar functions, its preferable to
expand builtins whilst lowering to RTL to take advantage of hardware
optab support where available.

Roger
--


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