1 ; RUN: llc -march=xcore < %s | FileCheck %s
3 declare i32 @llvm.xcore.int.p1(ptr addrspace(1) %r)
4 declare i32 @llvm.xcore.inct.p1(ptr addrspace(1) %r)
5 declare i32 @llvm.xcore.testct.p1(ptr addrspace(1) %r)
6 declare i32 @llvm.xcore.testwct.p1(ptr addrspace(1) %r)
7 declare i32 @llvm.xcore.getts.p1(ptr addrspace(1) %r)
8 declare void @llvm.xcore.outt.p1(ptr addrspace(1) %r, i32 %value)
9 declare void @llvm.xcore.outct.p1(ptr addrspace(1) %r, i32 %value)
10 declare void @llvm.xcore.chkct.p1(ptr addrspace(1) %r, i32 %value)
11 declare void @llvm.xcore.setpt.p1(ptr addrspace(1) %r, i32 %value)
13 define i32 @int(ptr addrspace(1) %r) nounwind {
15 ; CHECK: int r0, res[r0]
17 %result = call i32 @llvm.xcore.int.p1(ptr addrspace(1) %r)
18 %trunc = and i32 %result, 255
22 define i32 @inct(ptr addrspace(1) %r) nounwind {
24 ; CHECK: inct r0, res[r0]
26 %result = call i32 @llvm.xcore.inct.p1(ptr addrspace(1) %r)
27 %trunc = and i32 %result, 255
31 define i32 @testct(ptr addrspace(1) %r) nounwind {
32 ; CHECK-LABEL: testct:
33 ; CHECK: testct r0, res[r0]
35 %result = call i32 @llvm.xcore.testct.p1(ptr addrspace(1) %r)
36 %trunc = and i32 %result, 1
40 define i32 @testwct(ptr addrspace(1) %r) nounwind {
41 ; CHECK-LABEL: testwct:
42 ; CHECK: testwct r0, res[r0]
44 %result = call i32 @llvm.xcore.testwct.p1(ptr addrspace(1) %r)
45 %trunc = and i32 %result, 7
49 define i32 @getts(ptr addrspace(1) %r) nounwind {
51 ; CHECK: getts r0, res[r0]
53 %result = call i32 @llvm.xcore.getts.p1(ptr addrspace(1) %r)
54 %trunc = and i32 %result, 65535
58 define void @outt(ptr addrspace(1) %r, i32 %value) nounwind {
61 ; CHECK: outt res[r0], r1
63 %trunc = and i32 %value, 255
64 call void @llvm.xcore.outt.p1(ptr addrspace(1) %r, i32 %trunc)
68 define void @outct(ptr addrspace(1) %r, i32 %value) nounwind {
71 ; CHECK: outct res[r0], r1
72 %trunc = and i32 %value, 255
73 call void @llvm.xcore.outct.p1(ptr addrspace(1) %r, i32 %trunc)
77 define void @chkct(ptr addrspace(1) %r, i32 %value) nounwind {
80 ; CHECK: chkct res[r0], r1
81 %trunc = and i32 %value, 255
82 call void @llvm.xcore.chkct.p1(ptr addrspace(1) %r, i32 %trunc)
86 define void @setpt(ptr addrspace(1) %r, i32 %value) nounwind {
89 ; CHECK: setpt res[r0], r1
90 %trunc = and i32 %value, 65535
91 call void @llvm.xcore.setpt.p1(ptr addrspace(1) %r, i32 %trunc)