diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2005-01-21 19:48:18 +0300 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2005-01-21 19:48:18 +0300 |
commit | 6d606c4f5b68fa396d454a896d3223c2c13de2fb (patch) | |
tree | 13aa1623e71d49a1d12b1fa5667a00c5ebe4dba5 | |
parent | 45ce5ddb897ca14f18cc0bb26f1e457bf936c78c (diff) |
fix few x86_64 registers handling
Originally committed as revision 14557 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
-rw-r--r-- | postproc/swscale.c | 4 | ||||
-rw-r--r-- | postproc/swscale_template.c | 36 |
2 files changed, 34 insertions, 6 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c index 6e9419789f..5da32037e9 100644 --- a/postproc/swscale.c +++ b/postproc/swscale.c @@ -1175,7 +1175,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil "pshufw $0xFF, %%mm0, %%mm0 \n\t" "2: \n\t" "psubw %%mm1, %%mm0 \n\t" - "mov 8(%%"REG_b", %%"REG_a"), %%"REG_S"\n\t" + "movl 8(%%"REG_b", %%"REG_a"), %%esi\n\t" "pmullw %%mm3, %%mm0 \n\t" "psllw $7, %%mm1 \n\t" "paddw %%mm1, %%mm0 \n\t" @@ -1213,7 +1213,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil "pshufw $0xFF, %%mm0, %%mm0 \n\t" "2: \n\t" "psubw %%mm1, %%mm0 \n\t" - "mov 8(%%"REG_b", %%"REG_a"), %%"REG_S"\n\t" + "movl 8(%%"REG_b", %%"REG_a"), %%esi\n\t" "pmullw %%mm3, %%mm0 \n\t" "psllw $7, %%mm1 \n\t" "paddw %%mm1, %%mm0 \n\t" diff --git a/postproc/swscale_template.c b/postproc/swscale_template.c index 48a665895b..692a279a62 100644 --- a/postproc/swscale_template.c +++ b/postproc/swscale_template.c @@ -2271,13 +2271,27 @@ static inline void RENAME(hyscale)(uint16_t *dst, int dstWidth, uint8_t *src, in PREFETCH" 32(%%"REG_c") \n\t" PREFETCH" 64(%%"REG_c") \n\t" +#ifdef ARCH_X86_64 + +#define FUNNY_Y_CODE \ + "movl (%%"REG_b"), %%esi \n\t"\ + "call *%4 \n\t"\ + "movl (%%"REG_b", %%"REG_a"), %%esi\n\t"\ + "add %%"REG_S", %%"REG_c" \n\t"\ + "add %%"REG_a", %%"REG_D" \n\t"\ + "xor %%"REG_a", %%"REG_a" \n\t"\ + +#else + #define FUNNY_Y_CODE \ - "mov (%%"REG_b"), %%"REG_S" \n\t"\ + "movl (%%"REG_b"), %%esi \n\t"\ "call *%4 \n\t"\ - "addl (%%"REG_b", %%"REG_a"), %%ecx\n\t"\ + "addl (%%"REG_b", %%"REG_a"), %%"REG_c"\n\t"\ "add %%"REG_a", %%"REG_D" \n\t"\ "xor %%"REG_a", %%"REG_a" \n\t"\ +#endif + FUNNY_Y_CODE FUNNY_Y_CODE FUNNY_Y_CODE @@ -2440,13 +2454,27 @@ inline static void RENAME(hcscale)(uint16_t *dst, int dstWidth, uint8_t *src1, u PREFETCH" 32(%%"REG_c") \n\t" PREFETCH" 64(%%"REG_c") \n\t" +#ifdef ARCH_X86_64 + +#define FUNNY_UV_CODE \ + "movl (%%"REG_b"), %%esi \n\t"\ + "call *%4 \n\t"\ + "movl (%%"REG_b", %%"REG_a"), %%esi\n\t"\ + "add %%"REG_S", %%"REG_c" \n\t"\ + "add %%"REG_a", %%"REG_D" \n\t"\ + "xor %%"REG_a", %%"REG_a" \n\t"\ + +#else + #define FUNNY_UV_CODE \ "movl (%%"REG_b"), %%esi \n\t"\ "call *%4 \n\t"\ - "addl (%%"REG_b", %%"REG_a"), %%ecx\n\t"\ + "addl (%%"REG_b", %%"REG_a"), %%"REG_c"\n\t"\ "add %%"REG_a", %%"REG_D" \n\t"\ "xor %%"REG_a", %%"REG_a" \n\t"\ +#endif + FUNNY_UV_CODE FUNNY_UV_CODE FUNNY_UV_CODE @@ -2466,7 +2494,7 @@ FUNNY_UV_CODE :: "m" (src1), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), "m" (funnyUVCode), "m" (src2) - : "%"REG_a, "%"REG_b, "%"REG_c, "%"REG_d, "%esi", "%"REG_D + : "%"REG_a, "%"REG_b, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D ); for(i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) { |