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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse-9.c] - Rev 704

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

/* { dg-do run } */
/* { dg-options "-O2 -msse" } */
/* { dg-require-effective-target sse } */
 
#include "sse-check.h"
 
#include <xmmintrin.h>
#include <stddef.h>
#include <string.h>
 
static void
sse_test (void)
{
  int alignment, n;
  void *ptr;
  int errors = 0;
  const char test [] = "This is a test.";
 
  for (alignment = 1; alignment <= (1 << 20); alignment += alignment)
    {
      ptr = _mm_malloc (alignment, alignment);
      if (((ptrdiff_t) ptr) & (alignment - 1))
	abort ();
      if (ptr)
	{
	  n = alignment > sizeof test ? sizeof test : alignment;
	  memcpy (ptr, test, n);
	  if (memcmp (ptr, test, n) != 0)
	    errors++;
	  _mm_free (ptr);
	}
      else
	errors++;
    }
 
  if (errors != 0)
    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.