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

Gregor Riepl onitake at gmail.com
Thu Oct 30 18:14:41 CET 2008


> Tested on may MacBookPro running OSX 10.5.5, and it works wonderfully
> if I run configure as follows:
> CC="gcc -arch x86_64" ./configure --disable-liba52-internal -- 
> disable-qtx

glad to hear that!

>> /var/tmp//ccwLM6D8.s:1177:32-bit absolute addressing is not  
>> supported for
>> x86-64
>>
>
> I ran into the same problem, but I honestly don't know what causes
> this problem. The same code builds fine on Linux/x86_64... When I look
> at the assembly code, it looks quite fine. Maybe it's a bug in Apple's
> fork of GAS?

actually, it's a problem with apple's abi. in 64bit mode, only pic  
referencing and relative addressing is supported.
since the constants are source-local and not used anywhere else, they  
could easily be referenced %rip-relative. are number literals a  
possibility? i remember vagely that movq to/from mmx registers is only  
possible from/to memory or other registers.

according to this thread, the assembler is smart enough to generate  
relative addresses if (%rip) is specified after the symbol: http://lists.apple.com/archives/xcode-users/2006/Sep/msg00056.html
here's a pointer to apple's docs on the topic: http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/x86_64_code.html

the (%rip) approach works for resample_mmx.c, but not for imdct.c, as  
it already uses index addressing in a few places, and %rip can't be  
used as base register. the only way i see here would be something like
lea _<constant>+<offset>(%rip), %rbp
movq (%rbp,%r<index>), %mmx<x>

i'm sure there are better options. no need to make the code more  
complex (and a slight bit slower) for architectures without this quirk.




More information about the MPlayer-dev-eng mailing list