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

Subversion Repositories openrisc

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

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
 
7
static void
8
compute_pmuldq256 (int *s1, int *s2, long long int *r)
9
{
10
  int i;
11
 
12
  for (i = 0; i < 4; i++)
13
    r[i] = s1[i * 2] * s2[i * 2];
14
}
15
 
16
static void
17
avx2_test (void)
18
{
19
  union256i_d s1, s2;
20
  union256i_q res;
21
  long long int res_ref[4];
22
  int i, j, sign = 1;
23
  int fail = 0;
24
 
25
  for (i = 0; i < 10; i++)
26
    {
27
      for (j = 0; j < 8; j++)
28
        {
29
          s1.a[j] = i * j * sign;
30
          s2.a[j] = (j + 20) * sign;
31
          sign = -sign;
32
        }
33
 
34
      res.x = _mm256_mul_epi32 (s1.x, s2.x);
35
      compute_pmuldq256 (s1.a, s2.a, res_ref);
36
 
37
      fail += check_union256i_q (res, res_ref);
38
    }
39
 
40
  if (fail != 0)
41
    abort ();
42
}

powered by: WebSVN 2.1.0

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