(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
avx512dq-vcvtqq2pd-2.c
       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
      12  CALC (long long *s, double *r)
      13  {
      14    int i;
      15  
      16    for (i = 0; i < SIZE; i++)
      17      r[i] = (double) s[i];
      18  }
      19  
      20  void
      21  TEST (void)
      22  {
      23    UNION_TYPE (AVX512F_LEN, i_q) s;
      24    UNION_TYPE (AVX512F_LEN, d) res1, res2, res3;
      25    MASK_TYPE mask = MASK_VALUE;
      26    double res_ref[SIZE];
      27    int i, sign = 1;
      28  
      29    for (i = 0; i < SIZE; i++)
      30      {
      31        s.a[i] = 123 * (i + 2000) * sign;
      32        res2.a[i] = DEFAULT_VALUE;
      33        sign = -sign;
      34      }
      35  
      36    res1.x = INTRINSIC (_cvtepi64_pd) (s.x);
      37    res2.x = INTRINSIC (_mask_cvtepi64_pd) (res2.x, mask, s.x);
      38    res3.x = INTRINSIC (_maskz_cvtepi64_pd) (mask, s.x);
      39  
      40    CALC (s.a, res_ref);
      41  
      42    if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
      43      abort ();
      44  
      45    MASK_MERGE (d) (res_ref, mask, SIZE);
      46    if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
      47      abort ();
      48  
      49    MASK_ZERO (d) (res_ref, mask, SIZE);
      50    if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
      51      abort ();
      52  }