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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target avx2 } */
3
/* { dg-options "-O2 -mavx2" } */
4
 
5
#include <string.h>
6
#include "avx2-check.h"
7
 
8
#define N 0xec
9
 
10
static void
11
compute_pshufd256 (int *s1, unsigned char imm, int *r)
12
{
13
  int i;
14
 
15
  for (i = 0; i < 4; i++)
16
    r[i] = s1[((N & (0x3 << (2 * i))) >> (2 * i))];
17
 
18
  for (i = 0; i < 4; i++)
19
    r[i + 4] = s1[((N & (0x3 << (2 * i))) >> (2 * i)) + 4];
20
}
21
 
22
void static
23
avx2_test (void)
24
{
25
  union256i_d s1, res;
26
  int res_ref[8];
27
  int i, j, sign = 1;
28
  int fail = 0;
29
 
30
  for (i = 0; i < 10; i++)
31
    {
32
      for (j = 0; j < 8; j++)
33
        {
34
          s1.a[j] = j * i * sign;
35
          sign = -sign;
36
        }
37
 
38
      res.x = _mm256_shuffle_epi32 (s1.x, N);
39
      compute_pshufd256 (s1.a, N, res_ref);
40
 
41
      fail += check_union256i_d (res, res_ref);
42
    }
43
 
44
  if (fail != 0)
45
    abort ();
46
}

powered by: WebSVN 2.1.0

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