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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpshuflw-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-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_pshufhw256 (short *s1, unsigned char imm, short *r)
12
{
13
  int i;
14
 
15
  for (i = 0; i < 4; i++)
16
    {
17
      r[i] = s1[i];
18
      r[i + 8] = s1[i + 8];
19
    }
20
 
21
  for (i = 4; i < 8; i++)
22
    {
23
      r[i] = s1[((imm >> (2 * (i - 4))) & 3) + 4];
24
      r[i + 8] = s1[((imm >> (2 * (i - 4))) & 3) + 12];
25
    }
26
}
27
 
28
void static
29
avx2_test (void)
30
{
31
  union256i_w s1, res;
32
  short res_ref[16];
33
  int i, j, sign = 1;
34
  int fail = 0;
35
 
36
  for (i = 1; i < 10; i++)
37
    {
38
      for (j = 0; j < 16; j++)
39
        {
40
          s1.a[j] = j * i * sign;
41
          sign = -sign;
42
        }
43
 
44
      res.x = _mm256_shufflehi_epi16 (s1.x, N);
45
      compute_pshufhw256 (s1.a, N, res_ref);
46
 
47
      fail += check_union256i_w (res, res_ref);
48
    }
49
 
50
  if (fail != 0)
51
    abort ();
52
}

powered by: WebSVN 2.1.0

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