]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/util/math128.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / util / math128.h
index a1f6d41515da40adab4d5b80140ebbf42bc70bde..ae490051a78b905b5542c851859aa49d4bdb630e 100644 (file)
@@ -215,7 +215,25 @@ inline int BitsSetToOne(Unsigned128 v) {
 
 template <>
 inline int BitParity(Unsigned128 v) {
-  return BitParity(Lower64of128(v)) ^ BitParity(Upper64of128(v));
+  return BitParity(Lower64of128(v) ^ Upper64of128(v));
+}
+
+template <>
+inline Unsigned128 EndianSwapValue(Unsigned128 v) {
+  return (Unsigned128{EndianSwapValue(Lower64of128(v))} << 64) |
+         EndianSwapValue(Upper64of128(v));
+}
+
+template <>
+inline Unsigned128 ReverseBits(Unsigned128 v) {
+  return (Unsigned128{ReverseBits(Lower64of128(v))} << 64) |
+         ReverseBits(Upper64of128(v));
+}
+
+template <>
+inline Unsigned128 DownwardInvolution(Unsigned128 v) {
+  return (Unsigned128{DownwardInvolution(Upper64of128(v))} << 64) |
+         DownwardInvolution(Upper64of128(v) ^ Lower64of128(v));
 }
 
 template <typename T>