summaryrefslogtreecommitdiff
path: root/test/CodeGen/XCore
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2013-07-02 14:46:34 +0000
committerRichard Osborne <richard@xmos.com>2013-07-02 14:46:34 +0000
commit850ba41ed4252aae61e62140cdf0c61dbb444563 (patch)
treea303f3a990e231d52daa0e417e01f96ddda6bea5 /test/CodeGen/XCore
parent0a39e264330c5f6eb9e5e9e60d276613985e178d (diff)
downloadllvm-850ba41ed4252aae61e62140cdf0c61dbb444563.tar.gz
llvm-850ba41ed4252aae61e62140cdf0c61dbb444563.tar.bz2
llvm-850ba41ed4252aae61e62140cdf0c61dbb444563.tar.xz
[XCore] Fix instruction selection for zext, mkmsk instructions.
r182680 replaced CountLeadingZeros_32 with a template function countLeadingZeros that relies on using the correct argument type to give the right result. The type passed in the XCore backend after this revision was incorrect in a couple of places. Patch by Robert Lytton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore')
-rw-r--r--test/CodeGen/XCore/constants.ll8
-rw-r--r--test/CodeGen/XCore/zext.ll10
2 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/constants.ll b/test/CodeGen/XCore/constants.ll
index cad1a2153f..1e064f37ba 100644
--- a/test/CodeGen/XCore/constants.ll
+++ b/test/CodeGen/XCore/constants.ll
@@ -9,3 +9,11 @@ define i32 @f() {
entry:
ret i32 12345678
}
+
+define i32 @g() {
+entry:
+; CHECK: g:
+; CHECK: mkmsk r0, 1
+; CHECK: retsp 0
+ ret i32 1;
+}
diff --git a/test/CodeGen/XCore/zext.ll b/test/CodeGen/XCore/zext.ll
new file mode 100644
index 0000000000..32abfcaed1
--- /dev/null
+++ b/test/CodeGen/XCore/zext.ll
@@ -0,0 +1,10 @@
+; RUN: llc -march=xcore < %s | FileCheck %s
+
+define i32 @f(i1 %a) {
+entry:
+; CHECK: f
+; CHECK: zext r0, 1
+; CHECK: retsp 0
+ %b= zext i1 %a to i32
+ ret i32 %b
+}