summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_ivtc.c
diff options
context:
space:
mode:
authoraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-21 11:55:20 +0000
committeraurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-21 11:55:20 +0000
commit798d2d133780c000166f01fd2d7fbde395196be3 (patch)
tree1346451ddb9911c63cd778af21261a6ae6f70346 /libmpcodecs/vf_ivtc.c
parent159928a38a3fc65427a1336b2c73aa3f78a82aa7 (diff)
downloadmpv-798d2d133780c000166f01fd2d7fbde395196be3.tar.bz2
mpv-798d2d133780c000166f01fd2d7fbde395196be3.tar.xz
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13721 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_ivtc.c')
-rw-r--r--libmpcodecs/vf_ivtc.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/libmpcodecs/vf_ivtc.c b/libmpcodecs/vf_ivtc.c
index 804f68a084..3fb00e5f7b 100644
--- a/libmpcodecs/vf_ivtc.c
+++ b/libmpcodecs/vf_ivtc.c
@@ -71,11 +71,11 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
"1: \n\t"
// Even difference
- "movq (%%esi), %%mm0 \n\t"
- "movq (%%esi), %%mm2 \n\t"
- "addl %%eax, %%esi \n\t"
- "movq (%%edi), %%mm1 \n\t"
- "addl %%ebx, %%edi \n\t"
+ "movq (%%"REG_S"), %%mm0 \n\t"
+ "movq (%%"REG_S"), %%mm2 \n\t"
+ "add %%"REG_a", %%"REG_S" \n\t"
+ "movq (%%"REG_D"), %%mm1 \n\t"
+ "add %%"REG_b", %%"REG_D" \n\t"
"psubusb %%mm1, %%mm2 \n\t"
"psubusb %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm0 \n\t"
@@ -90,11 +90,11 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
"paddw %%mm3, %%mm4 \n\t"
// Odd difference
- "movq (%%esi), %%mm0 \n\t"
- "movq (%%esi), %%mm2 \n\t"
- "addl %%eax, %%esi \n\t"
- "movq (%%edi), %%mm1 \n\t"
- "addl %%ebx, %%edi \n\t"
+ "movq (%%"REG_S"), %%mm0 \n\t"
+ "movq (%%"REG_S"), %%mm2 \n\t"
+ "add %%"REG_a", %%"REG_S" \n\t"
+ "movq (%%"REG_D"), %%mm1 \n\t"
+ "add %%"REG_b", %%"REG_D" \n\t"
"psubusb %%mm1, %%mm2 \n\t"
"psubusb %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm0 \n\t"
@@ -110,8 +110,8 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
"decl %%ecx \n\t"
"jnz 1b \n\t"
- "movq %%mm4, (%%edx) \n\t"
- "movq %%mm5, 8(%%edx) \n\t"
+ "movq %%mm4, (%%"REG_d") \n\t"
+ "movq %%mm5, 8(%%"REG_d") \n\t"
:
: "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
: "memory"
@@ -130,14 +130,14 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
".balign 16 \n\t"
"2: \n\t"
- "movq (%%esi), %%mm0 \n\t"
- "movq (%%esi,%%eax), %%mm1 \n\t"
- "addl %%eax, %%esi \n\t"
- "addl %%eax, %%esi \n\t"
- "movq (%%edi), %%mm2 \n\t"
- "movq (%%edi,%%ebx), %%mm3 \n\t"
- "addl %%ebx, %%edi \n\t"
- "addl %%ebx, %%edi \n\t"
+ "movq (%%"REG_S"), %%mm0 \n\t"
+ "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+ "add %%"REG_a", %%"REG_S" \n\t"
+ "add %%"REG_a", %%"REG_S" \n\t"
+ "movq (%%"REG_D"), %%mm2 \n\t"
+ "movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
+ "add %%"REG_b", %%"REG_D" \n\t"
+ "add %%"REG_b", %%"REG_D" \n\t"
"punpcklbw %%mm7, %%mm0 \n\t"
"punpcklbw %%mm7, %%mm1 \n\t"
"punpcklbw %%mm7, %%mm2 \n\t"
@@ -164,16 +164,16 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
"psubw %%mm1, %%mm4 \n\t"
"psubw %%mm2, %%mm5 \n\t"
"psubw %%mm3, %%mm6 \n\t"
- "movq %%mm4, (%%edx) \n\t"
- "movq %%mm5, 16(%%edx) \n\t"
- "movq %%mm6, 32(%%edx) \n\t"
+ "movq %%mm4, (%%"REG_d") \n\t"
+ "movq %%mm5, 16(%%"REG_d") \n\t"
+ "movq %%mm6, 32(%%"REG_d") \n\t"
- "movl %%eax, %%ecx \n\t"
- "shll $3, %%ecx \n\t"
- "subl %%ecx, %%esi \n\t"
- "movl %%ebx, %%ecx \n\t"
- "shll $3, %%ecx \n\t"
- "subl %%ecx, %%edi \n\t"
+ "mov %%"REG_a", %%"REG_c" \n\t"
+ "shl $3, %%"REG_c" \n\t"
+ "sub %%"REG_c", %%"REG_S" \n\t"
+ "mov %%"REG_b", %%"REG_c" \n\t"
+ "shl $3, %%"REG_c" \n\t"
+ "sub %%"REG_c", %%"REG_D" \n\t"
// Second loop for the last four columns
"movl $4, %%ecx \n\t"
@@ -184,14 +184,14 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
".balign 16 \n\t"
"3: \n\t"
- "movq (%%esi), %%mm0 \n\t"
- "movq (%%esi,%%eax), %%mm1 \n\t"
- "addl %%eax, %%esi \n\t"
- "addl %%eax, %%esi \n\t"
- "movq (%%edi), %%mm2 \n\t"
- "movq (%%edi,%%ebx), %%mm3 \n\t"
- "addl %%ebx, %%edi \n\t"
- "addl %%ebx, %%edi \n\t"
+ "movq (%%"REG_S"), %%mm0 \n\t"
+ "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
+ "add %%"REG_a", %%"REG_S" \n\t"
+ "add %%"REG_a", %%"REG_S" \n\t"
+ "movq (%%"REG_D"), %%mm2 \n\t"
+ "movq (%%"REG_D",%%"REG_b"), %%mm3 \n\t"
+ "add %%"REG_b", %%"REG_D" \n\t"
+ "add %%"REG_b", %%"REG_D" \n\t"
"punpckhbw %%mm7, %%mm0 \n\t"
"punpckhbw %%mm7, %%mm1 \n\t"
"punpckhbw %%mm7, %%mm2 \n\t"
@@ -218,13 +218,13 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
"psubw %%mm1, %%mm4 \n\t"
"psubw %%mm2, %%mm5 \n\t"
"psubw %%mm3, %%mm6 \n\t"
- "movq %%mm4, 8(%%edx) \n\t"
- "movq %%mm5, 24(%%edx) \n\t"
- "movq %%mm6, 40(%%edx) \n\t"
+ "movq %%mm4, 8(%%"REG_d") \n\t"
+ "movq %%mm5, 24(%%"REG_d") \n\t"
+ "movq %%mm6, 40(%%"REG_d") \n\t"
"emms \n\t"
:
- : "S" (old), "D" (new), "a" (os), "b" (ns), "d" (out)
+ : "S" (old), "D" (new), "a" ((long)os), "b" ((long)ns), "d" (out)
: "memory"
);
m->p = m->t = m->s = 0;