diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-05-11 05:27:09 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-05-11 05:27:09 +0000 |
| commit | 724732404739b69bf2b329ec9ee47ae8940f567b (patch) | |
| tree | f2395397183e44b3f2669f73c00ec5c09aec516a /llvm/lib/CodeGen/SelectionDAG | |
| parent | 05309bf58e1bbbc3a2afaa8259a2aad8ab3be40a (diff) | |
| download | bcm5719-llvm-724732404739b69bf2b329ec9ee47ae8940f567b.tar.gz bcm5719-llvm-724732404739b69bf2b329ec9ee47ae8940f567b.zip | |
Add some notes for expanding clz/ctz
llvm-svn: 21862
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 27e621f6d8a..0f6f3d59151 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1132,10 +1132,27 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { Result = Tmp1; break; } -// case ISD::CTTZ: -// break; -// case ISD::CTLZ: -// break; + case ISD::CTTZ: + /* This should be used for targets that support ctpop: +int nlz5(unsigned x) { + int pop(unsigned x); + + x = x | (x >> 1); + x = x | (x >> 2); + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >>16); + return ctpop(~x); +} + See also: http://www.hackersdelight.org/HDcode/nlz.cc +*/ + + assert(0 && "Cannot expand this yet!"); + break; + case ISD::CTLZ: + // See Also: http://www.hackersdelight.org/HDcode/ntz.cc + assert(0 && "Cannot expand this yet!"); + break; default: assert(0 && "Cannot expand this yet!"); break; |

