aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/XCore
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2011-02-03 13:14:25 +0000
committerRichard Osborne <richard@xmos.com>2011-02-03 13:14:25 +0000
commit17c1e51d223c8f5ac2446b37495e0aa124dedbe9 (patch)
treef58b81e494e6d633768fb6d6a2f56d2ad4bb4dce /test/CodeGen/XCore
parent76422f3e08fc9cb19128760b8e7f0b87d23da0d9 (diff)
downloadexternal_llvm-17c1e51d223c8f5ac2446b37495e0aa124dedbe9.zip
external_llvm-17c1e51d223c8f5ac2446b37495e0aa124dedbe9.tar.gz
external_llvm-17c1e51d223c8f5ac2446b37495e0aa124dedbe9.tar.bz2
Add XCore intrinsics for resource instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore')
-rw-r--r--test/CodeGen/XCore/resources.ll97
1 files changed, 97 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/resources.ll b/test/CodeGen/XCore/resources.ll
new file mode 100644
index 0000000..878f318
--- /dev/null
+++ b/test/CodeGen/XCore/resources.ll
@@ -0,0 +1,97 @@
+; RUN: llc -march=xcore < %s | FileCheck %s
+
+declare i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 %type)
+declare void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r)
+declare i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r)
+declare i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
+declare i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
+declare void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value)
+declare void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value)
+declare void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value)
+declare void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value)
+declare void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value)
+declare void @llvm.xcore.setc.p1i8(i8 addrspace(1)* %r, i32 %value)
+
+define i8 addrspace(1)* @getr() {
+; CHECK: getr:
+; CHECK: getr r0, 5
+ %result = call i8 addrspace(1)* @llvm.xcore.getr.p1i8(i32 5)
+ ret i8 addrspace(1)* %result
+}
+
+define void @freer(i8 addrspace(1)* %r) {
+; CHECK: freer:
+; CHECK: freer res[r0]
+ call void @llvm.xcore.freer.p1i8(i8 addrspace(1)* %r)
+ ret void
+}
+
+define i32 @in(i8 addrspace(1)* %r) {
+; CHECK: in:
+; CHECK: in r0, res[r0]
+ %result = call i32 @llvm.xcore.in.p1i8(i8 addrspace(1)* %r)
+ ret i32 %result
+}
+
+define i32 @int(i8 addrspace(1)* %r) {
+; CHECK: int:
+; CHECK: int r0, res[r0]
+ %result = call i32 @llvm.xcore.int.p1i8(i8 addrspace(1)* %r)
+ ret i32 %result
+}
+
+define i32 @inct(i8 addrspace(1)* %r) {
+; CHECK: inct:
+; CHECK: inct r0, res[r0]
+ %result = call i32 @llvm.xcore.inct.p1i8(i8 addrspace(1)* %r)
+ ret i32 %result
+}
+
+define void @out(i8 addrspace(1)* %r, i32 %value) {
+; CHECK: out:
+; CHECK: out res[r0], r1
+ call void @llvm.xcore.out.p1i8(i8 addrspace(1)* %r, i32 %value)
+ ret void
+}
+
+define void @outt(i8 addrspace(1)* %r, i32 %value) {
+; CHECK: outt:
+; CHECK: outt res[r0], r1
+ call void @llvm.xcore.outt.p1i8(i8 addrspace(1)* %r, i32 %value)
+ ret void
+}
+
+define void @outct(i8 addrspace(1)* %r, i32 %value) {
+; CHECK: outct:
+; CHECK: outct res[r0], r1
+ call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 %value)
+ ret void
+}
+
+define void @outcti(i8 addrspace(1)* %r) {
+; CHECK: outcti:
+; CHECK: outct res[r0], 11
+ call void @llvm.xcore.outct.p1i8(i8 addrspace(1)* %r, i32 11)
+ ret void
+}
+
+define void @chkct(i8 addrspace(1)* %r, i32 %value) {
+; CHECK: chkct:
+; CHECK: chkct res[r0], r1
+ call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 %value)
+ ret void
+}
+
+define void @chkcti(i8 addrspace(1)* %r) {
+; CHECK: chkcti:
+; CHECK: chkct res[r0], 11
+ call void @llvm.xcore.chkct.p1i8(i8 addrspace(1)* %r, i32 11)
+ ret void
+}
+
+define void @setd(i8 addrspace(1)* %r, i32 %value) {
+; CHECK: setd:
+; CHECK: setd res[r0], r1
+ call void @llvm.xcore.setd.p1i8(i8 addrspace(1)* %r, i32 %value)
+ ret void
+}