(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
sse2-movmskpd-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_movmskpd_1
      13  #endif
      14  
      15  #include <emmintrin.h>
      16  
      17  #ifdef _ARCH_PWR8
      18  static int
      19  __attribute__((noinline, unused))
      20  test (__m128d p)
      21  {
      22    __asm("" : "+v"(p));
      23    return _mm_movemask_pd (p); 
      24  }
      25  #endif
      26  
      27  static void
      28  TEST (void)
      29  {
      30  #ifdef _ARCH_PWR8
      31    double source[2] = {1.234, -2234.23};
      32    union128d s1;
      33    int d;
      34    int e;
      35  
      36    s1.x = _mm_loadu_pd (source);
      37  
      38    d = test (s1.x);
      39  
      40    e = 0;
      41    if (source[0] < 0)
      42      e |= 1;
      43    
      44    if (source[1] < 0)
      45      e |= 1 << 1;
      46  
      47    if (checkVi (&d, &e, 1))
      48      {
      49  #if DEBUG
      50        printf ("sse2_test_movmskpd_1; check_union128d failed\n");
      51        printf ("\t [%f,%f] -> [%d]\n", s1.a[0], s1.a[1], d);
      52        printf ("\t expect [%d]\n", e);
      53  #endif
      54        abort ();
      55      }
      56  #endif
      57  }