Replace asmalign.h hack by ASMALIGN cpp macros from config.h.
authorDiego Biurrun <diego@biurrun.de>
Sun, 13 Aug 2006 00:21:14 +0000 (00:21 +0000)
committerDiego Biurrun <diego@biurrun.de>
Sun, 13 Aug 2006 00:21:14 +0000 (00:21 +0000)
Originally committed as revision 19378 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

libswscale/rgb2rgb_template.c
libswscale/swscale_template.c

index 807da61..bd8b9e0 100644 (file)
@@ -12,8 +12,6 @@
 #include <stddef.h>
 #include <inttypes.h> /* for __WORDSIZE */
 
-#include "asmalign.h"
-
 #ifndef __WORDSIZE
 // #warning You have misconfigured system and probably will lose performance!
 #define __WORDSIZE MP_WORDSIZE
@@ -343,7 +341,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
                "movq %3, %%mm5                 \n\t"
                "movq %4, %%mm6                 \n\t"
                "movq %5, %%mm7                 \n\t"
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                PREFETCH" 32(%1)                \n\t"
                "movd   (%1), %%mm0             \n\t"
@@ -500,7 +498,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
                "movq %3, %%mm5                 \n\t"
                "movq %4, %%mm6                 \n\t"
                "movq %5, %%mm7                 \n\t"
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                PREFETCH" 32(%1)                \n\t"
                "movd   (%1), %%mm0             \n\t"
@@ -1355,7 +1353,7 @@ static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long s
 /* TODO: unroll this loop */
        asm volatile (
                "xor %%"REG_a", %%"REG_a"       \n\t"
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                PREFETCH" 32(%0, %%"REG_a")     \n\t"
                "movq (%0, %%"REG_a"), %%mm0    \n\t"
@@ -1405,7 +1403,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
                "movq "MANGLE(mask24r)", %%mm5  \n\t"
                "movq "MANGLE(mask24g)", %%mm6  \n\t"
                "movq "MANGLE(mask24b)", %%mm7  \n\t"
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                PREFETCH" 32(%1, %%"REG_a")     \n\t"
                "movq   (%1, %%"REG_a"), %%mm0  \n\t" // BGR BGR BG
@@ -1475,7 +1473,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
 //FIXME handle 2 lines a once (fewer prefetch, reuse some chrom, but very likely limited by mem anyway)
                asm volatile(
                        "xor %%"REG_a", %%"REG_a"       \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 32(%1, %%"REG_a", 2)  \n\t"
                        PREFETCH" 32(%2, %%"REG_a")     \n\t"
@@ -1628,7 +1626,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
 //FIXME handle 2 lines a once (fewer prefetch, reuse some chrom, but very likely limited by mem anyway)
                asm volatile(
                        "xor %%"REG_a", %%"REG_a"       \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 32(%1, %%"REG_a", 2)  \n\t"
                        PREFETCH" 32(%2, %%"REG_a")     \n\t"
@@ -1752,7 +1750,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
                        "xor %%"REG_a", %%"REG_a"       \n\t"
                        "pcmpeqw %%mm7, %%mm7           \n\t"
                        "psrlw $8, %%mm7                \n\t" // FF,00,FF,00...
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 64(%0, %%"REG_a", 4)  \n\t"
                        "movq (%0, %%"REG_a", 4), %%mm0 \n\t" // YUYV YUYV(0)
@@ -1805,7 +1803,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
 
                asm volatile(
                        "xor %%"REG_a", %%"REG_a"       \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 64(%0, %%"REG_a", 4)  \n\t"
                        "movq (%0, %%"REG_a", 4), %%mm0 \n\t" // YUYV YUYV(0)
@@ -1990,7 +1988,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
                        "xorl %%eax, %%eax              \n\t"
                        "pcmpeqw %%mm7, %%mm7           \n\t"
                        "psrlw $8, %%mm7                \n\t" // FF,00,FF,00...
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 64(%0, %%eax, 4)      \n\t"
                        "movq (%0, %%eax, 4), %%mm0     \n\t" // UYVY UYVY(0)
@@ -2043,7 +2041,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
 
                asm volatile(
                        "xorl %%eax, %%eax              \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 64(%0, %%eax, 4)      \n\t"
                        "movq (%0, %%eax, 4), %%mm0     \n\t" // YUYV YUYV(0)
@@ -2121,7 +2119,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
                                "movq "MANGLE(w1111)", %%mm5            \n\t"
                                "pxor %%mm7, %%mm7              \n\t"
                                "lea (%%"REG_a", %%"REG_a", 2), %%"REG_b"\n\t"
-                               ASMALIGN16
+                               ASMALIGN(4)
                                "1:                             \n\t"
                                PREFETCH" 64(%0, %%"REG_b")     \n\t"
                                "movd (%0, %%"REG_b"), %%mm0    \n\t"
@@ -2195,7 +2193,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
                        "pxor %%mm7, %%mm7              \n\t"
                        "lea (%%"REG_a", %%"REG_a", 2), %%"REG_b"\n\t"
                        "add %%"REG_b", %%"REG_b"       \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        PREFETCH" 64(%0, %%"REG_b")     \n\t"
                        PREFETCH" 64(%1, %%"REG_b")     \n\t"
index 8588820..3bf20f9 100644 (file)
@@ -16,8 +16,6 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
 
-#include "asmalign.h"
-
 #undef REAL_MOVNTQ
 #undef MOVNTQ
 #undef PAVGB
@@ -74,7 +72,7 @@
                        "movq %%mm3, %%mm4              \n\t"\
                        "lea " offset "(%0), %%"REG_d"  \n\t"\
                        "mov (%%"REG_d"), %%"REG_S"     \n\t"\
-                       ASMALIGN16 /* FIXME Unroll? */\
+                       ASMALIGN(4) /* FIXME Unroll? */\
                        "1:                             \n\t"\
                        "movq 8(%%"REG_d"), %%mm0       \n\t" /* filterCoeff */\
                        "movq " #x "(%%"REG_S", %%"REG_a", 2), %%mm2\n\t" /* srcData */\
                         "pxor %%mm6, %%mm6              \n\t"\
                         "pxor %%mm7, %%mm7              \n\t"\
                        "mov (%%"REG_d"), %%"REG_S"     \n\t"\
-                       ASMALIGN16 \
+                       ASMALIGN(4) \
                        "1:                             \n\t"\
                        "movq " #x "(%%"REG_S", %%"REG_a", 2), %%mm0\n\t" /* srcData */\
                        "movq 8+" #x "(%%"REG_S", %%"REG_a", 2), %%mm2\n\t" /* srcData */\
 
 #define YSCALEYUV2YV121 \
                        "mov %2, %%"REG_a"              \n\t"\
-                       ASMALIGN16 /* FIXME Unroll? */\
+                       ASMALIGN(4) /* FIXME Unroll? */\
                        "1:                             \n\t"\
                        "movq (%0, %%"REG_a", 2), %%mm0 \n\t"\
                        "movq 8(%0, %%"REG_a", 2), %%mm1\n\t"\
 #define YSCALEYUV2PACKEDX \
        asm volatile(\
                "xor %%"REG_a", %%"REG_a"       \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "nop                            \n\t"\
                "1:                             \n\t"\
                "lea "CHR_MMX_FILTER_OFFSET"(%0), %%"REG_d"\n\t"\
                "mov (%%"REG_d"), %%"REG_S"     \n\t"\
                "movq "VROUNDER_OFFSET"(%0), %%mm3\n\t"\
                "movq %%mm3, %%mm4              \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "2:                             \n\t"\
                "movq 8(%%"REG_d"), %%mm0       \n\t" /* filterCoeff */\
                "movq (%%"REG_S", %%"REG_a"), %%mm2     \n\t" /* UsrcData */\
                "mov (%%"REG_d"), %%"REG_S"     \n\t"\
                "movq "VROUNDER_OFFSET"(%0), %%mm1\n\t"\
                "movq %%mm1, %%mm7              \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "2:                             \n\t"\
                "movq 8(%%"REG_d"), %%mm0       \n\t" /* filterCoeff */\
                "movq (%%"REG_S", %%"REG_a", 2), %%mm2  \n\t" /* Y1srcData */\
 #define YSCALEYUV2PACKEDX_ACCURATE \
        asm volatile(\
                "xor %%"REG_a", %%"REG_a"       \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "nop                            \n\t"\
                "1:                             \n\t"\
                "lea "CHR_MMX_FILTER_OFFSET"(%0), %%"REG_d"\n\t"\
                 "pxor %%mm5, %%mm5              \n\t"\
                 "pxor %%mm6, %%mm6              \n\t"\
                 "pxor %%mm7, %%mm7              \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "2:                             \n\t"\
                "movq (%%"REG_S", %%"REG_a"), %%mm0     \n\t" /* UsrcData */\
                "movq 4096(%%"REG_S", %%"REG_a"), %%mm2 \n\t" /* VsrcData */\
                 "pxor %%mm5, %%mm5              \n\t"\
                 "pxor %%mm7, %%mm7              \n\t"\
                 "pxor %%mm6, %%mm6              \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "2:                             \n\t"\
                "movq (%%"REG_S", %%"REG_a", 2), %%mm0  \n\t" /* Y1srcData */\
                "movq 8(%%"REG_S", %%"REG_a", 2), %%mm2 \n\t" /* Y2srcData */\
                "punpcklwd %%mm5, %%mm5         \n\t"\
                "punpcklwd %%mm5, %%mm5         \n\t"\
                "xor %%"REG_a", %%"REG_a"               \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%0, %%"REG_a", 2), %%mm0 \n\t" /*buf0[eax]*/\
                "movq (%1, %%"REG_a", 2), %%mm1 \n\t" /*buf1[eax]*/\
                "movq %%mm0, "CHR_MMX_FILTER_OFFSET"+8("#c")\n\t"\
                "movq %%mm1, "LUM_MMX_FILTER_OFFSET"+8("#c")\n\t"\
                "xor "#index", "#index"         \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
                "movq (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
                 
 #define REAL_YSCALEYUV2RGB(index, c) \
                "xor "#index", "#index" \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
                "movq (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
                 
 #define REAL_YSCALEYUV2PACKED1(index, c) \
                "xor "#index", "#index"         \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%2, "#index"), %%mm3     \n\t" /* uvbuf0[eax]*/\
                "movq 4096(%2, "#index"), %%mm4 \n\t" /* uvbuf0[eax+2048]*/\
                 
 #define REAL_YSCALEYUV2RGB1(index, c) \
                "xor "#index", "#index" \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%2, "#index"), %%mm3     \n\t" /* uvbuf0[eax]*/\
                "movq 4096(%2, "#index"), %%mm4 \n\t" /* uvbuf0[eax+2048]*/\
 
 #define REAL_YSCALEYUV2PACKED1b(index, c) \
                "xor "#index", "#index"         \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
                "movq (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
 // do vertical chrominance interpolation
 #define REAL_YSCALEYUV2RGB1b(index, c) \
                "xor "#index", "#index"         \n\t"\
-               ASMALIGN16\
+               ASMALIGN(4)\
                "1:                             \n\t"\
                "movq (%2, "#index"), %%mm2     \n\t" /* uvbuf0[eax]*/\
                "movq (%3, "#index"), %%mm3     \n\t" /* uvbuf1[eax]*/\
@@ -1868,7 +1866,7 @@ static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width)
                "movq "MANGLE(w1111)", %%mm5            \n\t"
                "pxor %%mm7, %%mm7              \n\t"
                "lea (%%"REG_a", %%"REG_a", 2), %%"REG_b"\n\t"
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                PREFETCH" 64(%0, %%"REG_b")     \n\t"
                "movd (%0, %%"REG_b"), %%mm0    \n\t"
@@ -1954,7 +1952,7 @@ static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
                "pxor %%mm7, %%mm7              \n\t"
                "lea (%%"REG_a", %%"REG_a", 2), %%"REG_b"       \n\t"
                "add %%"REG_b", %%"REG_b"       \n\t"
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                PREFETCH" 64(%0, %%"REG_b")     \n\t"
                PREFETCH" 64(%1, %%"REG_b")     \n\t"
@@ -2261,7 +2259,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
                        "movq "MANGLE(w02)", %%mm6      \n\t"
                        "push %%"REG_BP"                \n\t" // we use 7 regs here ...
                        "mov %%"REG_a", %%"REG_BP"      \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        "movzwl (%2, %%"REG_BP"), %%eax \n\t"
                        "movzwl 2(%2, %%"REG_BP"), %%ebx\n\t"
@@ -2299,7 +2297,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
                        "movq "MANGLE(w02)", %%mm6      \n\t"
                        "push %%"REG_BP"                \n\t" // we use 7 regs here ...
                        "mov %%"REG_a", %%"REG_BP"      \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        "movzwl (%2, %%"REG_BP"), %%eax \n\t"
                        "movzwl 2(%2, %%"REG_BP"), %%ebx\n\t"
@@ -2348,7 +2346,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
                asm volatile(
                        "pxor %%mm7, %%mm7              \n\t"
                        "movq "MANGLE(w02)", %%mm6      \n\t"
-                       ASMALIGN16
+                       ASMALIGN(4)
                        "1:                             \n\t"
                        "mov %2, %%"REG_c"              \n\t"
                        "movzwl (%%"REG_c", %0), %%eax  \n\t"
@@ -2532,7 +2530,7 @@ FUNNY_Y_CODE
                "xor %%"REG_a", %%"REG_a"       \n\t" // i
                "xor %%"REG_b", %%"REG_b"       \n\t" // xx
                "xorl %%ecx, %%ecx              \n\t" // 2*xalpha
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                "movzbl  (%0, %%"REG_b"), %%edi \n\t" //src[xx]
                "movzbl 1(%0, %%"REG_b"), %%esi \n\t" //src[xx+1]
@@ -2729,7 +2727,7 @@ FUNNY_UV_CODE
                "xor %%"REG_a", %%"REG_a"       \n\t" // i
                "xor %%"REG_b", %%"REG_b"               \n\t" // xx
                "xorl %%ecx, %%ecx              \n\t" // 2*xalpha
-               ASMALIGN16
+               ASMALIGN(4)
                "1:                             \n\t"
                "mov %0, %%"REG_S"              \n\t"
                "movzbl  (%%"REG_S", %%"REG_b"), %%edi  \n\t" //src[xx]