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-vperm2f128-256-1.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
#define CONTROL 0xCC
8
 
9
void static
10
avx_test (void)
11
{
12
  union256 u, s1, s2;
13
  float e [8];
14
 
15
  s1.x = _mm256_set_ps (1, 2, 3, 4, 5, 6, 7, 8);
16
  s2.x = _mm256_set_ps (9, 10, 11, 12, 13, 14, 15, 16);
17
  u.x = _mm256_permute2f128_ps (s1.x, s2.x, CONTROL);
18
 
19
  switch (CONTROL & 0x3)
20
    {
21
      case 0:
22
        __builtin_memcpy (e, s1.a, 16);
23
        break;
24
      case 1:
25
        __builtin_memcpy (e, s1.a+4, 16);
26
        break;
27
      case 2:
28
        __builtin_memcpy (e, s2.a, 16);
29
        break;
30
      case 3:
31
        __builtin_memcpy (e, s2.a+4, 16);
32
        break;
33
      default:
34
        abort ();
35
    }
36
 
37
 switch ((CONTROL & 0xc)>>2)
38
    {
39
      case 0:
40
        __builtin_memcpy (e+4, s1.a, 16);
41
        break;
42
      case 1:
43
        __builtin_memcpy (e+4, s1.a+4, 16);
44
        break;
45
      case 2:
46
        __builtin_memcpy (e+4, s2.a, 16);
47
        break;
48
      case 3:
49
        __builtin_memcpy (e+4, s2.a+4, 16);
50
        break;
51
      default:
52
        abort ();
53
    }
54
 
55
  if (CONTROL & (1<<3))
56
    __builtin_memset (e, 0, 16);
57
 
58
  if (CONTROL & (1<<7))
59
    __builtin_memset (e+4, 0, 16);
60
 
61
  if (check_union256 (u, e))
62
    abort ();
63
}

powered by: WebSVN 2.1.0

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