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: Baby's First AldyVec/AltiVec patch

Ziemowit Laski <> 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

  (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

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