mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
add an idiom that loop idiom could theoretically catch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ad48a4fc32
commit
477a98824a
@ -287,6 +287,16 @@ unsigned int popcount(unsigned int input) {
|
||||
return count;
|
||||
}
|
||||
|
||||
This should be recognized as CLZ: rdar://8459039
|
||||
|
||||
unsigned clz_a(unsigned a) {
|
||||
int i;
|
||||
for (i=0;i<32;i++)
|
||||
if (a & (1<<(31-i)))
|
||||
return i;
|
||||
return 32;
|
||||
}
|
||||
|
||||
This sort of thing should be added to the loop idiom pass.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user