comparison i386/motion_est_mmx.c @ 3576:f7125bf10892 libavcodec

Support for MacIntel, last part: balign directives Determines whether .align's arg is power-of-two or not, then defines ASMALIGN appropriately in config.h. Changes all .baligns to ASMALIGNs. Patch by John Dalgliesh % johnd AH defyne P org % Original thread: Date: Aug 11, 2006 8:00 AM Subject: Re: [Ffmpeg-devel] Mac OS X Intel last part: balign directives
author gpoirier
date Sat, 12 Aug 2006 16:37:31 +0000
parents e0927bc44a10
children c8c591fe26f8
comparison
equal deleted inserted replaced
3575:4baed6f6577b 3576:f7125bf10892
32 32
33 static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) 33 static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
34 { 34 {
35 long len= -(stride*h); 35 long len= -(stride*h);
36 asm volatile( 36 asm volatile(
37 ".balign 16 \n\t" 37 ASMALIGN(4)
38 "1: \n\t" 38 "1: \n\t"
39 "movq (%1, %%"REG_a"), %%mm0 \n\t" 39 "movq (%1, %%"REG_a"), %%mm0 \n\t"
40 "movq (%2, %%"REG_a"), %%mm2 \n\t" 40 "movq (%2, %%"REG_a"), %%mm2 \n\t"
41 "movq (%2, %%"REG_a"), %%mm4 \n\t" 41 "movq (%2, %%"REG_a"), %%mm4 \n\t"
42 "add %3, %%"REG_a" \n\t" 42 "add %3, %%"REG_a" \n\t"
68 68
69 static inline void sad8_1_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h) 69 static inline void sad8_1_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
70 { 70 {
71 long len= -(stride*h); 71 long len= -(stride*h);
72 asm volatile( 72 asm volatile(
73 ".balign 16 \n\t" 73 ASMALIGN(4)
74 "1: \n\t" 74 "1: \n\t"
75 "movq (%1, %%"REG_a"), %%mm0 \n\t" 75 "movq (%1, %%"REG_a"), %%mm0 \n\t"
76 "movq (%2, %%"REG_a"), %%mm2 \n\t" 76 "movq (%2, %%"REG_a"), %%mm2 \n\t"
77 "psadbw %%mm2, %%mm0 \n\t" 77 "psadbw %%mm2, %%mm0 \n\t"
78 "add %3, %%"REG_a" \n\t" 78 "add %3, %%"REG_a" \n\t"
90 90
91 static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h) 91 static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
92 { 92 {
93 long len= -(stride*h); 93 long len= -(stride*h);
94 asm volatile( 94 asm volatile(
95 ".balign 16 \n\t" 95 ASMALIGN(4)
96 "1: \n\t" 96 "1: \n\t"
97 "movq (%1, %%"REG_a"), %%mm0 \n\t" 97 "movq (%1, %%"REG_a"), %%mm0 \n\t"
98 "movq (%2, %%"REG_a"), %%mm2 \n\t" 98 "movq (%2, %%"REG_a"), %%mm2 \n\t"
99 "pavgb %%mm2, %%mm0 \n\t" 99 "pavgb %%mm2, %%mm0 \n\t"
100 "movq (%3, %%"REG_a"), %%mm2 \n\t" 100 "movq (%3, %%"REG_a"), %%mm2 \n\t"
116 116
117 static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h) 117 static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
118 { //FIXME reuse src 118 { //FIXME reuse src
119 long len= -(stride*h); 119 long len= -(stride*h);
120 asm volatile( 120 asm volatile(
121 ".balign 16 \n\t" 121 ASMALIGN(4)
122 "movq "MANGLE(bone)", %%mm5 \n\t" 122 "movq "MANGLE(bone)", %%mm5 \n\t"
123 "1: \n\t" 123 "1: \n\t"
124 "movq (%1, %%"REG_a"), %%mm0 \n\t" 124 "movq (%1, %%"REG_a"), %%mm0 \n\t"
125 "movq (%2, %%"REG_a"), %%mm2 \n\t" 125 "movq (%2, %%"REG_a"), %%mm2 \n\t"
126 "movq 1(%1, %%"REG_a"), %%mm1 \n\t" 126 "movq 1(%1, %%"REG_a"), %%mm1 \n\t"
153 153
154 static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h) 154 static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
155 { 155 {
156 long len= -(stride*h); 156 long len= -(stride*h);
157 asm volatile( 157 asm volatile(
158 ".balign 16 \n\t" 158 ASMALIGN(4)
159 "1: \n\t" 159 "1: \n\t"
160 "movq (%1, %%"REG_a"), %%mm0 \n\t" 160 "movq (%1, %%"REG_a"), %%mm0 \n\t"
161 "movq (%2, %%"REG_a"), %%mm1 \n\t" 161 "movq (%2, %%"REG_a"), %%mm1 \n\t"
162 "movq (%1, %%"REG_a"), %%mm2 \n\t" 162 "movq (%1, %%"REG_a"), %%mm2 \n\t"
163 "movq (%2, %%"REG_a"), %%mm3 \n\t" 163 "movq (%2, %%"REG_a"), %%mm3 \n\t"
191 191
192 static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) 192 static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
193 { 193 {
194 long len= -(stride*h); 194 long len= -(stride*h);
195 asm volatile( 195 asm volatile(
196 ".balign 16 \n\t" 196 ASMALIGN(4)
197 "1: \n\t" 197 "1: \n\t"
198 "movq (%1, %%"REG_a"), %%mm0 \n\t" 198 "movq (%1, %%"REG_a"), %%mm0 \n\t"
199 "movq (%2, %%"REG_a"), %%mm1 \n\t" 199 "movq (%2, %%"REG_a"), %%mm1 \n\t"
200 "movq %%mm0, %%mm4 \n\t" 200 "movq %%mm0, %%mm4 \n\t"
201 "movq %%mm1, %%mm2 \n\t" 201 "movq %%mm1, %%mm2 \n\t"