Re: Advice about using SIMD extensions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel -

Yeah, that's what I meant... but wouldn't optimal scheduling be nice ;)

I've been noticing this on a pentium4 (which it seemed was also what
Richard was using).

It seems like SSE would be a pretty widely used target, and that's why
I was surprised
to get slowdowns on even simple vector additions/multiplies/etc...
when mixed with other code.  If I ran very contrived examples, things
ran very fast, but as soon as I put my library into an application, I
noticed that things were slower, despite some things being calculated
4 times as fast.

It seems that you must use the intrinsics the same way that you'd
write the assembly in order to get decent results.

  Brian


On Thu, 24 Feb 2005 06:47:52 -0500, Daniel Berlin <dberlin@xxxxxxxxxxx> wrote:
> On Thu, 2005-02-24 at 12:20 +0100, Brian Budge wrote:
> > Hi Richard -
> >
> > With this kind of example you should definitely get about a 4 times
> > speed up.  One of your issues may be that gcc doesn't seem (I haven't
> > confirmed this with anyone) to like to perform instruction scheduling
> > on vector types.  I have also seen similar slowdowns when using
> > xmmintrin.h code if I code things naively.
> >
> > My advice:  Try to write the code out long hand using the xmm
> > intrinsics, interleaving loads and arithmetic, and see if you get a
> > speed up.
> >
> > Can anyone confirm if gcc does sub-optimal instruction scheduling for
> > vector types?
> 
> Every compiler does sub-optimal scheduling for everything (Optimal
> scheduling is NP-hard) :)
> 
> I think you meant "worse than it could be".
> In that case, yes, but it depends on the platform.
> 
> Some platforms with supported vector instructions have scheduler
> descriptions that include the vector instructions.
> Some do not.
> 
> For example, the 7450 and G5 scheduling descriptions describe the vector
> units and schedule vector code.
> 
> --Dan
> 
>

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux