Author: reimar Date: Thu Aug 30 13:41:58 2007 New Revision: 10261 Log: Replace complicated and currently broken manual alignment code by DECLARE_ALIGNED_16. Fixes crash in ff_snow_horizontal_compose97i_sse2 Modified: trunk/libavcodec/i386/snowdsp_mmx.c Modified: trunk/libavcodec/i386/snowdsp_mmx.c ============================================================================== --- trunk/libavcodec/i386/snowdsp_mmx.c (original) +++ trunk/libavcodec/i386/snowdsp_mmx.c Thu Aug 30 13:41:58 2007 @@ -25,9 +25,7 @@ void ff_snow_horizontal_compose97i_sse2(IDWTELEM *b, int width){ const int w2= (width+1)>>1; - // SSE2 code runs faster with pointers aligned on a 32-byte boundary. - IDWTELEM temp_buf[(width>>1) + 4]; - IDWTELEM * const temp = temp_buf + 4 - (((int)temp_buf & 0xF) >> 2); + DECLARE_ALIGNED_16(IDWTELEM, temp[width>>1]); const int w_l= (width>>1); const int w_r= w2 - 1; int i;
On Thu, Aug 30, 2007 at 01:41:59PM +0200, reimar wrote:
Author: reimar Date: Thu Aug 30 13:41:58 2007 New Revision: 10261
Log: Replace complicated and currently broken manual alignment code by DECLARE_ALIGNED_16. Fixes crash in ff_snow_horizontal_compose97i_sse2
Modified: trunk/libavcodec/i386/snowdsp_mmx.c
Modified: trunk/libavcodec/i386/snowdsp_mmx.c ============================================================================== --- trunk/libavcodec/i386/snowdsp_mmx.c (original) +++ trunk/libavcodec/i386/snowdsp_mmx.c Thu Aug 30 13:41:58 2007 @@ -25,9 +25,7 @@
void ff_snow_horizontal_compose97i_sse2(IDWTELEM *b, int width){ const int w2= (width+1)>>1; - // SSE2 code runs faster with pointers aligned on a 32-byte boundary. - IDWTELEM temp_buf[(width>>1) + 4]; - IDWTELEM * const temp = temp_buf + 4 - (((int)temp_buf & 0xF) >> 2); + DECLARE_ALIGNED_16(IDWTELEM, temp[width>>1]);
Wouldn't it be better to fix the manual alignment code, since gcc (except latest 4.2) does not support alignment of stack vars? Rich
On Thu, 2007-08-30 at 11:54 -0400, Rich Felker wrote:
Wouldn't it be better to fix the manual alignment code, since gcc (except latest 4.2) does not support alignment of stack vars?
4.0+ supports that. 4.2+ is only required for the function attribute to realign stack when entering from outside code that might possibly misalign it.
On Thu, Aug 30, 2007 at 07:36:38PM +0300, Uoti Urpala wrote:
On Thu, 2007-08-30 at 11:54 -0400, Rich Felker wrote:
Wouldn't it be better to fix the manual alignment code, since gcc (except latest 4.2) does not support alignment of stack vars?
4.0+ supports that. 4.2+ is only required for the function attribute to realign stack when entering from outside code that might possibly misalign it.
RTFABI Rich
Hello, On Thu, Aug 30, 2007 at 11:54:50AM -0400, Rich Felker wrote:
On Thu, Aug 30, 2007 at 01:41:59PM +0200, reimar wrote:
Author: reimar Date: Thu Aug 30 13:41:58 2007 New Revision: 10261
Log: Replace complicated and currently broken manual alignment code by DECLARE_ALIGNED_16. Fixes crash in ff_snow_horizontal_compose97i_sse2
Modified: trunk/libavcodec/i386/snowdsp_mmx.c
Modified: trunk/libavcodec/i386/snowdsp_mmx.c ============================================================================== --- trunk/libavcodec/i386/snowdsp_mmx.c (original) +++ trunk/libavcodec/i386/snowdsp_mmx.c Thu Aug 30 13:41:58 2007 @@ -25,9 +25,7 @@
void ff_snow_horizontal_compose97i_sse2(IDWTELEM *b, int width){ const int w2= (width+1)>>1; - // SSE2 code runs faster with pointers aligned on a 32-byte boundary. - IDWTELEM temp_buf[(width>>1) + 4]; - IDWTELEM * const temp = temp_buf + 4 - (((int)temp_buf & 0xF) >> 2); + DECLARE_ALIGNED_16(IDWTELEM, temp[width>>1]);
Wouldn't it be better to fix the manual alignment code, since gcc (except latest 4.2) does not support alignment of stack vars?
I don't see a point in using manual alignment in this one place and having all the rest use the problematic code. IOW I just don't see any advantage whatsoever in keeping this manual alignment code. Greetings, Reimar D?ffinger
participants (4)
-
dalias@aerifal.cx -
Reimar.Doeffinger@stud.uni-karlsruhe.de -
subversion@mplayerhq.hu -
uoti.urpala@pp1.inet.fi