[llvm-commits] [llvm] r147247 - /llvm/trunk/lib/Target/X86/README.txt

Benjamin Kramer benny.kra at googlemail.com
Sat Dec 24 03:23:32 PST 2011


Author: d0k
Date: Sat Dec 24 05:23:32 2011
New Revision: 147247

URL: http://llvm.org/viewvc/llvm-project?rev=147247&view=rev
Log:
Chandler fixed this.

Modified:
    llvm/trunk/lib/Target/X86/README.txt

Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=147247&r1=147246&r2=147247&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Sat Dec 24 05:23:32 2011
@@ -2060,35 +2060,3 @@
 The trick is to match "fetch_and_add(X, -C) == C".
 
 //===---------------------------------------------------------------------===//
-
-unsigned log2(unsigned x) {
-  return x > 1 ? 32-__builtin_clz(x-1) : 0;
-}
-
-generates (x86_64):
-	xorl	%eax, %eax
-	cmpl	$2, %edi
-	jb	LBB0_2
-## BB#1:
-	decl	%edi
-	movl	$63, %ecx
-	bsrl	%edi, %eax
-	cmovel	%ecx, %eax
-	xorl	$-32, %eax
-	addl	$33, %eax
-LBB0_2:
-	ret
-
-The cmov and the early test are redundant:
-	xorl	%eax, %eax
-	cmpl	$2, %edi
-	jb	LBB0_2
-## BB#1:
-	decl	%edi
-	bsrl	%edi, %eax
-	xorl	$-32, %eax
-	addl	$33, %eax
-LBB0_2:
-	ret
-
-//===---------------------------------------------------------------------===//





More information about the llvm-commits mailing list