[XviD-devel] suggestion: label pointer alignment

Christoph Nägeli chn at kbw.ch
Mon Apr 19 14:29:26 CEST 2004


Hi all,

On Apr 18, 2004, at 22:48, Mat Hostetter wrote:
> I've been reading through a bunch of XviD functions.
> One thing that would make the code clearer is if pointers which were
> known to be aligned mod N were marked in some way, perhaps using a
> typedef or a comment.
>
> Alignment knowledge is especially important when writing SSE2 code,
> since you want to know whether to use movqda or movqdu (aligned
> vs. unaligned).
>
> For example, I was just looking at interpolate8x8_avg2_c.  It takes
> three pointers, but doesn't specify their alignments.  I would naively
> guess they are always 8-byte aligned, and interpolate8x8_avg2_mmx just
> loads them with movq, which seems to confirm the theory.  But then
> again, interpolate8x8_halfpel_h_xmm intentionally does an unaligned
> movq, so movq doesn't prove alignment.

This would be really cool since altivec code is guessed what alignment 
the variables could have...
I guessed, storage is aligned (16-byte) and load is always unaligned.
It would give another performance gain, knowing that the strides would 
be a multiple of 16 and
pointers are 16 byte aligned...

--
Christoph



More information about the XviD-devel mailing list