comparison ppc/dsputil_ppc.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 3a93377e8b76
children 0d108ec85620
comparison
equal deleted inserted replaced
8030:a512ac8fa540 8031:eebc7209c47f
146 ((unsigned long*)blocks)[2] = 0L; 146 ((unsigned long*)blocks)[2] = 0L;
147 ((unsigned long*)blocks)[3] = 0L; 147 ((unsigned long*)blocks)[3] = 0L;
148 i += 16; 148 i += 16;
149 } 149 }
150 for ( ; i < sizeof(DCTELEM)*6*64-31 ; i += 32) { 150 for ( ; i < sizeof(DCTELEM)*6*64-31 ; i += 32) {
151 asm volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory"); 151 __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory");
152 } 152 }
153 if (misal) { 153 if (misal) {
154 ((unsigned long*)blocks)[188] = 0L; 154 ((unsigned long*)blocks)[188] = 0L;
155 ((unsigned long*)blocks)[189] = 0L; 155 ((unsigned long*)blocks)[189] = 0L;
156 ((unsigned long*)blocks)[190] = 0L; 156 ((unsigned long*)blocks)[190] = 0L;
179 // aren't available yet (2003-06-26) 179 // aren't available yet (2003-06-26)
180 memset(blocks, 0, sizeof(DCTELEM)*6*64); 180 memset(blocks, 0, sizeof(DCTELEM)*6*64);
181 } 181 }
182 else 182 else
183 for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) { 183 for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) {
184 asm volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory"); 184 __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
185 } 185 }
186 #else 186 #else
187 memset(blocks, 0, sizeof(DCTELEM)*6*64); 187 memset(blocks, 0, sizeof(DCTELEM)*6*64);
188 #endif 188 #endif
189 POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1); 189 POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1);
217 217
218 memset(fakedata, 0xFF, 1024); 218 memset(fakedata, 0xFF, 1024);
219 219
220 /* below the constraint "b" seems to mean "Address base register" 220 /* below the constraint "b" seems to mean "Address base register"
221 in gcc-3.3 / RS/6000 speaks. seems to avoid using r0, so.... */ 221 in gcc-3.3 / RS/6000 speaks. seems to avoid using r0, so.... */
222 asm volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero)); 222 __asm__ volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero));
223 223
224 for (i = 0; i < 1024 ; i ++) { 224 for (i = 0; i < 1024 ; i ++) {
225 if (fakedata[i] == (char)0) 225 if (fakedata[i] == (char)0)
226 count++; 226 count++;
227 } 227 }
239 239
240 static void prefetch_ppc(void *mem, int stride, int h) 240 static void prefetch_ppc(void *mem, int stride, int h)
241 { 241 {
242 register const uint8_t *p = mem; 242 register const uint8_t *p = mem;
243 do { 243 do {
244 asm volatile ("dcbt 0,%0" : : "r" (p)); 244 __asm__ volatile ("dcbt 0,%0" : : "r" (p));
245 p+= stride; 245 p+= stride;
246 } while(--h); 246 } while(--h);
247 } 247 }
248 248
249 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) 249 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)