blob: cca9e658ad5fc19fb61af04809fde1db85b00b56 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=ppc64 -mcpu=g5 | grep cntlzd
Chris Lattnereaa87ba2007-03-25 04:43:51 +00002
Chris Lattner261bc892010-11-14 22:22:14 +00003define i32 @_ZNK4llvm5APInt17countLeadingZerosEv(i64 *%t) nounwind {
Chris Lattnereaa87ba2007-03-25 04:43:51 +00004 %tmp19 = load i64* %t
Chandler Carruth69940402007-08-04 01:51:18 +00005 %tmp22 = tail call i64 @llvm.ctlz.i64( i64 %tmp19 ) ; <i64> [#uses=1]
6 %tmp23 = trunc i64 %tmp22 to i32
Reid Spencera3c533a2007-04-01 07:36:28 +00007 %tmp89 = add i32 %tmp23, -64 ; <i32> [#uses=1]
8 %tmp90 = add i32 %tmp89, 0 ; <i32> [#uses=1]
Chris Lattnereaa87ba2007-03-25 04:43:51 +00009 ret i32 %tmp90
10}
11
Chandler Carruth69940402007-08-04 01:51:18 +000012declare i64 @llvm.ctlz.i64(i64)