[TySan] Don't report globals with incomplete types. (#121922)
[llvm-project.git] / flang / test / Lower / PowerPC / ppc-vec-merge.f90
blob0f950379e8c0f5cc329dcd518936daf31d84b16e
1 ! RUN: %flang_fc1 -flang-experimental-hlfir -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s
2 ! REQUIRES: target=powerpc{{.*}}
4 !------------
5 ! vec_mergeh
6 !------------
8 ! CHECK-LABEL: vec_mergeh_test_i1
9 subroutine vec_mergeh_test_i1(arg1, arg2)
10 vector(integer(1)) :: arg1, arg2, r
11 r = vec_mergeh(arg1, arg2)
13 ! LLVMIR: %[[arg1:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
14 ! LLVMIR: %[[arg2:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
15 ! LLVMIR: %[[r:.*]] = shufflevector <16 x i8> %[[arg1]], <16 x i8> %[[arg2]], <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
16 ! LLVMIR: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
17 end subroutine vec_mergeh_test_i1
19 ! CHECK-LABEL: vec_mergeh_test_i2
20 subroutine vec_mergeh_test_i2(arg1, arg2)
21 vector(integer(2)) :: arg1, arg2, r
22 r = vec_mergeh(arg1, arg2)
24 ! LLVMIR: %[[arg1:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
25 ! LLVMIR: %[[arg2:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
26 ! LLVMIR: %[[r:.*]] = shufflevector <8 x i16> %[[arg1]], <8 x i16> %[[arg2]], <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
27 ! LLVMIR: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
28 end subroutine vec_mergeh_test_i2
30 ! CHECK-LABEL: vec_mergeh_test_i4
31 subroutine vec_mergeh_test_i4(arg1, arg2)
32 vector(integer(4)) :: arg1, arg2, r
33 r = vec_mergeh(arg1, arg2)
35 ! LLVMIR: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
36 ! LLVMIR: %[[arg2:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
37 ! LLVMIR: %[[r:.*]] = shufflevector <4 x i32> %[[arg1]], <4 x i32> %[[arg2]], <4 x i32> <i32 0, i32 4, i32 1, i32 5>
38 ! LLVMIR: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
39 end subroutine vec_mergeh_test_i4
41 ! CHECK-LABEL: vec_mergeh_test_i8
42 subroutine vec_mergeh_test_i8(arg1, arg2)
43 vector(integer(8)) :: arg1, arg2, r
44 r = vec_mergeh(arg1, arg2)
46 ! LLVMIR: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
47 ! LLVMIR: %[[arg2:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
48 ! LLVMIR: %[[r:.*]] = shufflevector <2 x i64> %[[arg1]], <2 x i64> %[[arg2]], <2 x i32> <i32 0, i32 2>
49 ! LLVMIR: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
50 end subroutine vec_mergeh_test_i8
52 ! CHECK-LABEL: vec_mergeh_test_u1
53 subroutine vec_mergeh_test_u1(arg1, arg2)
54 vector(unsigned(1)) :: arg1, arg2, r
55 r = vec_mergeh(arg1, arg2)
57 ! LLVMIR: %[[arg1:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
58 ! LLVMIR: %[[arg2:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
59 ! LLVMIR: %[[r:.*]] = shufflevector <16 x i8> %[[arg1]], <16 x i8> %[[arg2]], <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
60 ! LLVMIR: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
61 end subroutine vec_mergeh_test_u1
63 ! CHECK-LABEL: vec_mergeh_test_u2
64 subroutine vec_mergeh_test_u2(arg1, arg2)
65 vector(unsigned(2)) :: arg1, arg2, r
66 r = vec_mergeh(arg1, arg2)
68 ! LLVMIR: %[[arg1:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
69 ! LLVMIR: %[[arg2:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
70 ! LLVMIR: %[[r:.*]] = shufflevector <8 x i16> %[[arg1]], <8 x i16> %[[arg2]], <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
71 ! LLVMIR: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
72 end subroutine vec_mergeh_test_u2
74 ! CHECK-LABEL: vec_mergeh_test_u4
75 subroutine vec_mergeh_test_u4(arg1, arg2)
76 vector(unsigned(4)) :: arg1, arg2, r
77 r = vec_mergeh(arg1, arg2)
79 ! LLVMIR: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
80 ! LLVMIR: %[[arg2:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
81 ! LLVMIR: %[[r:.*]] = shufflevector <4 x i32> %[[arg1]], <4 x i32> %[[arg2]], <4 x i32> <i32 0, i32 4, i32 1, i32 5>
82 ! LLVMIR: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
83 end subroutine vec_mergeh_test_u4
85 ! CHECK-LABEL: vec_mergeh_test_u8
86 subroutine vec_mergeh_test_u8(arg1, arg2)
87 vector(unsigned(8)) :: arg1, arg2, r
88 r = vec_mergeh(arg1, arg2)
90 ! LLVMIR: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
91 ! LLVMIR: %[[arg2:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
92 ! LLVMIR: %[[r:.*]] = shufflevector <2 x i64> %[[arg1]], <2 x i64> %[[arg2]], <2 x i32> <i32 0, i32 2>
93 ! LLVMIR: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
94 end subroutine vec_mergeh_test_u8
96 ! CHECK-LABEL: vec_mergeh_test_r4
97 subroutine vec_mergeh_test_r4(arg1, arg2)
98 vector(real(4)) :: arg1, arg2, r
99 r = vec_mergeh(arg1, arg2)
101 ! LLVMIR: %[[arg1:.*]] = load <4 x float>, ptr %{{.*}}, align 16
102 ! LLVMIR: %[[arg2:.*]] = load <4 x float>, ptr %{{.*}}, align 16
103 ! LLVMIR: %[[r:.*]] = shufflevector <4 x float> %[[arg1]], <4 x float> %[[arg2]], <4 x i32> <i32 0, i32 4, i32 1, i32 5>
104 ! LLVMIR: store <4 x float> %[[r]], ptr %{{.*}}, align 16
105 end subroutine vec_mergeh_test_r4
107 ! CHECK-LABEL: vec_mergeh_test_r8
108 subroutine vec_mergeh_test_r8(arg1, arg2)
109 vector(real(8)) :: arg1, arg2, r
110 r = vec_mergeh(arg1, arg2)
112 ! LLVMIR: %[[arg1:.*]] = load <2 x double>, ptr %{{.*}}, align 16
113 ! LLVMIR: %[[arg2:.*]] = load <2 x double>, ptr %{{.*}}, align 16
114 ! LLVMIR: %[[r:.*]] = shufflevector <2 x double> %[[arg1]], <2 x double> %[[arg2]], <2 x i32> <i32 0, i32 2>
115 ! LLVMIR: store <2 x double> %[[r]], ptr %{{.*}}, align 16
116 end subroutine vec_mergeh_test_r8
118 !------------
119 ! vec_mergel
120 !------------
122 ! CHECK-LABEL: vec_mergel_test_i1
123 subroutine vec_mergel_test_i1(arg1, arg2)
124 vector(integer(1)) :: arg1, arg2, r
125 r = vec_mergel(arg1, arg2)
127 ! LLVMIR: %[[arg1:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
128 ! LLVMIR: %[[arg2:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
129 ! LLVMIR: %[[r:.*]] = shufflevector <16 x i8> %[[arg1]], <16 x i8> %[[arg2]], <16 x i32> <i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31>
130 ! LLVMIR: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
131 end subroutine vec_mergel_test_i1
133 ! CHECK-LABEL: vec_mergel_test_i2
134 subroutine vec_mergel_test_i2(arg1, arg2)
135 vector(integer(2)) :: arg1, arg2, r
136 r = vec_mergel(arg1, arg2)
138 ! LLVMIR: %[[arg1:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
139 ! LLVMIR: %[[arg2:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
140 ! LLVMIR: %[[r:.*]] = shufflevector <8 x i16> %[[arg1]], <8 x i16> %[[arg2]], <8 x i32> <i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
141 ! LLVMIR: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
142 end subroutine vec_mergel_test_i2
144 ! CHECK-LABEL: vec_mergel_test_i4
145 subroutine vec_mergel_test_i4(arg1, arg2)
146 vector(integer(4)) :: arg1, arg2, r
147 r = vec_mergel(arg1, arg2)
149 ! LLVMIR: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
150 ! LLVMIR: %[[arg2:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
151 ! LLVMIR: %[[r:.*]] = shufflevector <4 x i32> %[[arg1]], <4 x i32> %[[arg2]], <4 x i32> <i32 2, i32 6, i32 3, i32 7>
152 ! LLVMIR: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
153 end subroutine vec_mergel_test_i4
155 ! CHECK-LABEL: vec_mergel_test_i8
156 subroutine vec_mergel_test_i8(arg1, arg2)
157 vector(integer(8)) :: arg1, arg2, r
158 r = vec_mergel(arg1, arg2)
160 ! LLVMIR: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
161 ! LLVMIR: %[[arg2:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
162 ! LLVMIR: %[[r:.*]] = shufflevector <2 x i64> %[[arg1]], <2 x i64> %[[arg2]], <2 x i32> <i32 1, i32 3>
163 ! LLVMIR: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
164 end subroutine vec_mergel_test_i8
166 ! CHECK-LABEL: vec_mergel_test_u1
167 subroutine vec_mergel_test_u1(arg1, arg2)
168 vector(unsigned(1)) :: arg1, arg2, r
169 r = vec_mergel(arg1, arg2)
171 ! LLVMIR: %[[arg1:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
172 ! LLVMIR: %[[arg2:.*]] = load <16 x i8>, ptr %{{.*}}, align 16
173 ! LLVMIR: %[[r:.*]] = shufflevector <16 x i8> %[[arg1]], <16 x i8> %[[arg2]], <16 x i32> <i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31>
174 ! LLVMIR: store <16 x i8> %[[r]], ptr %{{.*}}, align 16
175 end subroutine vec_mergel_test_u1
177 ! CHECK-LABEL: vec_mergel_test_u2
178 subroutine vec_mergel_test_u2(arg1, arg2)
179 vector(unsigned(2)) :: arg1, arg2, r
180 r = vec_mergel(arg1, arg2)
182 ! LLVMIR: %[[arg1:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
183 ! LLVMIR: %[[arg2:.*]] = load <8 x i16>, ptr %{{.*}}, align 16
184 ! LLVMIR: %[[r:.*]] = shufflevector <8 x i16> %[[arg1]], <8 x i16> %[[arg2]], <8 x i32> <i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
185 ! LLVMIR: store <8 x i16> %[[r]], ptr %{{.*}}, align 16
186 end subroutine vec_mergel_test_u2
188 ! CHECK-LABEL: vec_mergel_test_u4
189 subroutine vec_mergel_test_u4(arg1, arg2)
190 vector(unsigned(4)) :: arg1, arg2, r
191 r = vec_mergel(arg1, arg2)
193 ! LLVMIR: %[[arg1:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
194 ! LLVMIR: %[[arg2:.*]] = load <4 x i32>, ptr %{{.*}}, align 16
195 ! LLVMIR: %[[r:.*]] = shufflevector <4 x i32> %[[arg1]], <4 x i32> %[[arg2]], <4 x i32> <i32 2, i32 6, i32 3, i32 7>
196 ! LLVMIR: store <4 x i32> %[[r]], ptr %{{.*}}, align 16
197 end subroutine vec_mergel_test_u4
199 ! CHECK-LABEL: vec_mergel_test_u8
200 subroutine vec_mergel_test_u8(arg1, arg2)
201 vector(unsigned(8)) :: arg1, arg2, r
202 r = vec_mergel(arg1, arg2)
204 ! LLVMIR: %[[arg1:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
205 ! LLVMIR: %[[arg2:.*]] = load <2 x i64>, ptr %{{.*}}, align 16
206 ! LLVMIR: %[[r:.*]] = shufflevector <2 x i64> %[[arg1]], <2 x i64> %[[arg2]], <2 x i32> <i32 1, i32 3>
207 ! LLVMIR: store <2 x i64> %[[r]], ptr %{{.*}}, align 16
208 end subroutine vec_mergel_test_u8
210 ! CHECK-LABEL: vec_mergel_test_r4
211 subroutine vec_mergel_test_r4(arg1, arg2)
212 vector(real(4)) :: arg1, arg2, r
213 r = vec_mergel(arg1, arg2)
215 ! LLVMIR: %[[arg1:.*]] = load <4 x float>, ptr %{{.*}}, align 16
216 ! LLVMIR: %[[arg2:.*]] = load <4 x float>, ptr %{{.*}}, align 16
217 ! LLVMIR: %[[r:.*]] = shufflevector <4 x float> %[[arg1]], <4 x float> %[[arg2]], <4 x i32> <i32 2, i32 6, i32 3, i32 7>
218 ! LLVMIR: store <4 x float> %[[r]], ptr %{{.*}}, align 16
219 end subroutine vec_mergel_test_r4
221 ! CHECK-LABEL: vec_mergel_test_r8
222 subroutine vec_mergel_test_r8(arg1, arg2)
223 vector(real(8)) :: arg1, arg2, r
224 r = vec_mergel(arg1, arg2)
226 ! LLVMIR: %[[arg1:.*]] = load <2 x double>, ptr %{{.*}}, align 16
227 ! LLVMIR: %[[arg2:.*]] = load <2 x double>, ptr %{{.*}}, align 16
228 ! LLVMIR: %[[r:.*]] = shufflevector <2 x double> %[[arg1]], <2 x double> %[[arg2]], <2 x i32> <i32 1, i32 3>
229 ! LLVMIR: store <2 x double> %[[r]], ptr %{{.*}}, align 16
230 end subroutine vec_mergel_test_r8