On Wed, Aug 1, 2012 at 1:03 AM, Daniel Kang <[email protected]> wrote:
> On Wed, Aug 1, 2012 at 12:57 AM, Loren Merritt <[email protected]>wrote: > >> libavcodec/x86/dsputil_mmx_avg_template.c:58:1: warning: >> `put_pixels4_l2_3dnow' defined but not used >> libavcodec/x86/dsputil_mmx_avg_template.c:229:1: warning: >> `avg_pixels4_l2_3dnow' defined but not used >> libavcodec/x86/dsputil_mmx_avg_template.c:875:1: warning: >> `avg_pixels4_3dnow' defined but not used >> > > Those errors are fairly difficult to fix. Whoever wrote the original > inlined assembly made it very hard to disable only certain functions at > specific CPU types. Which would you prefer, a hack-ish workaround or to > wait until I port the rest over to yasm? > I'm thinking something along the lines of: diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 47d99f9..126a0b9 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -198,12 +198,14 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 }; #define DEF(x) x ## _3dnow #define PAVGB "pavgusb" #define OP_AVG PAVGB +#define IS_3DNOW #include "dsputil_mmx_avg_template.c" #undef DEF #undef PAVGB #undef OP_AVG +#undef IS_3DNOW /***********************************/ /* MMX2 specific */ diff --git a/libavcodec/x86/dsputil_mmx_avg_template.c b/libavcodec/x86/dsputil_mmx_avg_template.c index 8b116b7..29d0e51 100644 --- a/libavcodec/x86/dsputil_mmx_avg_template.c +++ b/libavcodec/x86/dsputil_mmx_avg_template.c @@ -55,6 +55,7 @@ static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_ :"%"REG_a, "memory"); } +#ifndef IS_3DNOW static void DEF(put_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { __asm__ volatile( @@ -104,7 +105,7 @@ static void DEF(put_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int :"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride) :"memory"); } - +#endif static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { @@ -226,6 +227,7 @@ static void DEF(put_no_rnd_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src :"memory");*/ } +#ifndef IS_3DNOW static void DEF(avg_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { __asm__ volatile( @@ -276,7 +278,7 @@ static void DEF(avg_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int :"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride) :"memory"); } - +#endif static void DEF(avg_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { @@ -872,6 +874,7 @@ static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line :"%"REG_a, "memory"); } +#ifndef IS_3DNOW static void DEF(avg_pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h) { do { @@ -896,6 +899,7 @@ static void DEF(avg_pixels4)(uint8_t *block, const uint8_t *pixels, int line_siz h -= 4; } while(h > 0); } +#endif //FIXME the following could be optimized too ... static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
