annotate i386/dsputil_mmx_avg.h @ 2207:22b768f1261a libavcodec

10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster now
author michael
date Mon, 06 Sep 2004 03:17:31 +0000
parents f65d87bfdd5a
children c4a476971abc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
2 * DSP utils : average functions are compiled twice for 3dnow/mmx2
429
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
3 * Copyright (c) 2000, 2001 Fabrice Bellard.
1739
07a484280a82 copyright year update of the files i touched and remembered, things look annoyingly unmaintained otherwise
michael
parents: 1064
diff changeset
4 * Copyright (c) 2002-2004 Michael Niedermayer
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
5 *
429
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
6 * This library is free software; you can redistribute it and/or
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
8 * License as published by the Free Software Foundation; either
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
9 * version 2 of the License, or (at your option) any later version.
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
10 *
429
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
11 * This library is distributed in the hope that it will be useful,
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
429
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
14 * Lesser General Public License for more details.
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
15 *
429
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
17 * License along with this library; if not, write to the Free Software
718a22dc121f license/copyright change
glantau
parents: 416
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
19 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
20 * MMX optimization by Nick Kurshev <nickols_k@mail.ru>
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
21 * mostly rewritten by Michael Niedermayer <michaelni@gmx.at>
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
22 * and improved by Zdenek Kabelac <kabi@users.sf.net>
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
23 */
387
b8f3affeb8e1 shared lib support (req by kabi) ...
michaelni
parents: 386
diff changeset
24
389
f874493a1970 tried to avoid gcc 2.95.2 bug by puting explicit register constraints - added comment about rounding bug in some functions (need to correct or suppress them for regression tests)
glantau
parents: 387
diff changeset
25 /* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
26 clobber bug - now it will work with 2.95.2 and also with -fPIC
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
27 */
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
28 static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
29 {
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
30 __asm __volatile(
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
31 "lea (%3, %3), %%eax \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
32 "1: \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
33 "movq (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
34 "movq (%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
35 PAVGB" 1(%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
36 PAVGB" 1(%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
37 "movq %%mm0, (%2) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
38 "movq %%mm1, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
39 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
40 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
41 "movq (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
42 "movq (%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
43 PAVGB" 1(%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
44 PAVGB" 1(%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
45 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
46 "movq %%mm0, (%2) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
47 "movq %%mm1, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
48 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
49 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
50 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
51 :"+g"(h), "+S"(pixels), "+D"(block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
52 :"r" (line_size)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
53 :"%eax", "memory");
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
54 }
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
55
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
56 static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
57 {
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
58 __asm __volatile(
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
59 "testl $1, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
60 " jz 1f \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
61 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
62 "movq (%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
63 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
64 "addl $8, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
65 PAVGB" %%mm1, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
66 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
67 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
68 "decl %0 \n\t"
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
69 "1: \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
70 "movq (%1), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
71 "addl %4, %1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
72 "movq (%1), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
73 "addl %4, %1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
74 PAVGB" (%2), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
75 PAVGB" 8(%2), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
76 "movq %%mm0, (%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
77 "addl %5, %3 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
78 "movq %%mm1, (%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
79 "addl %5, %3 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
80 "movq (%1), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
81 "addl %4, %1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
82 "movq (%1), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
83 "addl %4, %1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
84 PAVGB" 16(%2), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
85 PAVGB" 24(%2), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
86 "movq %%mm0, (%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
87 "addl %5, %3 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
88 "movq %%mm1, (%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
89 "addl %5, %3 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
90 "addl $32, %2 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
91 "subl $4, %0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
92 "jnz 1b \n\t"
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
93 #ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
94 :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
95 #else
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
96 :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
97 #endif
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
98 :"S"(src1Stride), "D"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
99 :"memory");
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
100 //the following should be used, though better not with gcc ...
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
101 /* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
102 :"r"(src1Stride), "r"(dstStride)
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
103 :"memory");*/
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
104 }
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
105
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
106 static void DEF(put_no_rnd_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
107 {
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
108 __asm __volatile(
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
109 "pcmpeqb %%mm6, %%mm6 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
110 "testl $1, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
111 " jz 1f \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
112 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
113 "movq (%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
114 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
115 "addl $8, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
116 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
117 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
118 PAVGB" %%mm1, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
119 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
120 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
121 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
122 "decl %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
123 "1: \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
124 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
125 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
126 "movq (%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
127 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
128 "movq (%2), %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
129 "movq 8(%2), %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
130 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
131 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
132 "pxor %%mm6, %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
133 "pxor %%mm6, %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
134 PAVGB" %%mm2, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
135 PAVGB" %%mm3, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
136 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
137 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
138 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
139 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
140 "movq %%mm1, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
141 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
142 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
143 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
144 "movq (%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
145 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
146 "movq 16(%2), %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
147 "movq 24(%2), %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
148 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
149 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
150 "pxor %%mm6, %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
151 "pxor %%mm6, %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
152 PAVGB" %%mm2, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
153 PAVGB" %%mm3, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
154 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
155 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
156 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
157 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
158 "movq %%mm1, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
159 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
160 "addl $32, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
161 "subl $4, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
162 "jnz 1b \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
163 #ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
164 :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
165 #else
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
166 :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
167 #endif
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
168 :"S"(src1Stride), "D"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
169 :"memory");
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
170 //the following should be used, though better not with gcc ...
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
171 /* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
172 :"r"(src1Stride), "r"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
173 :"memory");*/
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
174 }
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
175
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
176 static void DEF(avg_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
177 {
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
178 __asm __volatile(
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
179 "testl $1, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
180 " jz 1f \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
181 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
182 "movq (%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
183 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
184 "addl $8, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
185 PAVGB" %%mm1, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
186 PAVGB" (%3), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
187 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
188 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
189 "decl %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
190 "1: \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
191 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
192 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
193 "movq (%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
194 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
195 PAVGB" (%2), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
196 PAVGB" 8(%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
197 PAVGB" (%3), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
198 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
199 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
200 PAVGB" (%3), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
201 "movq %%mm1, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
202 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
203 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
204 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
205 "movq (%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
206 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
207 PAVGB" 16(%2), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
208 PAVGB" 24(%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
209 PAVGB" (%3), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
210 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
211 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
212 PAVGB" (%3), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
213 "movq %%mm1, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
214 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
215 "addl $32, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
216 "subl $4, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
217 "jnz 1b \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
218 #ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
219 :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
220 #else
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
221 :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
222 #endif
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
223 :"S"(src1Stride), "D"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
224 :"memory");
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
225 //the following should be used, though better not with gcc ...
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
226 /* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
227 :"r"(src1Stride), "r"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
228 :"memory");*/
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
229 }
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
230
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
231 static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
232 {
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
233 __asm __volatile(
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
234 "lea (%3, %3), %%eax \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
235 "1: \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
236 "movq (%1), %%mm0 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
237 "movq (%1, %3), %%mm1 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
238 "movq 8(%1), %%mm2 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
239 "movq 8(%1, %3), %%mm3 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
240 PAVGB" 1(%1), %%mm0 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
241 PAVGB" 1(%1, %3), %%mm1 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
242 PAVGB" 9(%1), %%mm2 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
243 PAVGB" 9(%1, %3), %%mm3 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
244 "movq %%mm0, (%2) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
245 "movq %%mm1, (%2, %3) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
246 "movq %%mm2, 8(%2) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
247 "movq %%mm3, 8(%2, %3) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
248 "addl %%eax, %1 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
249 "addl %%eax, %2 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
250 "movq (%1), %%mm0 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
251 "movq (%1, %3), %%mm1 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
252 "movq 8(%1), %%mm2 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
253 "movq 8(%1, %3), %%mm3 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
254 PAVGB" 1(%1), %%mm0 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
255 PAVGB" 1(%1, %3), %%mm1 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
256 PAVGB" 9(%1), %%mm2 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
257 PAVGB" 9(%1, %3), %%mm3 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
258 "addl %%eax, %1 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
259 "movq %%mm0, (%2) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
260 "movq %%mm1, (%2, %3) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
261 "movq %%mm2, 8(%2) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
262 "movq %%mm3, 8(%2, %3) \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
263 "addl %%eax, %2 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
264 "subl $4, %0 \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
265 "jnz 1b \n\t"
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
266 :"+g"(h), "+S"(pixels), "+D"(block)
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
267 :"r" (line_size)
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
268 :"%eax", "memory");
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
269 }
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
270
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
271 static void DEF(put_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
272 {
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
273 __asm __volatile(
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
274 "testl $1, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
275 " jz 1f \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
276 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
277 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
278 PAVGB" (%2), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
279 PAVGB" 8(%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
280 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
281 "addl $16, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
282 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
283 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
284 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
285 "decl %0 \n\t"
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
286 "1: \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
287 "movq (%1), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
288 "movq 8(%1), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
289 "addl %4, %1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
290 PAVGB" (%2), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
291 PAVGB" 8(%2), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
292 "movq %%mm0, (%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
293 "movq %%mm1, 8(%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
294 "addl %5, %3 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
295 "movq (%1), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
296 "movq 8(%1), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
297 "addl %4, %1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
298 PAVGB" 16(%2), %%mm0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
299 PAVGB" 24(%2), %%mm1 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
300 "movq %%mm0, (%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
301 "movq %%mm1, 8(%3) \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
302 "addl %5, %3 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
303 "addl $32, %2 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
304 "subl $2, %0 \n\t"
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
305 "jnz 1b \n\t"
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
306 #ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
307 :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
308 #else
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
309 :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
310 #endif
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
311 :"S"(src1Stride), "D"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
312 :"memory");
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
313 //the following should be used, though better not with gcc ...
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
314 /* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
315 :"r"(src1Stride), "r"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
316 :"memory");*/
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
317 }
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
318
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
319 static void DEF(avg_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
320 {
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
321 __asm __volatile(
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
322 "testl $1, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
323 " jz 1f \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
324 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
325 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
326 PAVGB" (%2), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
327 PAVGB" 8(%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
328 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
329 "addl $16, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
330 PAVGB" (%3), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
331 PAVGB" 8(%3), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
332 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
333 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
334 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
335 "decl %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
336 "1: \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
337 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
338 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
339 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
340 PAVGB" (%2), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
341 PAVGB" 8(%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
342 PAVGB" (%3), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
343 PAVGB" 8(%3), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
344 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
345 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
346 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
347 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
348 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
349 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
350 PAVGB" 16(%2), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
351 PAVGB" 24(%2), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
352 PAVGB" (%3), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
353 PAVGB" 8(%3), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
354 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
355 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
356 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
357 "addl $32, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
358 "subl $2, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
359 "jnz 1b \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
360 #ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
361 :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
362 #else
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
363 :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
364 #endif
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
365 :"S"(src1Stride), "D"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
366 :"memory");
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
367 //the following should be used, though better not with gcc ...
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
368 /* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
369 :"r"(src1Stride), "r"(dstStride)
2207
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
370 :"memory");*/
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
371 }
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
372
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
373 static void DEF(put_no_rnd_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
374 {
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
375 __asm __volatile(
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
376 "pcmpeqb %%mm6, %%mm6\n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
377 "testl $1, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
378 " jz 1f \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
379 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
380 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
381 "movq (%2), %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
382 "movq 8(%2), %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
383 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
384 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
385 "pxor %%mm6, %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
386 "pxor %%mm6, %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
387 PAVGB" %%mm2, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
388 PAVGB" %%mm3, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
389 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
390 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
391 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
392 "addl $16, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
393 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
394 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
395 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
396 "decl %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
397 "1: \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
398 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
399 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
400 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
401 "movq (%2), %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
402 "movq 8(%2), %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
403 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
404 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
405 "pxor %%mm6, %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
406 "pxor %%mm6, %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
407 PAVGB" %%mm2, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
408 PAVGB" %%mm3, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
409 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
410 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
411 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
412 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
413 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
414 "movq (%1), %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
415 "movq 8(%1), %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
416 "addl %4, %1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
417 "movq 16(%2), %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
418 "movq 24(%2), %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
419 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
420 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
421 "pxor %%mm6, %%mm2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
422 "pxor %%mm6, %%mm3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
423 PAVGB" %%mm2, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
424 PAVGB" %%mm3, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
425 "pxor %%mm6, %%mm0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
426 "pxor %%mm6, %%mm1 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
427 "movq %%mm0, (%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
428 "movq %%mm1, 8(%3) \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
429 "addl %5, %3 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
430 "addl $32, %2 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
431 "subl $2, %0 \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
432 "jnz 1b \n\t"
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
433 #ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
434 :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
435 #else
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
436 :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
437 #endif
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
438 :"S"(src1Stride), "D"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
439 :"memory");
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
440 //the following should be used, though better not with gcc ...
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
441 /* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
442 :"r"(src1Stride), "r"(dstStride)
22b768f1261a 10000l fix and use more mmx2/3dnow code for mpeg4 qpel which has been written and commited long time ago but appearently never used, qpel motion compensation is 5% faster
michael
parents: 2024
diff changeset
443 :"memory");*/
954
13aec7e50c52 qpel in mmx2/3dnow
michaelni
parents: 651
diff changeset
444 }
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
445
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
446 /* GL: this function does incorrect rounding if overflow */
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
447 static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
448 {
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
449 MOVQ_BONE(mm6);
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
450 __asm __volatile(
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
451 "lea (%3, %3), %%eax \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
452 "1: \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
453 "movq (%1), %%mm0 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
454 "movq (%1, %3), %%mm2 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
455 "movq 1(%1), %%mm1 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
456 "movq 1(%1, %3), %%mm3 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
457 "addl %%eax, %1 \n\t"
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
458 "psubusb %%mm6, %%mm0 \n\t"
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
459 "psubusb %%mm6, %%mm2 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
460 PAVGB" %%mm1, %%mm0 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
461 PAVGB" %%mm3, %%mm2 \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
462 "movq %%mm0, (%2) \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
463 "movq %%mm2, (%2, %3) \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
464 "movq (%1), %%mm0 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
465 "movq 1(%1), %%mm1 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
466 "movq (%1, %3), %%mm2 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
467 "movq 1(%1, %3), %%mm3 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
468 "addl %%eax, %2 \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
469 "addl %%eax, %1 \n\t"
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
470 "psubusb %%mm6, %%mm0 \n\t"
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
471 "psubusb %%mm6, %%mm2 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
472 PAVGB" %%mm1, %%mm0 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
473 PAVGB" %%mm3, %%mm2 \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
474 "movq %%mm0, (%2) \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
475 "movq %%mm2, (%2, %3) \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
476 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
477 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
478 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
479 :"+g"(h), "+S"(pixels), "+D"(block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
480 :"r" (line_size)
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
481 :"%eax", "memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
482 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
483
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
484 static void DEF(put_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
485 {
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
486 __asm __volatile(
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
487 "lea (%3, %3), %%eax \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
488 "movq (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
489 "subl %3, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
490 "1: \n\t"
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
491 "movq (%1, %3), %%mm1 \n\t"
416
ca1f2c0e44ef * fixed contrains and avoid usage of scale index access
kabi
parents: 414
diff changeset
492 "movq (%1, %%eax), %%mm2 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
493 "addl %%eax, %1 \n\t"
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
494 PAVGB" %%mm1, %%mm0 \n\t"
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
495 PAVGB" %%mm2, %%mm1 \n\t"
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
496 "movq %%mm0, (%2, %3) \n\t"
416
ca1f2c0e44ef * fixed contrains and avoid usage of scale index access
kabi
parents: 414
diff changeset
497 "movq %%mm1, (%2, %%eax) \n\t"
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
498 "movq (%1, %3), %%mm1 \n\t"
416
ca1f2c0e44ef * fixed contrains and avoid usage of scale index access
kabi
parents: 414
diff changeset
499 "movq (%1, %%eax), %%mm0 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
500 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
501 "addl %%eax, %1 \n\t"
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
502 PAVGB" %%mm1, %%mm2 \n\t"
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
503 PAVGB" %%mm0, %%mm1 \n\t"
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
504 "movq %%mm2, (%2, %3) \n\t"
416
ca1f2c0e44ef * fixed contrains and avoid usage of scale index access
kabi
parents: 414
diff changeset
505 "movq %%mm1, (%2, %%eax) \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
506 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
507 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
508 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
509 :"+g"(h), "+S"(pixels), "+D" (block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
510 :"r" (line_size)
413
1548abb7bbed * fix for -fPIC compilation - compiles with 2.95.2 as well - any
kabi
parents: 402
diff changeset
511 :"%eax", "memory");
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
512 }
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
513
389
f874493a1970 tried to avoid gcc 2.95.2 bug by puting explicit register constraints - added comment about rounding bug in some functions (need to correct or suppress them for regression tests)
glantau
parents: 387
diff changeset
514 /* GL: this function does incorrect rounding if overflow */
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
515 static void DEF(put_no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
516 {
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
517 MOVQ_BONE(mm6);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
518 __asm __volatile(
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
519 "lea (%3, %3), %%eax \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
520 "movq (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
521 "subl %3, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
522 "1: \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
523 "movq (%1, %3), %%mm1 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
524 "movq (%1, %%eax), %%mm2 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
525 "addl %%eax, %1 \n\t"
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
526 "psubusb %%mm6, %%mm1 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
527 PAVGB" %%mm1, %%mm0 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
528 PAVGB" %%mm2, %%mm1 \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
529 "movq %%mm0, (%2, %3) \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
530 "movq %%mm1, (%2, %%eax) \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
531 "movq (%1, %3), %%mm1 \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
532 "movq (%1, %%eax), %%mm0 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
533 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
534 "addl %%eax, %1 \n\t"
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
535 "psubusb %%mm6, %%mm1 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
536 PAVGB" %%mm1, %%mm2 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
537 PAVGB" %%mm0, %%mm1 \n\t"
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
538 "movq %%mm2, (%2, %3) \n\t"
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
539 "movq %%mm1, (%2, %%eax) \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
540 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
541 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
542 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
543 :"+g"(h), "+S"(pixels), "+D" (block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
544 :"r" (line_size)
439
6ae275655a23 * more PIC friendly and faster code
kabi
parents: 429
diff changeset
545 :"%eax", "memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
546 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
547
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
548 static void DEF(avg_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
549 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
550 __asm __volatile(
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
551 "lea (%3, %3), %%eax \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
552 "1: \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
553 "movq (%2), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
554 "movq (%2, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
555 PAVGB" (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
556 PAVGB" (%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
557 "movq %%mm0, (%2) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
558 "movq %%mm1, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
559 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
560 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
561 "movq (%2), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
562 "movq (%2, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
563 PAVGB" (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
564 PAVGB" (%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
565 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
566 "movq %%mm0, (%2) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
567 "movq %%mm1, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
568 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
569 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
570 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
571 :"+g"(h), "+S"(pixels), "+D"(block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
572 :"r" (line_size)
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
573 :"%eax", "memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
574 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
575
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
576 static void DEF(avg_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
577 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
578 __asm __volatile(
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
579 "lea (%3, %3), %%eax \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
580 "1: \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
581 "movq (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
582 "movq (%1, %3), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
583 PAVGB" 1(%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
584 PAVGB" 1(%1, %3), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
585 PAVGB" (%2), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
586 PAVGB" (%2, %3), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
587 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
588 "movq %%mm0, (%2) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
589 "movq %%mm2, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
590 "movq (%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
591 "movq (%1, %3), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
592 PAVGB" 1(%1), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
593 PAVGB" 1(%1, %3), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
594 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
595 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
596 PAVGB" (%2), %%mm0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
597 PAVGB" (%2, %3), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
598 "movq %%mm0, (%2) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
599 "movq %%mm2, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
600 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
601 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
602 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
603 :"+g"(h), "+S"(pixels), "+D"(block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
604 :"r" (line_size)
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
605 :"%eax", "memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
606 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
607
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
608 static void DEF(avg_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
609 {
986e461dc072 Initial revision
glantau
parents:
diff changeset
610 __asm __volatile(
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
611 "lea (%3, %3), %%eax \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
612 "movq (%1), %%mm0 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
613 "subl %3, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
614 "1: \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
615 "movq (%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
616 "movq (%1, %%eax), %%mm2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
617 "addl %%eax, %1 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
618 PAVGB" %%mm1, %%mm0 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
619 PAVGB" %%mm2, %%mm1 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
620 "movq (%2, %3), %%mm3 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
621 "movq (%2, %%eax), %%mm4 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
622 PAVGB" %%mm3, %%mm0 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
623 PAVGB" %%mm4, %%mm1 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
624 "movq %%mm0, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
625 "movq %%mm1, (%2, %%eax) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
626 "movq (%1, %3), %%mm1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
627 "movq (%1, %%eax), %%mm0 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
628 PAVGB" %%mm1, %%mm2 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
629 PAVGB" %%mm0, %%mm1 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
630 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
631 "addl %%eax, %1 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
632 "movq (%2, %3), %%mm3 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
633 "movq (%2, %%eax), %%mm4 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
634 PAVGB" %%mm3, %%mm2 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
635 PAVGB" %%mm4, %%mm1 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
636 "movq %%mm2, (%2, %3) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
637 "movq %%mm1, (%2, %%eax) \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
638 "addl %%eax, %2 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
639 "subl $4, %0 \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
640 "jnz 1b \n\t"
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
641 :"+g"(h), "+S"(pixels), "+D"(block)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
642 :"r" (line_size)
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
643 :"%eax", "memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
644 }
986e461dc072 Initial revision
glantau
parents:
diff changeset
645
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
646 // Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
647 static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
648 {
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
649 MOVQ_BONE(mm6);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
650 __asm __volatile(
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
651 "lea (%3, %3), %%eax \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
652 "movq (%1), %%mm0 \n\t"
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
653 PAVGB" 1(%1), %%mm0 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
654 ".balign 8 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
655 "1: \n\t"
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
656 "movq (%1, %%eax), %%mm2 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
657 "movq (%1, %3), %%mm1 \n\t"
448
e8c8ca9106aa * removed MANGLE from macros for setting constants
kabi
parents: 443
diff changeset
658 "psubusb %%mm6, %%mm2 \n\t"
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
659 PAVGB" 1(%1, %3), %%mm1 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
660 PAVGB" 1(%1, %%eax), %%mm2 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
661 "addl %%eax, %1 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
662 PAVGB" %%mm1, %%mm0 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
663 PAVGB" %%mm2, %%mm1 \n\t"
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
664 PAVGB" (%2), %%mm0 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
665 PAVGB" (%2, %3), %%mm1 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
666 "movq %%mm0, (%2) \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
667 "movq %%mm1, (%2, %3) \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
668 "movq (%1, %3), %%mm1 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
669 "movq (%1, %%eax), %%mm0 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
670 PAVGB" 1(%1, %3), %%mm1 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
671 PAVGB" 1(%1, %%eax), %%mm0 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
672 "addl %%eax, %2 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
673 "addl %%eax, %1 \n\t"
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
674 PAVGB" %%mm1, %%mm2 \n\t"
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
675 PAVGB" %%mm0, %%mm1 \n\t"
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
676 PAVGB" (%2), %%mm2 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
677 PAVGB" (%2, %3), %%mm1 \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
678 "movq %%mm2, (%2) \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
679 "movq %%mm1, (%2, %3) \n\t"
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
680 "addl %%eax, %2 \n\t"
441
c0de4d3c7d3c * optimized avg_* functions (except xy2)
kabi
parents: 439
diff changeset
681 "subl $4, %0 \n\t"
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
682 "jnz 1b \n\t"
443
63467327c06c * cosmetic minor change
kabi
parents: 442
diff changeset
683 :"+g"(h), "+S"(pixels), "+D"(block)
442
006965950f49 * optimized remaing avg_pixels_xy2
kabi
parents: 441
diff changeset
684 :"r" (line_size)
386
f49629bab18d hopefully faster mmx2&3dnow MC
michaelni
parents: 151
diff changeset
685 :"%eax", "memory");
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
686 }
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
687
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
688 //FIXME the following could be optimized too ...
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
689 static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
690 DEF(put_no_rnd_pixels8_x2)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
691 DEF(put_no_rnd_pixels8_x2)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
692 }
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
693 static void DEF(put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
694 DEF(put_pixels8_y2)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
695 DEF(put_pixels8_y2)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
696 }
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
697 static void DEF(put_no_rnd_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
698 DEF(put_no_rnd_pixels8_y2)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
699 DEF(put_no_rnd_pixels8_y2)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
700 }
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
701 static void DEF(avg_pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
702 DEF(avg_pixels8)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
703 DEF(avg_pixels8)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
704 }
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
705 static void DEF(avg_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
706 DEF(avg_pixels8_x2)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
707 DEF(avg_pixels8_x2)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
708 }
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
709 static void DEF(avg_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
710 DEF(avg_pixels8_y2)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
711 DEF(avg_pixels8_y2)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
712 }
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 954
diff changeset
713 static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
651
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
714 DEF(avg_pixels8_xy2)(block , pixels , line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
715 DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h);
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
716 }
45e8f39fda50 put/avg_pixels16
michaelni
parents: 448
diff changeset
717