This is the mail archive of the gcc-patches@gcc.gnu.org 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 <zlaski@apple.com> writes:

| On 23 Dec, 2003, at 15.30, Gabriel Dos Reis wrote:
| 
| > Ziemowit Laski <zlaski@apple.com> writes:
| >
| > | 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_. :-(
| >
| > No, I think you misunderstood.
| >
| >      (type) {1, 2, 3, 4}
| >
| > is a standard C99 syntax to designate a compond literal.  And if "type"
| > designates an  array then you get an array compound literal.  That is
| > standard.
| 
| I was referring to the AltiVec PIM standard.  The C99 standard is
| necessarily
| silent on vector initializers, since it is silent on the topic of
| vectors
| themselves (which are _not_ arrays). :-)

Well, from initialization and value construction point of view, they
are hardly different.  The point is that when "type" has a very
general sequence-like layout, (type) { 1, 2, 3, 4} does the right
thing and poses no conflict for the existing syntax+semantics.   

| Having said this, I don't really disagree with you that using C99-style
| brace initializers would be nicer.  

I'm not raising that issue just from a "nice looking" point of view.

| But this is not the point; the
| existing
| AltiVec standard (which AldyVec does not follow) and extensive industry
| usage says otherwise.  One simply can't rewrite the laws of gravity
| on-the-fly
| like this, as much as one would want to...

If it were the law of gravity, I would not propose to rewrite it :-)
But, the real point is that your proposed syntax, not only does it add
yet another way to say something we already have syntax for, but it
does hijack on existing syntax with a completely different meaning.

-- Gaby


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