summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-01-31 17:15:16 +0100
committerMarek Olšák <marek.olsak@amd.com>2015-02-04 14:34:13 +0100
commit50433ea526942dbeac75cc415becadea157e5d33 (patch)
tree00e9c1cb85f1931f1856024df3081a2c59169c2b
parentf2328ffdc80d0ea817b2f3f802dae6b2210fbfe2 (diff)
downloadexternal_mesa3d-50433ea526942dbeac75cc415becadea157e5d33.zip
external_mesa3d-50433ea526942dbeac75cc415becadea157e5d33.tar.gz
external_mesa3d-50433ea526942dbeac75cc415becadea157e5d33.tar.bz2
gallium/util: add u_bit_scan64
Same as u_bit_scan, but for uint64_t. Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
-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 ca6d0f1..8eb840f 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.