OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse2-vec-4.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -msse2" } */
3
/* { dg-require-effective-target sse2 } */
4
 
5
#include "sse2-check.h"
6
 
7
#include <emmintrin.h>
8
 
9
static void
10
sse2_test (void)
11
{
12
  union
13
    {
14
      __m128i x;
15
      char c[16];
16
      short s[8];
17
      int i[4];
18
      long long ll[2];
19
    } val1;
20
  short res[8];
21
  int masks[8];
22
  int i;
23
 
24
  for (i = 0; i < 16; i++)
25
    val1.c[i] = i;
26
 
27
  res[0] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 0);
28
  res[1] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 1);
29
  res[2] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 2);
30
  res[3] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 3);
31
  res[4] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 4);
32
  res[5] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 5);
33
  res[6] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 6);
34
  res[7] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 7);
35
 
36
  for (i = 0; i < 8; i++)
37
    masks[i] = i;
38
 
39
  for (i = 0; i < 8; i++)
40
    if (res[i] != val1.s [masks[i]])
41
      abort ();
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.