On Mon, 1 Dec 2003, Richard Ellis wrote:

> I just tried an experiment.  I added a printf just after the
> assignment to the piqf pointer in quant_non_intra_sse to print out

> mulps_m2r( *(mmx_t*)&piqf[0], xmm2 ); 
> 
> The value of &piqf[0] for my setup was 0x40eb7008, which is 8 byte
> aligned, but not 16 byte aligned.  So, then I just tried hardwiring
> the mulps_m2r line to say:
> 
> mulps_m2r( *(mmx_t*)0x40eb7010, xmm2 );

> where 0x40eb7010 is 16 byte aligned.  Yes, I realize this will
> produce garbage output from mpeg2enc, I just wanted to see if...

        This does confirm it though - P4 SSE instructions require 16
        byte alignment and while older glibc versions have posix_memalign
        there is a bug that causes it to not behave as expected.

> So it looks like the address for the piqf pointer needs to be 16 byte
> aligned, and at least with glibc 2.1.2 it's only getting 8 byte
> alignment from glibc.

        Hmmm, &piqf needs to be aligned?   The data accessed by dereference 
        (*piqf) needs to be aligned but the pointer itself?

        I see that piqf is initialized with 'i_quant_matf' but I have not 
        traced the logic beyond that point.

        Perhaps the problem isn't only in glibc, but the compiler and how
        it is aligning data tables?

        Steven Schultz



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to