This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: MS/CW-style inline assembly for GCC
- From: Paul Koning <pkoning at equallogic dot com>
- To: shebs at apple dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 4 May 2004 10:27:54 -0400
- Subject: Re: MS/CW-style inline assembly for GCC
- References: <4096C4A0.8030000@apple.com>
>>>>> "Stan" == Stan Shebs <shebs@apple.com> writes:
Stan> One of the long-notorious features of GCC has been its inline
Stan> assembly extension for C-dialect languages. ...
Stan> However, the syntax has also been somewhat inaccessible. Those
Stan> constraint letters were often undocumented, and are still
Stan> somewhat mysterious to users, while the use of strings for
Stan> instructions makes the construction of longer assembly
Stan> sequences a rather difficult undertaking. In addition, the
Stan> "capture" of GCC's constraint letters and pattern syntax into
Stan> source code has the potential to reduce our flexibility to
Stan> change compiler internals later.
I don't understand these objections.
Yes, the constraints are very poorly documented. To the extent they
are documented at all, the description is aimed at authors of xxx.md
files. But that's fixable.
I don't see why the use of strings makes constructing long assembly
statements hard. String concatenations works just fine.
As for tying things to internals: if the internals ever need to change
away from constraint letters, you end up needing a mapping from
constraint letters in asm statements to whatever replaces them. Right
now that's an identity mapping, but it does not need to be.
paul