[FFmpeg-devel] r9017 breaks WMA decoding on Intel Macs

Michael Niedermayer michaelni
Fri Jun 1 12:27:26 CEST 2007


Hi

On Fri, Jun 01, 2007 at 11:51:31AM +0200, Guillaume Poirier wrote:
> Hi,
> 
> Michael Niedermayer wrote:
> 
> > so ive came up with the following decissions:
> > 1. trent please stay out of disscussions related to gnu/elf/pic if you
> >    cannot accept that your views are not shared by the other people
> > 2. the code should be changed so the loop statements are in asm and not
> >    in C this is the obvious optimal solution
> 
> Could you explain why this would get rid of the shitty offset+%pointer
> syntax? This may seem like a trivial question to you, but this doesn't
> seem obvious to me. I'd tend to think that we'd still have to write
> smth like offset+loop_register+%pointer, or smth like that.

there is no problem with offset(%loop_register, %pointer) or the intel
syntax of [loop_register+pointe+offset] the problem is that
%1/"m" is a placeholder in inline asm which gets replaced by an arbitrary
memory operand by gcc, something like (%eax) or (%eax, %ebx) or 5(%eax)
gcc does just replace all the %<number> strings in an inline asm by
the various strings corresponding to register, constanst and 
memory locations it has no intelligence in fixing things up it just does
silly string search and replace

and we have no control or knowledeg about what gcc will use so for a %1/"m"
if we write %1 gcc could use 123(%eax) or (%ebx,%ecx) or any other
variant

if you now try to add an offset with 345+%1 that would lead to
345+123(%eax) and 345+(%ebx,%ecx)
the later syntax is not supported by apples as, and trent claims its
incorrect syntax

if OTOH you would use 345%1 that would lead to
345123(%eax) and 345(%ebx,%ecx)
here the first ends up with a total nonsense offset which every as
would assemble to 345123 instead of 345+123 as it just gets a long
string from gcc it no longer knows that these 2 where seperate

if the whole loop where written in asm you would not use "m" but rather
"r" to access the array and increase (or decrease) this register in every
iteration
you could in principle also use "r"/(%1) with the current code though
noone suggested that IIRC

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070601/63306fe6/attachment.pgp>



More information about the ffmpeg-devel mailing list