111
|
1 /* { dg-require-effective-target vect_int } */
|
|
2 /* { dg-additional-options "-fno-ipa-icf" } */
|
|
3
|
|
4 #include "tree-vect.h"
|
|
5
|
|
6 #define N 32
|
|
7
|
|
8 __attribute__ ((noinline)) void
|
|
9 foo (unsigned int *__restrict a,
|
|
10 unsigned short *__restrict b,
|
|
11 int n)
|
|
12 {
|
|
13 int i;
|
|
14
|
|
15 for (i = 0; i < n; i++)
|
|
16 a[i] = b[i] * 2333;
|
|
17
|
|
18 for (i = 0; i < n; i++)
|
|
19 if (a[i] != b[i] * 2333)
|
|
20 abort ();
|
|
21 }
|
|
22
|
|
23 __attribute__ ((noinline)) void
|
|
24 bar (unsigned int *__restrict a,
|
|
25 unsigned short *__restrict b,
|
|
26 int n)
|
|
27 {
|
|
28 int i;
|
|
29
|
|
30 for (i = 0; i < n; i++)
|
|
31 a[i] = (unsigned short) 2333 * b[i];
|
|
32
|
|
33 for (i = 0; i < n; i++)
|
|
34 if (a[i] != b[i] * (unsigned short) 2333)
|
|
35 abort ();
|
|
36 }
|
|
37
|
|
38 __attribute__ ((noinline)) void
|
|
39 baz (unsigned int *__restrict a,
|
|
40 unsigned short *__restrict b,
|
|
41 int n)
|
|
42 {
|
|
43 int i;
|
|
44
|
|
45 for (i = 0; i < n; i++)
|
|
46 a[i] = b[i] * 233333333;
|
|
47
|
|
48 for (i = 0; i < n; i++)
|
|
49 if (a[i] != b[i] * 233333333)
|
|
50 abort ();
|
|
51 }
|
|
52
|
|
53
|
|
54 int main (void)
|
|
55 {
|
|
56 int i;
|
|
57 unsigned int a[N];
|
|
58 unsigned short b[N];
|
|
59
|
|
60 check_vect ();
|
|
61
|
|
62 for (i = 0; i < N; i++)
|
|
63 {
|
|
64 a[i] = 0;
|
|
65 b[i] = i;
|
|
66 __asm__ volatile ("");
|
|
67 }
|
|
68
|
|
69 foo (a, b, N);
|
|
70 bar (a, b, N);
|
|
71 baz (a, b, N);
|
|
72 return 0;
|
|
73 }
|
|
74
|
|
75 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { target vect_widen_mult_hi_to_si } } } */
|
131
|
76 /* { dg-final { scan-tree-dump-times {vect_recog_widen_mult_pattern: detected:[^\n]* 2333} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
|
|
77 /* { dg-final { scan-tree-dump-times {widen_mult pattern recognized:[^\n]* = \(int\)} 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
|