Skip to content

Commit

Permalink
[Support] Fix xxh3_128bits for Win32 builds after #95863
Browse files Browse the repository at this point in the history
`__emulu` is used without including `intrin.h`. Actually, it's better to
rely on compiler optimizations. In this LLVM copy, we try to eliminate
unneceeded workarounds for old compilers.

Pull Request: #96931
  • Loading branch information
MaskRay authored Jun 28, 2024
1 parent 4403ece commit 7205562
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions llvm/lib/Support/xxhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,18 +453,7 @@ uint64_t llvm::xxh3_64bits(ArrayRef<uint8_t> data) {
#define XXH_rotl64(x, r) (((x) << (r)) | ((x) >> (64 - (r))))
#endif

#if defined(_MSC_VER) && defined(_M_IX86)
#define XXH_mult32to64(x, y) __emulu((unsigned)(x), (unsigned)(y))
#else
/*
* Downcast + upcast is usually better than masking on older compilers like
* GCC 4.2 (especially 32-bit ones), all without affecting newer compilers.
*
* The other method, (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF), will AND both operands
* and perform a full 64x64 multiply -- entirely redundant on 32-bit.
*/
#define XXH_mult32to64(x, y) ((uint64_t)(uint32_t)(x) * (uint64_t)(uint32_t)(y))
#endif

/*!
* @brief Calculates a 64->128-bit long multiply.
Expand Down

0 comments on commit 7205562

Please sign in to comment.