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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx-set-v8sf-4.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target avx } */
3
/* { dg-options "-O2 -mavx" } */
4
 
5
#include "avx-check.h"
6
 
7
static __m256
8
__attribute__((noinline))
9
foo (float x, int i)
10
{
11
  switch (i)
12
    {
13
    case 7:
14
      return _mm256_set_ps (x, 0, 0, 0, 0, 0, 0, 0);
15
    case 6:
16
      return _mm256_set_ps (0, x, 0, 0, 0, 0, 0, 0);
17
    case 5:
18
      return _mm256_set_ps (0, 0, x, 0, 0, 0, 0, 0);
19
    case 4:
20
      return _mm256_set_ps (0, 0, 0, x, 0, 0, 0, 0);
21
    case 3:
22
      return _mm256_set_ps (0, 0, 0, 0, x, 0, 0, 0);
23
    case 2:
24
      return _mm256_set_ps (0, 0, 0, 0, 0, x, 0, 0);
25
    case 1:
26
      return _mm256_set_ps (0, 0, 0, 0, 0, 0, x, 0);
27
    case 0:
28
      return _mm256_set_ps (0, 0, 0, 0, 0, 0, 0, x);
29
    default:
30
      abort ();
31
    }
32
}
33
 
34
static void
35
avx_test (void)
36
{
37
  float e = -3.234;
38
  float v[8];
39
  union256 u;
40
  int i, j;
41
 
42
  for (i = 0; i < ARRAY_SIZE (v); i++)
43
    {
44
      for (j = 0; j < ARRAY_SIZE (v); j++)
45
        v[j] = 0;
46
      v[i] = e;
47
      u.x = foo (e, i);
48
      if (check_union256 (u, v))
49
        abort ();
50
    }
51
}

powered by: WebSVN 2.1.0

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