(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
sse2-psrld-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_psrld_1
      13  #endif
      14  
      15  #define N 0xf
      16  
      17  #include <emmintrin.h>
      18  
      19  static __m128i
      20  __attribute__((noinline, unused))
      21  test (__m128i s1)
      22  {
      23    return _mm_srli_epi32 (s1, N); 
      24  }
      25  
      26  static void
      27  TEST (void)
      28  {
      29    union128i_d u, s;
      30    int e[4] = { 0 };
      31    unsigned int tmp;
      32    int i;
      33   
      34    s.x = _mm_set_epi32 (1, -2, 3, 4);
      35  
      36    u.x = test (s.x);
      37  
      38    if (N < 32)
      39      for (i = 0; i < 4; i++)
      40        {
      41          tmp  = s.a[i];
      42          e[i] = tmp >> N; 
      43        }
      44  
      45    if (check_union128i_d (u, e))
      46      {
      47  #if DEBUG
      48        printf ("sse2_test_psrld_1; check_union128i_d failed\n");
      49        printf ("\tsrl\t([%x,%x,%x,%x],%d\n", s.a[0], s.a[1], s.a[2], s.a[3], N);
      50        printf ("\t ->\t [%x,%x,%x,%x]\n", u.a[0], u.a[1], u.a[2], u.a[3]);
      51        printf ("\texpect\t [%x,%x,%x,%x]\n", e[0], e[1], e[2], e[3]);
      52  #endif
      53        abort ();
      54      }
      55  }