From 5079a0d32f2824445cf593dfbcb65598eaa97dee Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Tue, 27 Nov 2012 11:32:38 -0800 Subject: Remove assembly coded log2 function As we move to supporting other systems we need to get rid of assembly where we can. The log2 function in src/lib is identical to the assembly one (tested for all 32-bit signed integers :-) and takes about 10 ns to run as opposed to 5ns for the non-portable assembly version. While speed is good, I think we can spare the 15 ns or so we add to boot time by using the C version only. Change-Id: Icafa565eae282c85fa5fc01b3bd1f110cd9aaa91 Signed-off-by: Ronald G. Minnich Reviewed-on: http://review.coreboot.org/1928 Tested-by: build bot (Jenkins) --- src/arch/x86/include/bitops.h | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/arch/x86/include/bitops.h (limited to 'src/arch') diff --git a/src/arch/x86/include/bitops.h b/src/arch/x86/include/bitops.h deleted file mode 100644 index 9206465c77..0000000000 --- a/src/arch/x86/include/bitops.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef I386_BITOPS_H -#define I386_BITOPS_H - -/** - * log2 - Find the truncated log base 2 of x - */ - -static inline unsigned long log2(unsigned long x) -{ - unsigned long r = 0; - __asm__( - "bsrl %1, %0\n\t" - "jnz 1f\n\t" - "movl $-1, %0\n\t" - "1:\n\t" - : "=r" (r) : "r" (x)); - return r; - -} -#endif /* I386_BITOPS_H */ -- cgit v1.2.3