public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Daniel Yek <dyek@real.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Porting to .intel_syntax Inline Assembly / "m" Constraint with .intel_syntax  / Targeting -fPIC
Date: Wed, 05 Mar 2008 00:37:00 -0000	[thread overview]
Message-ID: <m3prua9fby.fsf@localhost.localdomain> (raw)
In-Reply-To: <47CC9CD9.4080304@real.com>

Daniel Yek <dyek@real.com> writes:

> I would like to find out if it is a good idea to utilize GCC's
> .intel_syntax Inline Assembly support (for non-trivial blocks), or to
> convert them to GAS or NASM assembly functions, .S files.

For a complete function written in assembly code, you might as well
put it in a .s or .S file.  You can put it in a .c file using a simple
asm if that is is more convenient for you.  It doesn't make any big
difference.


> Is there a way I can use the memory constraint, "m", effectively in
> .intel_syntax Inline Assembly?

Use the -masm=intel option with gcc.


> (3) Is there any document providing information how I can create a
> single version of assembly code (Inline Assembly or pure assembly) and
> have it compiled with or without -fPIC correctly?

I don't know of any document.  The basic guideline is fairly obvious:
don't use %ebx.  If you must use it, push and pop it in your assembly
code.

Ian

      reply	other threads:[~2008-03-05  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04  0:50 Daniel Yek
2008-03-05  0:37 ` Ian Lance Taylor [this message]

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=m3prua9fby.fsf@localhost.localdomain \
    --to=iant@google.com \
    --cc=dyek@real.com \
    --cc=gcc-help@gcc.gnu.org \
    /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).