From 967aabca06fc48ee18e1f4fc534483d45bdcaa70 Mon Sep 17 00:00:00 2001 From: Vlad Golovkin Date: Mon, 16 Apr 2018 23:50:24 +0300 Subject: [PATCH] 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 --- src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2