1 /* { dg-do run } */ 2 /* { dg-require-effective-target sse4 } */ 3 /* { dg-options "-O2 -msse4.1" } */ 4 5 #ifndef CHECK_H 6 #define CHECK_H "sse4_1-check.h" 7 #endif 8 9 #ifndef TEST 10 #define TEST sse4_1_test 11 #endif 12 13 #include CHECK_H 14 15 #include <smmintrin.h> 16 17 #define NUM 128 18 19 static void TEST(void)20TEST (void) 21 { 22 union 23 { 24 __m128i x[NUM / 2]; 25 long long ll[NUM]; 26 char c[NUM * 8]; 27 } dst, src; 28 int i, sign = 1; 29 30 for (i = 0; i < NUM; i++) 31 { 32 src.c[(i % 2) + (i / 2) * 16] = i * i * sign; 33 sign = -sign; 34 } 35 36 for (i = 0; i < NUM; i += 2) 37 dst.x [i / 2] = _mm_cvtepi8_epi64 (src.x [i / 2]); 38 39 for (i = 0; i < NUM; i++) 40 if (src.c[(i % 2) + (i / 2) * 16] != dst.ll[i]) 41 abort (); 42 } 43