[Ffmpeg-devel] [MacIntel] Testers welcome!

Marco Manfredini mldb
Mon Aug 14 11:11:51 CEST 2006


On Sunday 13 August 2006 04:46, John Dalgliesh wrote:
> If you want to continue the investigation instead, then please be my
> guest! :)

Hi John,

It looks like the compiler has a personal feud with 'i' in 
ff_snow_horizontal_compose97i_sse and tries to kill it as best as he can. 

Getting i in again is not so easy: 

For example, none of these work

--------
 int i; 
 asm("/*&0!*/\n\t"::"m"(i)); 
--------
 int i; 
 asm("/*&0!*/\n\t"::"m"(&i)); // doesn't compile, says memory operand 0 is not 
addressable
--------
 static void __attribute__((noinline)) __keep(int i) {}
 ..
 int i; 
 __keep(i);  
--------
 static void __attribute__((noinline)) __keep(void *p) {}
 ..
 int i; 
 __keep(&i);  
--------
These work: 
--------
 static inline void __keep(void *p) { 
  asm volatile("/*%0!*/\n\t"::"m"(p)); // funny eh?
 }
 ..
 int i; 
 __keep_1(&i);  
--------
 static void __attribute__((weak)) __keep(void *p) {}
 ..
 int i; 
 __keep_2(&i);  
---------
my copy of ffmpeg passes the tests after this modification.
Potentially bad is, that both solutions force 'i' into memory after 
declaration.

Marco





More information about the ffmpeg-devel mailing list