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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpsrlvq128-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_psrlvq128 (long long int *s1, long long int *s2, long long int *r)
10
{
11
  int i;
12
  long long int count;
13
 
14
  for (i = 0; i < 2; ++i)
15
    {
16
      count = s2[i];
17
      r[i] = ((unsigned long long int) s1[i]) >> count;
18
    }
19
}
20
 
21
void static
22
avx2_test (void)
23
{
24
  union128i_q s1, s2, res;
25
  long long int res_ref[2];
26
  int i, j, sign = 1;
27
  int fail = 0;
28
 
29
  for (i = 0; i < 10; i++)
30
    {
31
      for (j = 0; j < 2; j++)
32
        {
33
          s1.a[j] = j * i * sign;
34
          s2.a[j] = (j + i) >> 2;
35
          sign = -sign;
36
        }
37
 
38
      res.x = _mm_srlv_epi64 (s1.x, s2.x);
39
 
40
      compute_psrlvq128 (s1.a, s2.a, res_ref);
41
 
42
      fail += check_union128i_q (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.