On my PowerBook G4, compiling this program: #include <stdio.h> int main() { unsigned long int ctz_x = 0x0000f000; unsigned long int ctz_c; __asm__("{cntlz|cntlzw} %0,%1" : "=r" (ctz_c) : "r" (ctz_x & -ctz_x)); printf("ctz_c == %d\n", ctz_c); return 0; } results in the use of the mnemonic "cntlz" instead of "cntlzw". This produces an error when trying to assemble the program: cntlzw_miscompile.s:25:Invalid mnemonic 'cntlz' GCC outputs "cntlzw" instead. -bw
This was found when trying to compile "gmp".
Fixed with: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042747.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042748.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042749.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042750.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042751.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070115/042752.html -bw