Boost logo

Boost :

Subject: Re: [boost] [OT?] SIMD and Auto-Vectorization (was Re: How to structurate libraries ?)
From: David A. Greene (greened_at_[hidden])
Date: 2009-01-20 17:08:37


On Tuesday 20 January 2009 06:58, David Abrahams wrote:

> > Actually, I think you're missing the point (at least from what I'm
> > saying).
> >
> > I'm saying SIMD code generation ought to be the job of the compiler(s)
> > for the platforms where they make sense.
>
> Why are these SIMD operations different in that respect from, say, large
> matrix multiplications?

A matrix multiplication is a higher-level construct. Still, most compilers
will pattern-match matrix multiplication to an optimal routine.

SIMD code generation is extremely low-level. Programmers want to think in a
higher level. If the programmers want to direct the compiler to do something,
I'm all for it. But those directions should be expressible in the higher
level at which the programmer is working. The fact that not all compilers
provide this capability is a shortcoming of the compilers. gcc is a prime
example and is fortunately one the community can easily fix should it choose
to do so.

> > Does this need another library? I wager to say it doesn't -- it's like
> > saying you're implementing a DSEL in C++ to do simple mathematics.
>
> Why do you say that? Do you routinely find yourself having to write
> non-portable code to do simple math in C++? Do you routinely find that
> the compiler generates inadequate simple math code?

I have people who tell me that every day. :) Then we go and fix it.

                                            -Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk