[cxx-abi-dev] mangling vector types

Jason Merrill jason at redhat.com
Tue Nov 10 22:23:27 UTC 2009


On 11/10/2009 03:54 PM, Mark Mitchell wrote:
> I think number of elements, not bytes, though; for all processors I know
> of bytes = length * sizeof(element_type), so using bytes is just a less
> compact encoding with no increase in information.

It's not a matter of more or less information, but it does determine how 
a template parameter could be represented.  Specifically, currently in 
GCC vector types are currently specified with the vector_size attribute, 
which takes an argument of bytes, i.e.

template <class T, int I>
void f (T vec __attribute ((vector_size (I))));

(which doesn't work currently)

to represent the type of vec in an element-based mangling, the number of 
elements would need to be expressed as I/sizeof(T), which is not more 
compact.

That, and the fact that vector_size takes a number of bytes rather than 
elements suggests that maybe the former is more natural for working with 
vector hardware.

Jason



More information about the cxx-abi-dev mailing list