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/] [avx-set-v16hi-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-require-effective-target avx } */
3
/* { dg-options "-O2 -mavx" } */
4
 
5
#include "avx-check.h"
6
 
7
static __m256i
8
__attribute__((noinline))
9
foo (short x, int i)
10
{
11
  switch (i)
12
    {
13
    case 15:
14
      return _mm256_set_epi16 (x, 0, 0, 0, 0, 0, 0, 0,
15
                               0, 0, 0, 0, 0, 0, 0, 0);
16
    case 14:
17
      return _mm256_set_epi16 (0, x, 0, 0, 0, 0, 0, 0,
18
                               0, 0, 0, 0, 0, 0, 0, 0);
19
    case 13:
20
      return _mm256_set_epi16 (0, 0, x, 0, 0, 0, 0, 0,
21
                               0, 0, 0, 0, 0, 0, 0, 0);
22
    case 12:
23
      return _mm256_set_epi16 (0, 0, 0, x, 0, 0, 0, 0,
24
                               0, 0, 0, 0, 0, 0, 0, 0);
25
    case 11:
26
      return _mm256_set_epi16 (0, 0, 0, 0, x, 0, 0, 0,
27
                               0, 0, 0, 0, 0, 0, 0, 0);
28
    case 10:
29
      return _mm256_set_epi16 (0, 0, 0, 0, 0, x, 0, 0,
30
                               0, 0, 0, 0, 0, 0, 0, 0);
31
    case 9:
32
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, x, 0,
33
                               0, 0, 0, 0, 0, 0, 0, 0);
34
    case 8:
35
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, x,
36
                               0, 0, 0, 0, 0, 0, 0, 0);
37
    case 7:
38
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
39
                               x, 0, 0, 0, 0, 0, 0, 0);
40
    case 6:
41
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
42
                               0, x, 0, 0, 0, 0, 0, 0);
43
    case 5:
44
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
45
                               0, 0, x, 0, 0, 0, 0, 0);
46
    case 4:
47
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
48
                               0, 0, 0, x, 0, 0, 0, 0);
49
    case 3:
50
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
51
                               0, 0, 0, 0, x, 0, 0, 0);
52
    case 2:
53
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
54
                               0, 0, 0, 0, 0, x, 0, 0);
55
    case 1:
56
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
57
                               0, 0, 0, 0, 0, 0, x, 0);
58
    case 0:
59
      return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0,
60
                               0, 0, 0, 0, 0, 0, 0, x);
61
    default:
62
      abort ();
63
    }
64
}
65
 
66
static void
67
avx_test (void)
68
{
69
  short e = 0xbeef;
70
  short v[16];
71
  union256i_w u;
72
  int i, j;
73
 
74
  for (i = 0; i < ARRAY_SIZE (v); i++)
75
    {
76
      for (j = 0; j < ARRAY_SIZE (v); j++)
77
        v[j] = 0;
78
      v[i] = e;
79
      u.x = foo (e, i);
80
      if (check_union256i_w (u, v))
81
        abort ();
82
    }
83
}

powered by: WebSVN 2.1.0

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