public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Brian Dessent <brian@dessent.net>
To: Soul Studios <soulstudios@orcon.net.nz>
Cc: Pedro Alves <pedro_alves@portugalmail.pt>,
	 	Matthew Bentley <moc.pophot@hotpop.com>,
	 	Daniel Jacobowitz <drow@false.org>,
	binutils@sourceware.org
Subject: Re: Smpeg MMX asm compilation (problem)
Date: Tue, 22 Aug 2006 03:42:00 -0000	[thread overview]
Message-ID: <44EA59AF.BD3F0583@dessent.net> (raw)
In-Reply-To: <44EA4C2C.3040606@orcon.net.nz>

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

  parent reply	other threads:[~2006-08-22  1:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-20 19:59 Matthew Bentley
2006-08-21  1:38 ` Daniel Jacobowitz
2006-08-21  1:54   ` Matthew Bentley
2006-08-21 15:25     ` Daniel Jacobowitz
2006-08-21 22:52     ` Pedro Alves
2006-08-22  1:10       ` Soul Studios
2006-08-22  3:05         ` Pedro Alves
2006-08-22  3:42         ` Brian Dessent [this message]
2006-08-22  5:47           ` Pedro Alves
2006-08-22 12:11             ` Nick Clifton
2006-08-22 17:22               ` Soul Studios
2006-08-23  1:53             ` Matt
2006-08-23 17:33               ` Nick Clifton
2006-08-23  2:45             ` Matt
2006-08-23 17:49               ` Pedro Alves
2006-08-24  8:33             ` Matt
2006-08-22  6:44           ` Matt Bentley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44EA59AF.BD3F0583@dessent.net \
    --to=brian@dessent.net \
    --cc=binutils@sourceware.org \
    --cc=drow@false.org \
    --cc=moc.pophot@hotpop.com \
    --cc=pedro_alves@portugalmail.pt \
    --cc=soulstudios@orcon.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).