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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-vpop-check.h] - Rev 695

Go to most recent revision | Compare with Previous | Blame | View Log

#include "avx2-check.h"
 
#define SIZE 256
 
TYPE a[SIZE];
TYPE b[SIZE];
TYPE c[SIZE];
volatile TYPE c_ref[SIZE];
 
__attribute__ ((__noinline__))
void
gen_pop ()
{
  int i;
  for (i = 0; i < SIZE; ++i)
#ifdef BIN_OP
    c[i] = BIN_OP (a[i], b[i]);
#else /*  Must be UN_OP */
    c[i] = UN_OP (a[i]);
#endif /*  BIN_OP */
}
 
void
check_pop ()
{
  int i;
  for (i = 0; i < SIZE; ++i)
#ifdef BIN_OP
    c_ref[i] = BIN_OP (a[i], b[i]);
#else /*  Must be UN_OP */
    c_ref[i] = UN_OP (a[i]);
#endif /*  BIN_OP */
}
 
void static
avx2_test (void)
{
  int i, j;
  for (i = 0; i < 4; ++i )
    {
      for ( j = 0; j < SIZE; ++j )
	{
	  a[i] = i * i + i;
	  b[i] = i * i * i;
	}
 
      gen_pop ();
      check_pop ();
 
      if (memcmp (c, c_ref, SIZE * sizeof (TYPE)))
	abort();
    }
}
 

Go to most recent revision | 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.