summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/clz.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/X86/clz.ll')
-rw-r--r--llvm/test/CodeGen/X86/clz.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/clz.ll b/llvm/test/CodeGen/X86/clz.ll
new file mode 100644
index 00000000000..0505529cc48
--- /dev/null
+++ b/llvm/test/CodeGen/X86/clz.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep bsr
+; RUN: llvm-as < %s | llc -march=x86 | grep bsf
+
+define i32 @t1(i32 %x) nounwind {
+ %tmp = tail call i32 @llvm.ctlz.i32( i32 %x )
+ ret i32 %tmp
+}
+
+declare i32 @llvm.ctlz.i32(i32) nounwind readnone
+
+define i32 @t2(i32 %x) nounwind {
+ %tmp = tail call i32 @llvm.cttz.i32( i32 %x )
+ ret i32 %tmp
+}
+
+declare i32 @llvm.cttz.i32(i32) nounwind readnone
OpenPOWER on IntegriCloud