summaryrefslogtreecommitdiff
path: root/other/bitOps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other/bitOps.cpp')
-rw-r--r--other/bitOps.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/other/bitOps.cpp b/other/bitOps.cpp
index 8bad842..ecb94fa 100644
--- a/other/bitOps.cpp
+++ b/other/bitOps.cpp
@@ -14,3 +14,9 @@ a = -1
a = (1 << n) - 1
// Iteriert über alle Teilmengen einer Bitmaske (außer der leeren Menge).
for (int subset = bitmask; subset > 0; subset = (subset - 1) & bitmask)
+// Anzahl der gesetzten Bits.
+int __builtin_popcount(unsigned int x);
+int __builtin_popcountll(unsigned long long x);
+// Anzahl der führenden 0-Bits.
+int __builtin_clz(unsigned int x);
+int __builtin_clzll(unsigned long long x);