1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
6 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
8 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \
9 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
12 ; This test case aims to test the vector mask manipulation operations
15 declare i32 @llvm.ppc.altivec.vextractbm(<16 x i8>)
16 declare i32 @llvm.ppc.altivec.vextracthm(<8 x i16>)
17 declare i32 @llvm.ppc.altivec.vextractwm(<4 x i32>)
18 declare i32 @llvm.ppc.altivec.vextractdm(<2 x i64>)
19 declare i32 @llvm.ppc.altivec.vextractqm(<1 x i128>)
21 define i32 @test_vextractbm(<16 x i8> %a) {
22 ; CHECK-LABEL: test_vextractbm:
23 ; CHECK: # %bb.0: # %entry
24 ; CHECK-NEXT: vextractbm r3, v2
27 %ext = tail call i32 @llvm.ppc.altivec.vextractbm(<16 x i8> %a)
31 define i32 @test_vextracthm(<8 x i16> %a) {
32 ; CHECK-LABEL: test_vextracthm:
33 ; CHECK: # %bb.0: # %entry
34 ; CHECK-NEXT: vextracthm r3, v2
37 %ext = tail call i32 @llvm.ppc.altivec.vextracthm(<8 x i16> %a)
41 define i32 @test_vextractwm(<4 x i32> %a) {
42 ; CHECK-LABEL: test_vextractwm:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: vextractwm r3, v2
47 %ext = tail call i32 @llvm.ppc.altivec.vextractwm(<4 x i32> %a)
51 define i32 @test_vextractdm(<2 x i64> %a) {
52 ; CHECK-LABEL: test_vextractdm:
53 ; CHECK: # %bb.0: # %entry
54 ; CHECK-NEXT: vextractdm r3, v2
57 %ext = tail call i32 @llvm.ppc.altivec.vextractdm(<2 x i64> %a)
61 define i32 @test_vextractqm(<1 x i128> %a) {
62 ; CHECK-LABEL: test_vextractqm:
63 ; CHECK: # %bb.0: # %entry
64 ; CHECK-NEXT: vextractqm r3, v2
67 %ext = tail call i32 @llvm.ppc.altivec.vextractqm(<1 x i128> %a)
71 declare <16 x i8> @llvm.ppc.altivec.vexpandbm(<16 x i8>)
72 declare <8 x i16> @llvm.ppc.altivec.vexpandhm(<8 x i16>)
73 declare <4 x i32> @llvm.ppc.altivec.vexpandwm(<4 x i32>)
74 declare <2 x i64> @llvm.ppc.altivec.vexpanddm(<2 x i64>)
75 declare <1 x i128> @llvm.ppc.altivec.vexpandqm(<1 x i128>)
77 define <16 x i8> @test_vexpandbm(<16 x i8> %a) {
78 ; CHECK-LABEL: test_vexpandbm:
79 ; CHECK: # %bb.0: # %entry
80 ; CHECK-NEXT: vexpandbm v2, v2
83 %exp = tail call <16 x i8> @llvm.ppc.altivec.vexpandbm(<16 x i8> %a)
87 define <8 x i16> @test_vexpandhm(<8 x i16> %a) {
88 ; CHECK-LABEL: test_vexpandhm:
89 ; CHECK: # %bb.0: # %entry
90 ; CHECK-NEXT: vexpandhm v2, v2
93 %exp = tail call <8 x i16> @llvm.ppc.altivec.vexpandhm(<8 x i16> %a)
97 define <4 x i32> @test_vexpandwm(<4 x i32> %a) {
98 ; CHECK-LABEL: test_vexpandwm:
99 ; CHECK: # %bb.0: # %entry
100 ; CHECK-NEXT: vexpandwm v2, v2
103 %exp = tail call <4 x i32> @llvm.ppc.altivec.vexpandwm(<4 x i32> %a)
107 define <2 x i64> @test_vexpanddm(<2 x i64> %a) {
108 ; CHECK-LABEL: test_vexpanddm:
109 ; CHECK: # %bb.0: # %entry
110 ; CHECK-NEXT: vexpanddm v2, v2
113 %exp = tail call <2 x i64> @llvm.ppc.altivec.vexpanddm(<2 x i64> %a)
117 define <1 x i128> @test_vexpandqm(<1 x i128> %a) {
118 ; CHECK-LABEL: test_vexpandqm:
119 ; CHECK: # %bb.0: # %entry
120 ; CHECK-NEXT: vexpandqm v2, v2
123 %exp = tail call <1 x i128> @llvm.ppc.altivec.vexpandqm(<1 x i128> %a)
127 declare i64 @llvm.ppc.altivec.vcntmbb(<16 x i8>, i32)
128 declare i64 @llvm.ppc.altivec.vcntmbh(<8 x i16>, i32)
129 declare i64 @llvm.ppc.altivec.vcntmbw(<4 x i32>, i32)
130 declare i64 @llvm.ppc.altivec.vcntmbd(<2 x i64>, i32)
132 define i64 @test_vcntmbb(<16 x i8> %a) {
133 ; CHECK-LABEL: test_vcntmbb:
134 ; CHECK: # %bb.0: # %entry
135 ; CHECK-NEXT: vcntmbb r3, v2, 1
138 %cnt = tail call i64 @llvm.ppc.altivec.vcntmbb(<16 x i8> %a, i32 1)
142 define i64 @test_vcntmbh(<8 x i16> %a) {
143 ; CHECK-LABEL: test_vcntmbh:
144 ; CHECK: # %bb.0: # %entry
145 ; CHECK-NEXT: vcntmbh r3, v2, 0
148 %cnt = tail call i64 @llvm.ppc.altivec.vcntmbh(<8 x i16> %a, i32 0)
152 define i64 @test_vcntmbw(<4 x i32> %a) {
153 ; CHECK-LABEL: test_vcntmbw:
154 ; CHECK: # %bb.0: # %entry
155 ; CHECK-NEXT: vcntmbw r3, v2, 1
158 %cnt = tail call i64 @llvm.ppc.altivec.vcntmbw(<4 x i32> %a, i32 1)
162 define i64 @test_vcntmbd(<2 x i64> %a) {
163 ; CHECK-LABEL: test_vcntmbd:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: vcntmbd r3, v2, 0
168 %cnt = tail call i64 @llvm.ppc.altivec.vcntmbd(<2 x i64> %a, i32 0)
172 declare <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64)
173 declare <8 x i16> @llvm.ppc.altivec.mtvsrhm(i64)
174 declare <4 x i32> @llvm.ppc.altivec.mtvsrwm(i64)
175 declare <2 x i64> @llvm.ppc.altivec.mtvsrdm(i64)
176 declare <1 x i128> @llvm.ppc.altivec.mtvsrqm(i64)
178 define <16 x i8> @test_mtvsrbm(i64 %a) {
179 ; CHECK-LABEL: test_mtvsrbm:
180 ; CHECK: # %bb.0: # %entry
181 ; CHECK-NEXT: mtvsrbm v2, r3
184 %mv = tail call <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64 %a)
188 define <16 x i8> @test_mtvsrbmi() {
189 ; CHECK-LABEL: test_mtvsrbmi:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: mtvsrbmi v2, 1
194 %mv = tail call <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64 1)
198 define <16 x i8> @test_mtvsrbmi2() {
199 ; CHECK-LABEL: test_mtvsrbmi2:
200 ; CHECK: # %bb.0: # %entry
201 ; CHECK-NEXT: mtvsrbmi v2, 255
204 %mv = tail call <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64 255)
208 define <16 x i8> @test_mtvsrbmi3() {
209 ; CHECK-LABEL: test_mtvsrbmi3:
210 ; CHECK: # %bb.0: # %entry
211 ; CHECK-NEXT: mtvsrbmi v2, 65535
214 %mv = tail call <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64 65535)
218 define <16 x i8> @test_mtvsrbmi4() {
219 ; CHECK-LABEL: test_mtvsrbmi4:
220 ; CHECK: # %bb.0: # %entry
221 ; CHECK-NEXT: mtvsrbmi v2, 0
224 %mv = tail call <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64 65536)
228 define <16 x i8> @test_mtvsrbmi5() {
229 ; CHECK-LABEL: test_mtvsrbmi5:
230 ; CHECK: # %bb.0: # %entry
231 ; CHECK-NEXT: mtvsrbmi v2, 10
234 %mv = tail call <16 x i8> @llvm.ppc.altivec.mtvsrbm(i64 65546)
238 define <8 x i16> @test_mtvsrhm(i64 %a) {
239 ; CHECK-LABEL: test_mtvsrhm:
240 ; CHECK: # %bb.0: # %entry
241 ; CHECK-NEXT: mtvsrhm v2, r3
244 %mv = tail call <8 x i16> @llvm.ppc.altivec.mtvsrhm(i64 %a)
248 define <4 x i32> @test_mtvsrwm(i64 %a) {
249 ; CHECK-LABEL: test_mtvsrwm:
250 ; CHECK: # %bb.0: # %entry
251 ; CHECK-NEXT: mtvsrwm v2, r3
254 %mv = tail call <4 x i32> @llvm.ppc.altivec.mtvsrwm(i64 %a)
258 define <2 x i64> @test_mtvsrdm(i64 %a) {
259 ; CHECK-LABEL: test_mtvsrdm:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: mtvsrdm v2, r3
264 %mv = tail call <2 x i64> @llvm.ppc.altivec.mtvsrdm(i64 %a)
268 define <1 x i128> @test_mtvsrqm(i64 %a) {
269 ; CHECK-LABEL: test_mtvsrqm:
270 ; CHECK: # %bb.0: # %entry
271 ; CHECK-NEXT: mtvsrqm v2, r3
274 %mv = tail call <1 x i128> @llvm.ppc.altivec.mtvsrqm(i64 %a)