summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-01-31 17:15:16 +0100
committerMarek Olšák <[email protected]>2015-02-04 14:34:13 +0100
commit50433ea526942dbeac75cc415becadea157e5d33 (patch)
tree00e9c1cb85f1931f1856024df3081a2c59169c2b /src/gallium
parentf2328ffdc80d0ea817b2f3f802dae6b2210fbfe2 (diff)
gallium/util: add u_bit_scan64
Same as u_bit_scan, but for uint64_t. Reviewed-by: Glenn Kennard <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_math.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index ca6d0f1dfc8..8eb840f1ec0 100644
--- 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.