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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpermpd-2.c] - Blame information for rev 848

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-mavx2 -O2" } */
3
/* { dg-require-effective-target avx2 } */
4
 
5
#include "avx2-check.h"
6
#include <string.h>
7
 
8
#define MASK 0x1a
9
 
10
#define NUM 10
11
 
12
static void
13
init_permpd (double *src1, int seed)
14
{
15
  int i, sign = 1;
16
 
17
  for (i = 0; i < 4; i++)
18
    {
19
      src1[i] = (i + seed) * (i + seed) * sign;
20
      sign = -sign;
21
    }
22
}
23
 
24
static void
25
calc_permpd (double *src1, int mask, double *dst)
26
{
27
  int i;
28
  unsigned temp;
29
 
30
  memcpy (dst, src1, 32);
31
  for (i = 0; i < 4; i++)
32
    {
33
      temp = mask >> (i * 2);
34
      dst[i] = src1[temp & 3];
35
    }
36
}
37
 
38
static void
39
avx2_test (void)
40
{
41
  union256d src1, dst;
42
  double dst_ref[4];
43
  int i;
44
 
45
  for (i = 0; i < NUM; i++)
46
    {
47
      init_permpd (src1.a, i);
48
 
49
      dst.x = _mm256_permute4x64_pd (src1.x, MASK);
50
      calc_permpd (src1.a, MASK, dst_ref);
51
 
52
      if (check_union256d (dst, dst_ref))
53
        abort ();
54
    }
55
}

powered by: WebSVN 2.1.0

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