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 \
4 ; RUN: -ppc-vsr-nums-as-vr < %s | FileCheck %s
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
6 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names \
7 ; RUN: -ppc-vsr-nums-as-vr < %s | FileCheck %s --check-prefix=CHECK-P9
9 define dso_local i64 @test_invalid(<16 x i8> %a) local_unnamed_addr #0 {
10 ; CHECK-LABEL: test_invalid:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: bcdsub. v2, v2, v2, 0
13 ; CHECK-NEXT: setbc r3, 4*cr6+un
16 ; CHECK-P9-LABEL: test_invalid:
17 ; CHECK-P9: # %bb.0: # %entry
18 ; CHECK-P9-NEXT: bcdsub. v2, v2, v2, 0
19 ; CHECK-P9-NEXT: mfocrf r3, 2
20 ; CHECK-P9-NEXT: rlwinm r3, r3, 28, 31, 31
23 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 6, <16 x i8> %a, <16 x i8> %a) #2
24 %conv.i = sext i32 %0 to i64
28 define dso_local <16 x i8> @test_add(<16 x i8> %a, <16 x i8> %b, i64 %ps) local_unnamed_addr #0 {
29 ; CHECK-LABEL: test_add:
30 ; CHECK: # %bb.0: # %entry
31 ; CHECK-NEXT: bcdadd. v2, v2, v3, 1
34 ; CHECK-P9-LABEL: test_add:
35 ; CHECK-P9: # %bb.0: # %entry
36 ; CHECK-P9-NEXT: bcdadd. v2, v2, v3, 1
39 %0 = tail call <16 x i8> @llvm.ppc.bcdadd(<16 x i8> %a, <16 x i8> %b, i32 1)
43 define dso_local i64 @test_add_ofl(<16 x i8> %a, <16 x i8> %b, i64 %ps) local_unnamed_addr #0 {
44 ; CHECK-LABEL: test_add_ofl:
45 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: bcdadd. v2, v2, v3, 0
47 ; CHECK-NEXT: setbc r3, 4*cr6+un
50 ; CHECK-P9-LABEL: test_add_ofl:
51 ; CHECK-P9: # %bb.0: # %entry
52 ; CHECK-P9-NEXT: bcdadd. v2, v2, v3, 0
53 ; CHECK-P9-NEXT: mfocrf r3, 2
54 ; CHECK-P9-NEXT: rlwinm r3, r3, 28, 31, 31
57 %0 = tail call i32 @llvm.ppc.bcdadd.p(i32 6, <16 x i8> %a, <16 x i8> %b) #2
58 %conv.i = sext i32 %0 to i64
62 define dso_local <16 x i8> @test_sub(<16 x i8> %a, <16 x i8> %b, i64 %ps) local_unnamed_addr #0 {
63 ; CHECK-LABEL: test_sub:
64 ; CHECK: # %bb.0: # %entry
65 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
68 ; CHECK-P9-LABEL: test_sub:
69 ; CHECK-P9: # %bb.0: # %entry
70 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
73 %0 = tail call <16 x i8> @llvm.ppc.bcdsub(<16 x i8> %a, <16 x i8> %b, i32 0)
77 define dso_local i64 @test_sub_ofl(<16 x i8> %a, <16 x i8> %b, i64 %ps) local_unnamed_addr #0 {
78 ; CHECK-LABEL: test_sub_ofl:
79 ; CHECK: # %bb.0: # %entry
80 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
81 ; CHECK-NEXT: setbc r3, 4*cr6+un
84 ; CHECK-P9-LABEL: test_sub_ofl:
85 ; CHECK-P9: # %bb.0: # %entry
86 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
87 ; CHECK-P9-NEXT: mfocrf r3, 2
88 ; CHECK-P9-NEXT: rlwinm r3, r3, 28, 31, 31
91 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 6, <16 x i8> %a, <16 x i8> %b) #2
92 %conv.i = sext i32 %0 to i64
96 define dso_local i64 @test_cmplt(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
97 ; CHECK-LABEL: test_cmplt:
98 ; CHECK: # %bb.0: # %entry
99 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
100 ; CHECK-NEXT: setbc r3, 4*cr6+lt
103 ; CHECK-P9-LABEL: test_cmplt:
104 ; CHECK-P9: # %bb.0: # %entry
105 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
106 ; CHECK-P9-NEXT: mfocrf r3, 2
107 ; CHECK-P9-NEXT: rlwinm r3, r3, 25, 31, 31
110 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 2, <16 x i8> %a, <16 x i8> %b) #2
111 %conv.i = sext i32 %0 to i64
115 define dso_local i64 @test_cmpgt(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
116 ; CHECK-LABEL: test_cmpgt:
117 ; CHECK: # %bb.0: # %entry
118 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
119 ; CHECK-NEXT: setbc r3, 4*cr6+gt
122 ; CHECK-P9-LABEL: test_cmpgt:
123 ; CHECK-P9: # %bb.0: # %entry
124 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
125 ; CHECK-P9-NEXT: mfocrf r3, 2
126 ; CHECK-P9-NEXT: rlwinm r3, r3, 26, 31, 31
129 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 4, <16 x i8> %a, <16 x i8> %b) #2
130 %conv.i = sext i32 %0 to i64
134 define dso_local i64 @test_cmpeq(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
135 ; CHECK-LABEL: test_cmpeq:
136 ; CHECK: # %bb.0: # %entry
137 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
138 ; CHECK-NEXT: setbc r3, 4*cr6+eq
141 ; CHECK-P9-LABEL: test_cmpeq:
142 ; CHECK-P9: # %bb.0: # %entry
143 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
144 ; CHECK-P9-NEXT: mfocrf r3, 2
145 ; CHECK-P9-NEXT: rlwinm r3, r3, 27, 31, 31
148 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 0, <16 x i8> %a, <16 x i8> %b) #2
149 %conv.i = sext i32 %0 to i64
153 define dso_local i64 @test_cmpge(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
154 ; CHECK-LABEL: test_cmpge:
155 ; CHECK: # %bb.0: # %entry
156 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
157 ; CHECK-NEXT: setbcr r3, 4*cr6+lt
160 ; CHECK-P9-LABEL: test_cmpge:
161 ; CHECK-P9: # %bb.0: # %entry
162 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
163 ; CHECK-P9-NEXT: mfocrf r3, 2
164 ; CHECK-P9-NEXT: rlwinm r3, r3, 25, 31, 31
165 ; CHECK-P9-NEXT: xori r3, r3, 1
168 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 3, <16 x i8> %a, <16 x i8> %b) #2
169 %conv.i = sext i32 %0 to i64
173 define dso_local i64 @test_cmple(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
174 ; CHECK-LABEL: test_cmple:
175 ; CHECK: # %bb.0: # %entry
176 ; CHECK-NEXT: bcdsub. v2, v2, v3, 0
177 ; CHECK-NEXT: setbcr r3, 4*cr6+gt
180 ; CHECK-P9-LABEL: test_cmple:
181 ; CHECK-P9: # %bb.0: # %entry
182 ; CHECK-P9-NEXT: bcdsub. v2, v2, v3, 0
183 ; CHECK-P9-NEXT: mfocrf r3, 2
184 ; CHECK-P9-NEXT: rlwinm r3, r3, 26, 31, 31
185 ; CHECK-P9-NEXT: xori r3, r3, 1
188 %0 = tail call i32 @llvm.ppc.bcdsub.p(i32 5, <16 x i8> %a, <16 x i8> %b) #2
189 %conv.i = sext i32 %0 to i64
193 declare i32 @llvm.ppc.bcdsub.p(i32 immarg, <16 x i8>, <16 x i8>) #1
194 declare i32 @llvm.ppc.bcdadd.p(i32 immarg, <16 x i8>, <16 x i8>) #1
195 declare <16 x i8> @llvm.ppc.bcdadd(<16 x i8>, <16 x i8>, i32 immarg) #1
196 declare <16 x i8> @llvm.ppc.bcdsub(<16 x i8>, <16 x i8>, i32 immarg) #1