Skip to content

Commit

Permalink
make XXH_VECTOR values more accessible
Browse files Browse the repository at this point in the history
via #include "xxhash.h"
to fix double-include issues in xsum_arch.c
  • Loading branch information
Cyan4973 committed Dec 27, 2024
1 parent cfd7723 commit 5a8de81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
2 changes: 0 additions & 2 deletions cli/xsum_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ int g_xsumarch_avoid_empty_unit = 0;
#if defined(XXHSUM_DISPATCH)

#include "../xxh_x86dispatch.h"
#define XXH_INLINE_ALL /* XXH_* vector types */
#include "../xxhash.h"

const char* XSUM_autox86(void)
{
Expand Down
53 changes: 17 additions & 36 deletions xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,23 @@ XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const
*
* The API supports one-shot hashing, streaming mode, and custom secrets.
*/

/*!
* @ingroup tuning
* @brief Possible values for @ref XXH_VECTOR.
*
* Unless set explicitly, determined automatically.
*/
# define XXH_SCALAR 0 /*!< Portable scalar version */
# define XXH_SSE2 1 /*!< SSE2 for Pentium 4, Opteron, all x86_64. */
# define XXH_AVX2 2 /*!< AVX2 for Haswell and Bulldozer */
# define XXH_AVX512 3 /*!< AVX512 for Skylake and Icelake */
# define XXH_NEON 4 /*!< NEON for most ARMv7-A, all AArch64, and WASM SIMD128 */
# define XXH_VSX 5 /*!< VSX and ZVector for POWER8/z13 (64-bit) */
# define XXH_SVE 6 /*!< SVE for some ARMv8-A and ARMv9-A */
# define XXH_LSX 7 /*!< LSX (128-bit SIMD) for LoongArch64 */


/*-**********************************************************************
* XXH3 64-bit variant
************************************************************************/
Expand Down Expand Up @@ -3842,34 +3859,6 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_can
* ========================================== */

#ifdef XXH_DOXYGEN
/*!
* @ingroup tuning
* @brief Possible values for @ref XXH_VECTOR.
*
* Note that these are actually implemented as macros.
*
* If this is not defined, it is detected automatically.
* internal macro XXH_X86DISPATCH overrides this.
*/
enum XXH_VECTOR_TYPE /* fake enum */ {
XXH_SCALAR = 0, /*!< Portable scalar version */
XXH_SSE2 = 1, /*!<
* SSE2 for Pentium 4, Opteron, all x86_64.
*
* @note SSE2 is also guaranteed on Windows 10, macOS, and
* Android x86.
*/
XXH_AVX2 = 2, /*!< AVX2 for Haswell and Bulldozer */
XXH_AVX512 = 3, /*!< AVX512 for Skylake and Icelake */
XXH_NEON = 4, /*!<
* NEON for most ARMv7-A, all AArch64, and WASM SIMD128
* via the SIMDeverywhere polyfill provided with the
* Emscripten SDK.
*/
XXH_VSX = 5, /*!< VSX and ZVector for POWER8/z13 (64-bit) */
XXH_SVE = 6, /*!< SVE for some ARMv8-A and ARMv9-A */
XXH_LSX = 7, /*!< LSX (128-bit SIMD) for LoongArch64 */
};
/*!
* @ingroup tuning
* @brief Overrides the vectorization implementation chosen for XXH3.
Expand All @@ -3895,14 +3884,6 @@ enum XXH_VECTOR_TYPE /* fake enum */ {

/* Actual definition */
#ifndef XXH_DOXYGEN
# define XXH_SCALAR 0
# define XXH_SSE2 1
# define XXH_AVX2 2
# define XXH_AVX512 3
# define XXH_NEON 4
# define XXH_VSX 5
# define XXH_SVE 6
# define XXH_LSX 7
#endif

#ifndef XXH_VECTOR /* can be defined on command line */
Expand Down

0 comments on commit 5a8de81

Please sign in to comment.