(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
avx512dq-vextractf64x2-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  #include "string.h"
      11  
      12  void
      13  CALC (double *s1, double *res_ref, int mask)
      14  {
      15    memset (res_ref, 0, 16);
      16    memcpy (res_ref, s1 + mask * 2, 16);
      17  }
      18  
      19  void
      20  TEST (void)
      21  {
      22    UNION_TYPE (AVX512F_LEN, d) s1;
      23    union128d res1, res2, res3;
      24    double res_ref[2];
      25    MASK_TYPE mask = MASK_VALUE;
      26    int j;
      27  
      28    for (j = 0; j < SIZE; j++)
      29      {
      30        s1.a[j] = j * j / 4.56;
      31      }
      32  
      33    for (j = 0; j < 2; j++)
      34      {
      35        res1.a[j] = DEFAULT_VALUE;
      36        res2.a[j] = DEFAULT_VALUE;
      37        res3.a[j] = DEFAULT_VALUE;
      38      }
      39  
      40    res1.x = INTRINSIC (_extractf64x2_pd) (s1.x, 1);
      41    res2.x = INTRINSIC (_mask_extractf64x2_pd) (res2.x, mask, s1.x, 1);
      42    res3.x = INTRINSIC (_maskz_extractf64x2_pd) (mask, s1.x, 1);
      43    CALC (s1.a, res_ref, 1);
      44  
      45    if (check_union128d (res1, res_ref))
      46      abort ();
      47  
      48    MASK_MERGE (d) (res_ref, mask, 2);
      49    if (check_union128d (res2, res_ref))
      50      abort ();
      51  
      52    MASK_ZERO (d) (res_ref, mask, 2);
      53    if (check_union128d (res3, res_ref))
      54      abort ();
      55  }