(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
sse2-cvtdq2pd-1.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
       3  /* { dg-require-effective-target p8vector_hw } */
       4  
       5  #ifndef CHECK_H
       6  #define CHECK_H "sse2-check.h"
       7  #endif
       8  
       9  #include CHECK_H
      10  
      11  #ifndef TEST
      12  #define TEST sse2_test_cvtepi32_pd
      13  #endif
      14  
      15  #include <emmintrin.h>
      16  #ifdef _ARCH_PWR8
      17  static __m128d
      18  __attribute__((noinline, unused))
      19  test (__m128i p)
      20  {
      21    return _mm_cvtepi32_pd (p); 
      22  }
      23  #endif
      24  
      25  static void
      26  TEST (void)
      27  {
      28  #ifdef _ARCH_PWR8
      29    union128d u;
      30    union128i_d s;
      31    double e[2];
      32  
      33    s.x = _mm_set_epi32 (123, 321, 456, 987);
      34  
      35    u.x = test (s.x);
      36  
      37    e[0] = (double)s.a[0]; 
      38    e[1] = (double)s.a[1]; 
      39  
      40    if (check_union128d (u, e))
      41      {
      42  #if DEBUG
      43        printf ("sse2_test_cvtepi32_pd; check_union128d failed\n");
      44        printf ("\t [%d,%d, %d, %d] -> [%f,%f]\n",
      45  	      s.a[0], s.a[1], s.a[2], s.a[3],
      46  	      u.a[0], u.a[1]);
      47        printf ("\t expect [%f,%f]\n", e[0], e[1]);
      48  #endif
      49        abort ();
      50      }
      51  #endif
      52  }