This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Smpeg MMX asm compilation (problem)


Soul Studios wrote:

> how do you call macros in GNU as?- I've tried copying examples from the
> net but gas complains about the syntax.
> Or do I need to be running the file through GCC instead to use the
> #define's?

Read section 3.1 of the manual.

> A few more questions:
> from mmxflags_asm.S:
> What is .Lfe1?
> Is it a register, a function call?

Neither.  It's a label, because it ends in a colon.  It is just a
temporary label to use in computing the length of the cpu_flags function
in the .size expression in the next line.  The fact that is is named 'L'
+ some hex number implies that it is just a dummy label that was
probably automatically generated.

> Is there a table somewhere for all the different "@" types and their
> respective int's (ie @object, @function, etc)?

Look at the documentation for .type in the manual, in section 7.

> And I'm now looking at
> http://cvs.icculus.org/*checkout*/cvs/smpeg/video/mmxidct_asm.S?rev=1.7
> which's even more complicated. How do I go about converting something
> like this?

That's pretty ugly.  There's lots of stuff in there that's ELF
specific.  For example, on windows, all code is PIC and there is no
GOT.  So that code will take more than a few changes to be portable to
anything but ELF.

Have you considered that stuff like MMX IDCT routines for video decoding
is pretty much a solved problem?  For example, take a look at how
libavcodec implments this.  They use gcc's inline __asm__ () statements
(through defines in mmx.h) and don't bother themselves with platform
specific details that can be handled by the compiler and/or assembler. 
This code compiles and runs the same on both linux and mingw/windows.

http://svn.sourceforge.net/viewvc/ffdshow/trunk/src/ffmpeg/libavcodec/i386/idct_mmx.c?revision=2471&view=markup
http://svn.sourceforge.net/viewvc/ffdshow/trunk/src/ffmpeg/libavcodec/i386/mmx.h?revision=2484&view=markup
http://svn.sourceforge.net/viewvc/ffdshow/trunk/src/ffmpeg/libavcodec/i386/

> but pages on differences between COFF/PE & ELF syntax are naught, and
> COFF pages seem scarce- any useful URL's you have would be... useful?

Perhaps you need to read
http://sourceware.org/binutils/docs-2.17/as/index.html ?

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]