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.dg/] [vect/] [vect-align-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdlib.h>
4
#include <stdarg.h>
5
#include "tree-vect.h"
6
 
7
/* Compile time known misalignment. Cannot use loop peeling to align
8
   the store.  */
9
 
10
#define N 16
11
 
12
struct foo {
13
  char x;
14
  int y[N];
15
} __attribute__((packed));
16
 
17
int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
18
 
19
__attribute__ ((noinline)) int
20
main1 (struct foo * __restrict__ p)
21
{
22
  int i;
23
 
24
  for (i = 0; i < N; i++)
25
    {
26
      p->y[i] = x[i];
27
    }
28
 
29
  /* check results:  */
30
  for (i = 0; i < N; i++)
31
    {
32
      if (p->y[i] != x[i])
33
        abort ();
34
    }
35
  return 0;
36
}
37
 
38
 
39
int main (void)
40
{
41
  int i;
42
  struct foo *p = malloc (2*sizeof (struct foo));
43
  check_vect ();
44
 
45
  main1 (p);
46
  return 0;
47
}
48
 
49
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
50
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { xfail vect_hw_misalign} } } */
51
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
52
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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