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] - Rev 691

Compare with Previous | Blame | View Log

/* { dg-do run } */
/* { dg-require-effective-target avx2 } */
/* { dg-options "-O2 -mavx2" } */
 
#include "ssse3-vals.h"
#include "avx2-check.h"
 
/* Routine to manually compute the results */
static void
compute_pabs256 (int *i1, char *r)
{
  char *b1 = (char *) i1;
  int i;
 
  for (i = 0; i < 32; i++)
    if (b1[i] < 0)
      r[i] = -b1[i];
    else
      r[i] = b1[i];
}
 
static void
avx2_test (void)
{
  int i;
  char ck[32];
  int fail = 0;
 
  union256i_b s, d;
 
  for (i = 0; i < 256; ++i)
    {
      /* Recompute the results for 256-bits */
      compute_pabs256 (&vals[i], ck);
 
      s.x = _mm256_loadu_si256 ((__m256i *) & vals[i]);
 
      /* Run the 256-bit tests */
      d.x = _mm256_abs_epi8 (s.x);
 
      fail += check_union256i_b (d, ck);
    }
 
  if (fail != 0)
    abort ();
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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