This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Target-specific Front-Ends? (Was: front end changes for
- From: Alex Rosenberg <alexr at spies dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Ziemowit Laski <zlaski at apple dot com>, "Joseph S. Myers" <jsm28 at cam dot ac dot uk>, Aldy Hernandez <aldyh at redhat dot com>, Joe Buck <jbuck at synopsys dot com>, egcs <gcc at gcc dot gnu dot org>
- Date: Tue, 04 Dec 2001 00:14:39 -0800
- Subject: Re: Target-specific Front-Ends? (Was: front end changes for
(Sorry for the late response...)
on 11/27/01 3:26 PM, Mark Mitchell at mark@codesourcery.com wrote:
> --On Tuesday, November 27, 2001 02:53:26 PM -0800 Joe Buck
> <jbuck@synopsys.COM> wrote:
>
>> Mark writes:
>>> Concretely, the Altivec specification allows "vector" to be either a
>>> macro, or a context-sensitive keyword. The latter is a much better
>>> choice, and it is the one we should adopt in GCC. It will be far
>>> less intrusive.
>>
>> Allowing "vector" to be a macro would be completely unacceptable, because
>> people will mix C and C++ code.
>
> The Altivec specification says that __vector is a keyword. It says that
> vector can be either a macro or a context-sensitive keyword. If it
> is a macro you are explicitly allowed to #undef it.
>
> So, you can use __vector in C or C++, with any Altivec compiler. If
> you're using (Altivec) vector in C++ code, you're not writing
> portable code, even across Altivec implementations.
>
> I don't know how many Altivec code authors know this, but we would
> certainly be within the letter of the law going this way, and it's
> (relatively) easy to implement, and far less horrid than a
> context-sensitive keyword.
I just wanted to point out that the AltiVec PIM "specification" contains
this macro allowance (2.2.1) as a concession to the former Metrowerks
engineer who was responsible for AltiVec support. The same is true of the
entire discussion of the optional <altivec.h> include file in 2.6. At that
time, he didn't understand Ira's explanations of "context-sensitive keyword"
(much as many on the gcc list seem to not understand it).
Shortly before MW shipped their first AltiVec support release, they switched
over to the context-sensitive "vector" method (2.2.2). Pretty much every
line of existing AltiVec code uses "vector" in this way.
It seems to me that a major problem with target-dependant front-end
extensions like this is that the front-ends are automatically built from a
grammar and installers aren't required to have those tools.
Would the new C++ front-end make this less difficult?
+------------------------------------------------------------+
| Alexander M. Rosenberg <mailto:alexr@_spies.com> |
| Nobody cares what I say. Remove the underscore to mail me. |