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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpmaddwd-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
#include "ssse3-vals.h"
7
 
8
static void
9
compute_pmaddwd256 (short *i1, short *i2, int *r)
10
{
11
  int i;
12
 
13
  for (i = 0; i < 8; i++)
14
    r[i] = ((int) i1[2 * i] * (int) i2[2 * i] +
15
            (int) i1[2 * i + 1] * (int) i2[2 * i + 1]);
16
}
17
 
18
static void
19
avx2_test (void)
20
{
21
  union256i_w s1, s2;
22
  union256i_d res;
23
  int res_ref[8];
24
  int i;
25
  int fail = 0;
26
 
27
  for (i = 0; i < 256; i += 16)
28
    {
29
      s1.x = _mm256_loadu_si256 ((__m256i *) & vals[i]);
30
      s2.x = _mm256_loadu_si256 ((__m256i *) & vals[i + 8]);
31
 
32
      res.x = _mm256_madd_epi16 (s1.x, s2.x);
33
 
34
      compute_pmaddwd256 (s1.a, s2.a, res_ref);
35
 
36
      fail += check_union256i_d (res, res_ref);
37
    }
38
 
39
  if (fail != 0)
40
    abort ();
41
}

powered by: WebSVN 2.1.0

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