1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3 ;;; Test intrinsics for communication register
6 ;;; We test LCR, SCR, TSCR, and FIDCR instructions.
8 ; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
9 define i64 @lcr_sss(i64 noundef %0, i64 noundef %1) {
10 ; CHECK-LABEL: lcr_sss:
12 ; CHECK-NEXT: lcr %s0, %s0, %s1
13 ; CHECK-NEXT: b.l.t (, %s10)
14 %3 = tail call i64 @llvm.ve.vl.lcr.sss(i64 %0, i64 %1)
18 ; Function Attrs: nofree nosync nounwind readnone
19 declare i64 @llvm.ve.vl.lcr.sss(i64, i64)
21 ; Function Attrs: nounwind
22 define void @scr_sss(i64 noundef %0, i64 noundef %1, i64 noundef %2) {
23 ; CHECK-LABEL: scr_sss:
25 ; CHECK-NEXT: scr %s0, %s1, %s2
26 ; CHECK-NEXT: b.l.t (, %s10)
27 tail call void @llvm.ve.vl.scr.sss(i64 %0, i64 %1, i64 %2)
31 ; Function Attrs: nounwind
32 declare void @llvm.ve.vl.scr.sss(i64, i64, i64)
34 ; Function Attrs: nounwind
35 define i64 @tscr_ssss(i64 noundef %0, i64 noundef %1, i64 noundef %2) {
36 ; CHECK-LABEL: tscr_ssss:
38 ; CHECK-NEXT: tscr %s0, %s1, %s2
39 ; CHECK-NEXT: b.l.t (, %s10)
40 %4 = tail call i64 @llvm.ve.vl.tscr.ssss(i64 %0, i64 %1, i64 %2)
44 ; Function Attrs: nounwind
45 declare i64 @llvm.ve.vl.tscr.ssss(i64, i64, i64)
47 ; Function Attrs: nounwind
48 define i64 @fidcr_ss0(i64 noundef %0) {
49 ; CHECK-LABEL: fidcr_ss0:
51 ; CHECK-NEXT: fidcr %s0, %s0, 0
52 ; CHECK-NEXT: b.l.t (, %s10)
53 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 0)
57 ; Function Attrs: nounwind
58 declare i64 @llvm.ve.vl.fidcr.sss(i64, i32)
60 ; Function Attrs: nounwind
61 define i64 @fidcr_ss1(i64 noundef %0) {
62 ; CHECK-LABEL: fidcr_ss1:
64 ; CHECK-NEXT: fidcr %s0, %s0, 1
65 ; CHECK-NEXT: b.l.t (, %s10)
66 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 1)
70 ; Function Attrs: nounwind
71 define i64 @fidcr_ss2(i64 noundef %0) {
72 ; CHECK-LABEL: fidcr_ss2:
74 ; CHECK-NEXT: fidcr %s0, %s0, 2
75 ; CHECK-NEXT: b.l.t (, %s10)
76 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 2)
80 ; Function Attrs: nounwind
81 define i64 @fidcr_ss3(i64 noundef %0) {
82 ; CHECK-LABEL: fidcr_ss3:
84 ; CHECK-NEXT: fidcr %s0, %s0, 3
85 ; CHECK-NEXT: b.l.t (, %s10)
86 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 3)
90 ; Function Attrs: nounwind
91 define i64 @fidcr_ss4(i64 noundef %0) {
92 ; CHECK-LABEL: fidcr_ss4:
94 ; CHECK-NEXT: fidcr %s0, %s0, 4
95 ; CHECK-NEXT: b.l.t (, %s10)
96 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 4)
100 ; Function Attrs: nounwind
101 define i64 @fidcr_ss5(i64 noundef %0) {
102 ; CHECK-LABEL: fidcr_ss5:
104 ; CHECK-NEXT: fidcr %s0, %s0, 5
105 ; CHECK-NEXT: b.l.t (, %s10)
106 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 5)
110 ; Function Attrs: nounwind
111 define i64 @fidcr_ss6(i64 noundef %0) {
112 ; CHECK-LABEL: fidcr_ss6:
114 ; CHECK-NEXT: fidcr %s0, %s0, 6
115 ; CHECK-NEXT: b.l.t (, %s10)
116 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 6)
120 ; Function Attrs: nounwind
121 define i64 @fidcr_ss7(i64 noundef %0) {
122 ; CHECK-LABEL: fidcr_ss7:
124 ; CHECK-NEXT: fidcr %s0, %s0, 7
125 ; CHECK-NEXT: b.l.t (, %s10)
126 %2 = tail call i64 @llvm.ve.vl.fidcr.sss(i64 %0, i32 7)
130 !2 = !{!"clang version 15.0.0 (git@kaz7.github.com:sx-aurora-dev/llvm-project.git e0c5640dba6e9ba1cd29ed8d59b85c6378e48ac7)"}