Remove redundant util_unsigned_logbase2

util_logbase2 is exactly the same function.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Matt Turner 2011-05-09 00:17:01 -04:00 committed by Brian Paul
parent 48a0a096f8
commit c5ac8a8aa2
5 changed files with 5 additions and 17 deletions

View File

@ -1055,7 +1055,7 @@ lp_build_sample_partial_offset(struct lp_build_context *bld,
subcoord = LLVMBuildURem(builder, coord, block_width, "");
coord = LLVMBuildUDiv(builder, coord, block_width, "");
#else
unsigned logbase2 = util_unsigned_logbase2(block_length);
unsigned logbase2 = util_logbase2(block_length);
LLVMValueRef block_shift = lp_build_const_int_vec(bld->gallivm, bld->type, logbase2);
LLVMValueRef block_mask = lp_build_const_int_vec(bld->gallivm, bld->type, block_length - 1);
subcoord = LLVMBuildAnd(builder, coord, block_mask, "");

View File

@ -414,18 +414,6 @@ unsigned ffs( unsigned u )
#endif
/* Could also binary search for the highest bit.
*/
static INLINE unsigned
util_unsigned_logbase2(unsigned n)
{
unsigned log2 = 0;
while (n >>= 1)
++log2;
return log2;
}
/**
* Return float bits.
*/

View File

@ -398,7 +398,7 @@ lp_debug_draw_bins_by_cmd_length( struct lp_scene *scene )
for (x = 0; x < scene->tiles_x; x++) {
const char *bits = " ...,-~:;=o+xaw*#XAWWWWWWWWWWWWWWWW";
int sz = lp_scene_bin_size(scene, x, y);
int sz2 = util_unsigned_logbase2(sz);
int sz2 = util_logbase2(sz);
debug_printf("%c", bits[MIN2(sz2,32)]);
}
debug_printf("\n");

View File

@ -489,7 +489,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
BEGIN_RING(chan, RING_3D(LOCAL_ADDRESS_HIGH), 3);
OUT_RELOCh(chan, screen->tls_bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
OUT_RELOCl(chan, screen->tls_bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
OUT_RING (chan, util_unsigned_logbase2(tls_space / 8));
OUT_RING (chan, util_logbase2(tls_space / 8));
ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 1 << 16, 4 << 16,
&screen->uniforms);

View File

@ -2243,8 +2243,8 @@ sp_sampler_variant_bind_view( struct sp_sampler_variant *samp,
samp->view = view;
samp->cache = tex_cache;
samp->xpot = util_unsigned_logbase2( texture->width0 );
samp->ypot = util_unsigned_logbase2( texture->height0 );
samp->xpot = util_logbase2( texture->width0 );
samp->ypot = util_logbase2( texture->height0 );
samp->level = view->u.tex.first_level;
}