1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 2
2 ; RUN: opt -S -vector-library=ArmPL -replace-with-veclib < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
7 ; The replace-with-veclib pass does not work with scalable types, thus
8 ; the mappings aren't utilised. Tests will need to be regenerated when the
12 declare <2 x double> @llvm.cos.v2f64(<2 x double>)
13 declare <4 x float> @llvm.cos.v4f32(<4 x float>)
14 declare <vscale x 2 x double> @llvm.cos.nxv2f64(<vscale x 2 x double>)
15 declare <vscale x 4 x float> @llvm.cos.nxv4f32(<vscale x 4 x float>)
18 ; CHECK: @llvm.compiler.used = appending global [36 x ptr] [ptr @armpl_vcosq_f64, ptr @armpl_vcosq_f32, ptr @armpl_svcos_f64_x, ptr @armpl_svcos_f32_x, ptr @armpl_vexpq_f64, ptr @armpl_vexpq_f32, ptr @armpl_svexp_f64_x, ptr @armpl_svexp_f32_x, ptr @armpl_vexp10q_f64, ptr @armpl_vexp10q_f32, ptr @armpl_svexp10_f64_x, ptr @armpl_svexp10_f32_x, ptr @armpl_vexp2q_f64, ptr @armpl_vexp2q_f32, ptr @armpl_svexp2_f64_x, ptr @armpl_svexp2_f32_x, ptr @armpl_vlogq_f64, ptr @armpl_vlogq_f32, ptr @armpl_svlog_f64_x, ptr @armpl_svlog_f32_x, ptr @armpl_vlog10q_f64, ptr @armpl_vlog10q_f32, ptr @armpl_svlog10_f64_x, ptr @armpl_svlog10_f32_x, ptr @armpl_vlog2q_f64, ptr @armpl_vlog2q_f32, ptr @armpl_svlog2_f64_x, ptr @armpl_svlog2_f32_x, ptr @armpl_vsinq_f64, ptr @armpl_vsinq_f32, ptr @armpl_svsin_f64_x, ptr @armpl_svsin_f32_x, ptr @armpl_vfmodq_f64, ptr @armpl_vfmodq_f32, ptr @armpl_svfmod_f64_x, ptr @armpl_svfmod_f32_x], section "llvm.metadata"
20 define <2 x double> @llvm_cos_f64(<2 x double> %in) {
21 ; CHECK-LABEL: define <2 x double> @llvm_cos_f64
22 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
23 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vcosq_f64(<2 x double> [[IN]])
24 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
26 %1 = call fast <2 x double> @llvm.cos.v2f64(<2 x double> %in)
30 define <4 x float> @llvm_cos_f32(<4 x float> %in) {
31 ; CHECK-LABEL: define <4 x float> @llvm_cos_f32
32 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
33 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vcosq_f32(<4 x float> [[IN]])
34 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
36 %1 = call fast <4 x float> @llvm.cos.v4f32(<4 x float> %in)
40 define <vscale x 2 x double> @llvm_cos_vscale_f64(<vscale x 2 x double> %in) #0 {
41 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_cos_vscale_f64
42 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1:[0-9]+]] {
43 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svcos_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
44 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
46 %1 = call fast <vscale x 2 x double> @llvm.cos.nxv2f64(<vscale x 2 x double> %in)
47 ret <vscale x 2 x double> %1
50 define <vscale x 4 x float> @llvm_cos_vscale_f32(<vscale x 4 x float> %in) #0 {
51 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_cos_vscale_f32
52 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
53 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svcos_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
54 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
56 %1 = call fast <vscale x 4 x float> @llvm.cos.nxv4f32(<vscale x 4 x float> %in)
57 ret <vscale x 4 x float> %1
60 declare <2 x double> @llvm.exp.v2f64(<2 x double>)
61 declare <4 x float> @llvm.exp.v4f32(<4 x float>)
62 declare <vscale x 2 x double> @llvm.exp.nxv2f64(<vscale x 2 x double>)
63 declare <vscale x 4 x float> @llvm.exp.nxv4f32(<vscale x 4 x float>)
65 define <2 x double> @llvm_exp_f64(<2 x double> %in) {
66 ; CHECK-LABEL: define <2 x double> @llvm_exp_f64
67 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
68 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vexpq_f64(<2 x double> [[IN]])
69 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
71 %1 = call fast <2 x double> @llvm.exp.v2f64(<2 x double> %in)
75 define <4 x float> @llvm_exp_f32(<4 x float> %in) {
76 ; CHECK-LABEL: define <4 x float> @llvm_exp_f32
77 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
78 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vexpq_f32(<4 x float> [[IN]])
79 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
81 %1 = call fast <4 x float> @llvm.exp.v4f32(<4 x float> %in)
85 define <vscale x 2 x double> @llvm_exp_vscale_f64(<vscale x 2 x double> %in) #0 {
86 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_exp_vscale_f64
87 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
88 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svexp_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
89 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
91 %1 = call fast <vscale x 2 x double> @llvm.exp.nxv2f64(<vscale x 2 x double> %in)
92 ret <vscale x 2 x double> %1
95 define <vscale x 4 x float> @llvm_exp_vscale_f32(<vscale x 4 x float> %in) #0 {
96 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_exp_vscale_f32
97 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
98 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svexp_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
99 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
101 %1 = call fast <vscale x 4 x float> @llvm.exp.nxv4f32(<vscale x 4 x float> %in)
102 ret <vscale x 4 x float> %1
105 declare <2 x double> @llvm.exp10.v2f64(<2 x double>)
106 declare <4 x float> @llvm.exp10.v4f32(<4 x float>)
107 declare <vscale x 2 x double> @llvm.exp10.nxv2f64(<vscale x 2 x double>)
108 declare <vscale x 4 x float> @llvm.exp10.nxv4f32(<vscale x 4 x float>)
110 define <2 x double> @llvm_exp10_f64(<2 x double> %in) {
111 ; CHECK-LABEL: define <2 x double> @llvm_exp10_f64
112 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
113 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vexp10q_f64(<2 x double> [[IN]])
114 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
116 %1 = call fast <2 x double> @llvm.exp10.v2f64(<2 x double> %in)
120 define <4 x float> @llvm_exp10_f32(<4 x float> %in) {
121 ; CHECK-LABEL: define <4 x float> @llvm_exp10_f32
122 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
123 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vexp10q_f32(<4 x float> [[IN]])
124 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
126 %1 = call fast <4 x float> @llvm.exp10.v4f32(<4 x float> %in)
130 define <vscale x 2 x double> @llvm_exp10_vscale_f64(<vscale x 2 x double> %in) #0 {
131 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_exp10_vscale_f64
132 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
133 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svexp10_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
134 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
136 %1 = call fast <vscale x 2 x double> @llvm.exp10.nxv2f64(<vscale x 2 x double> %in)
137 ret <vscale x 2 x double> %1
140 define <vscale x 4 x float> @llvm_exp10_vscale_f32(<vscale x 4 x float> %in) #0 {
141 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_exp10_vscale_f32
142 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
143 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svexp10_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
144 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
146 %1 = call fast <vscale x 4 x float> @llvm.exp10.nxv4f32(<vscale x 4 x float> %in)
147 ret <vscale x 4 x float> %1
150 declare <2 x double> @llvm.exp2.v2f64(<2 x double>)
151 declare <4 x float> @llvm.exp2.v4f32(<4 x float>)
152 declare <vscale x 2 x double> @llvm.exp2.nxv2f64(<vscale x 2 x double>)
153 declare <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float>)
155 define <2 x double> @llvm_exp2_f64(<2 x double> %in) {
156 ; CHECK-LABEL: define <2 x double> @llvm_exp2_f64
157 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
158 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vexp2q_f64(<2 x double> [[IN]])
159 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
161 %1 = call fast <2 x double> @llvm.exp2.v2f64(<2 x double> %in)
165 define <4 x float> @llvm_exp2_f32(<4 x float> %in) {
166 ; CHECK-LABEL: define <4 x float> @llvm_exp2_f32
167 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
168 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vexp2q_f32(<4 x float> [[IN]])
169 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
171 %1 = call fast <4 x float> @llvm.exp2.v4f32(<4 x float> %in)
175 define <vscale x 2 x double> @llvm_exp2_vscale_f64(<vscale x 2 x double> %in) #0 {
176 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_exp2_vscale_f64
177 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
178 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svexp2_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
179 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
181 %1 = call fast <vscale x 2 x double> @llvm.exp2.nxv2f64(<vscale x 2 x double> %in)
182 ret <vscale x 2 x double> %1
185 define <vscale x 4 x float> @llvm_exp2_vscale_f32(<vscale x 4 x float> %in) #0 {
186 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_exp2_vscale_f32
187 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
188 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svexp2_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
189 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
191 %1 = call fast <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float> %in)
192 ret <vscale x 4 x float> %1
195 declare <2 x double> @llvm.log.v2f64(<2 x double>)
196 declare <4 x float> @llvm.log.v4f32(<4 x float>)
197 declare <vscale x 2 x double> @llvm.log.nxv2f64(<vscale x 2 x double>)
198 declare <vscale x 4 x float> @llvm.log.nxv4f32(<vscale x 4 x float>)
200 define <2 x double> @llvm_log_f64(<2 x double> %in) {
201 ; CHECK-LABEL: define <2 x double> @llvm_log_f64
202 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
203 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vlogq_f64(<2 x double> [[IN]])
204 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
206 %1 = call fast <2 x double> @llvm.log.v2f64(<2 x double> %in)
210 define <4 x float> @llvm_log_f32(<4 x float> %in) {
211 ; CHECK-LABEL: define <4 x float> @llvm_log_f32
212 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
213 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vlogq_f32(<4 x float> [[IN]])
214 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
216 %1 = call fast <4 x float> @llvm.log.v4f32(<4 x float> %in)
220 define <vscale x 2 x double> @llvm_log_vscale_f64(<vscale x 2 x double> %in) #0 {
221 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_log_vscale_f64
222 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
223 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svlog_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
224 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
226 %1 = call fast <vscale x 2 x double> @llvm.log.nxv2f64(<vscale x 2 x double> %in)
227 ret <vscale x 2 x double> %1
230 define <vscale x 4 x float> @llvm_log_vscale_f32(<vscale x 4 x float> %in) #0 {
231 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_log_vscale_f32
232 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
233 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svlog_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
234 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
236 %1 = call fast <vscale x 4 x float> @llvm.log.nxv4f32(<vscale x 4 x float> %in)
237 ret <vscale x 4 x float> %1
240 declare <2 x double> @llvm.log10.v2f64(<2 x double>)
241 declare <4 x float> @llvm.log10.v4f32(<4 x float>)
242 declare <vscale x 2 x double> @llvm.log10.nxv2f64(<vscale x 2 x double>)
243 declare <vscale x 4 x float> @llvm.log10.nxv4f32(<vscale x 4 x float>)
245 define <2 x double> @llvm_log10_f64(<2 x double> %in) {
246 ; CHECK-LABEL: define <2 x double> @llvm_log10_f64
247 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
248 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vlog10q_f64(<2 x double> [[IN]])
249 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
251 %1 = call fast <2 x double> @llvm.log10.v2f64(<2 x double> %in)
255 define <4 x float> @llvm_log10_f32(<4 x float> %in) {
256 ; CHECK-LABEL: define <4 x float> @llvm_log10_f32
257 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
258 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vlog10q_f32(<4 x float> [[IN]])
259 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
261 %1 = call fast <4 x float> @llvm.log10.v4f32(<4 x float> %in)
265 define <vscale x 2 x double> @llvm_log10_vscale_f64(<vscale x 2 x double> %in) #0 {
266 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_log10_vscale_f64
267 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
268 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svlog10_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
269 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
271 %1 = call fast <vscale x 2 x double> @llvm.log10.nxv2f64(<vscale x 2 x double> %in)
272 ret <vscale x 2 x double> %1
275 define <vscale x 4 x float> @llvm_log10_vscale_f32(<vscale x 4 x float> %in) #0 {
276 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_log10_vscale_f32
277 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
278 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svlog10_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
279 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
281 %1 = call fast <vscale x 4 x float> @llvm.log10.nxv4f32(<vscale x 4 x float> %in)
282 ret <vscale x 4 x float> %1
285 declare <2 x double> @llvm.log2.v2f64(<2 x double>)
286 declare <4 x float> @llvm.log2.v4f32(<4 x float>)
287 declare <vscale x 2 x double> @llvm.log2.nxv2f64(<vscale x 2 x double>)
288 declare <vscale x 4 x float> @llvm.log2.nxv4f32(<vscale x 4 x float>)
290 define <2 x double> @llvm_log2_f64(<2 x double> %in) {
291 ; CHECK-LABEL: define <2 x double> @llvm_log2_f64
292 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
293 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vlog2q_f64(<2 x double> [[IN]])
294 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
296 %1 = call fast <2 x double> @llvm.log2.v2f64(<2 x double> %in)
300 define <4 x float> @llvm_log2_f32(<4 x float> %in) {
301 ; CHECK-LABEL: define <4 x float> @llvm_log2_f32
302 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
303 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vlog2q_f32(<4 x float> [[IN]])
304 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
306 %1 = call fast <4 x float> @llvm.log2.v4f32(<4 x float> %in)
310 define <vscale x 2 x double> @llvm_log2_vscale_f64(<vscale x 2 x double> %in) #0 {
311 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_log2_vscale_f64
312 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
313 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svlog2_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
314 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
316 %1 = call fast <vscale x 2 x double> @llvm.log2.nxv2f64(<vscale x 2 x double> %in)
317 ret <vscale x 2 x double> %1
320 define <vscale x 4 x float> @llvm_log2_vscale_f32(<vscale x 4 x float> %in) #0 {
321 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_log2_vscale_f32
322 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
323 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svlog2_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
324 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
326 %1 = call fast <vscale x 4 x float> @llvm.log2.nxv4f32(<vscale x 4 x float> %in)
327 ret <vscale x 4 x float> %1
330 declare <2 x double> @llvm.pow.v2f64(<2 x double>, <2 x double>)
331 declare <4 x float> @llvm.pow.v4f32(<4 x float>, <4 x float>)
332 declare <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
333 declare <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
336 ; There is a bug in the replace-with-veclib pass, and for intrinsics which take
337 ; more than one arguments, but has just one overloaded type, it incorrectly
338 ; reconstructs the scalar name, for pow specifically it is searching for:
339 ; llvm.pow.f64.f64 and llvm.pow.f32.f32
342 define <2 x double> @llvm_pow_f64(<2 x double> %in, <2 x double> %power) {
343 ; CHECK-LABEL: define <2 x double> @llvm_pow_f64
344 ; CHECK-SAME: (<2 x double> [[IN:%.*]], <2 x double> [[POWER:%.*]]) {
345 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @llvm.pow.v2f64(<2 x double> [[IN]], <2 x double> [[POWER]])
346 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
348 %1 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %in, <2 x double> %power)
352 define <4 x float> @llvm_pow_f32(<4 x float> %in, <4 x float> %power) {
353 ; CHECK-LABEL: define <4 x float> @llvm_pow_f32
354 ; CHECK-SAME: (<4 x float> [[IN:%.*]], <4 x float> [[POWER:%.*]]) {
355 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @llvm.pow.v4f32(<4 x float> [[IN]], <4 x float> [[POWER]])
356 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
358 %1 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %in, <4 x float> %power)
362 define <vscale x 2 x double> @llvm_pow_vscale_f64(<vscale x 2 x double> %in, <vscale x 2 x double> %power) #0 {
363 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_pow_vscale_f64
364 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]], <vscale x 2 x double> [[POWER:%.*]]) #[[ATTR1]] {
365 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> [[IN]], <vscale x 2 x double> [[POWER]])
366 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
368 %1 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %in, <vscale x 2 x double> %power)
369 ret <vscale x 2 x double> %1
372 define <vscale x 4 x float> @llvm_pow_vscale_f32(<vscale x 4 x float> %in, <vscale x 4 x float> %power) #0 {
373 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_pow_vscale_f32
374 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]], <vscale x 4 x float> [[POWER:%.*]]) #[[ATTR1]] {
375 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> [[IN]], <vscale x 4 x float> [[POWER]])
376 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
378 %1 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %in, <vscale x 4 x float> %power)
379 ret <vscale x 4 x float> %1
382 declare <2 x double> @llvm.sin.v2f64(<2 x double>)
383 declare <4 x float> @llvm.sin.v4f32(<4 x float>)
384 declare <vscale x 2 x double> @llvm.sin.nxv2f64(<vscale x 2 x double>)
385 declare <vscale x 4 x float> @llvm.sin.nxv4f32(<vscale x 4 x float>)
387 define <2 x double> @llvm_sin_f64(<2 x double> %in) {
388 ; CHECK-LABEL: define <2 x double> @llvm_sin_f64
389 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
390 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <2 x double> @armpl_vsinq_f64(<2 x double> [[IN]])
391 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
393 %1 = call fast <2 x double> @llvm.sin.v2f64(<2 x double> %in)
397 define <4 x float> @llvm_sin_f32(<4 x float> %in) {
398 ; CHECK-LABEL: define <4 x float> @llvm_sin_f32
399 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
400 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <4 x float> @armpl_vsinq_f32(<4 x float> [[IN]])
401 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
403 %1 = call fast <4 x float> @llvm.sin.v4f32(<4 x float> %in)
407 define <vscale x 2 x double> @llvm_sin_vscale_f64(<vscale x 2 x double> %in) #0 {
408 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_sin_vscale_f64
409 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
410 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svsin_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
411 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
413 %1 = call fast <vscale x 2 x double> @llvm.sin.nxv2f64(<vscale x 2 x double> %in)
414 ret <vscale x 2 x double> %1
417 define <vscale x 4 x float> @llvm_sin_vscale_f32(<vscale x 4 x float> %in) #0 {
418 ; CHECK-LABEL: define <vscale x 4 x float> @llvm_sin_vscale_f32
419 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
420 ; CHECK-NEXT: [[TMP1:%.*]] = call fast <vscale x 4 x float> @armpl_svsin_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
421 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
423 %1 = call fast <vscale x 4 x float> @llvm.sin.nxv4f32(<vscale x 4 x float> %in)
424 ret <vscale x 4 x float> %1
428 define <2 x double> @frem_f64(<2 x double> %in) {
429 ; CHECK-LABEL: define <2 x double> @frem_f64
430 ; CHECK-SAME: (<2 x double> [[IN:%.*]]) {
431 ; CHECK-NEXT: [[TMP1:%.*]] = call <2 x double> @armpl_vfmodq_f64(<2 x double> [[IN]], <2 x double> [[IN]])
432 ; CHECK-NEXT: ret <2 x double> [[TMP1]]
434 %1= frem <2 x double> %in, %in
438 define <4 x float> @frem_f32(<4 x float> %in) {
439 ; CHECK-LABEL: define <4 x float> @frem_f32
440 ; CHECK-SAME: (<4 x float> [[IN:%.*]]) {
441 ; CHECK-NEXT: [[TMP1:%.*]] = call <4 x float> @armpl_vfmodq_f32(<4 x float> [[IN]], <4 x float> [[IN]])
442 ; CHECK-NEXT: ret <4 x float> [[TMP1]]
444 %1= frem <4 x float> %in, %in
448 define <vscale x 2 x double> @frem_vscale_f64(<vscale x 2 x double> %in) #0 {
449 ; CHECK-LABEL: define <vscale x 2 x double> @frem_vscale_f64
450 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1]] {
451 ; CHECK-NEXT: [[TMP1:%.*]] = call <vscale x 2 x double> @armpl_svfmod_f64_x(<vscale x 2 x double> [[IN]], <vscale x 2 x double> [[IN]], <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer))
452 ; CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
454 %1= frem <vscale x 2 x double> %in, %in
455 ret <vscale x 2 x double> %1
458 define <vscale x 4 x float> @frem_vscale_f32(<vscale x 4 x float> %in) #0 {
459 ; CHECK-LABEL: define <vscale x 4 x float> @frem_vscale_f32
460 ; CHECK-SAME: (<vscale x 4 x float> [[IN:%.*]]) #[[ATTR1]] {
461 ; CHECK-NEXT: [[TMP1:%.*]] = call <vscale x 4 x float> @armpl_svfmod_f32_x(<vscale x 4 x float> [[IN]], <vscale x 4 x float> [[IN]], <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
462 ; CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
464 %1= frem <vscale x 4 x float> %in, %in
465 ret <vscale x 4 x float> %1
468 attributes #0 = { "target-features"="+sve" }
470 ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
471 ; CHECK: attributes #[[ATTR1]] = { "target-features"="+sve" }