0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::uleb128: Add #ifdefs for intrinsics.

This commit is contained in:
Jason Volk 2019-10-16 19:33:18 -07:00
parent 6d380dcb6c
commit bd6860743c

View file

@ -105,6 +105,7 @@ noexcept
/// counting the trailing (least significant) zero bits; then add one for
/// the terminating byte itself. Note doc sez if mask had all zero bits then
/// the result of clz/ctz is undefined.
#if defined(__MMX__)
template<>
inline size_t
ircd::uleb128::length(const uint64_t &val)
@ -119,7 +120,9 @@ noexcept
return __builtin_ctz(~mask) + 1;
}
#endif
#if defined(__SSE2__)
template<>
inline size_t
ircd::uleb128::length(const uint128_t &val)
@ -134,6 +137,7 @@ noexcept
return __builtin_ctz(~mask) + 1;
}
#endif
/// Counts number of bytes of an LEB encoded integer contained in a word of
/// type T. This is the length of the LEB encoding, not the decoded length.