1 ; Test the MSA ctcmsa and cfcmsa intrinsics (which are encoded with the ELM
4 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 -verify-machineinstrs < %s | FileCheck %s
5 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 -verify-machineinstrs < %s | FileCheck %s
7 define i32 @msa_ir_cfcmsa_test() nounwind {
9 %0 = tail call i32 @llvm.mips.cfcmsa(i32 0)
13 ; CHECK: msa_ir_cfcmsa_test:
14 ; CHECK: cfcmsa $[[R1:[0-9]+]], $0
15 ; CHECK: .size msa_ir_cfcmsa_test
17 define i32 @msa_csr_cfcmsa_test() nounwind {
19 %0 = tail call i32 @llvm.mips.cfcmsa(i32 1)
23 ; CHECK: msa_csr_cfcmsa_test:
24 ; CHECK: cfcmsa $[[R1:[0-9]+]], $1
25 ; CHECK: .size msa_csr_cfcmsa_test
27 define i32 @msa_access_cfcmsa_test() nounwind {
29 %0 = tail call i32 @llvm.mips.cfcmsa(i32 2)
33 ; CHECK: msa_access_cfcmsa_test:
34 ; CHECK: cfcmsa $[[R1:[0-9]+]], $2
35 ; CHECK: .size msa_access_cfcmsa_test
37 define i32 @msa_save_cfcmsa_test() nounwind {
39 %0 = tail call i32 @llvm.mips.cfcmsa(i32 3)
43 ; CHECK: msa_save_cfcmsa_test:
44 ; CHECK: cfcmsa $[[R1:[0-9]+]], $3
45 ; CHECK: .size msa_save_cfcmsa_test
47 define i32 @msa_modify_cfcmsa_test() nounwind {
49 %0 = tail call i32 @llvm.mips.cfcmsa(i32 4)
53 ; CHECK: msa_modify_cfcmsa_test:
54 ; CHECK: cfcmsa $[[R1:[0-9]+]], $4
55 ; CHECK: .size msa_modify_cfcmsa_test
57 define i32 @msa_request_cfcmsa_test() nounwind {
59 %0 = tail call i32 @llvm.mips.cfcmsa(i32 5)
63 ; CHECK: msa_request_cfcmsa_test:
64 ; CHECK: cfcmsa $[[R1:[0-9]+]], $5
65 ; CHECK: .size msa_request_cfcmsa_test
67 define i32 @msa_map_cfcmsa_test() nounwind {
69 %0 = tail call i32 @llvm.mips.cfcmsa(i32 6)
73 ; CHECK: msa_map_cfcmsa_test:
74 ; CHECK: cfcmsa $[[R1:[0-9]+]], $6
75 ; CHECK: .size msa_map_cfcmsa_test
77 define i32 @msa_unmap_cfcmsa_test() nounwind {
79 %0 = tail call i32 @llvm.mips.cfcmsa(i32 7)
83 ; CHECK: msa_unmap_cfcmsa_test:
84 ; CHECK: cfcmsa $[[R1:[0-9]+]], $7
85 ; CHECK: .size msa_unmap_cfcmsa_test
87 define i32 @msa_invalid_reg_cfcmsa_test() nounwind {
89 %0 = tail call i32 @llvm.mips.cfcmsa(i32 8)
93 ; CHECK-LABEL: msa_invalid_reg_cfcmsa_test:
94 ; CHECK: cfcmsa ${{[0-9]+}}, $8
96 define void @msa_ir_ctcmsa_test() nounwind {
98 tail call void @llvm.mips.ctcmsa(i32 0, i32 1)
102 ; CHECK: msa_ir_ctcmsa_test:
104 ; CHECK: .size msa_ir_ctcmsa_test
106 define void @msa_csr_ctcmsa_test() nounwind {
108 tail call void @llvm.mips.ctcmsa(i32 1, i32 1)
112 ; CHECK: msa_csr_ctcmsa_test:
114 ; CHECK: .size msa_csr_ctcmsa_test
116 define void @msa_access_ctcmsa_test() nounwind {
118 tail call void @llvm.mips.ctcmsa(i32 2, i32 1)
122 ; CHECK: msa_access_ctcmsa_test:
124 ; CHECK: .size msa_access_ctcmsa_test
126 define void @msa_save_ctcmsa_test() nounwind {
128 tail call void @llvm.mips.ctcmsa(i32 3, i32 1)
132 ; CHECK: msa_save_ctcmsa_test:
134 ; CHECK: .size msa_save_ctcmsa_test
136 define void @msa_modify_ctcmsa_test() nounwind {
138 tail call void @llvm.mips.ctcmsa(i32 4, i32 1)
142 ; CHECK: msa_modify_ctcmsa_test:
144 ; CHECK: .size msa_modify_ctcmsa_test
146 define void @msa_request_ctcmsa_test() nounwind {
148 tail call void @llvm.mips.ctcmsa(i32 5, i32 1)
152 ; CHECK: msa_request_ctcmsa_test:
154 ; CHECK: .size msa_request_ctcmsa_test
156 define void @msa_map_ctcmsa_test() nounwind {
158 tail call void @llvm.mips.ctcmsa(i32 6, i32 1)
162 ; CHECK: msa_map_ctcmsa_test:
164 ; CHECK: .size msa_map_ctcmsa_test
166 define void @msa_unmap_ctcmsa_test() nounwind {
168 tail call void @llvm.mips.ctcmsa(i32 7, i32 1)
172 ; CHECK: msa_unmap_ctcmsa_test:
174 ; CHECK: .size msa_unmap_ctcmsa_test
176 define void @msa_invalid_reg_ctcmsa_test() nounwind {
178 tail call void @llvm.mips.ctcmsa(i32 8, i32 1)
182 ; CHECK: msa_invalid_reg_ctcmsa_test:
185 declare i32 @llvm.mips.cfcmsa(i32) nounwind
186 declare void @llvm.mips.ctcmsa(i32, i32) nounwind