This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [DOC PATCH] Rewrite docs for inline asm
- From: dw <limegreensocks at yahoo dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: James Greenhalgh <james dot greenhalgh at arm dot com>, gcc-patches at gcc dot gnu dot org, Joseph Myers <joseph at codesourcery dot com>, Hans-Peter Nilsson <hp at bitrange dot com>, Andrew Haley <aph at redhat dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Date: Tue, 29 Apr 2014 03:47:42 -0700
- Subject: Re: [DOC PATCH] Rewrite docs for inline asm
- Authentication-results: sourceware.org; auth=none
- References: <533F0C97 dot 2010206 at yahoo dot com> <alpine dot BSF dot 2 dot 02 dot 1404081759100 dot 23831 at arjuna dot pair dot com> <5344DAC3 dot 90005 at yahoo dot com> <alpine dot BSF dot 2 dot 02 dot 1404122053010 dot 48644 at arjuna dot pair dot com> <534A5BFD dot 3000906 at yahoo dot com> <alpine dot BSF dot 2 dot 02 dot 1404132037070 dot 39694 at arjuna dot pair dot com> <534B7F38 dot 9010605 at yahoo dot com> <20140425154343 dot GA30738 at arm dot com> <alpine dot LSU dot 2 dot 11 dot 1404251938320 dot 2591 at tuna dot site> <535D8CC3 dot 2000100 at yahoo dot com>
While I'm waiting to hear back from Gerald about my responses to his
other corrections, I have answered one question:
How does the user know what is dialect #0? Same for the others?
When I originally wrote that section, I didn't know the answer (which
is why I left it vague). Now I think I do, but I'd like someone to
confirm. On my builds of gcc, the dialects are listed (in dialect
order) under "Known assembler dialects" in "gcc --target-help". Can I
rely on this enough to put it in the docs? Is there some better source?
First of all, -masm is (currently) only supported on i386:
http://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html
Second, i386 -masm only supports two options:
http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
So, the inline asm docs could just say "att" and "intel." However,
there's a difference between using "intel" and "att" as examples of how
dialects work, and "hard coding" these names into this section as the
list of available options. I'm not keen on putting machine-specific
info like this into an otherwise machine-neutral section.
Such being the case, I replaced the previously vague paragraph with:
GCC may support multiple assembler dialects (such as "att" or "intel") for
inline assembler. In builds that support this capability, the
@option{-masm}
option controls which dialect GCC uses as its default. The
hardware-specific
documentation for the @option{-masm} option contains the list of supported
dialects, as well as the default dialect if the option is not specified.
This
information may be important to understand, since assembler code that works
correctly when compiled using one dialect will likely fail if compiled
using
another.
This keeps the machine-specific details with the already
machine-specific compile options. While this option only applies to
i386 currently, this text leaves the option open should some other
platform make use of it in the future.
Unless someone says otherwise, I'm calling this question resolved.
dw