alignment issues for sse

corey taylor corey.taylor@gmail.com
Thu Feb 17 10:10:00 GMT 2005


Brian,

  Unfortunately, I'm a little out of it from oral surgery.

  However, after looking into the current public project I'm on, I
realize that it doesn't use SSE for the allocation.  It simply
advances to an aligned location and manually forces the alignment,
hides the actual allocation pointer, and returns the aligned pointer.

  All the other memory copy/fill/use routines are MMX based.

  I'll keep looking for an SSE article that is used in the area you are looking.

corey


On Wed, 16 Feb 2005 17:58:15 +0100, Brian Budge <brian.budge@gmail.com> wrote:
> Corey -
> 
> Do you know of any documentation anywhere that discusses doing this
> quickly?  I can think of a method which is basically like allocating
> your own stack of aligned variables... since I only ever use about 5
> temps, and it's unlikely I'll be using more than a few threads, I
> could just allocate 20 __m128 variables aligned, and let them be
> requested in the functions.
> 
> I can't help but be slightly disenchanted with the idea, but if this
> is the sort of thing that needs to be done...
> 
> Thanks Corey,
>   Brian
> 
> On Wed, 16 Feb 2005 10:46:54 -0600, corey taylor <corey.taylor@gmail.com> wrote:
> > Implementation's I've used and worked on always do aligned allocations
> > manually.  Typically the hidden and real sizes of the allocation are
> > put into the memory allocation itself and the returned pointer is
> > incremented a few bytes.  The downside to this is that you must be
> > strict in using the aligned free routine also.
> >
> > corey
> >
> >
> > On Wed, 16 Feb 2005 10:09:27 -0600, Eljay Love-Jensen <eljay@adobe.com> wrote:
> > > Hi Brian,
> > >
> > >  >Wow, that's terrible news if true.
> > >
> > > Take it with a grain of salt.  I'm just speculating.
> > >
> > > You might want to try looking at the assembly output of the compiler, using
> > > the -S switch.  It might shed some light as to what's going on under the
> > > covers, especially pertaining to alignment.
> > >
> > >  >But surely thousands of people are writing sse code... how do they make
> > > it work?
> > >
> > > I presume by taking measures to assure the SSE structs are properly aligned.
> > >
> > >  >Do I need to switch to the intel compiler/linker?
> > >
> > > I do not know.
> > >
> > >  >Or is there a way to tell ld to allow larger alignment sizes?
> > >
> > > I'm not sure -- perhaps it is an option when ld is configure'd and make'd.
> > >
> > >  >Are there other linkers available for (free) use with gcc?
> > >
> > > I do not know.
> > >
> > > HTH,
> > > --Eljay
> > >
> > >
> >
>



More information about the Gcc-help mailing list