Baby's First AldyVec/AltiVec patch
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Dec 23 23:22:00 GMT 2003
Ziemowit Laski <zlaski@apple.com> writes:
[...]
| Also, note that the only real syntactic extension being proposed here
| are the
| context-sensitive keywords. The cast expression
|
| (type)(1, 2, 3, 4)
|
| is _already_ legal in C and C++; all the AltiVec patch does is change
| its _semantics_
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.
| (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.
-- Gaby
More information about the Gcc-patches
mailing list