diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-05-03 17:19:30 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-05-03 17:19:30 +0000 |
commit | 691ef2ba066dda14ae4ac0ad645054fbc967785a (patch) | |
tree | 1c06734df74c2303e4c1481e59c9598cd401b11c /lib/VMCore/Function.cpp | |
parent | c88e681498feb35b78a029d029e3de401c75a8d3 (diff) |
Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop). Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r-- | lib/VMCore/Function.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 6740c6bbb0..f61a4d2326 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -206,6 +206,11 @@ unsigned Function::getIntrinsicID() const { assert(getName().size() != 5 && "'llvm.' is an invalid intrinsic name!"); switch (getName()[5]) { + case 'c': + if (getName() == "llvm.ctpop") return Intrinsic::ctpop; + if (getName() == "llvm.cttz") return Intrinsic::cttz; + if (getName() == "llvm.ctlz") return Intrinsic::ctlz; + break; case 'd': if (getName() == "llvm.dbg.stoppoint") return Intrinsic::dbg_stoppoint; if (getName() == "llvm.dbg.region.start")return Intrinsic::dbg_region_start; |