summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-10-11 06:47:01 +0000
committerCraig Topper <craig.topper@gmail.com>2011-10-11 06:47:01 +0000
commita6f386b4cd953f5c2584672711792e6d3609c3e7 (patch)
tree85b78051696259fde99bbfebd41608dd917d2c12 /test/CodeGen
parent37f2167f15608ff56d202ff21954a456aab6e534 (diff)
downloadllvm-a6f386b4cd953f5c2584672711792e6d3609c3e7.tar.gz
llvm-a6f386b4cd953f5c2584672711792e6d3609c3e7.tar.bz2
llvm-a6f386b4cd953f5c2584672711792e6d3609c3e7.tar.xz
Test case for X86 LZCNT instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141652 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/lzcnt.ll38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/CodeGen/X86/lzcnt.ll b/test/CodeGen/X86/lzcnt.ll
new file mode 100644
index 0000000000..e5a55abf1a
--- /dev/null
+++ b/test/CodeGen/X86/lzcnt.ll
@@ -0,0 +1,38 @@
+; RUN: llc < %s -march=x86-64 -mattr=+lzcnt | FileCheck %s
+
+define i32 @t1(i32 %x) nounwind {
+ %tmp = tail call i32 @llvm.ctlz.i32( i32 %x )
+ ret i32 %tmp
+; CHECK: t1:
+; CHECK: lzcntl
+}
+
+declare i32 @llvm.ctlz.i32(i32) nounwind readnone
+
+define i16 @t2(i16 %x) nounwind {
+ %tmp = tail call i16 @llvm.ctlz.i16( i16 %x )
+ ret i16 %tmp
+; CHECK: t2:
+; CHECK: lzcntw
+}
+
+declare i16 @llvm.ctlz.i16(i16) nounwind readnone
+
+define i64 @t3(i64 %x) nounwind {
+ %tmp = tail call i64 @llvm.ctlz.i64( i64 %x )
+ ret i64 %tmp
+; CHECK: t3:
+; CHECK: lzcntq
+}
+
+declare i64 @llvm.ctlz.i64(i64) nounwind readnone
+
+define i8 @t4(i8 %x) nounwind {
+ %tmp = tail call i8 @llvm.ctlz.i8( i8 %x )
+ ret i8 %tmp
+; CHECK: t4:
+; CHECK: lzcntw
+}
+
+declare i8 @llvm.ctlz.i8(i8) nounwind readnone
+