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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse2-vec-5.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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