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]

Re: Status of SSE support in current gcc mainline


kumar@chaos.ph.utexas.edu writes:

> I believe the altivec patches to gcc were done as an example
> implementation of the programming model with know problems.  It was not
> meant to be FSF acceptable code.  I believe Samuel's idea to model altivec
> support after the SSE implementation is not a bad idea.

Nope, in fact, it's a good idea. But I wouldn't look at the altivec
patches while doing it at all.
In fact, i'd avoid them like the plague.

> 
> > They specify the sizeof of their vector types to always be 16, and the
> > sizeof *pointers* to the vector types to be 16 as well.
> > Did I mention that the vector types are, in reality, a few different
> > sizes, and the pointers certainly aren't 16 bytes?
> > I guess 16 just seemed like a nice number.
> 
> Vectors are always 16 bytes on altivec.  The doc states that 'p' is a
> pointer to a vector. 

I must have misread that part, i thought it also said that sizeof(p)
is 16, not sizeof(*p)==16.


> I know Motorola is looking into changes to the programming model.  Any
> pointers to other existing programming models could be useful to that
> effort.

Errr, look at how, for instance, Intel does SSE programming. They have
a few datatypes defined, a whole bunch of intrinsics, and C++ classes
that encapsulate the intrinsics in a vector class, etc.

They didn't make basic changes to the actual language to try to
accomodate their code.


As a result, MSVC7, Intel's reference compiler,, and
various versions of GCC (probably not seen by most) support the
model without any trouble(off the top of my head, i'm sure there are
more). In fact, I can compile the same code on any of the compilers,

What's better, things like the vector class that uses the intrinsics
will use normal, non-SSE calculations if your platform doesn't support
it (through #ifdefs).


> 
> - kumar
> 
> 
> 

-- 
I have a map of the United States...  Actual size.  It says,
"Scale:  1 mile = 1 mile."  I spent last summer folding it.  I
also have a full-size map of the world.  I hardly ever unroll it.
People ask me where I live, and I say, "E6".


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