1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -O0 -mtriple=powerpc64le-unknown-unknown | FileCheck %s
4 ; Function Attrs: nobuiltin nounwind readonly
5 define i8 @popcount128(ptr nocapture nonnull readonly %0) {
6 ; CHECK-LABEL: popcount128:
7 ; CHECK: # %bb.0: # %Entry
9 ; CHECK-NEXT: ld 3, 0(4)
10 ; CHECK-NEXT: ld 4, 8(4)
11 ; CHECK-NEXT: popcntd 4, 4
12 ; CHECK-NEXT: popcntd 3, 3
13 ; CHECK-NEXT: add 3, 3, 4
14 ; CHECK-NEXT: # kill: def $r3 killed $r3 killed $x3
15 ; CHECK-NEXT: clrldi 3, 3, 56
18 %1 = load i128, ptr %0, align 16
19 %2 = tail call i128 @llvm.ctpop.i128(i128 %1)
20 %3 = trunc i128 %2 to i8
24 ; Function Attrs: nounwind readnone speculatable willreturn
25 declare i128 @llvm.ctpop.i128(i128)
27 ; Function Attrs: nobuiltin nounwind readonly
28 define i16 @popcount256(ptr nocapture nonnull readonly %0) {
29 ; CHECK-LABEL: popcount256:
30 ; CHECK: # %bb.0: # %Entry
32 ; CHECK-NEXT: ld 3, 0(6)
33 ; CHECK-NEXT: ld 5, 8(6)
34 ; CHECK-NEXT: ld 4, 16(6)
35 ; CHECK-NEXT: ld 6, 24(6)
36 ; CHECK-NEXT: popcntd 6, 6
37 ; CHECK-NEXT: popcntd 4, 4
38 ; CHECK-NEXT: add 4, 4, 6
39 ; CHECK-NEXT: popcntd 5, 5
40 ; CHECK-NEXT: popcntd 3, 3
41 ; CHECK-NEXT: add 3, 3, 5
42 ; CHECK-NEXT: add 3, 3, 4
43 ; CHECK-NEXT: # kill: def $r3 killed $r3 killed $x3
44 ; CHECK-NEXT: clrldi 3, 3, 48
47 %1 = load i256, ptr %0, align 16
48 %2 = tail call i256 @llvm.ctpop.i256(i256 %1)
49 %3 = trunc i256 %2 to i16
53 ; Function Attrs: nounwind readnone speculatable willreturn
54 declare i256 @llvm.ctpop.i256(i256)
56 define <1 x i128> @popcount1x128(<1 x i128> %0) {
57 ; CHECK-LABEL: popcount1x128:
58 ; CHECK: # %bb.0: # %Entry
59 ; CHECK-NEXT: xxlor 0, 34, 34
60 ; CHECK-NEXT: # kill: def $f0 killed $f0 killed $vsl0
61 ; CHECK-NEXT: mffprd 3, 0
62 ; CHECK-NEXT: popcntd 4, 3
63 ; CHECK-NEXT: xxswapd 0, 34
64 ; CHECK-NEXT: # kill: def $f0 killed $f0 killed $vsl0
65 ; CHECK-NEXT: mffprd 3, 0
66 ; CHECK-NEXT: popcntd 3, 3
67 ; CHECK-NEXT: add 3, 3, 4
68 ; CHECK-NEXT: mtfprd 0, 3
69 ; CHECK-NEXT: fmr 1, 0
71 ; CHECK-NEXT: mtfprd 0, 3
72 ; CHECK-NEXT: # kill: def $vsl0 killed $f0
73 ; CHECK-NEXT: xxmrghd 34, 0, 1
76 %1 = tail call <1 x i128> @llvm.ctpop.v1.i128(<1 x i128> %0)
80 declare <1 x i128> @llvm.ctpop.v1.i128(<1 x i128>)