aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/XCore
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2008-11-14 10:12:16 +0000
committerRichard Osborne <richard@xmos.com>2008-11-14 10:12:16 +0000
commit1d8f975890bba8a328b1e940c9b87675d8d4949c (patch)
treef075c028efb480aa5a829972ecd6e6a1ac3aa8b8 /test/CodeGen/XCore
parent56c523c63b2b5d95ed61c79e1efe9de5465a7d25 (diff)
downloadexternal_llvm-1d8f975890bba8a328b1e940c9b87675d8d4949c.zip
external_llvm-1d8f975890bba8a328b1e940c9b87675d8d4949c.tar.gz
external_llvm-1d8f975890bba8a328b1e940c9b87675d8d4949c.tar.bz2
Add XCore intrinsics for getid (returns thread id) and bitrev (reverses
bits in a word). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore')
-rw-r--r--test/CodeGen/XCore/bitrev.ll8
-rw-r--r--test/CodeGen/XCore/getid.ll8
2 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/bitrev.ll b/test/CodeGen/XCore/bitrev.ll
new file mode 100644
index 0000000..38f3948
--- /dev/null
+++ b/test/CodeGen/XCore/bitrev.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -march=xcore > %t1.s
+; RUN: grep bitrev %t1.s | count 1
+declare i32 @llvm.xcore.bitrev(i32)
+
+define i32 @test(i32 %val) {
+ %result = call i32 @llvm.xcore.bitrev(i32 %val)
+ ret i32 %result
+}
diff --git a/test/CodeGen/XCore/getid.ll b/test/CodeGen/XCore/getid.ll
new file mode 100644
index 0000000..810e8ad
--- /dev/null
+++ b/test/CodeGen/XCore/getid.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -march=xcore > %t1.s
+; RUN: grep "get r11, id" %t1.s | count 1
+declare i32 @llvm.xcore.getid()
+
+define i32 @test() {
+ %result = call i32 @llvm.xcore.getid()
+ ret i32 %result
+}