diff options
author | Diego Biurrun <diego@biurrun.de> | 2012-07-08 18:42:12 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-08-03 22:51:05 +0200 |
commit | 239fdf1b4a3dd9decad157d4694837cffa917021 (patch) | |
tree | a92ed88dd8a7bf975f10ff638f1fa2d256de657e /libswscale/x86 | |
parent | 66adb7ce1bc1cc5e3f1c4b1cd9f20ac68086a486 (diff) | |
download | ffmpeg-239fdf1b4a3dd9decad157d4694837cffa917021.tar.gz |
x86: build: replace mmx2 by mmxext
Refactoring mmx2/mmxext YASM code with cpuflags will force renames.
So switching to a consistent naming scheme beforehand is sensible.
The name "mmxext" is more official and widespread and also the name
of the CPU flag, as reported e.g. by the Linux kernel.
Diffstat (limited to 'libswscale/x86')
-rw-r--r-- | libswscale/x86/rgb2rgb.c | 12 | ||||
-rw-r--r-- | libswscale/x86/rgb2rgb_template.c | 18 | ||||
-rw-r--r-- | libswscale/x86/swscale.c | 16 | ||||
-rw-r--r-- | libswscale/x86/swscale_template.c | 18 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb.c | 16 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb_template.c | 12 |
6 files changed, 46 insertions, 46 deletions
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index f940888a70..066749c22f 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -85,7 +85,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; //Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one. -#define COMPILE_TEMPLATE_MMX2 0 +#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_AMD3DNOW 0 #define COMPILE_TEMPLATE_SSE2 0 @@ -96,8 +96,8 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; //MMX2 versions #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _MMX2 #include "rgb2rgb_template.c" @@ -110,10 +110,10 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; //3DNOW versions #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 +#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_AMD3DNOW -#define COMPILE_TEMPLATE_MMX2 0 +#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_SSE2 0 #define COMPILE_TEMPLATE_AMD3DNOW 1 #define RENAME(a) a ## _3DNOW @@ -137,7 +137,7 @@ av_cold void rgb2rgb_init_x86(void) rgb2rgb_init_MMX(); if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW) rgb2rgb_init_3DNOW(); - if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) + if (HAVE_MMXEXT && cpu_flags & AV_CPU_FLAG_MMXEXT) rgb2rgb_init_MMX2(); if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) rgb2rgb_init_SSE2(); diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index c255610193..3374f45908 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -35,7 +35,7 @@ #if COMPILE_TEMPLATE_AMD3DNOW #define PREFETCH "prefetch" #define PAVGB "pavgusb" -#elif COMPILE_TEMPLATE_MMX2 +#elif COMPILE_TEMPLATE_MMXEXT #define PREFETCH "prefetchnta" #define PAVGB "pavgb" #else @@ -49,7 +49,7 @@ #define EMMS "emms" #endif -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define MOVNTQ "movntq" #define SFENCE "sfence" #else @@ -1148,7 +1148,7 @@ static inline void RENAME(shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, PREFETCH" 32(%1, %0) \n\t" "movq (%1, %0), %%mm0 \n\t" "movq 8(%1, %0), %%mm1 \n\t" -# if COMPILE_TEMPLATE_MMX2 +# if COMPILE_TEMPLATE_MMXEXT "pshufw $177, %%mm0, %%mm3 \n\t" "pshufw $177, %%mm1, %%mm5 \n\t" "pand %%mm7, %%mm0 \n\t" @@ -1512,7 +1512,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t } #endif /* !COMPILE_TEMPLATE_AMD3DNOW */ -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride) { int x,y; @@ -1602,7 +1602,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid SFENCE" \n\t" :::"memory"); } -#endif /* COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW */ +#endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */ #if !COMPILE_TEMPLATE_AMD3DNOW /** @@ -1810,7 +1810,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ "1: \n\t" PREFETCH" 64(%0, %%"REG_d") \n\t" PREFETCH" 64(%1, %%"REG_d") \n\t" -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW "movq (%0, %%"REG_d"), %%mm0 \n\t" "movq (%1, %%"REG_d"), %%mm1 \n\t" "movq 6(%0, %%"REG_d"), %%mm2 \n\t" @@ -1871,7 +1871,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ "packssdw %%mm1, %%mm0 \n\t" // V1 V0 U1 U0 "psraw $7, %%mm0 \n\t" -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW "movq 12(%0, %%"REG_d"), %%mm4 \n\t" "movq 12(%1, %%"REG_d"), %%mm1 \n\t" "movq 18(%0, %%"REG_d"), %%mm2 \n\t" @@ -2592,9 +2592,9 @@ static inline void RENAME(rgb2rgb_init)(void) yuyvtoyuv422 = RENAME(yuyvtoyuv422); #endif /* !COMPILE_TEMPLATE_SSE2 */ -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW planar2x = RENAME(planar2x); -#endif /* COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW */ +#endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */ rgb24toyv12 = RENAME(rgb24toyv12); yuyvtoyuv420 = RENAME(yuyvtoyuv420); diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index a0c18c79fc..57d270b09d 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -72,16 +72,16 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; //MMX versions #if HAVE_MMX #undef RENAME -#define COMPILE_TEMPLATE_MMX2 0 +#define COMPILE_TEMPLATE_MMXEXT 0 #define RENAME(a) a ## _MMX #include "swscale_template.c" #endif //MMX2 versions -#if HAVE_MMX2 +#if HAVE_MMXEXT #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _MMX2 #include "swscale_template.c" #endif @@ -308,8 +308,8 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c) #if HAVE_INLINE_ASM if (cpu_flags & AV_CPU_FLAG_MMX) sws_init_swScale_MMX(c); -#if HAVE_MMX2 - if (cpu_flags & AV_CPU_FLAG_MMX2) +#if HAVE_MMXEXT + if (cpu_flags & AV_CPU_FLAG_MMXEXT) sws_init_swScale_MMX2(c); #endif #endif /* HAVE_INLINE_ASM */ @@ -360,7 +360,7 @@ switch(c->dstBpc){ \ if (cpu_flags & AV_CPU_FLAG_MMX) { ASSIGN_MMX_SCALE_FUNC(c->hyScale, c->hLumFilterSize, mmx, mmx); ASSIGN_MMX_SCALE_FUNC(c->hcScale, c->hChrFilterSize, mmx, mmx); - ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMX2); + ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMXEXT); switch (c->srcFormat) { case PIX_FMT_Y400A: @@ -392,7 +392,7 @@ switch(c->dstBpc){ \ break; } } - if (cpu_flags & AV_CPU_FLAG_MMX2) { + if (cpu_flags & AV_CPU_FLAG_MMXEXT) { ASSIGN_VSCALEX_FUNC(c->yuv2planeX, mmx2, , 1); } #endif diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index ad2b32f27b..e9816cf0a6 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -22,13 +22,13 @@ #undef MOVNTQ #undef PREFETCH -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define PREFETCH "prefetchnta" #else #define PREFETCH " # nop" #endif -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t" #else #define REAL_MOVNTQ(a,b) "movq " #a ", " #b " \n\t" @@ -567,7 +567,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, "cmp "#dstw", "#index" \n\t"\ " jb 1b \n\t" -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #undef WRITEBGR24 #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX2(dst, dstw, index) #else @@ -1371,7 +1371,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0, } } -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc) @@ -1553,7 +1553,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, dst2[i] = src2[srcW-1]*128; } } -#endif /* COMPILE_TEMPLATE_MMX2 */ +#endif /* COMPILE_TEMPLATE_MMXEXT */ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) { @@ -1616,17 +1616,17 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) if (c->srcBpc == 8 && c->dstBpc <= 10) { // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT if (c->flags & SWS_FAST_BILINEAR && c->canMMX2BeUsed) { c->hyscale_fast = RENAME(hyscale_fast); c->hcscale_fast = RENAME(hcscale_fast); } else { -#endif /* COMPILE_TEMPLATE_MMX2 */ +#endif /* COMPILE_TEMPLATE_MMXEXT */ c->hyscale_fast = NULL; c->hcscale_fast = NULL; -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT } -#endif /* COMPILE_TEMPLATE_MMX2 */ +#endif /* COMPILE_TEMPLATE_MMXEXT */ } } diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index b4bcbf53c2..501993ae42 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -52,20 +52,20 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; //MMX versions #if HAVE_MMX #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 0 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 0 #define RENAME(a) a ## _MMX #include "yuv2rgb_template.c" #endif /* HAVE_MMX */ //MMX2 versions -#if HAVE_MMX2 +#if HAVE_MMXEXT #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _MMX2 #include "yuv2rgb_template.c" -#endif /* HAVE_MMX2 */ +#endif /* HAVE_MMXEXT */ #endif /* HAVE_INLINE_ASM */ @@ -78,8 +78,8 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) c->srcFormat != PIX_FMT_YUVA420P) return NULL; -#if HAVE_MMX2 - if (cpu_flags & AV_CPU_FLAG_MMX2) { +#if HAVE_MMXEXT + if (cpu_flags & AV_CPU_FLAG_MMXEXT) { switch (c->dstFormat) { case PIX_FMT_RGB24: return yuv420_rgb24_MMX2; case PIX_FMT_BGR24: return yuv420_bgr24_MMX2; diff --git a/libswscale/x86/yuv2rgb_template.c b/libswscale/x86/yuv2rgb_template.c index 5d1fa5b309..a71fd13862 100644 --- a/libswscale/x86/yuv2rgb_template.c +++ b/libswscale/x86/yuv2rgb_template.c @@ -25,7 +25,7 @@ #undef EMMS #undef SFENCE -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define MOVNTQ "movntq" #define SFENCE "sfence" #else @@ -182,7 +182,7 @@ "paddusb "GREEN_DITHER"(%4), %%mm2\n\t" \ "paddusb "RED_DITHER"(%4), %%mm1\n\t" \ -#if !COMPILE_TEMPLATE_MMX2 +#if !COMPILE_TEMPLATE_MMXEXT static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, @@ -238,7 +238,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[], YUV2RGB_OPERANDS YUV2RGB_ENDFUNC } -#endif /* !COMPILE_TEMPLATE_MMX2 */ +#endif /* !COMPILE_TEMPLATE_MMXEXT */ #define RGB_PACK24(blue, red)\ "packuswb %%mm3, %%mm0 \n" /* R0 R2 R4 R6 R1 R3 R5 R7 */\ @@ -255,7 +255,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[], "punpckhwd %%mm6, %%mm5 \n" /* R4 G4 B4 R5 R6 G6 B6 R7 */\ RGB_PACK24_B -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT DECLARE_ASM_CONST(8, int16_t, mask1101[4]) = {-1,-1, 0,-1}; DECLARE_ASM_CONST(8, int16_t, mask0010[4]) = { 0, 0,-1, 0}; DECLARE_ASM_CONST(8, int16_t, mask0110[4]) = { 0,-1,-1, 0}; @@ -362,7 +362,7 @@ static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[], MOVNTQ " %%mm5, 16(%1)\n\t" \ MOVNTQ " %%mm"alpha", 24(%1)\n\t" \ -#if !COMPILE_TEMPLATE_MMX2 +#if !COMPILE_TEMPLATE_MMXEXT static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, @@ -449,4 +449,4 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[], } #endif -#endif /* !COMPILE_TEMPLATE_MMX2 */ +#endif /* !COMPILE_TEMPLATE_MMXEXT */ |