# HG changeset patch # User michaelni # Date 1021640461 0 # Node ID b8f3affeb8e1a009d89ed69a5f66a6798f576991 # Parent f49629bab18d915a1b8af5c196e9b9ed76c30401 shared lib support (req by kabi) ... diff -r f49629bab18d -r b8f3affeb8e1 i386/dsputil_mmx.c --- a/i386/dsputil_mmx.c Fri May 17 01:04:14 2002 +0000 +++ b/i386/dsputil_mmx.c Fri May 17 13:01:01 2002 +0000 @@ -50,9 +50,9 @@ void ff_mmxext_idct(DCTELEM *block); /* pixel operations */ -static const unsigned long long int mm_bone __attribute__ ((aligned(8))) = 0x0101010101010101LL; -static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001LL; -static const unsigned long long int mm_wtwo __attribute__ ((aligned(8))) = 0x0002000200020002LL; +static const uint64_t mm_bone __attribute__ ((aligned(8))) = 0x0101010101010101ULL; +static const uint64_t mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL; +static const uint64_t mm_wtwo __attribute__ ((aligned(8))) = 0x0002000200020002ULL; //static const unsigned short mm_wone[4] __attribute__ ((aligned(8))) = { 0x1, 0x1, 0x1, 0x1 }; //static const unsigned short mm_wtwo[4] __attribute__ ((aligned(8))) = { 0x2, 0x2, 0x2, 0x2 }; @@ -62,6 +62,7 @@ #ifndef PIC #define MOVQ_WONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wone)) #define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo)) +#define MOVQ_BONE(regd) "movq "MANGLE(mm_bone)", "#regd" \n\t" #else // for shared library it's better to use this way for accessing constants // pcmpeqd -> -1 @@ -75,8 +76,14 @@ "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ "psrlw $15, %%" #regd " \n\t" \ "psllw $1, %%" #regd ::) + +#define MOVQ_BONE(regd) \ + "pcmpeqd " #regd ", " #regd " \n\t" \ + "psrlw $15, " #regd " \n\t"\ + "packuswb " #regd ", " #regd " \n\t" #endif + /***********************************/ /* 3Dnow specific */ diff -r f49629bab18d -r b8f3affeb8e1 i386/dsputil_mmx_avg.h --- a/i386/dsputil_mmx_avg.h Fri May 17 01:04:14 2002 +0000 +++ b/i386/dsputil_mmx_avg.h Fri May 17 13:01:01 2002 +0000 @@ -20,7 +20,7 @@ * MMX optimization by Nick Kurshev * mostly rewritten by Michael Niedermayer */ - + static void DEF(put_pixels_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h) { __asm __volatile( @@ -57,7 +57,7 @@ { __asm __volatile( "xorl %%eax, %%eax \n\t" - "movq "MANGLE(mm_bone)", %%mm7 \n\t" + MOVQ_BONE(%%mm7) ".balign 16 \n\t" "1: \n\t" "movq (%1, %%eax), %%mm0 \n\t" @@ -122,7 +122,7 @@ static void DEF(put_no_rnd_pixels_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h) { __asm __volatile( - "movq "MANGLE(mm_bone)", %%mm7 \n\t" + MOVQ_BONE(%%mm7) "xorl %%eax, %%eax \n\t" "movq (%1), %%mm0 \n\t" ".balign 16 \n\t" @@ -264,7 +264,7 @@ static void DEF(avg_pixels_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h) { __asm __volatile( - "movq "MANGLE(mm_bone)", %%mm7 \n\t" + MOVQ_BONE(%%mm7) "xorl %%eax, %%eax \n\t" "movq (%1), %%mm0 \n\t" "movq 1(%1), %%mm1 \n\t"