• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=x86-64 -mattr=+lzcnt | FileCheck %s
2
3declare i8 @llvm.ctlz.i8(i8, i1) nounwind readnone
4declare i16 @llvm.ctlz.i16(i16, i1) nounwind readnone
5declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
6declare i64 @llvm.ctlz.i64(i64, i1) nounwind readnone
7
8define i8 @t1(i8 %x) nounwind  {
9	%tmp = tail call i8 @llvm.ctlz.i8( i8 %x, i1 false )
10	ret i8 %tmp
11; CHECK-LABEL: t1:
12; CHECK: lzcntl
13}
14
15define i16 @t2(i16 %x) nounwind  {
16	%tmp = tail call i16 @llvm.ctlz.i16( i16 %x, i1 false )
17	ret i16 %tmp
18; CHECK-LABEL: t2:
19; CHECK: lzcntw
20}
21
22define i32 @t3(i32 %x) nounwind  {
23	%tmp = tail call i32 @llvm.ctlz.i32( i32 %x, i1 false )
24	ret i32 %tmp
25; CHECK-LABEL: t3:
26; CHECK: lzcntl
27}
28
29define i64 @t4(i64 %x) nounwind  {
30	%tmp = tail call i64 @llvm.ctlz.i64( i64 %x, i1 false )
31	ret i64 %tmp
32; CHECK-LABEL: t4:
33; CHECK: lzcntq
34}
35
36define i8 @t5(i8 %x) nounwind  {
37	%tmp = tail call i8 @llvm.ctlz.i8( i8 %x, i1 true )
38	ret i8 %tmp
39; CHECK-LABEL: t5:
40; CHECK: lzcntl
41}
42
43define i16 @t6(i16 %x) nounwind  {
44	%tmp = tail call i16 @llvm.ctlz.i16( i16 %x, i1 true )
45	ret i16 %tmp
46; CHECK-LABEL: t6:
47; CHECK: lzcntw
48}
49
50define i32 @t7(i32 %x) nounwind  {
51	%tmp = tail call i32 @llvm.ctlz.i32( i32 %x, i1 true )
52	ret i32 %tmp
53; CHECK-LABEL: t7:
54; CHECK: lzcntl
55}
56
57define i64 @t8(i64 %x) nounwind  {
58	%tmp = tail call i64 @llvm.ctlz.i64( i64 %x, i1 true )
59	ret i64 %tmp
60; CHECK-LABEL: t8:
61; CHECK: lzcntq
62}
63