This is the mail archive of the mailing list for the GCC 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: MS/CW-style inline assembly for GCC

>>>>> "Stan" == Stan Shebs <> 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
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.


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