diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-05-18 22:49:11 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-05-18 22:49:11 +0000 |
commit | 924155104944fbb46d37f2d102071c702aa22a16 (patch) | |
tree | 1bce1fc7682ebaefdd82e01b3857900d5f5dc852 | |
parent | a6e14edde01bafbbe54f6f451efa718a48975b47 (diff) | |
download | ffmpeg-924155104944fbb46d37f2d102071c702aa22a16.tar.gz |
tried to avoid gcc 2.95.2 bug by puting explicit register constraints - added comment about rounding bug in some functions (need to correct or suppress them for regression tests)
Originally committed as revision 515 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/i386/dsputil_mmx_avg.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/libavcodec/i386/dsputil_mmx_avg.h b/libavcodec/i386/dsputil_mmx_avg.h index 78ed4040f5..77204e1af9 100644 --- a/libavcodec/i386/dsputil_mmx_avg.h +++ b/libavcodec/i386/dsputil_mmx_avg.h @@ -21,6 +21,8 @@ * mostly rewritten by Michael Niedermayer <michaelni@gmx.at> */ +/* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm + clobber bug */ static void DEF(put_pixels_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h) { __asm __volatile( @@ -48,11 +50,12 @@ static void DEF(put_pixels_x2)(UINT8 *block, const UINT8 *pixels, int line_size, "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r" (block), "r" (block+line_size), - "r"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d" (block), "S" (block+line_size), + "D"(line_size<<1) :"%eax", "memory"); } +/* GL: this function does incorrect rounding if overflow */ static void DEF(put_no_rnd_pixels_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h) { __asm __volatile( @@ -85,8 +88,8 @@ static void DEF(put_no_rnd_pixels_x2)(UINT8 *block, const UINT8 *pixels, int lin "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r" (block), "r" (block+line_size), - "r"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d" (block), "S" (block+line_size), + "D"(line_size<<1) :"%eax", "memory"); } @@ -114,11 +117,12 @@ static void DEF(put_pixels_y2)(UINT8 *block, const UINT8 *pixels, int line_size, "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r"(pixels+line_size*2), "r" (block), - "r" (block+line_size), "g"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d"(pixels+line_size*2), "S" (block), + "D" (block+line_size), "g"(line_size<<1) :"%eax", "memory"); } +/* GL: this function does incorrect rounding if overflow */ static void DEF(put_no_rnd_pixels_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h) { __asm __volatile( @@ -146,8 +150,8 @@ static void DEF(put_no_rnd_pixels_y2)(UINT8 *block, const UINT8 *pixels, int lin "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r"(pixels+line_size*2), "r" (block), - "r" (block+line_size), "g"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d"(pixels+line_size*2), "S" (block), + "D" (block+line_size), "g"(line_size<<1) :"%eax", "memory"); } @@ -178,8 +182,8 @@ static void DEF(avg_pixels)(UINT8 *block, const UINT8 *pixels, int line_size, in "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r" (block), "r" (block+line_size), - "r"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d" (block), "S" (block+line_size), + "D"(line_size<<1) :"%eax", "memory"); } @@ -218,8 +222,8 @@ static void DEF(avg_pixels_x2)(UINT8 *block, const UINT8 *pixels, int line_size, "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r" (block), "r" (block+line_size), - "r"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d" (block), "S" (block+line_size), + "D"(line_size<<1) :"%eax", "memory"); } @@ -255,8 +259,8 @@ static void DEF(avg_pixels_y2)(UINT8 *block, const UINT8 *pixels, int line_size, "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r"(pixels+line_size*2), "r" (block), - "r" (block+line_size), "g"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d"(pixels+line_size*2), "S" (block), + "D" (block+line_size), "g"(line_size<<1) :"%eax", "memory"); } @@ -305,8 +309,8 @@ static void DEF(avg_pixels_xy2)(UINT8 *block, const UINT8 *pixels, int line_size "subl $4, %0 \n\t" " jnz 1b \n\t" :"+g"(h) - :"r"(pixels), "r"(pixels+line_size), "r"(pixels+line_size*2), "r" (block), - "r" (block+line_size), "g"(line_size<<1) + :"b"(pixels), "c"(pixels+line_size), "d"(pixels+line_size*2), "S" (block), + "D" (block+line_size), "g"(line_size<<1) :"%eax", "memory"); } |