This is the mail archive of the
mailing list for the GCC project.
Re: MS/CW-style inline assembly for GCC
Andrew Pinski wrote:
I have the view now that any use of inline-asm is usually wrong except
the instruction is not avialable to compiler to use such as mftbu/mftb
instructions which implement atomic operations (but then again there is
already a request for builtins for the atomic operations, PR 14311).
And there could be target dependent builtins for most other things
I think this view is unhelpful. The fact is there are many gcc
who need and expect this facility. It is not useful to tell these
customers they are wrong, and indeed it is a bit arrogant, since
you cannot possibly understand the requirements in each case.
For example, we have one large Ada customer who has a requirement
to write CPU diagnostics, which certainly require the issuing of
specific instructions, and would far prefer to write in Ada since
that is their general preference, both informally and formally in
their environment. They will write in ASM if they absolutely have
to because they give up fighting the format as it exists now. In
fact I think this particular situation is under control, largely
because we provided them with extensive additional documentation.
And yes, it would be useful to contribute this, we will investigate