comparison armv4l/dsputil_iwmmxt.c @ 8031:eebc7209c47f libavcodec

Convert asm keyword into __asm__. Neither the asm() nor the __asm__() keyword is part of the C99 standard, but while GCC accepts the former in C89 syntax, it is not accepted in C99 unless GNU extensions are turned on (with -fasm). The latter form is accepted in any syntax as an extension (without requiring further command-line options). Sun Studio C99 compiler also does not accept asm() while accepting __asm__(), albeit reporting warnings that it's not valid C99 syntax.
author flameeyes
date Thu, 16 Oct 2008 13:34:09 +0000
parents f7cbb7733146
children 915bc657348f
comparison
equal deleted inserted replaced
8030:a512ac8fa540 8031:eebc7209c47f
20 */ 20 */
21 21
22 #include "libavcodec/dsputil.h" 22 #include "libavcodec/dsputil.h"
23 23
24 #define DEF(x, y) x ## _no_rnd_ ## y ##_iwmmxt 24 #define DEF(x, y) x ## _no_rnd_ ## y ##_iwmmxt
25 #define SET_RND(regd) asm volatile ("mov r12, #1 \n\t tbcsth " #regd ", r12":::"r12"); 25 #define SET_RND(regd) __asm__ volatile ("mov r12, #1 \n\t tbcsth " #regd ", r12":::"r12");
26 #define WAVG2B "wavg2b" 26 #define WAVG2B "wavg2b"
27 #include "dsputil_iwmmxt_rnd.h" 27 #include "dsputil_iwmmxt_rnd.h"
28 #undef DEF 28 #undef DEF
29 #undef SET_RND 29 #undef SET_RND
30 #undef WAVG2B 30 #undef WAVG2B
31 31
32 #define DEF(x, y) x ## _ ## y ##_iwmmxt 32 #define DEF(x, y) x ## _ ## y ##_iwmmxt
33 #define SET_RND(regd) asm volatile ("mov r12, #2 \n\t tbcsth " #regd ", r12":::"r12"); 33 #define SET_RND(regd) __asm__ volatile ("mov r12, #2 \n\t tbcsth " #regd ", r12":::"r12");
34 #define WAVG2B "wavg2br" 34 #define WAVG2B "wavg2br"
35 #include "dsputil_iwmmxt_rnd.h" 35 #include "dsputil_iwmmxt_rnd.h"
36 #undef DEF 36 #undef DEF
37 #undef SET_RND 37 #undef SET_RND
38 #undef WAVG2BR 38 #undef WAVG2BR
39 39
40 // need scheduling 40 // need scheduling
41 #define OP(AVG) \ 41 #define OP(AVG) \
42 asm volatile ( \ 42 __asm__ volatile ( \
43 /* alignment */ \ 43 /* alignment */ \
44 "and r12, %[pixels], #7 \n\t" \ 44 "and r12, %[pixels], #7 \n\t" \
45 "bic %[pixels], %[pixels], #7 \n\t" \ 45 "bic %[pixels], %[pixels], #7 \n\t" \
46 "tmcr wcgr1, r12 \n\t" \ 46 "tmcr wcgr1, r12 \n\t" \
47 \ 47 \
87 87
88 void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_size) 88 void add_pixels_clamped_iwmmxt(const DCTELEM *block, uint8_t *pixels, int line_size)
89 { 89 {
90 uint8_t *pixels2 = pixels + line_size; 90 uint8_t *pixels2 = pixels + line_size;
91 91
92 asm volatile ( 92 __asm__ volatile (
93 "mov r12, #4 \n\t" 93 "mov r12, #4 \n\t"
94 "1: \n\t" 94 "1: \n\t"
95 "pld [%[pixels], %[line_size2]] \n\t" 95 "pld [%[pixels], %[line_size2]] \n\t"
96 "pld [%[pixels2], %[line_size2]] \n\t" 96 "pld [%[pixels2], %[line_size2]] \n\t"
97 "wldrd wr4, [%[pixels]] \n\t" 97 "wldrd wr4, [%[pixels]] \n\t"
123 : "cc", "memory", "r12"); 123 : "cc", "memory", "r12");
124 } 124 }
125 125
126 static void clear_blocks_iwmmxt(DCTELEM *blocks) 126 static void clear_blocks_iwmmxt(DCTELEM *blocks)
127 { 127 {
128 asm volatile( 128 __asm__ volatile(
129 "wzero wr0 \n\t" 129 "wzero wr0 \n\t"
130 "mov r1, #(128 * 6 / 32) \n\t" 130 "mov r1, #(128 * 6 / 32) \n\t"
131 "1: \n\t" 131 "1: \n\t"
132 "wstrd wr0, [%0] \n\t" 132 "wstrd wr0, [%0] \n\t"
133 "wstrd wr0, [%0, #8] \n\t" 133 "wstrd wr0, [%0, #8] \n\t"