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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpop-check.h] - Blame information for rev 695

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

Line No. Rev Author Line
1 691 jeremybenn
#include "avx2-check.h"
2
 
3
#define SIZE 256
4
 
5
TYPE a[SIZE];
6
TYPE b[SIZE];
7
TYPE c[SIZE];
8
volatile TYPE c_ref[SIZE];
9
 
10
__attribute__ ((__noinline__))
11
void
12
gen_pop ()
13
{
14
  int i;
15
  for (i = 0; i < SIZE; ++i)
16
#ifdef BIN_OP
17
    c[i] = BIN_OP (a[i], b[i]);
18
#else /*  Must be UN_OP */
19
    c[i] = UN_OP (a[i]);
20
#endif /*  BIN_OP */
21
}
22
 
23
void
24
check_pop ()
25
{
26
  int i;
27
  for (i = 0; i < SIZE; ++i)
28
#ifdef BIN_OP
29
    c_ref[i] = BIN_OP (a[i], b[i]);
30
#else /*  Must be UN_OP */
31
    c_ref[i] = UN_OP (a[i]);
32
#endif /*  BIN_OP */
33
}
34
 
35
void static
36
avx2_test (void)
37
{
38
  int i, j;
39
  for (i = 0; i < 4; ++i )
40
    {
41
      for ( j = 0; j < SIZE; ++j )
42
        {
43
          a[i] = i * i + i;
44
          b[i] = i * i * i;
45
        }
46
 
47
      gen_pop ();
48
      check_pop ();
49
 
50
      if (memcmp (c, c_ref, SIZE * sizeof (TYPE)))
51
        abort();
52
    }
53
}

powered by: WebSVN 2.1.0

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