This is the mail archive of the gcc@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: Single Element Vectors


>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:

 >> If so, they would like to know why single element vectors should not
 >> be supported.

 > What possible usefulness could they have?  Semantically they
 > are exactly the same as a scalar.  To my way of thinking, 
 > that they want this shows that they are confused and making
 > distinctions that don't make sense.

The problem is that they have an __ev64_u64__ type for initialization
purposes.  That is, they want the type to be a vector, but want to
initialize it from a 64-bit long.  However, when the __ev64_u64__ is
used, they want it to have the vector's ABIness when it comes to
argument passing, not long long argument passing rules.

What I have suggested is having macros used for initialization, as so:

        #define VECTOR_INT_FROM_LONG_LONG(x) ((vector int)x)

        vector int foo = VECTOR_INT_FROM_LONG_LONG(65LL);

Nick also has a patch (that I'm not too fond off, but I *could*
consider if there's no other way), that looks at the typedef name
("__ev64_u64__" in this case) to determine where arguments should go.

I think at this point, more explanations as to why they want a
single-element vector is in order.  If it's just because of
initialization, I suggest macros be used.

Aldy


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