Baby's First AldyVec/AltiVec patch

Ziemowit Laski zlaski@apple.com
Tue Dec 23 23:35:00 GMT 2003


On 23 Dec, 2003, at 15.06, Gabriel Dos Reis wrote:
> The *syntax* is valid, but the semantic is fundamentally different.
>
> That is a red flag.
>
>   (1) it uses the same syntax to mean something completely different,
>       and given that C and C++ grammars are not really context-free,
>       I think there is more to say that a bare "the syntax is already
>       valid".
>
>   (2) for the semantics, you already have an existing standard syntax
>       for saying exactly the same thing.

Unfortunately, the "existing" syntax (by which I'm assuming you mean
AldyVec) is not standard, whereas the syntax I'm proposing (as imperfect
as it may be) _is_. :-(

> | (and again, only when '-maltivec' or '-faltivec' is specified and you
> | are casting to
> | a vector type).  The context-sensitive keywords are, I admit, a bit
> | trickier, which
> | is why I asked for people to critique the implementation.  However,
> | all of that is also
> | hidden behind a target hook.
>
> The idea of context-sensitve keywords (which Microsoft has been
> experimenting with its CLI/C++) is not really a good idea.  It might
> be fun for lexing and parsing exercises, but in the long run it is a
> nightmarre for both implementors and users.
>
> I would strongly recommand against extension experiments along that
> line in GCC.

If this truly were an "experiment", I might be inclined to agree with 
you.
Alas, the syntactic extensions we're discussing have existed in 
production
compilers (including Apple's version of gcc) for at least 5 years.

--Zem
--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477



More information about the Gcc-patches mailing list