mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-11 13:30:47 -04:00
Remove unused nilsimsa code
This commit is contained in:
parent
54e5723f01
commit
acc4e7d7b4
@ -27,19 +27,8 @@
|
|||||||
#include <span>
|
#include <span>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include <folly/lang/Bits.h>
|
|
||||||
|
|
||||||
#include "dwarfs/compiler.h"
|
#include "dwarfs/compiler.h"
|
||||||
|
|
||||||
#define DWARFS_NILSIMSA_SIMILARITY(r, a, b) \
|
|
||||||
do { \
|
|
||||||
int bits = 0; \
|
|
||||||
for (int i = 0; i < 4; ++i) { \
|
|
||||||
bits += folly::popcount(a[i] ^ b[i]); \
|
|
||||||
} \
|
|
||||||
r 255 - bits; \
|
|
||||||
} while (false)
|
|
||||||
|
|
||||||
namespace dwarfs {
|
namespace dwarfs {
|
||||||
|
|
||||||
class nilsimsa {
|
class nilsimsa {
|
||||||
@ -52,15 +41,6 @@ class nilsimsa {
|
|||||||
void update(uint8_t const* data, size_t size);
|
void update(uint8_t const* data, size_t size);
|
||||||
void finalize(hash_type& hash) const;
|
void finalize(hash_type& hash) const;
|
||||||
|
|
||||||
#ifdef DWARFS_MULTIVERSIONING
|
|
||||||
__attribute__((target("popcnt"))) static int
|
|
||||||
similarity(uint64_t const* a, uint64_t const* b);
|
|
||||||
|
|
||||||
__attribute__((target("default")))
|
|
||||||
#endif
|
|
||||||
static int
|
|
||||||
similarity(uint64_t const* a, uint64_t const* b);
|
|
||||||
|
|
||||||
void operator()(std::span<uint8_t const> data) {
|
void operator()(std::span<uint8_t const> data) {
|
||||||
update(data.data(), data.size());
|
update(data.data(), data.size());
|
||||||
}
|
}
|
||||||
|
@ -192,19 +192,4 @@ void nilsimsa::update(uint8_t const* data, size_t size) {
|
|||||||
|
|
||||||
void nilsimsa::finalize(hash_type& hash) const { impl_->finalize(hash); }
|
void nilsimsa::finalize(hash_type& hash) const { impl_->finalize(hash); }
|
||||||
|
|
||||||
#ifdef DWARFS_MULTIVERSIONING
|
|
||||||
__attribute__((target("popcnt"))) int
|
|
||||||
nilsimsa::similarity(uint64_t const* a, uint64_t const* b) {
|
|
||||||
DWARFS_NILSIMSA_SIMILARITY(return, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
__attribute__((target("default")))
|
|
||||||
#endif
|
|
||||||
int nilsimsa::similarity(uint64_t const* a, uint64_t const* b) {
|
|
||||||
DWARFS_NILSIMSA_SIMILARITY(return, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
static_assert(std::is_same_v<unsigned long, uint64_t> ||
|
|
||||||
std::is_same_v<unsigned long long, uint64_t>);
|
|
||||||
|
|
||||||
} // namespace dwarfs
|
} // namespace dwarfs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user