Re: Re: [AD] malloc for bitmaps alignment?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


At 06:59 AM 20/05/2004 -0500, you wrote:
> >What alignment?
>
>
> a google search for  "intel SSE 16
> byte alignment"  reveals many links
> about the performance advantages of
> 16byte aligned data.

But the point is that it depends on the
nature of the data involved. Aligning
everything will mean extra space being
wasted, for data that may not need to be
aligned.


i have not suggested aligning everything.
i have suggested aligning the malloc of the data for memory bitmaps.


SSE alignment is for things like quats,
vect3s, matrices, etc. Blitters already
do a pre-blit alignemnt IIRC. Even with
normal (non SSE) code, alignment is
taken care of where it matters (eg, non
SSE blitters do).

So, what are you suggesting ? Surely not
aligning every single malloc to return
16 byte aligned data. What, then ?
This is a real question, not a dismissal
of the benefits of alignment :)



just the malloc for  memory bitmaps.


Now, SSE is only used for blitters, am
I right ? I don't think there's any SSE
code (or MMX/Altivec/whatever) for, say,
QUAT routines. So where what is there
left to align ?


memory bitmaps


Small BITMAPs' data may
benefit here, by minimizing cache line
changes, but the extent of such speedup
is not clear.


the documentation all over the net indicates performace can improve for 16byte aligned data, and there is very little indication that performance will be worse. at worst the increased memory required to align to 16bytes for each bitmap would be 14bytes.. which is not going to make anything slower.

the equation of speed vs space has changed, sometimes taking up a few bytes extra can increase performance.

also, i am doing my own MMX/SSE(2) coding with allegro bitmaps, so im nessasirily talking about changing alignment for data structures within allegro.
just the malloc for the data in bitmaps.

aj.





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/