xref: /llvm-project/llvm/test/CodeGen/PowerPC/p10-string-ops.ll (revision 079757b551f3ab5218af7344a7ab3c79976ec478)
1cc95635bSAmy Kwan; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2cc95635bSAmy Kwan; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3cc95635bSAmy Kwan; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
4cc95635bSAmy Kwan; RUN:   FileCheck %s
5*079757b5SAmy Kwan; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
6*079757b5SAmy Kwan; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
7*079757b5SAmy Kwan; RUN:   FileCheck %s
8cc95635bSAmy Kwan
9cc95635bSAmy Kwan; These test cases aim to test the vector string isolate builtins on Power10.
10cc95635bSAmy Kwan
11cc95635bSAmy Kwandeclare <16 x i8> @llvm.ppc.altivec.vclrlb(<16 x i8>, i32)
12cc95635bSAmy Kwandeclare <16 x i8> @llvm.ppc.altivec.vclrrb(<16 x i8>, i32)
13cc95635bSAmy Kwan
14cc95635bSAmy Kwandefine <16 x i8> @test_vclrlb(<16 x i8> %a, i32 %n) {
15cc95635bSAmy Kwan; CHECK-LABEL: test_vclrlb:
16cc95635bSAmy Kwan; CHECK:       # %bb.0: # %entry
17cc95635bSAmy Kwan; CHECK-NEXT:    vclrlb v2, v2, r5
18cc95635bSAmy Kwan; CHECK-NEXT:    blr
19cc95635bSAmy Kwanentry:
20cc95635bSAmy Kwan  %tmp = tail call <16 x i8> @llvm.ppc.altivec.vclrlb(<16 x i8> %a, i32 %n)
21cc95635bSAmy Kwan  ret <16 x i8> %tmp
22cc95635bSAmy Kwan}
23cc95635bSAmy Kwan
24cc95635bSAmy Kwandefine <16 x i8> @test_vclrrb(<16 x i8> %a, i32 %n) {
25cc95635bSAmy Kwan; CHECK-LABEL: test_vclrrb:
26cc95635bSAmy Kwan; CHECK:       # %bb.0: # %entry
27cc95635bSAmy Kwan; CHECK-NEXT:    vclrrb v2, v2, r5
28cc95635bSAmy Kwan; CHECK-NEXT:    blr
29cc95635bSAmy Kwanentry:
30cc95635bSAmy Kwan  %tmp = tail call <16 x i8> @llvm.ppc.altivec.vclrrb(<16 x i8> %a, i32 %n)
31cc95635bSAmy Kwan  ret <16 x i8> %tmp
32cc95635bSAmy Kwan}
33*079757b5SAmy Kwan
34*079757b5SAmy Kwandeclare <16 x i8> @llvm.ppc.altivec.vstribr(<16 x i8>)
35*079757b5SAmy Kwandeclare <16 x i8> @llvm.ppc.altivec.vstribl(<16 x i8>)
36*079757b5SAmy Kwandeclare <8 x i16> @llvm.ppc.altivec.vstrihr(<8 x i16>)
37*079757b5SAmy Kwandeclare <8 x i16> @llvm.ppc.altivec.vstrihl(<8 x i16>)
38*079757b5SAmy Kwan
39*079757b5SAmy Kwandeclare i32 @llvm.ppc.altivec.vstribr.p(i32, <16 x i8>)
40*079757b5SAmy Kwandeclare i32 @llvm.ppc.altivec.vstribl.p(i32, <16 x i8>)
41*079757b5SAmy Kwandeclare i32 @llvm.ppc.altivec.vstrihr.p(i32, <8 x i16>)
42*079757b5SAmy Kwandeclare i32 @llvm.ppc.altivec.vstrihl.p(i32, <8 x i16>)
43*079757b5SAmy Kwan
44*079757b5SAmy Kwandefine <16 x i8> @test_vstribr(<16 x i8> %a) {
45*079757b5SAmy Kwan; CHECK-LABEL: test_vstribr:
46*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
47*079757b5SAmy Kwan; CHECK-NEXT:    vstribr v2, v2
48*079757b5SAmy Kwan; CHECK-NEXT:    blr
49*079757b5SAmy Kwanentry:
50*079757b5SAmy Kwan  %tmp = tail call <16 x i8> @llvm.ppc.altivec.vstribr(<16 x i8> %a)
51*079757b5SAmy Kwan  ret <16 x i8> %tmp
52*079757b5SAmy Kwan}
53*079757b5SAmy Kwan
54*079757b5SAmy Kwandefine <16 x i8> @test_vstribl(<16 x i8> %a) {
55*079757b5SAmy Kwan; CHECK-LABEL: test_vstribl:
56*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
57*079757b5SAmy Kwan; CHECK-NEXT:    vstribl v2, v2
58*079757b5SAmy Kwan; CHECK-NEXT:    blr
59*079757b5SAmy Kwanentry:
60*079757b5SAmy Kwan  %tmp = tail call <16 x i8> @llvm.ppc.altivec.vstribl(<16 x i8>%a)
61*079757b5SAmy Kwan  ret <16 x i8> %tmp
62*079757b5SAmy Kwan}
63*079757b5SAmy Kwan
64*079757b5SAmy Kwandefine <8 x i16> @test_vstrihr(<8 x i16> %a) {
65*079757b5SAmy Kwan; CHECK-LABEL: test_vstrihr:
66*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
67*079757b5SAmy Kwan; CHECK-NEXT:    vstrihr v2, v2
68*079757b5SAmy Kwan; CHECK-NEXT:    blr
69*079757b5SAmy Kwanentry:
70*079757b5SAmy Kwan  %tmp = tail call <8 x i16> @llvm.ppc.altivec.vstrihr(<8 x i16> %a)
71*079757b5SAmy Kwan  ret <8 x i16> %tmp
72*079757b5SAmy Kwan}
73*079757b5SAmy Kwan
74*079757b5SAmy Kwandefine <8 x i16> @test_vstrihl(<8 x i16> %a) {
75*079757b5SAmy Kwan; CHECK-LABEL: test_vstrihl:
76*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
77*079757b5SAmy Kwan; CHECK-NEXT:    vstrihl v2, v2
78*079757b5SAmy Kwan; CHECK-NEXT:    blr
79*079757b5SAmy Kwanentry:
80*079757b5SAmy Kwan  %tmp = tail call <8 x i16> @llvm.ppc.altivec.vstrihl(<8 x i16> %a)
81*079757b5SAmy Kwan  ret <8 x i16> %tmp
82*079757b5SAmy Kwan}
83*079757b5SAmy Kwan
84*079757b5SAmy Kwandefine i32 @test_vstribr_p(<16 x i8> %a) {
85*079757b5SAmy Kwan; CHECK-LABEL: test_vstribr_p:
86*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
87*079757b5SAmy Kwan; CHECK-NEXT:    vstribr. v2, v2
88*079757b5SAmy Kwan; CHECK-NEXT:    setbc r3, 4*cr6+eq
89*079757b5SAmy Kwan; CHECK-NEXT:    blr
90*079757b5SAmy Kwanentry:
91*079757b5SAmy Kwan  %tmp = tail call i32 @llvm.ppc.altivec.vstribr.p(i32 1, <16 x i8> %a)
92*079757b5SAmy Kwan  ret i32 %tmp
93*079757b5SAmy Kwan}
94*079757b5SAmy Kwan
95*079757b5SAmy Kwandefine i32 @test_vstribl_p(<16 x i8> %a) {
96*079757b5SAmy Kwan; CHECK-LABEL: test_vstribl_p:
97*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
98*079757b5SAmy Kwan; CHECK-NEXT:    vstribl. v2, v2
99*079757b5SAmy Kwan; CHECK-NEXT:    setbc r3, 4*cr6+eq
100*079757b5SAmy Kwan; CHECK-NEXT:    blr
101*079757b5SAmy Kwanentry:
102*079757b5SAmy Kwan  %tmp = tail call i32 @llvm.ppc.altivec.vstribl.p(i32 1, <16 x i8> %a)
103*079757b5SAmy Kwan  ret i32 %tmp
104*079757b5SAmy Kwan}
105*079757b5SAmy Kwan
106*079757b5SAmy Kwandefine i32 @test_vstrihr_p(<8 x i16> %a) {
107*079757b5SAmy Kwan; CHECK-LABEL: test_vstrihr_p:
108*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
109*079757b5SAmy Kwan; CHECK-NEXT:    vstrihr. v2, v2
110*079757b5SAmy Kwan; CHECK-NEXT:    setbc r3, 4*cr6+eq
111*079757b5SAmy Kwan; CHECK-NEXT:    blr
112*079757b5SAmy Kwanentry:
113*079757b5SAmy Kwan  %tmp = tail call i32 @llvm.ppc.altivec.vstrihr.p(i32 1, <8 x i16> %a)
114*079757b5SAmy Kwan  ret i32 %tmp
115*079757b5SAmy Kwan}
116*079757b5SAmy Kwan
117*079757b5SAmy Kwandefine i32 @test_vstrihl_p(<8 x i16> %a) {
118*079757b5SAmy Kwan; CHECK-LABEL: test_vstrihl_p:
119*079757b5SAmy Kwan; CHECK:       # %bb.0: # %entry
120*079757b5SAmy Kwan; CHECK-NEXT:    vstrihl. v2, v2
121*079757b5SAmy Kwan; CHECK-NEXT:    setbc r3, 4*cr6+eq
122*079757b5SAmy Kwan; CHECK-NEXT:    blr
123*079757b5SAmy Kwanentry:
124*079757b5SAmy Kwan  %tmp = tail call i32 @llvm.ppc.altivec.vstrihl.p(i32 1, <8 x i16> %a)
125*079757b5SAmy Kwan  ret i32 %tmp
126*079757b5SAmy Kwan}
127