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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse-9.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -msse" } */
3
/* { dg-require-effective-target sse } */
4
 
5
#include "sse-check.h"
6
 
7
#include <xmmintrin.h>
8
#include <stddef.h>
9
#include <string.h>
10
 
11
static void
12
sse_test (void)
13
{
14
  int alignment, n;
15
  void *ptr;
16
  int errors = 0;
17
  const char test [] = "This is a test.";
18
 
19
  for (alignment = 1; alignment <= (1 << 20); alignment += alignment)
20
    {
21
      ptr = _mm_malloc (alignment, alignment);
22
      if (((ptrdiff_t) ptr) & (alignment - 1))
23
        abort ();
24
      if (ptr)
25
        {
26
          n = alignment > sizeof test ? sizeof test : alignment;
27
          memcpy (ptr, test, n);
28
          if (memcmp (ptr, test, n) != 0)
29
            errors++;
30
          _mm_free (ptr);
31
        }
32
      else
33
        errors++;
34
    }
35
 
36
  if (errors != 0)
37
    abort ();
38
}

powered by: WebSVN 2.1.0

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