1
; Check the vecpopcnt* instructions that were added in P8
2
; In addition, check the conversions to/from the v2i64 VMX register that was also added in P8.
3
; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
4
; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s
6
declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>) nounwind readnone
7
declare <8 x i16> @llvm.ctpop.v8i16(<8 x i16>) nounwind readnone
8
declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>) nounwind readnone
9
declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>) nounwind readnone
11
define <16 x i8> @test_v16i8_v2i64(<2 x i64> %x) nounwind readnone {
12
%tmp = bitcast <2 x i64> %x to <16 x i8>;
13
%vcnt = tail call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %tmp)
15
; CHECK: @test_v16i8_v2i64
16
; CHECK: vpopcntb 2, 2
20
define <8 x i16> @test_v8i16_v2i64(<2 x i64> %x) nounwind readnone {
21
%tmp = bitcast <2 x i64> %x to <8 x i16>
22
%vcnt = tail call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %tmp)
24
; CHECK: @test_v8i16_v2i64
25
; CHECK: vpopcnth 2, 2
29
define <4 x i32> @test_v4i32_v2i64(<2 x i64> %x) nounwind readnone {
30
%tmp = bitcast <2 x i64> %x to <4 x i32>
31
%vcnt = tail call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %tmp)
33
; CHECK: @test_v4i32_v2i64
34
; CHECK: vpopcntw 2, 2
38
define <2 x i64> @test_v2i64_v2i64(<2 x i64> %x) nounwind readnone {
39
%vcnt = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %x)
41
; CHECK: @test_v2i64_v2i64
42
; CHECK: vpopcntd 2, 2
46
define <2 x i64> @test_v2i64_v4i32(<4 x i32> %x) nounwind readnone {
47
%tmp = bitcast <4 x i32> %x to <2 x i64>
48
%vcnt = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %tmp)
50
; CHECK: @test_v2i64_v4i32
51
; CHECK: vpopcntd 2, 2
56
define <2 x i64> @test_v2i64_v8i16(<8 x i16> %x) nounwind readnone {
57
%tmp = bitcast <8 x i16> %x to <2 x i64>
58
%vcnt = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %tmp)
60
; CHECK: @test_v2i64_v8i16
61
; CHECK: vpopcntd 2, 2
65
define <2 x i64> @test_v2i64_v16i8(<16 x i8> %x) nounwind readnone {
66
%tmp = bitcast <16 x i8> %x to <2 x i64>
67
%vcnt = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %tmp)
69
; CHECK: @test_v2i64_v16i8
70
; CHECK: vpopcntd 2, 2