1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -relocation-model=static -verify-machineinstrs -mcpu=pwr9 \
3 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu \
4 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
5 ; RUN: --check-prefixes=CHECK,CHECK-P9UP
6 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector \
7 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu \
8 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
9 ; RUN: --check-prefixes=CHECK,CHECK-NOINTRIN
10 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx \
11 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu \
12 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
13 ; RUN: --check-prefixes=CHECK,CHECK-NOINTRIN
14 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 \
15 ; RUN: -mtriple=powerpc64-unknown-linux-gnu \
16 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
17 ; RUN: --check-prefixes=CHECK,CHECK-P9UP
18 ; RUN: llc -verify-machineinstrs -mcpu=pwr9 -mattr=-power9-vector \
19 ; RUN: -mtriple=powerpc64-unknown-linux-gnu \
20 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
21 ; RUN: --check-prefixes=CHECK,CHECK-INTRIN
22 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mattr=+vsx \
23 ; RUN: -mtriple=powerpc64-unknown-linux-gnu \
24 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
25 ; RUN: --check-prefixes=CHECK,CHECK-INTRIN
26 ; RUN: llc -verify-machineinstrs -mcpu=pwr10 \
27 ; RUN: -mtriple=powerpc64-unknown-linux-gnu \
28 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
29 ; RUN: --check-prefixes=CHECK,CHECK-P9UP
30 ; RUN: llc -verify-machineinstrs -mcpu=pwr10 \
31 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu \
32 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s \
33 ; RUN: --check-prefixes=CHECK,CHECK-P9UP
35 ; Function Attrs: nounwind readnone
36 define <4 x i32> @test1(ptr %a) {
38 ; CHECK: # %bb.0: # %entry
39 ; CHECK-NEXT: lxvw4x v2, 0, r3
42 %0 = tail call <4 x i32> @llvm.ppc.vsx.lxvw4x.be(ptr %a)
45 ; Function Attrs: nounwind readnone
46 declare <4 x i32> @llvm.ppc.vsx.lxvw4x.be(ptr)
48 ; Function Attrs: nounwind readnone
49 define <2 x double> @test2(ptr %a) {
51 ; CHECK: # %bb.0: # %entry
52 ; CHECK-NEXT: lxvd2x v2, 0, r3
55 %0 = tail call <2 x double> @llvm.ppc.vsx.lxvd2x.be(ptr %a)
58 ; Function Attrs: nounwind readnone
59 declare <2 x double> @llvm.ppc.vsx.lxvd2x.be(ptr)
61 ; Function Attrs: nounwind readnone
62 define void @test3(<4 x i32> %a, ptr %b) {
64 ; CHECK: # %bb.0: # %entry
65 ; CHECK-NEXT: stxvw4x v2, 0, r5
68 tail call void @llvm.ppc.vsx.stxvw4x.be(<4 x i32> %a, ptr %b)
71 ; Function Attrs: nounwind readnone
72 declare void @llvm.ppc.vsx.stxvw4x.be(<4 x i32>, ptr)
74 ; Function Attrs: nounwind readnone
75 define void @test4(<2 x double> %a, ptr %b) {
77 ; CHECK: # %bb.0: # %entry
78 ; CHECK-NEXT: stxvd2x v2, 0, r5
81 tail call void @llvm.ppc.vsx.stxvd2x.be(<2 x double> %a, ptr %b)
84 ; Function Attrs: nounwind readnone
85 declare void @llvm.ppc.vsx.stxvd2x.be(<2 x double>, ptr)
87 define i32 @test_vec_test_swdiv(<2 x double> %a, <2 x double> %b) {
88 ; CHECK-LABEL: test_vec_test_swdiv:
89 ; CHECK: # %bb.0: # %entry
90 ; CHECK-NEXT: xvtdivdp cr0, v2, v3
91 ; CHECK-NEXT: mfocrf r3, 128
92 ; CHECK-NEXT: srwi r3, r3, 28
95 %0 = tail call i32 @llvm.ppc.vsx.xvtdivdp(<2 x double> %a, <2 x double> %b)
98 declare i32 @llvm.ppc.vsx.xvtdivdp(<2 x double>, <2 x double>)
100 define i32 @test_vec_test_swdivs(<4 x float> %a, <4 x float> %b) {
101 ; CHECK-LABEL: test_vec_test_swdivs:
102 ; CHECK: # %bb.0: # %entry
103 ; CHECK-NEXT: xvtdivsp cr0, v2, v3
104 ; CHECK-NEXT: mfocrf r3, 128
105 ; CHECK-NEXT: srwi r3, r3, 28
108 %0 = tail call i32 @llvm.ppc.vsx.xvtdivsp(<4 x float> %a, <4 x float> %b)
111 declare i32 @llvm.ppc.vsx.xvtdivsp(<4 x float>, <4 x float>)
113 define i32 @test_vec_test_swsqrt(<2 x double> %a) {
114 ; CHECK-LABEL: test_vec_test_swsqrt:
115 ; CHECK: # %bb.0: # %entry
116 ; CHECK-NEXT: xvtsqrtdp cr0, v2
117 ; CHECK-NEXT: mfocrf r3, 128
118 ; CHECK-NEXT: srwi r3, r3, 28
121 %0 = tail call i32 @llvm.ppc.vsx.xvtsqrtdp(<2 x double> %a)
124 declare i32 @llvm.ppc.vsx.xvtsqrtdp(<2 x double>)
126 define i32 @test_vec_test_swsqrts(<4 x float> %a) {
127 ; CHECK-LABEL: test_vec_test_swsqrts:
128 ; CHECK: # %bb.0: # %entry
129 ; CHECK-NEXT: xvtsqrtsp cr0, v2
130 ; CHECK-NEXT: mfocrf r3, 128
131 ; CHECK-NEXT: srwi r3, r3, 28
134 %0 = tail call i32 @llvm.ppc.vsx.xvtsqrtsp(<4 x float> %a)
137 declare i32 @llvm.ppc.vsx.xvtsqrtsp(<4 x float>)
139 define i32 @xvtdivdp_andi(<2 x double> %a, <2 x double> %b) {
140 ; CHECK-LABEL: xvtdivdp_andi:
141 ; CHECK: # %bb.0: # %entry
142 ; CHECK-NEXT: xvtdivdp cr0, v2, v3
143 ; CHECK-NEXT: li r4, 222
144 ; CHECK-NEXT: mfocrf r3, 128
145 ; CHECK-NEXT: srwi r3, r3, 28
146 ; CHECK-NEXT: andi. r3, r3, 2
147 ; CHECK-NEXT: li r3, 22
148 ; CHECK-NEXT: iseleq r3, r4, r3
151 %0 = tail call i32 @llvm.ppc.vsx.xvtdivdp(<2 x double> %a, <2 x double> %b)
153 %cmp.not = icmp eq i32 %1, 0
154 %retval.0 = select i1 %cmp.not, i32 222, i32 22
158 define i32 @xvtdivdp_shift(<2 x double> %a, <2 x double> %b) {
159 ; CHECK-LABEL: xvtdivdp_shift:
160 ; CHECK: # %bb.0: # %entry
161 ; CHECK-NEXT: xvtdivdp cr0, v2, v3
162 ; CHECK-NEXT: mfocrf r3, 128
163 ; CHECK-NEXT: srwi r3, r3, 28
164 ; CHECK-NEXT: rlwinm r3, r3, 28, 31, 31
167 %0 = tail call i32 @llvm.ppc.vsx.xvtdivdp(<2 x double> %a, <2 x double> %b)
169 %.lobit = and i32 %1, 1
173 ; Function Attrs: nounwind readnone
174 define <2 x double> @test_lxvd2x(ptr %a) {
175 ; CHECK-P9UP-LABEL: test_lxvd2x:
176 ; CHECK-P9UP: # %bb.0: # %entry
177 ; CHECK-P9UP-NEXT: lxv v2, 0(r3)
178 ; CHECK-P9UP-NEXT: blr
180 ; CHECK-NOINTRIN-LABEL: test_lxvd2x:
181 ; CHECK-NOINTRIN: # %bb.0: # %entry
182 ; CHECK-NOINTRIN-NEXT: lxvd2x vs0, 0, r3
183 ; CHECK-NOINTRIN-NEXT: xxswapd v2, vs0
184 ; CHECK-NOINTRIN-NEXT: blr
186 ; CHECK-INTRIN-LABEL: test_lxvd2x:
187 ; CHECK-INTRIN: # %bb.0: # %entry
188 ; CHECK-INTRIN-NEXT: lxvd2x v2, 0, r3
189 ; CHECK-INTRIN-NEXT: blr
191 %0 = tail call <2 x double> @llvm.ppc.vsx.lxvd2x(ptr %a)
194 ; Function Attrs: nounwind readnone
195 declare <2 x double> @llvm.ppc.vsx.lxvd2x(ptr)
197 ; Function Attrs: nounwind readnone
198 define void @test_stxvd2x(<2 x double> %a, ptr %b) {
199 ; CHECK-P9UP-LABEL: test_stxvd2x:
200 ; CHECK-P9UP: # %bb.0: # %entry
201 ; CHECK-P9UP-NEXT: stxv v2, 0(r5)
202 ; CHECK-P9UP-NEXT: blr
204 ; CHECK-NOINTRIN-LABEL: test_stxvd2x:
205 ; CHECK-NOINTRIN: # %bb.0: # %entry
206 ; CHECK-NOINTRIN-NEXT: xxswapd vs0, v2
207 ; CHECK-NOINTRIN-NEXT: stxvd2x vs0, 0, r5
208 ; CHECK-NOINTRIN-NEXT: blr
210 ; CHECK-INTRIN-LABEL: test_stxvd2x:
211 ; CHECK-INTRIN: # %bb.0: # %entry
212 ; CHECK-INTRIN-NEXT: stxvd2x v2, 0, r5
213 ; CHECK-INTRIN-NEXT: blr
215 tail call void @llvm.ppc.vsx.stxvd2x(<2 x double> %a, ptr %b)
218 ; Function Attrs: nounwind readnone
219 declare void @llvm.ppc.vsx.stxvd2x(<2 x double>, ptr)