1 /* { dg-do run } */ 2 /* { dg-options "-O2 -mavx512dq" } */ 3 /* { dg-require-effective-target avx512dq } */ 4 5 #define AVX512DQ 6 #include "avx512f-helper.h" 7 8 #define SIZE (AVX512F_LEN / 64) 9 #include "avx512f-mask-type.h" 10 11 void CALC(MASK_TYPE * r,long long * s1)12CALC (MASK_TYPE *r, long long *s1) 13 { 14 int i; 15 MASK_TYPE res = 0; 16 MASK_TYPE one = 1; 17 18 for (i = 0; i < SIZE; i++) 19 if (s1[i] >> 63) 20 res = res | (one << i); 21 22 *r = res; 23 } 24 25 void TEST(void)26TEST (void) 27 { 28 int i, sign; 29 UNION_TYPE (AVX512F_LEN, i_q) src; 30 MASK_TYPE res, res_ref = 0; 31 32 sign = -1; 33 for (i = 0; i < SIZE; i++) 34 { 35 src.a[i] = 2 * i * sign; 36 sign = sign * -1; 37 } 38 39 res = INTRINSIC (_movepi64_mask) (src.x); 40 41 CALC (&res_ref, src.a); 42 43 if (res_ref != res) 44 abort (); 45 } 46