On 8/1/07, Diego Novillo <dnovillo@xxxxxxxxxx> wrote: > On 8/1/07 1:49 PM, Mike Lewis wrote: > > > I'm having an issue getting my software to compile with GCC 4.2. I > > use x86 intrinsics such as _mm_slli_epi32 and I pass the second > > parameter as a variable. This works fine with GCC 4.1, and ICC 9.1. > > Now, with GCC 4.2 I get "error: shift must be an immediate" for the > > lines. > > Could you post the test case? If GCC is not propagating an immediate > constant into the intrinsic call, you will get this message. > Here's a simple one: #include <xmmintrin.h> void a( int n ) { __m128i a; a = _mm_slli_epi32( a, n ); } Generates valid code with ICC and GCC 4.1 and errors 4.2. Now, the IA-32 Software Developer's Manual defines the second argument of _mm_slli_epi32 as "int count." So it should allow a variable (in others such as _mm_slli_epi128 it specifies it as "int imm," but the mnemonic for that one requires an immediate). Thanks again, Mike