1 /* { dg-do run } */ 2 /* { dg-require-effective-target avx2 } */ 3 /* { dg-options "-O2 -mavx2" } */ 4 5 #include "avx2-check.h" 6 7 #ifndef MASK 8 #define MASK 7 9 #endif 10 11 #define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63) 12 13 void static avx2_test(void)14avx2_test (void) 15 { 16 int i; 17 long long m[4] = { mask_v (0), mask_v (1), mask_v (2), mask_v (3) }; 18 long long s[4] = { 1, 2, 3, 4 }; 19 union256i_q u, mask; 20 long long e[4] = { 0 }; 21 22 mask.x = _mm256_loadu_si256 ((__m256i *) m); 23 u.x = _mm256_maskload_epi64 (s, mask.x); 24 25 for (i = 0; i < 4; i++) 26 e[i] = m[i] ? s[i] : 0; 27 28 if (check_union256i_q (u, e)) 29 abort (); 30 } 31