comparison i386/dsputil_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 f549d1e685f7
children 47821be55b6c
comparison
equal deleted inserted replaced
3575:4baed6f6577b 3576:f7125bf10892
54 static const uint64_t ff_pw_15 attribute_used __attribute__ ((aligned(8))) = 0x000F000F000F000FULL; 54 static const uint64_t ff_pw_15 attribute_used __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;
55 55
56 static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL; 56 static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL;
57 static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL; 57 static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL;
58 58
59 #define JUMPALIGN() __asm __volatile (".balign 8"::) 59 #define JUMPALIGN() __asm __volatile (ASMALIGN(3)::)
60 #define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::) 60 #define MOVQ_ZERO(regd) __asm __volatile ("pxor %%" #regd ", %%" #regd ::)
61 61
62 #define MOVQ_WONE(regd) \ 62 #define MOVQ_WONE(regd) \
63 __asm __volatile ( \ 63 __asm __volatile ( \
64 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ 64 "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
202 static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size) 202 static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size)
203 { 203 {
204 asm volatile( 204 asm volatile(
205 "mov $-128, %%"REG_a" \n\t" 205 "mov $-128, %%"REG_a" \n\t"
206 "pxor %%mm7, %%mm7 \n\t" 206 "pxor %%mm7, %%mm7 \n\t"
207 ".balign 16 \n\t" 207 ASMALIGN(4)
208 "1: \n\t" 208 "1: \n\t"
209 "movq (%0), %%mm0 \n\t" 209 "movq (%0), %%mm0 \n\t"
210 "movq (%0, %2), %%mm2 \n\t" 210 "movq (%0, %2), %%mm2 \n\t"
211 "movq %%mm0, %%mm1 \n\t" 211 "movq %%mm0, %%mm1 \n\t"
212 "movq %%mm2, %%mm3 \n\t" 212 "movq %%mm2, %%mm3 \n\t"
230 static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) 230 static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride)
231 { 231 {
232 asm volatile( 232 asm volatile(
233 "pxor %%mm7, %%mm7 \n\t" 233 "pxor %%mm7, %%mm7 \n\t"
234 "mov $-128, %%"REG_a" \n\t" 234 "mov $-128, %%"REG_a" \n\t"
235 ".balign 16 \n\t" 235 ASMALIGN(4)
236 "1: \n\t" 236 "1: \n\t"
237 "movq (%0), %%mm0 \n\t" 237 "movq (%0), %%mm0 \n\t"
238 "movq (%1), %%mm2 \n\t" 238 "movq (%1), %%mm2 \n\t"
239 "movq %%mm0, %%mm1 \n\t" 239 "movq %%mm0, %%mm1 \n\t"
240 "movq %%mm2, %%mm3 \n\t" 240 "movq %%mm2, %%mm3 \n\t"
373 373
374 static void put_pixels4_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) 374 static void put_pixels4_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
375 { 375 {
376 __asm __volatile( 376 __asm __volatile(
377 "lea (%3, %3), %%"REG_a" \n\t" 377 "lea (%3, %3), %%"REG_a" \n\t"
378 ".balign 8 \n\t" 378 ASMALIGN(3)
379 "1: \n\t" 379 "1: \n\t"
380 "movd (%1), %%mm0 \n\t" 380 "movd (%1), %%mm0 \n\t"
381 "movd (%1, %3), %%mm1 \n\t" 381 "movd (%1, %3), %%mm1 \n\t"
382 "movd %%mm0, (%2) \n\t" 382 "movd %%mm0, (%2) \n\t"
383 "movd %%mm1, (%2, %3) \n\t" 383 "movd %%mm1, (%2, %3) \n\t"
399 399
400 static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) 400 static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
401 { 401 {
402 __asm __volatile( 402 __asm __volatile(
403 "lea (%3, %3), %%"REG_a" \n\t" 403 "lea (%3, %3), %%"REG_a" \n\t"
404 ".balign 8 \n\t" 404 ASMALIGN(3)
405 "1: \n\t" 405 "1: \n\t"
406 "movq (%1), %%mm0 \n\t" 406 "movq (%1), %%mm0 \n\t"
407 "movq (%1, %3), %%mm1 \n\t" 407 "movq (%1, %3), %%mm1 \n\t"
408 "movq %%mm0, (%2) \n\t" 408 "movq %%mm0, (%2) \n\t"
409 "movq %%mm1, (%2, %3) \n\t" 409 "movq %%mm1, (%2, %3) \n\t"
425 425
426 static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h) 426 static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
427 { 427 {
428 __asm __volatile( 428 __asm __volatile(
429 "lea (%3, %3), %%"REG_a" \n\t" 429 "lea (%3, %3), %%"REG_a" \n\t"
430 ".balign 8 \n\t" 430 ASMALIGN(3)
431 "1: \n\t" 431 "1: \n\t"
432 "movq (%1), %%mm0 \n\t" 432 "movq (%1), %%mm0 \n\t"
433 "movq 8(%1), %%mm4 \n\t" 433 "movq 8(%1), %%mm4 \n\t"
434 "movq (%1, %3), %%mm1 \n\t" 434 "movq (%1, %3), %%mm1 \n\t"
435 "movq 8(%1, %3), %%mm5 \n\t" 435 "movq 8(%1, %3), %%mm5 \n\t"