1 ; RUN: llc -march=xcore < %s | FileCheck %s
3 declare i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 %type)
4 declare void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r)
5 declare i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r)
6 declare i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
7 declare i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
8 declare void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value)
9 declare void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value)
10 declare void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value)
11 declare void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value)
12 declare i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r)
13 declare i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r)
14 declare void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value)
15 declare void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value)
16 declare i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value)
17 declare i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value)
18 declare void @llvm.xcore.clrpt.p1i8(i8 addrspace(1)* %r)
19 declare void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value)
20 declare i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r)
21 declare void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r)
22 declare void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value)
23 declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
24 declare void @llvm.xcore.setev.p1i8(i8 addrspace(1)* %r, i8* %p)
25 declare void @llvm.xcore.edu.p1i8(i8 addrspace(1)* %r)
26 declare void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r)
27 declare void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
28 declare void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
29 declare void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value)
30 declare i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r)
31 declare i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r)
33 define i8 addrspace(1)* @getr() {
36 %result = call i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 5)
37 ret i8 addrspace(1)* %result
40 define void @freer(i8 addrspace(1)* %r) {
42 ; CHECK: freer res[r0]
43 call void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r)
47 define i32 @in(i8 addrspace(1)* %r) {
49 ; CHECK: in r0, res[r0]
50 %result = call i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r)
54 define i32 @int(i8 addrspace(1)* %r) {
56 ; CHECK: int r0, res[r0]
57 %result = call i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
61 define i32 @inct(i8 addrspace(1)* %r) {
63 ; CHECK: inct r0, res[r0]
64 %result = call i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
68 define void @out(i8 addrspace(1)* %r, i32 %value) {
70 ; CHECK: out res[r0], r1
71 call void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value)
75 define void @outt(i8 addrspace(1)* %r, i32 %value) {
77 ; CHECK: outt res[r0], r1
78 call void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value)
82 define void @outct(i8 addrspace(1)* %r, i32 %value) {
84 ; CHECK: outct res[r0], r1
85 call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value)
89 define void @outcti(i8 addrspace(1)* %r) {
90 ; CHECK-LABEL: outcti:
91 ; CHECK: outct res[r0], 11
92 call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 11)
96 define void @chkct(i8 addrspace(1)* %r, i32 %value) {
98 ; CHECK: chkct res[r0], r1
99 call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value)
103 define void @chkcti(i8 addrspace(1)* %r) {
104 ; CHECK-LABEL: chkcti:
105 ; CHECK: chkct res[r0], 11
106 call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 11)
110 define void @setd(i8 addrspace(1)* %r, i32 %value) {
112 ; CHECK: setd res[r0], r1
113 call void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value)
117 define void @setc(i8 addrspace(1)* %r, i32 %value) {
119 ; CHECK: setc res[r0], r1
120 call void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value)
124 define void @setci(i8 addrspace(1)* %r) {
125 ; CHECK-LABEL: setci:
126 ; CHECK: setc res[r0], 2
127 call void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 2)
131 define i32 @inshr(i32 %value, i8 addrspace(1)* %r) {
132 ; CHECK-LABEL: inshr:
133 ; CHECK: inshr r0, res[r1]
134 %result = call i32 @llvm.xcore.inshr.p1i8(i8 addrspace(1)* %r, i32 %value)
138 define i32 @outshr(i32 %value, i8 addrspace(1)* %r) {
139 ; CHECK-LABEL: outshr:
140 ; CHECK: outshr res[r1], r0
141 %result = call i32 @llvm.xcore.outshr.p1i8(i8 addrspace(1)* %r, i32 %value)
145 define void @clrpt(i8 addrspace(1)* %r) {
146 ; CHECK-LABEL: clrpt:
147 ; CHECK: clrpt res[r0]
148 call void @llvm.xcore.clrpt.p1i8(i8 addrspace(1)* %r)
152 define void @setpt(i8 addrspace(1)* %r, i32 %value) {
153 ; CHECK-LABEL: setpt:
154 ; CHECK: setpt res[r0], r1
155 call void @llvm.xcore.setpt.p1i8(i8 addrspace(1)* %r, i32 %value)
159 define i32 @getts(i8 addrspace(1)* %r) {
160 ; CHECK-LABEL: getts:
161 ; CHECK: getts r0, res[r0]
162 %result = call i32 @llvm.xcore.getts.p1i8(i8 addrspace(1)* %r)
166 define void @syncr(i8 addrspace(1)* %r) {
167 ; CHECK-LABEL: syncr:
168 ; CHECK: syncr res[r0]
169 call void @llvm.xcore.syncr.p1i8(i8 addrspace(1)* %r)
173 define void @settw(i8 addrspace(1)* %r, i32 %value) {
174 ; CHECK-LABEL: settw:
175 ; CHECK: settw res[r0], r1
176 call void @llvm.xcore.settw.p1i8(i8 addrspace(1)* %r, i32 %value)
180 define void @setv(i8 addrspace(1)* %r, i8* %p) {
183 ; CHECK-NEXT: setv res[r0], r11
184 call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
188 define void @setev(i8 addrspace(1)* %r, i8* %p) {
189 ; CHECK-LABEL: setev:
191 ; CHECK-NEXT: setev res[r0], r11
192 call void @llvm.xcore.setev.p1i8(i8 addrspace(1)* %r, i8* %p)
196 define void @edu(i8 addrspace(1)* %r) {
199 call void @llvm.xcore.edu.p1i8(i8 addrspace(1)* %r)
203 define void @eeu(i8 addrspace(1)* %r) {
206 call void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r)
210 define void @setclk(i8 addrspace(1)* %a, i8 addrspace(1)* %b) {
212 ; CHECK: setclk res[r0], r1
213 call void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
217 define void @setrdy(i8 addrspace(1)* %a, i8 addrspace(1)* %b) {
219 ; CHECK: setrdy res[r0], r1
220 call void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
224 define void @setpsc(i8 addrspace(1)* %r, i32 %value) {
226 ; CHECK: setpsc res[r0], r1
227 call void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value)
231 define i32 @peek(i8 addrspace(1)* %r) {
233 ; CHECK: peek r0, res[r0]
234 %result = call i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r)
238 define i32 @endin(i8 addrspace(1)* %r) {
239 ; CHECK-LABEL: endin:
240 ; CHECK: endin r0, res[r0]
241 %result = call i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r)
245 define i32 @testct(i8 addrspace(1)* %r) {
246 ; CHECK-LABEL: testct:
247 ; CHECK: testct r0, res[r0]
248 %result = call i32 @llvm.xcore.testct.p1i8(i8 addrspace(1)* %r)
252 define i32 @testwct(i8 addrspace(1)* %r) {
253 ; CHECK-LABEL: testwct:
254 ; CHECK: testwct r0, res[r0]
255 %result = call i32 @llvm.xcore.testwct.p1i8(i8 addrspace(1)* %r)