summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_util.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-07-14 16:44:34 -0400
committerRob Clark <[email protected]>2016-07-30 09:23:42 -0400
commit0739bbceecbb66ffbcf14e5b73e6df222794c264 (patch)
tree08652e070680d1c21492f3ffe9a1e44d151b6a1f /src/gallium/drivers/freedreno/freedreno_util.h
parente1b10527006a03f1bd845f222f353496502c8d16 (diff)
freedreno: a bit of micro-optimization
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index 6321cd7b4cd..30097008e2a 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -338,4 +338,7 @@ pack_rgba(enum pipe_format format, const float *rgba)
#define swap(a, b) \
do { __typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
+#define foreach_bit(b, mask) \
+ for (uint32_t _m = (mask); _m && ({(b) = u_bit_scan(&_m); 1;});)
+
#endif /* FREEDRENO_UTIL_H_ */