[cfe-dev] [libc++abi] demangle fails to handle SSE2 types

Jean-Daniel Dupas devlists at shadowlab.org
Wed May 23 08:39:07 PDT 2012


Le 23 mai 2012 à 17:12, Luc Bourhis a écrit :

> 
> On 23 May 2012, at 16:01, Howard Hinnant wrote:
> 
>> It does include a mangling for vendor extended types, and it is a shame that the ABI hasn't been followed for these types (prefix with 'u'), but oh well.
> 
> For the record, g++ follows that ABI. The demangling is unfortunately not symmetric, at least for g++ 4.6:
> 
> Type: __m64
> Mangled: U8__vectori
> Demangled: int __vector
> 
> Type: __m128
> Mangled: U8__vectorf
> Demangled: float __vector
> 
> Type: __m128d
> Mangled: U8__vectord
> Demangled: double __vector
> 
> Type: __m128i
> Mangled: U8__vectorx
> Demangled: long long __vector
> 
> I mention that because it can become annoying in the context of C++ programs generating C++ code (an exercise I indulge into on a regular basis): it would be nice if clang/libc++abi keeps it symmetric.
> 
>> If you'll tell me what string you would like to see these symbols demangle to, I'll put it on my to-do list.
> 
> Thanks! Here you are:
> 
> Type: __m64
> Mangled: Dv1_x
> 
> Type: __m128
> Mangled: Dv4_f
> 
> Type: __m128d
> Mangled: Dv2_d
> 
> Type: __m128i
> Mangled: Dv2_x
> 
> Type: __m256
> Mangled: Dv8_f
> 
> Type: __m256d
> Mangled: Dv4_d
> 
> Type: __m256i
> Mangled: Dv4_x
> 
> The last 3 types are actually AVX types, a technology only available on Sandy Bridge platforms, and I had to run clang on a Linux machine because I don't have access to a Mac with those processors, but it should not matter as far as you are concerned. 
> 

> Best wishes,
> 
> Luc Bourhis


AFAIK, you don't have to have a sandy bridge machine to compile AVX code.

Just tell clang to enable AVX extension:

clang++ -mavx -S vec.cpp

-- Jean-Daniel








More information about the cfe-dev mailing list