From: Vlad Golovkin Date: Mon, 16 Apr 2018 20:50:24 +0000 (+0300) Subject: nv50: Extract needed value bits without shifting them before calling bitcount X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=967aabca06fc48ee18e1f4fc534483d45bdcaa70;p=mesa.git nv50: Extract needed value bits without shifting them before calling bitcount This can save one instruction since bitcount doesn't care about specific bits' positions. Reviewed-by: Karol Herbst --- diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 1db112fa6c7..b278a2f11b4 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -992,7 +992,7 @@ nv50_screen_create(struct nouveau_device *dev) nouveau_getparam(dev, NOUVEAU_GETPARAM_GRAPH_UNITS, &value); screen->TPs = util_bitcount(value & 0xffff); - screen->MPsInTP = util_bitcount((value >> 24) & 0xf); + screen->MPsInTP = util_bitcount(value & 0x0f000000); screen->mp_count = screen->TPs * screen->MPsInTP;