blob: 5905e1cf00fcf92d3cbcf5d4e97a4c5b4fc63b9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/* { dg-do compile } */
/* { dg-options "-mavx512bw -mavx512dq -O3 -fopenmp-simd -fdump-tree-vect-details" } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 10 "vect" } } */
/* { dg-final { scan-assembler-not "maskmov" } } */
#define LENGTH 1000
long l1[LENGTH], l2[LENGTH];
int i1[LENGTH], i2[LENGTH];
short s1[LENGTH], s2[LENGTH];
char c1[LENGTH], c2[LENGTH];
double d1[LENGTH], d2[LENGTH];
int test1 ()
{
int i;
#pragma omp simd safelen(16)
for (i = 0; i < LENGTH; i++)
if (i1[i] > i2[i])
l1[i] = 1;
}
int test2 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
if (s1[i] > s2[i])
i1[i] = 1;
}
int test3 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
if (c1[i] > c2[i])
s1[i] = 1;
}
int test4 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
if (c1[i] > c2[i])
d1[i] = 1;
}
int test5 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
l1[i] = i1[i] > i2[i] ? 1 : 2;
}
int test6 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
i1[i] = s1[i] > s2[i] ? 1 : 2;
}
int test7 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
s1[i] = c1[i] > c2[i] ? 1 : 2;
}
int test8 (int n)
{
int i;
#pragma omp simd safelen(32)
for (i = 0; i < LENGTH; i++)
d1[i] = c1[i] > c2[i] ? 1 : 2;
}
int test9 (int n)
{
int i;
#pragma omp simd safelen(16)
for (i = 0; i < LENGTH; i++)
if (c1[i] > c2[i] && i1[i] < i2[i])
l1[i] = 1;
}
int test10 (int n)
{
int i;
#pragma omp simd safelen(16)
for (i = 0; i < LENGTH; i++)
if (c1[i] > c2[i] && i1[i] < i2[i])
l1[i] = 1;
else
l1[i] = 2;
}
|