blob: f887882cec2fb148800efba794cf71f5ab52ce3d [file] [log] [blame]
Andrew Lenharthe8aebf72005-05-04 15:56:34 +00001; Make sure this testcase codegens to the ctpop instruction
Dan Gohmanfce288f2009-09-09 00:09:15 +00002; RUN: llc < %s -march=alpha -mcpu=ev67 | grep -i ctpop
3; RUN: llc < %s -march=alpha -mattr=+CIX | \
Reid Spencer65f47a32007-04-15 18:40:57 +00004; RUN: grep -i ctpop
Dan Gohmanfce288f2009-09-09 00:09:15 +00005; RUN: llc < %s -march=alpha -mcpu=ev6 | \
Reid Spencer65f47a32007-04-15 18:40:57 +00006; RUN: not grep -i ctpop
Dan Gohmanfce288f2009-09-09 00:09:15 +00007; RUN: llc < %s -march=alpha -mattr=-CIX | \
Reid Spencer43b40032007-04-16 15:31:49 +00008; RUN: not grep -i ctpop
Andrew Lenharth14197112005-05-04 15:20:16 +00009
Tanya Lattner53a66d12008-02-19 01:41:04 +000010declare i64 @llvm.ctpop.i64(i64)
Andrew Lenharth14197112005-05-04 15:20:16 +000011
Tanya Lattner53a66d12008-02-19 01:41:04 +000012define i64 @bar(i64 %x) {
Andrew Lenharth14197112005-05-04 15:20:16 +000013entry:
Tanya Lattner53a66d12008-02-19 01:41:04 +000014 %tmp.1 = call i64 @llvm.ctpop.i64( i64 %x ) ; <i64> [#uses=1]
15 ret i64 %tmp.1
Andrew Lenharth14197112005-05-04 15:20:16 +000016}
Tanya Lattner53a66d12008-02-19 01:41:04 +000017