This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Advice about using SIMD extensions
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Brian Budge <brian dot budge at gmail dot com>
- Cc: Richard Beare <Richard dot Beare at csiro dot au>, gcc-help at gcc dot gnu dot org
- Date: Thu, 24 Feb 2005 06:47:52 -0500
- Subject: Re: Advice about using SIMD extensions
- References: <421D1D78.2080904@csiro.au> <5b70945805022403206491547a@mail.gmail.com>
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