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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpabsb256-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-require-effective-target avx2 } */
3
/* { dg-options "-O2 -mavx2" } */
4
 
5
#include "ssse3-vals.h"
6
#include "avx2-check.h"
7
 
8
/* Routine to manually compute the results */
9
static void
10
compute_pabs256 (int *i1, char *r)
11
{
12
  char *b1 = (char *) i1;
13
  int i;
14
 
15
  for (i = 0; i < 32; i++)
16
    if (b1[i] < 0)
17
      r[i] = -b1[i];
18
    else
19
      r[i] = b1[i];
20
}
21
 
22
static void
23
avx2_test (void)
24
{
25
  int i;
26
  char ck[32];
27
  int fail = 0;
28
 
29
  union256i_b s, d;
30
 
31
  for (i = 0; i < 256; ++i)
32
    {
33
      /* Recompute the results for 256-bits */
34
      compute_pabs256 (&vals[i], ck);
35
 
36
      s.x = _mm256_loadu_si256 ((__m256i *) & vals[i]);
37
 
38
      /* Run the 256-bit tests */
39
      d.x = _mm256_abs_epi8 (s.x);
40
 
41
      fail += check_union256i_b (d, ck);
42
    }
43
 
44
  if (fail != 0)
45
    abort ();
46
}

powered by: WebSVN 2.1.0

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