This is the mail archive of the gcc@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: v3sf type and union types to reference elements


If I define builtins though, I don't get the optimization benefits from the
compiler do I?

For example:

a = b * c + d * c;

optimizes to:

a = (b + d) * c;

This all works if the types are V4SF.

However, using builtins and a "fake" v3sf type, I get this rather cumbersome
result (I presume this is what you mean?).  Of course, using C++ the
cumbersome factor can be removed.

a = v3sfmul( b, c ) + v3sfmul( d, c );

... and no factorization occurs... does it? Maybe it does if I define the
instruction patterns correctly?  Although I think that pass is done in the
tree folding stage which is done before the machine description instruction
matching?

Any help much appreciated.

----------------------
Dylan Cuthbert.

"Richard Henderson" <rth@redhat.com> wrote in message
20040802201137.GA1935@redhat.com">news:20040802201137.GA1935@redhat.com...
> On Mon, Aug 02, 2004 at 06:53:40PM +0900, Dylan Cuthbert wrote:
> > Mmm.. should I add a new intrinsic type for v3sf then do you think?  I
need
> > it to behave almost exactly the same as a v4sf, ie. it is 128 bits wide,
but
> > I want the type to use a different set of instructions which have faster
> > cycle times when using standard math, ie.
> >
> > v3sf vec1, vec2, vec3;
> >
> > vec1 = vec2 + vec3;
> >
> > matches the v3sfadd3 pattern in the md file and executes instructions
that
> > are a few cycles less than for the v4sf type.
>
> Defining v3sf is a very bad idea.
>
> What you should do is create builtins for these non-standard arithmetic
> operations.
>
>
>
> r~
>



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