Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/vect-93.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-require-effective-target vect_float } */ | |
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */ | |
3 | |
4 #include <stdarg.h> | |
5 #include "tree-vect.h" | |
6 | |
7 #define N 3001 | |
8 | |
9 | |
10 __attribute__ ((noinline)) int | |
11 main1 (float *pa) | |
12 { | |
13 int i; | |
14 | |
15 for (i = 0; i < 3001; i++) | |
16 { | |
17 pa[i] = 2.0; | |
18 } | |
19 | |
20 /* check results: */ | |
21 for (i = 0; i < 3001; i++) | |
22 { | |
23 if (pa[i] != 2.0) | |
24 abort (); | |
25 } | |
26 | |
27 for (i = 1; i <= 10; i++) | |
28 { | |
29 pa[i] = 3.0; | |
30 } | |
31 | |
32 /* check results: */ | |
33 for (i = 1; i <= 10; i++) | |
34 { | |
35 if (pa[i] != 3.0) | |
36 abort (); | |
37 } | |
38 | |
39 return 0; | |
40 } | |
41 | |
42 int main (void) | |
43 { | |
44 int i; | |
45 float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); | |
46 float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); | |
47 | |
48 check_vect (); | |
49 | |
50 /* from bzip2: */ | |
51 for (i=0; i<N; i++) b[i] = i; | |
52 a[0] = 0; | |
53 for (i = 1; i <= 256; i++) a[i] = b[i-1]; | |
54 | |
55 /* check results: */ | |
56 for (i = 1; i <= 256; i++) | |
57 { | |
58 if (a[i] != i-1) | |
59 abort (); | |
60 } | |
61 if (a[0] != 0) | |
62 abort (); | |
63 | |
64 main1 (a); | |
65 | |
66 return 0; | |
67 } | |
68 | |
69 /* 2 loops vectorized in main1, 2 loops vectorized in main: | |
70 the first loop in main requires vectorization of conversions, | |
71 the second loop in main requires vectorization of misaligned load. */ | |
72 | |
73 /* main && main1 together: */ | |
74 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */ | |
75 | |
76 /* in main1: */ | |
77 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */ | |
78 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ | |
79 | |
80 /* in main: */ | |
81 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */ | |
82 |