[FFmpeg-devel] Nasm/yasm support and x264 asm

Michael Niedermayer michaelni
Tue Jul 29 20:31:04 CEST 2008

On Tue, Jul 29, 2008 at 08:53:12AM -0600, Loren Merritt wrote:
> On Tue, 29 Jul 2008, Michael Niedermayer wrote:
> >
> > One thing for example that i would not accept in unshared code is
> > the numbered registers, the registers have names and hiding them behind
> > numbers is idiotic. using new names for the native 32/64 bit size makes
> > sense but they should be based on the historic names of the registers.
> > nax, nbx, ... would be a random option
> > If one would rename the registers per function so the code would be
> > more readable and use thing like src, dst, stride, ... that would be
> > nice but changing eax/ebx/... to r0/r1/... really is not, unless for the
> > occasional case where a r0 really maps to different physical registers
> > at different points in a function but in that case it almost certainly
> > should have some more descriptive name ...
> Interesting. I see no point in inventing a new name like "nax". When I 
> want to refer to the native size of register "a", I just use "rax" which 
> is defined to "eax" on x86_32 and not defined on x86_64.

Indeed ive missed that, rax==eax on 32bit is a fine solution as well.

> The point of the numbered registers is that they don't have a fixed 
> correspondence to the lettered registers, they correspond to function 
> arguments. I didn't immediately see a way to allocate named function 
> arguments; maybe I should spend some more time looking. (To be precise, I 
> do see how to add a parameter list to a function declaration, but not how 
> to cleanup the definitions at the end of the function. Afaict yasm lacks 
> sufficient control over dereferencing (this is shared by several other 
> languages, like C preprocessor and shell).)

I cant really say anything here as ive never worked with YASM and the last
time i coded for NASM was very long ago.
But i would suspect that some "non concise" solution exists like
(in C preprocessor)
#define dst "%eax"
#define src "%ebx"
#undef dst
#undef src

Iam not sure though that it would be worth the extra code, maybe for large
and complex functions the gain in readability might be worth it.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080729/2b110ebd/attachment.pgp>

More information about the ffmpeg-devel mailing list