(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
sse2-mmx-16.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O2 -fno-strict-aliasing -msse2" } */
       3  /* { dg-additional-options "-mno-mmx" { target { ! ia32 } } } */
       4  
       5  #include "sse2-check.h"
       6  
       7  __attribute__((noinline, noclone))
       8  static void
       9  test_set (int i0, int i1, int i2, int i3, long long *r)
      10  {
      11    *(__m64 *) r = _mm_set_pi16 (i0, i1, i2, i3);
      12  }
      13  
      14  /* Routine to manually compute the results */
      15  static void
      16  compute_correct_result (int i0, int i1, int i2, int i3, long long *res_p)
      17  {
      18    short *res = (short *) res_p;
      19    res[0] = i3;
      20    res[1] = i2;
      21    res[2] = i1;
      22    res[3] = i0;
      23  }
      24  
      25  static void
      26  sse2_test (void)
      27  {
      28    short i0, i1, i2, i3;
      29    long long r, ck;
      30  
      31    /* Run the MMX tests */
      32    i0 = 0x0bad;
      33    i1 = 0xbeef;
      34    i2 = 0x0bad;
      35    i3 = 0xfeed;
      36    test_set (i0, i1, i2, i3, &r);
      37    compute_correct_result (i0, i1, i2, i3, &ck);
      38    if (ck != r)
      39      abort ();
      40  }