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 | \
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-aix \
6 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
9 ; These test cases aim to test the bit manipulation operations on Power10.
11 declare <2 x i64> @llvm.ppc.altivec.vpdepd(<2 x i64>, <2 x i64>)
12 declare <2 x i64> @llvm.ppc.altivec.vpextd(<2 x i64>, <2 x i64>)
13 declare i64 @llvm.ppc.pdepd(i64, i64)
14 declare i64 @llvm.ppc.pextd(i64, i64)
15 declare <2 x i64> @llvm.ppc.altivec.vcfuged(<2 x i64>, <2 x i64>)
16 declare i64 @llvm.ppc.cfuged(i64, i64)
17 declare i64 @llvm.ppc.altivec.vgnb(<1 x i128>, i32)
18 declare <2 x i64> @llvm.ppc.vsx.xxeval(<2 x i64>, <2 x i64>, <2 x i64>, i32)
19 declare <2 x i64> @llvm.ppc.altivec.vclzdm(<2 x i64>, <2 x i64>)
20 declare <2 x i64> @llvm.ppc.altivec.vctzdm(<2 x i64>, <2 x i64>)
21 declare i64 @llvm.ppc.cntlzdm(i64, i64)
22 declare i64 @llvm.ppc.cnttzdm(i64, i64)
24 define <2 x i64> @test_vpdepd(<2 x i64> %a, <2 x i64> %b) {
25 ; CHECK-LABEL: test_vpdepd:
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: vpdepd v2, v2, v3
30 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vpdepd(<2 x i64> %a, <2 x i64> %b)
34 define <2 x i64> @test_vpextd(<2 x i64> %a, <2 x i64> %b) {
35 ; CHECK-LABEL: test_vpextd:
36 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: vpextd v2, v2, v3
40 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vpextd(<2 x i64> %a, <2 x i64> %b)
44 define i64 @test_pdepd(i64 %a, i64 %b) {
45 ; CHECK-LABEL: test_pdepd:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: pdepd r3, r3, r4
50 %tmp = tail call i64 @llvm.ppc.pdepd(i64 %a, i64 %b)
54 define i64 @test_pextd(i64 %a, i64 %b) {
55 ; CHECK-LABEL: test_pextd:
56 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: pextd r3, r3, r4
60 %tmp = tail call i64 @llvm.ppc.pextd(i64 %a, i64 %b)
64 define <2 x i64> @test_vcfuged(<2 x i64> %a, <2 x i64> %b) {
65 ; CHECK-LABEL: test_vcfuged:
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: vcfuged v2, v2, v3
70 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vcfuged(<2 x i64> %a, <2 x i64> %b)
74 define i64 @test_cfuged(i64 %a, i64 %b) {
75 ; CHECK-LABEL: test_cfuged:
76 ; CHECK: # %bb.0: # %entry
77 ; CHECK-NEXT: cfuged r3, r3, r4
80 %tmp = tail call i64 @llvm.ppc.cfuged(i64 %a, i64 %b)
84 define i64 @test_vgnb_1(<1 x i128> %a) {
85 ; CHECK-LABEL: test_vgnb_1:
86 ; CHECK: # %bb.0: # %entry
87 ; CHECK-NEXT: vgnb r3, v2, 2
90 %tmp = tail call i64 @llvm.ppc.altivec.vgnb(<1 x i128> %a, i32 2)
94 define i64 @test_vgnb_2(<1 x i128> %a) {
95 ; CHECK-LABEL: test_vgnb_2:
96 ; CHECK: # %bb.0: # %entry
97 ; CHECK-NEXT: vgnb r3, v2, 7
100 %tmp = tail call i64 @llvm.ppc.altivec.vgnb(<1 x i128> %a, i32 7)
104 define i64 @test_vgnb_3(<1 x i128> %a) {
105 ; CHECK-LABEL: test_vgnb_3:
106 ; CHECK: # %bb.0: # %entry
107 ; CHECK-NEXT: vgnb r3, v2, 5
110 %tmp = tail call i64 @llvm.ppc.altivec.vgnb(<1 x i128> %a, i32 5)
114 define <2 x i64> @test_xxeval(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
115 ; CHECK-LABEL: test_xxeval:
116 ; CHECK: # %bb.0: # %entry
117 ; CHECK-NEXT: xxeval v2, v2, v3, v4, 255
120 %tmp = tail call <2 x i64> @llvm.ppc.vsx.xxeval(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c, i32 255)
124 define <2 x i64> @test_vclzdm(<2 x i64> %a, <2 x i64> %b) {
125 ; CHECK-LABEL: test_vclzdm:
126 ; CHECK: # %bb.0: # %entry
127 ; CHECK-NEXT: vclzdm v2, v2, v3
130 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vclzdm(<2 x i64> %a, <2 x i64> %b)
134 define <2 x i64> @test_vctzdm(<2 x i64> %a, <2 x i64> %b) {
135 ; CHECK-LABEL: test_vctzdm:
136 ; CHECK: # %bb.0: # %entry
137 ; CHECK-NEXT: vctzdm v2, v2, v3
140 %tmp = tail call <2 x i64> @llvm.ppc.altivec.vctzdm(<2 x i64> %a, <2 x i64> %b)
144 define i64 @test_cntlzdm(i64 %a, i64 %b) {
145 ; CHECK-LABEL: test_cntlzdm:
146 ; CHECK: # %bb.0: # %entry
147 ; CHECK-NEXT: cntlzdm r3, r3, r4
150 %tmp = tail call i64 @llvm.ppc.cntlzdm(i64 %a, i64 %b)
154 define i64 @test_cnttzdm(i64 %a, i64 %b) {
155 ; CHECK-LABEL: test_cnttzdm:
156 ; CHECK: # %bb.0: # %entry
157 ; CHECK-NEXT: cnttzdm r3, r3, r4
160 %tmp = tail call i64 @llvm.ppc.cnttzdm(i64 %a, i64 %b)