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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpsrad-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
static void
9
compute_psrad256 (int *s1, long long int *s2, int *r)
10
{
11
  int i;
12
  long long int count = s2[0];
13
 
14
  memset (r, 0, 32);
15
 
16
  if (count < 32)
17
    for (i = 0; i < 8; ++i)
18
      r[i] = s1[i] >> count;
19
}
20
 
21
 
22
void static
23
avx2_test (void)
24
{
25
  union256i_d s1, res;
26
  union128i_q s2;
27
  int res_ref[8];
28
  int i, j;
29
  int fail = 0;
30
 
31
  for (i = 0; i < 10; i++)
32
    {
33
      for (j = 0; j < 8; j++)
34
        s1.a[j] = j * i;
35
 
36
      s2.a[0] = i;
37
 
38
      res.x = _mm256_sra_epi32 (s1.x, s2.x);
39
 
40
      compute_psrad256 (s1.a, s2.a, res_ref);
41
 
42
      fail += check_union256i_d (res, res_ref);
43
    }
44
 
45
  if (fail != 0)
46
    abort ();
47
}

powered by: WebSVN 2.1.0

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