Mercurial > mplayer.hg
comparison libmpcodecs/pullup.c @ 10741:fec729835823
1000l, mmx code was not being used because of missing config.h, and
the mmx code was broken too! :(
author | rfelker |
---|---|
date | Sun, 31 Aug 2003 20:36:33 +0000 |
parents | b6b68224033d |
children | cd4c523eaac4 |
comparison
equal
deleted
inserted
replaced
10740:0b5748047607 | 10741:fec729835823 |
---|---|
1 | 1 |
2 | 2 |
3 #include <stdlib.h> | 3 #include <stdlib.h> |
4 #include "pullup.h" | 4 #include "pullup.h" |
5 | 5 #include "config.h" |
6 | 6 |
7 | 7 |
8 | 8 |
9 #ifdef HAVE_MMX | 9 #ifdef HAVE_MMX |
10 static int diff_y_mmx(unsigned char *a, unsigned char *b, int s) | 10 static int diff_y_mmx(unsigned char *a, unsigned char *b, int s) |
11 { | 11 { |
12 int ret; | 12 int ret; |
13 asm ( | 13 asm volatile ( |
14 "movl $4, %%ecx \n\t" | 14 "movl $4, %%ecx \n\t" |
15 "pxor %%mm4, %%mm4 \n\t" | 15 "pxor %%mm4, %%mm4 \n\t" |
16 "pxor %%mm7, %%mm7 \n\t" | 16 "pxor %%mm7, %%mm7 \n\t" |
17 | 17 |
18 ".balign 16 \n\t" | 18 ".balign 16 \n\t" |
35 "paddw %%mm1, %%mm4 \n\t" | 35 "paddw %%mm1, %%mm4 \n\t" |
36 "paddw %%mm2, %%mm4 \n\t" | 36 "paddw %%mm2, %%mm4 \n\t" |
37 "paddw %%mm3, %%mm4 \n\t" | 37 "paddw %%mm3, %%mm4 \n\t" |
38 | 38 |
39 "decl %%ecx \n\t" | 39 "decl %%ecx \n\t" |
40 "jnz fb \n\t" | 40 "jnz 1b \n\t" |
41 | 41 |
42 "movq %%mm4, %%mm3 \n\t" | 42 "movq %%mm4, %%mm3 \n\t" |
43 "punpcklwl %%mm7, %%mm4 \n\t" | 43 "punpcklwd %%mm7, %%mm4 \n\t" |
44 "punpckhwl %%mm7, %%mm3 \n\t" | 44 "punpckhwd %%mm7, %%mm3 \n\t" |
45 "paddl %%mm4, %%mm3 \n\t" | 45 "paddd %%mm4, %%mm3 \n\t" |
46 "movq %%mm3, %%mm2 \n\t" | 46 "movd %%mm3, %%eax \n\t" |
47 "punpckllq %%mm7, %%mm3 \n\t" | 47 "psrlq $32, %%mm3 \n\t" |
48 "punpckhlq %%mm7, %%mm2 \n\t" | 48 "movd %%mm3, %%ebx \n\t" |
49 "paddl %%mm3, %%mm2 \n\t" | 49 "addl %%ebx, %%eax \n\t" |
50 "movl %%mm2, %eax" | |
51 | 50 |
52 "emms \n\t" | 51 "emms \n\t" |
53 : "=a" (ret) | 52 : "=a" (ret) |
54 : "S" (a), "D" (b), "a" (s) | 53 : "S" (a), "D" (b), "a" (s) |
55 : | |
56 ); | 54 ); |
57 return ret; | 55 return ret; |
58 } | 56 } |
59 #endif | 57 #endif |
60 | 58 |