mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-16 14:27:54 +00:00
Add some notes for expanding clz/ctz
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1132,10 +1132,27 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
Result = Tmp1;
|
Result = Tmp1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// case ISD::CTTZ:
|
case ISD::CTTZ:
|
||||||
// break;
|
/* This should be used for targets that support ctpop:
|
||||||
// case ISD::CTLZ:
|
int nlz5(unsigned x) {
|
||||||
// break;
|
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:
|
default:
|
||||||
assert(0 && "Cannot expand this yet!");
|
assert(0 && "Cannot expand this yet!");
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user