[LLVMdev] Error Compiling Intrinsics On Windows

Eric Mader emader at gmx.us
Wed Oct 1 12:42:17 PDT 2014


I'm seeing errors like this in Visual Studio 3013:

1>  In file included from C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\algorithm:6:
1>  In file included from C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\xmemory:6:
1>  In file included from C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\xmemory0:909:
1>  In file included from C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\intrin.h:34:
1>  In file included from C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\x86intrin.h:29:
1>  In file included from C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:
1>C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40): 
error : cannot initialize a parameter of type 
'__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 
'int' values) with an rvalue of type '__v2si' (aka 'int')
1>      return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
1>                                         ^~~~~~~~~~~

Here's the relevant code from mmintrin.h:

typedef long long __m64 __attribute__((__vector_size__(8)));

typedef int __v2si __attribute__((__vector_size__(8)));
typedef short __v4hi __attribute__((__vector_size__(8)));
typedef char __v8qi __attribute__((__vector_size__(8)));

static __inline__ void __attribute__((__always_inline__, __nodebug__))
_mm_empty(void)
{
     __builtin_ia32_emms();
}

static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
_mm_cvtsi32_si64(int __i)
{
     return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
}

static __inline__ int __attribute__((__always_inline__, __nodebug__))
_mm_cvtsi64_si32(__m64 __m)
{
     return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
}

This looks OK to me, but I'm not really familiar with the MMX 
extensions. Does anyone know what's going wrong here? Do I need to 
change my compiler flags?

Regards,
Eric Mader





More information about the llvm-dev mailing list