[MPlayer-dev-eng] [PATCH] Replaced deprecated QuickDraw calls in vo_quartz

Gregor Riepl onitake at gmail.com
Mon Dec 15 18:24:05 CET 2008


> Huh? That sounds like the completely normal process for 64 bit  
> systems,
> but that normally only applies to PIC/PIE code (rip-relative  
> addressing
> is just an attempt to make PIC not be uselessly slow in the worst- 
> case).

is that so? i was having the impression that other os kernels support  
segment-absolute addressing too - or the assembler/linker is smart  
enough to automatically translate.

>> +	:"m"(one_null), "m"(null_one)
>
> I don't like it much because my compilation attempts on OpenBSD and
> FreeBSD have made me painfully aware that gcc will mess it up most of
> the time - using "m" constraints is simply a sure way to get the  
> "could
> not find a register in GENERAL_REGS" error in at least one gcc version
> (unless you have less than 5 arguments + register clobbers total).
> In addition I am not sure if the generated code properly uses
> PIC-relative addressing, if not it will be slower.

now this is funny. one_null and null_one are memory references  
already, at least if the compiler doesn't do any magic tricks on them.  
so why allocate another register before handing them over to the  
assembly code?
maybe the g constraint works better in this case...

>> // Use rip-relative addressing if compiling PIC code on x86-64.
>> #if defined(ARCH_X86_64) && defined(PIC)
>> #    define LOCAL_MANGLE(a) #a "(%%rip)"
>> #else
>> #    define LOCAL_MANGLE(a) #a
>> #endif
>>
>> #define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
>
> As you can see it does not think there is any reason to do anything
> different unless you are building a library, if OSX indeed is  
> different
> FFmpeg needs to be fixed as well.

this is very good news. if the code is already there, i second using  
it, as this is precisely what's needed. only indexing doesn't work  
like this, and that's the reason why a52 won't compile. sweeping  
arrays using an index register is not possible like this. but it would  
work with a lea instruction and another register, i guess.




More information about the MPlayer-dev-eng mailing list