aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/XCore
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2011-07-19 12:50:25 +0000
committerRichard Osborne <richard@xmos.com>2011-07-19 12:50:25 +0000
commitdee3dd9129e1bb5283a7e7f79c3c20b8b81cf13d (patch)
treed9e6a6d4da6f17bd78952dc93c321217c343143f /test/CodeGen/XCore
parentbb2518c71671cf7962f8b5e9ab0f0eec9784a2c1 (diff)
downloadexternal_llvm-dee3dd9129e1bb5283a7e7f79c3c20b8b81cf13d.zip
external_llvm-dee3dd9129e1bb5283a7e7f79c3c20b8b81cf13d.tar.gz
external_llvm-dee3dd9129e1bb5283a7e7f79c3c20b8b81cf13d.tar.bz2
Add intrinsics for the peek and endin instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore')
-rw-r--r--test/CodeGen/XCore/resources.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/resources.ll b/test/CodeGen/XCore/resources.ll
index bd0492c..9e5f9cc 100644
--- a/test/CodeGen/XCore/resources.ll
+++ b/test/CodeGen/XCore/resources.ll
@@ -22,6 +22,8 @@ declare void @llvm.xcore.eeu.p1i8(i8 addrspace(1)* %r)
declare void @llvm.xcore.setclk.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
declare void @llvm.xcore.setrdy.p1i8.p1i8(i8 addrspace(1)* %a, i8 addrspace(1)* %b)
declare void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value)
+declare i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r)
+declare i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r)
define i8 addrspace(1)* @getr() {
; CHECK: getr:
@@ -198,3 +200,17 @@ define void @setpsc(i8 addrspace(1)* %r, i32 %value) {
call void @llvm.xcore.setpsc.p1i8(i8 addrspace(1)* %r, i32 %value)
ret void
}
+
+define i32 @peek(i8 addrspace(1)* %r) {
+; CHECK: peek:
+; CHECK: peek r0, res[r0]
+ %result = call i32 @llvm.xcore.peek.p1i8(i8 addrspace(1)* %r)
+ ret i32 %result
+}
+
+define i32 @endin(i8 addrspace(1)* %r) {
+; CHECK: endin:
+; CHECK: endin r0, res[r0]
+ %result = call i32 @llvm.xcore.endin.p1i8(i8 addrspace(1)* %r)
+ ret i32 %result
+}