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 -ppc-vsr-nums-as-vr < %s | \
6 ; These test cases aim to test the bit manipulation operations on Power10.
8 declare <2 x i64> @llvm.ppc.altivec.vpdepd(<2 x i64>, <2 x i64>)
9 declare <2 x i64> @llvm.ppc.altivec.vpextd(<2 x i64>, <2 x i64>)
10 declare i64 @llvm.ppc.pdepd(i64, i64)
11 declare i64 @llvm.ppc.pextd(i64, i64)
12 declare <2 x i64> @llvm.ppc.altivec.vcfuged(<2 x i64>, <2 x i64>)
13 declare i64 @llvm.ppc.cfuged(i64, i64)
14 declare i64 @llvm.ppc.altivec.vgnb(<1 x i128>, i32)
15 declare <2 x i64> @llvm.ppc.vsx.xxeval(<2 x i64>, <2 x i64>, <2 x i64>, i32)
16 declare <2 x i64> @llvm.ppc.altivec.vclzdm(<2 x i64>, <2 x i64>)
17 declare <2 x i64> @llvm.ppc.altivec.vctzdm(<2 x i64>, <2 x i64>)
18 declare i64 @llvm.ppc.cntlzdm(i64, i64)
19 declare i64 @llvm.ppc.cnttzdm(i64, i64)
21 define <2 x i64> @test_vpdepd(<2 x i64> %a, <2 x i64> %b) {
22 ; CHECK-LABEL: test_vpdepd:
23 ; CHECK: # %bb.0: # %entry
24 ; CHECK-NEXT: vpdepd v2, v2, v3
27 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vpdepd(<2 x i64> %a, <2 x i64> %b)
31 define <2 x i64> @test_vpextd(<2 x i64> %a, <2 x i64> %b) {
32 ; CHECK-LABEL: test_vpextd:
33 ; CHECK: # %bb.0: # %entry
34 ; CHECK-NEXT: vpextd v2, v2, v3
37 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vpextd(<2 x i64> %a, <2 x i64> %b)
41 define i64 @test_pdepd(i64 %a, i64 %b) {
42 ; CHECK-LABEL: test_pdepd:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: pdepd r3, r3, r4
47 %tmp = tail call i64 @llvm.ppc.pdepd(i64 %a, i64 %b)
51 define i64 @test_pextd(i64 %a, i64 %b) {
52 ; CHECK-LABEL: test_pextd:
53 ; CHECK: # %bb.0: # %entry
54 ; CHECK-NEXT: pextd r3, r3, r4
57 %tmp = tail call i64 @llvm.ppc.pextd(i64 %a, i64 %b)
61 define <2 x i64> @test_vcfuged(<2 x i64> %a, <2 x i64> %b) {
62 ; CHECK-LABEL: test_vcfuged:
63 ; CHECK: # %bb.0: # %entry
64 ; CHECK-NEXT: vcfuged v2, v2, v3
67 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vcfuged(<2 x i64> %a, <2 x i64> %b)
71 define i64 @test_cfuged(i64 %a, i64 %b) {
72 ; CHECK-LABEL: test_cfuged:
73 ; CHECK: # %bb.0: # %entry
74 ; CHECK-NEXT: cfuged r3, r3, r4
77 %tmp = tail call i64 @llvm.ppc.cfuged(i64 %a, i64 %b)
81 define i64 @test_vgnb_1(<1 x i128> %a) {
82 ; CHECK-LABEL: test_vgnb_1:
83 ; CHECK: # %bb.0: # %entry
84 ; CHECK-NEXT: vgnb r3, v2, 2
87 %tmp = tail call i64 @llvm.ppc.altivec.vgnb(<1 x i128> %a, i32 2)
91 define i64 @test_vgnb_2(<1 x i128> %a) {
92 ; CHECK-LABEL: test_vgnb_2:
93 ; CHECK: # %bb.0: # %entry
94 ; CHECK-NEXT: vgnb r3, v2, 7
97 %tmp = tail call i64 @llvm.ppc.altivec.vgnb(<1 x i128> %a, i32 7)
101 define i64 @test_vgnb_3(<1 x i128> %a) {
102 ; CHECK-LABEL: test_vgnb_3:
103 ; CHECK: # %bb.0: # %entry
104 ; CHECK-NEXT: vgnb r3, v2, 5
107 %tmp = tail call i64 @llvm.ppc.altivec.vgnb(<1 x i128> %a, i32 5)
111 define <2 x i64> @test_xxeval(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
112 ; CHECK-LABEL: test_xxeval:
113 ; CHECK: # %bb.0: # %entry
114 ; CHECK-NEXT: xxeval v2, v2, v3, v4, 255
117 %tmp = tail call <2 x i64> @llvm.ppc.vsx.xxeval(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, i32 255)
121 define <2 x i64> @test_vclzdm(<2 x i64> %a, <2 x i64> %b) {
122 ; CHECK-LABEL: test_vclzdm:
123 ; CHECK: # %bb.0: # %entry
124 ; CHECK-NEXT: vclzdm v2, v2, v3
127 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vclzdm(<2 x i64> %a, <2 x i64> %b)
131 define <2 x i64> @test_vctzdm(<2 x i64> %a, <2 x i64> %b) {
132 ; CHECK-LABEL: test_vctzdm:
133 ; CHECK: # %bb.0: # %entry
134 ; CHECK-NEXT: vctzdm v2, v2, v3
137 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vctzdm(<2 x i64> %a, <2 x i64> %b)
141 define i64 @test_cntlzdm(i64 %a, i64 %b) {
142 ; CHECK-LABEL: test_cntlzdm:
143 ; CHECK: # %bb.0: # %entry
144 ; CHECK-NEXT: cntlzdm r3, r3, r4
147 %tmp = tail call i64 @llvm.ppc.cntlzdm(i64 %a, i64 %b)
151 define i64 @test_cnttzdm(i64 %a, i64 %b) {
152 ; CHECK-LABEL: test_cnttzdm:
153 ; CHECK: # %bb.0: # %entry
154 ; CHECK-NEXT: cnttzdm r3, r3, r4
157 %tmp = tail call i64 @llvm.ppc.cnttzdm(i64 %a, i64 %b)