From f72848a09a9d3069705fbe8e4daa29b9918ea56e Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Sat, 13 Dec 2008 23:24:39 +0200 Subject: Nouveau: move the definition of log2i() to header Also make the type unsigned instead of signed, since negative values do not make sense. Signed-off-by: Pekka Paalanen --- src/gallium/drivers/nv04/nv04_fragtex.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'src/gallium/drivers/nv04') diff --git a/src/gallium/drivers/nv04/nv04_fragtex.c b/src/gallium/drivers/nv04/nv04_fragtex.c index 1b866aae19..21f990fd53 100644 --- a/src/gallium/drivers/nv04/nv04_fragtex.c +++ b/src/gallium/drivers/nv04/nv04_fragtex.c @@ -1,30 +1,5 @@ #include "nv04_context.h" - -static INLINE int log2i(int i) -{ - int r = 0; - - if (i & 0xffff0000) { - i >>= 16; - r += 16; - } - if (i & 0x0000ff00) { - i >>= 8; - r += 8; - } - if (i & 0x000000f0) { - i >>= 4; - r += 4; - } - if (i & 0x0000000c) { - i >>= 2; - r += 2; - } - if (i & 0x00000002) { - r += 1; - } - return r; -} +#include "nouveau/nouveau_util.h" #define _(m,tf) \ { \ -- cgit v1.2.3