(C++) mangling vector types

Jason Merrill jason@redhat.com
Thu Nov 12 15:25:00 GMT 2009


The G++ mangling of SIMD vector types (SSE, Altivec, etc.) is 
fundamentally broken as it doesn't currently encode the size of the 
vector, only the element type.  So overloading of different size vectors 
fails.  It seems when I implemented this I was modeling the Altivec 
__vector qualifier, which doesn't generalize very well at all...

Clearly, we need to fix this, and the ABI committee has been settling on 
a new mangling.

The question is, how should we handle the transition?

Should the default behavior in 4.5 be:

1) Leave the current mangling as is
2) Leave the current mangling as is for the most common vector size on a 
target (SSE, Altivec) and use the new mangling for other vector sizes.
3) Switch to the new mangling

And what flag should we use to control it?  We're currently at 
-fabi-version=2.  -fabi-version=3 currently changes the mangling of the 
address of a variable or function used as a template argument.

a) Add the vector change to the current ABI v3.
b) Take over -fabi-version=3 and bump the template arg change to v4.
c) Use -fabi-version=2.1.
d) Use a separate flag to control vector mangling.

Opinions?

Jason



More information about the Gcc mailing list