1 ; RUN: not llc --mtriple=loongarch32 -mattr=+d < %s 2>&1 | FileCheck %s
3 declare void @llvm.loongarch.cacop.w(i32, i32, i32)
4 declare i32 @llvm.loongarch.crc.w.b.w(i32, i32)
5 declare i32 @llvm.loongarch.crc.w.h.w(i32, i32)
6 declare i32 @llvm.loongarch.crc.w.w.w(i32, i32)
7 declare i32 @llvm.loongarch.crc.w.d.w(i64, i32)
8 declare i32 @llvm.loongarch.crcc.w.b.w(i32, i32)
9 declare i32 @llvm.loongarch.crcc.w.h.w(i32, i32)
10 declare i32 @llvm.loongarch.crcc.w.w.w(i32, i32)
11 declare i32 @llvm.loongarch.crcc.w.d.w(i64, i32)
12 declare i64 @llvm.loongarch.csrrd.d(i32 immarg)
13 declare i64 @llvm.loongarch.csrwr.d(i64, i32 immarg)
14 declare i64 @llvm.loongarch.csrxchg.d(i64, i64, i32 immarg)
15 declare i64 @llvm.loongarch.iocsrrd.d(i32)
16 declare void @llvm.loongarch.iocsrwr.d(i64, i32)
17 declare void @llvm.loongarch.asrtle.d(i64, i64)
18 declare void @llvm.loongarch.asrtgt.d(i64, i64)
19 declare i64 @llvm.loongarch.lddir.d(i64, i64 immarg)
20 declare void @llvm.loongarch.ldpte.d(i64, i64 immarg)
22 define void @cacop_arg0_out_of_hi_range(i32 %a) nounwind {
23 ; CHECK: llvm.loongarch.cacop.w: argument out of range
25 call void @llvm.loongarch.cacop.w(i32 32, i32 %a, i32 1024)
29 define void @cacop_arg0_out_of_lo_range(i32 %a) nounwind {
30 ; CHECK: llvm.loongarch.cacop.w: argument out of range
32 call void @llvm.loongarch.cacop.w(i32 -1, i32 %a, i32 1024)
36 define void @cacop_arg2_out_of_hi_range(i32 %a) nounwind {
37 ; CHECK: llvm.loongarch.cacop.w: argument out of range
39 call void @llvm.loongarch.cacop.w(i32 1, i32 %a, i32 4096)
43 define void @cacop_arg2_out_of_lo_range(i32 %a) nounwind {
44 ; CHECK: llvm.loongarch.cacop.w: argument out of range
46 call void @llvm.loongarch.cacop.w(i32 1, i32 %a, i32 -4096)
50 define i32 @crc_w_b_w(i32 %a, i32 %b) nounwind {
51 ; CHECK: llvm.loongarch.crc.w.b.w: requires loongarch64
53 %res = call i32 @llvm.loongarch.crc.w.b.w(i32 %a, i32 %b)
57 define i32 @crc_w_h_w(i32 %a, i32 %b) nounwind {
58 ; CHECK: llvm.loongarch.crc.w.h.w: requires loongarch64
60 %res = call i32 @llvm.loongarch.crc.w.h.w(i32 %a, i32 %b)
64 define i32 @crc_w_w_w(i32 %a, i32 %b) nounwind {
65 ; CHECK: llvm.loongarch.crc.w.w.w: requires loongarch64
67 %res = call i32 @llvm.loongarch.crc.w.w.w(i32 %a, i32 %b)
71 define i32 @crc_w_d_w(i64 %a, i32 %b) nounwind {
72 ; CHECK: llvm.loongarch.crc.w.d.w: requires loongarch64
74 %res = call i32 @llvm.loongarch.crc.w.d.w(i64 %a, i32 %b)
78 define i32 @crcc_w_b_w(i32 %a, i32 %b) nounwind {
79 ; CHECK: llvm.loongarch.crcc.w.b.w: requires loongarch64
81 %res = call i32 @llvm.loongarch.crcc.w.b.w(i32 %a, i32 %b)
85 define i32 @crcc_w_h_w(i32 %a, i32 %b) nounwind {
86 ; CHECK: llvm.loongarch.crcc.w.h.w: requires loongarch64
88 %res = call i32 @llvm.loongarch.crcc.w.h.w(i32 %a, i32 %b)
92 define i32 @crcc_w_w_w(i32 %a, i32 %b) nounwind {
93 ; CHECK: llvm.loongarch.crcc.w.w.w: requires loongarch64
95 %res = call i32 @llvm.loongarch.crcc.w.w.w(i32 %a, i32 %b)
99 define i32 @crcc_w_d_w(i64 %a, i32 %b) nounwind {
100 ; CHECK: llvm.loongarch.crcc.w.d.w: requires loongarch64
102 %res = call i32 @llvm.loongarch.crcc.w.d.w(i64 %a, i32 %b)
106 define i64 @csrrd_d() {
107 ; CHECK: llvm.loongarch.csrrd.d: requires loongarch64
109 %0 = tail call i64 @llvm.loongarch.csrrd.d(i32 1)
113 define i64 @csrwr_d(i64 %a) {
114 ; CHECK: llvm.loongarch.csrwr.d: requires loongarch64
116 %0 = tail call i64 @llvm.loongarch.csrwr.d(i64 %a, i32 1)
120 define i64 @csrxchg_d(i64 %a, i64 %b) {
121 ; CHECK: llvm.loongarch.csrxchg.d: requires loongarch64
123 %0 = tail call i64 @llvm.loongarch.csrxchg.d(i64 %a, i64 %b, i32 1)
127 define i64 @iocsrrd_d(i32 %a) {
128 ; CHECK: llvm.loongarch.iocsrrd.d: requires loongarch64
130 %0 = tail call i64 @llvm.loongarch.iocsrrd.d(i32 %a)
134 define void @iocsrwr_d(i64 %a, i32 signext %b) {
135 ; CHECK: llvm.loongarch.iocsrwr.d: requires loongarch64
137 tail call void @llvm.loongarch.iocsrwr.d(i64 %a, i32 %b)
141 define void @asrtle_d(i64 %a, i64 %b) {
142 ; CHECK: llvm.loongarch.asrtle.d: requires loongarch64
144 tail call void @llvm.loongarch.asrtle.d(i64 %a, i64 %b)
148 define void @asrtgt_d(i64 %a, i64 %b) {
149 ; CHECK: llvm.loongarch.asrtgt.d: requires loongarch64
151 tail call void @llvm.loongarch.asrtgt.d(i64 %a, i64 %b)
155 define i64 @lddir_d(i64 %a) {
156 ; CHECK: llvm.loongarch.lddir.d: requires loongarch64
158 %0 = tail call i64 @llvm.loongarch.lddir.d(i64 %a, i64 1)
162 define void @ldpte_d(i64 %a) {
163 ; CHECK: llvm.loongarch.ldpte.d: requires loongarch64
165 tail call void @llvm.loongarch.ldpte.d(i64 %a, i64 1)