1 ; RUN: llc -verify-machineinstrs -mtriple=ppc64-- -mattr=+popcntd < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mtriple=ppc64-- -mattr=+slow-popcntd < %s | FileCheck %s --check-prefix=SLOWPC
3 ; RUN: llc -verify-machineinstrs -mtriple=ppc64-- -mcpu=pwr7 < %s | FileCheck %s
5 define i64 @_cntb64(i64 %x) nounwind readnone {
6 %cnt = tail call i64 @llvm.ppc.popcntb(i64 %x)
8 ; CHECK-LABEL: @_cntb64
13 define i32 @_cntb32(i32 %x) nounwind readnone {
14 %y = zext i32 %x to i64
15 %cnt = tail call i64 @llvm.ppc.popcntb(i64 %y)
16 %res = trunc i64 %cnt to i32
18 ; CHECK-LABEL: @_cntb32
23 define i8 @cnt8(i8 %x) nounwind readnone {
24 %cnt = tail call i8 @llvm.ctpop.i8(i8 %x)
35 define i16 @cnt16(i16 %x) nounwind readnone {
36 %cnt = tail call i16 @llvm.ctpop.i16(i16 %x)
43 ; SLOWPC-LABEL: @cnt16
47 define i32 @cnt32(i32 %x) nounwind readnone {
48 %cnt = tail call i32 @llvm.ctpop.i32(i32 %x)
54 ; SLOWPC-LABEL: @cnt32
58 define i64 @cnt64(i64 %x) nounwind readnone {
59 %cnt = tail call i64 @llvm.ctpop.i64(i64 %x)
65 ; SLOWPC-LABEL: @cnt64
69 declare i8 @llvm.ctpop.i8(i8) nounwind readnone
70 declare i16 @llvm.ctpop.i16(i16) nounwind readnone
71 declare i32 @llvm.ctpop.i32(i32) nounwind readnone
72 declare i64 @llvm.ctpop.i64(i64) nounwind readnone
73 declare i64 @llvm.ppc.popcntb(i64) nounwind readnone