1 ; Test vector intrinsics added with arch13.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=arch13 | FileCheck %s
5 declare <16 x i8> @llvm.s390.vsld(<16 x i8>, <16 x i8>, i32)
6 declare <16 x i8> @llvm.s390.vsrd(<16 x i8>, <16 x i8>, i32)
8 declare {<16 x i8>, i32} @llvm.s390.vstrsb(<16 x i8>, <16 x i8>, <16 x i8>)
9 declare {<16 x i8>, i32} @llvm.s390.vstrsh(<8 x i16>, <8 x i16>, <16 x i8>)
10 declare {<16 x i8>, i32} @llvm.s390.vstrsf(<4 x i32>, <4 x i32>, <16 x i8>)
11 declare {<16 x i8>, i32} @llvm.s390.vstrszb(<16 x i8>, <16 x i8>, <16 x i8>)
12 declare {<16 x i8>, i32} @llvm.s390.vstrszh(<8 x i16>, <8 x i16>, <16 x i8>)
13 declare {<16 x i8>, i32} @llvm.s390.vstrszf(<4 x i32>, <4 x i32>, <16 x i8>)
16 ; VSLD with the minimum useful value.
17 define <16 x i8> @test_vsld_1(<16 x i8> %a, <16 x i8> %b) {
18 ; CHECK-LABEL: test_vsld_1:
19 ; CHECK: vsld %v24, %v24, %v26, 1
21 %res = call <16 x i8> @llvm.s390.vsld(<16 x i8> %a, <16 x i8> %b, i32 1)
25 ; VSLD with the maximum value.
26 define <16 x i8> @test_vsld_7(<16 x i8> %a, <16 x i8> %b) {
27 ; CHECK-LABEL: test_vsld_7:
28 ; CHECK: vsld %v24, %v24, %v26, 7
30 %res = call <16 x i8> @llvm.s390.vsld(<16 x i8> %a, <16 x i8> %b, i32 7)
34 ; VSRD with the minimum useful value.
35 define <16 x i8> @test_vsrd_1(<16 x i8> %a, <16 x i8> %b) {
36 ; CHECK-LABEL: test_vsrd_1:
37 ; CHECK: vsrd %v24, %v24, %v26, 1
39 %res = call <16 x i8> @llvm.s390.vsrd(<16 x i8> %a, <16 x i8> %b, i32 1)
43 ; VSRD with the maximum value.
44 define <16 x i8> @test_vsrd_7(<16 x i8> %a, <16 x i8> %b) {
45 ; CHECK-LABEL: test_vsrd_7:
46 ; CHECK: vsrd %v24, %v24, %v26, 7
48 %res = call <16 x i8> @llvm.s390.vsrd(<16 x i8> %a, <16 x i8> %b, i32 7)
54 define <16 x i8> @test_vstrsb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,
56 ; CHECK-LABEL: test_vstrsb:
57 ; CHECK: vstrsb %v24, %v24, %v26, %v28, 0
58 ; CHECK: ipm [[REG:%r[0-5]]]
59 ; CHECK: srl [[REG]], 28
60 ; CHECK: st [[REG]], 0(%r2)
62 %call = call {<16 x i8>, i32} @llvm.s390.vstrsb(<16 x i8> %a, <16 x i8> %b,
64 %res = extractvalue {<16 x i8>, i32} %call, 0
65 %cc = extractvalue {<16 x i8>, i32} %call, 1
66 store i32 %cc, i32 *%ccptr
71 define <16 x i8> @test_vstrsh(<8 x i16> %a, <8 x i16> %b, <16 x i8> %c,
73 ; CHECK-LABEL: test_vstrsh:
74 ; CHECK: vstrsh %v24, %v24, %v26, %v28, 0
75 ; CHECK: ipm [[REG:%r[0-5]]]
76 ; CHECK: srl [[REG]], 28
77 ; CHECK: st [[REG]], 0(%r2)
79 %call = call {<16 x i8>, i32} @llvm.s390.vstrsh(<8 x i16> %a, <8 x i16> %b,
81 %res = extractvalue {<16 x i8>, i32} %call, 0
82 %cc = extractvalue {<16 x i8>, i32} %call, 1
83 store i32 %cc, i32 *%ccptr
88 define <16 x i8> @test_vstrsf(<4 x i32> %a, <4 x i32> %b, <16 x i8> %c,
90 ; CHECK-LABEL: test_vstrsf:
91 ; CHECK: vstrsf %v24, %v24, %v26, %v28, 0
92 ; CHECK: ipm [[REG:%r[0-5]]]
93 ; CHECK: srl [[REG]], 28
94 ; CHECK: st [[REG]], 0(%r2)
96 %call = call {<16 x i8>, i32} @llvm.s390.vstrsf(<4 x i32> %a, <4 x i32> %b,
98 %res = extractvalue {<16 x i8>, i32} %call, 0
99 %cc = extractvalue {<16 x i8>, i32} %call, 1
100 store i32 %cc, i32 *%ccptr
105 define <16 x i8> @test_vstrszb(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c,
107 ; CHECK-LABEL: test_vstrszb:
108 ; CHECK: vstrszb %v24, %v24, %v26, %v28
109 ; CHECK: ipm [[REG:%r[0-5]]]
110 ; CHECK: srl [[REG]], 28
111 ; CHECK: st [[REG]], 0(%r2)
113 %call = call {<16 x i8>, i32} @llvm.s390.vstrszb(<16 x i8> %a, <16 x i8> %b,
115 %res = extractvalue {<16 x i8>, i32} %call, 0
116 %cc = extractvalue {<16 x i8>, i32} %call, 1
117 store i32 %cc, i32 *%ccptr
122 define <16 x i8> @test_vstrszh(<8 x i16> %a, <8 x i16> %b, <16 x i8> %c,
124 ; CHECK-LABEL: test_vstrszh:
125 ; CHECK: vstrszh %v24, %v24, %v26, %v28
126 ; CHECK: ipm [[REG:%r[0-5]]]
127 ; CHECK: srl [[REG]], 28
128 ; CHECK: st [[REG]], 0(%r2)
130 %call = call {<16 x i8>, i32} @llvm.s390.vstrszh(<8 x i16> %a, <8 x i16> %b,
132 %res = extractvalue {<16 x i8>, i32} %call, 0
133 %cc = extractvalue {<16 x i8>, i32} %call, 1
134 store i32 %cc, i32 *%ccptr
139 define <16 x i8> @test_vstrszf(<4 x i32> %a, <4 x i32> %b, <16 x i8> %c,
141 ; CHECK-LABEL: test_vstrszf:
142 ; CHECK: vstrszf %v24, %v24, %v26, %v28
143 ; CHECK: ipm [[REG:%r[0-5]]]
144 ; CHECK: srl [[REG]], 28
145 ; CHECK: st [[REG]], 0(%r2)
147 %call = call {<16 x i8>, i32} @llvm.s390.vstrszf(<4 x i32> %a, <4 x i32> %b,
149 %res = extractvalue {<16 x i8>, i32} %call, 0
150 %cc = extractvalue {<16 x i8>, i32} %call, 1
151 store i32 %cc, i32 *%ccptr