projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2328ff
)
gallium/util: add u_bit_scan64
author
Marek Olšák
<marek.olsak@amd.com>
Sat, 31 Jan 2015 16:15:16 +0000
(17:15 +0100)
committer
Marek Olšák
<marek.olsak@amd.com>
Wed, 4 Feb 2015 13:34:13 +0000
(14:34 +0100)
Same as u_bit_scan, but for uint64_t.
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/util/u_math.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_math.h
b/src/gallium/auxiliary/util/u_math.h
index ca6d0f1dfc845335c13653605920332ecbd67da4..8eb840f1ec0fa4ee5712ac71e8d528588f5e77f2 100644
(file)
--- a/
src/gallium/auxiliary/util/u_math.h
+++ b/
src/gallium/auxiliary/util/u_math.h
@@
-583,6
+583,13
@@
u_bit_scan(unsigned *mask)
return i;
}
+static INLINE int
+u_bit_scan64(uint64_t *mask)
+{
+ int i = ffsll(*mask) - 1;
+ *mask &= ~(1llu << i);
+ return i;
+}
/**
* Return float bits.