Disable multiversioning on non-x86 platforms

This commit is contained in:
Marcus Holland-Moritz 2021-03-13 17:20:30 +01:00
parent c57a0a67ce
commit eddce26ac4
4 changed files with 7 additions and 3 deletions

View File

@ -36,3 +36,7 @@
#define DWARFS_SANITIZE_THREAD 1
#endif
#endif
#if !defined(DWARFS_SANITIZE_THREAD) && defined(__x86_64__)
#define DWARFS_MULTIVERSIONING 1
#endif

View File

@ -51,7 +51,7 @@ class nilsimsa {
void update(uint8_t const* data, size_t size);
std::vector<uint64_t> finalize() const;
#ifndef DWARFS_SANITIZE_THREAD
#ifdef DWARFS_MULTIVERSIONING
__attribute__((target("popcnt"))) static int
similarity(uint64_t const* a, uint64_t const* b);

View File

@ -75,7 +75,7 @@ namespace dwarfs {
} \
static_assert(true, "")
#ifndef DWARFS_SANITIZE_THREAD
#ifdef DWARFS_MULTIVERSIONING
#ifdef __clang__
__attribute__((target("arch=skylake"))) DWARFS_FIND_SIMILAR_INODE_IMPL;
#endif

View File

@ -197,7 +197,7 @@ void nilsimsa::update(uint8_t const* data, size_t size) {
std::vector<uint64_t> nilsimsa::finalize() const { return impl_->finalize(); }
#ifndef DWARFS_SANITIZE_THREAD
#ifdef DWARFS_MULTIVERSIONING
__attribute__((target("popcnt"))) int
nilsimsa::similarity(uint64_t const* a, uint64_t const* b) {
DWARFS_NILSIMSA_SIMILARITY(return, a, b);