Skip to content

Commit 7aee8d0

Browse files
authored
Merge pull request #1056 from Cyan4973/fix_dispatch1_arm
fix DISPATCH=1 on non-x86 target
2 parents ef8929c + db36ccb commit 7aee8d0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ ifneq ($(strip $(call detect_x86_arch)),)
6060
#note: can be overridden at compile time, by setting DISPATCH=0
6161
DISPATCH ?= 1
6262
else
63-
DISPATCH = 0
63+
ifeq ($(DISPATCH),1)
64+
$(info "Note: DISPATCH=1 is only supported on x86/x64 targets")
65+
endif
66+
override DISPATCH := 0
6467
endif
6568

6669
ifeq ($(NODE_JS),1)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,13 @@ The following macros can be set at compilation time to modify `libxxhash`'s beha
170170
- `XXH_PREFETCH_DIST` : select prefetching distance. For close-to-metal adaptation to specific hardware platforms. XXH3 only.
171171
- `XXH_NO_PREFETCH` : disable prefetching. Some platforms or situations may perform better without prefetching. XXH3 only.
172172

173+
#### Build modifiers for `xxhsum` CLI
174+
- `XXH_1ST_SPEED_TARGET` : select an initial speed target, expressed in MB/s, for the first speed test in benchmark mode. Benchmark will adjust the target at subsequent iterations, but the first test is made "blindly" by targeting this speed. Currently conservatively set to 10 MB/s, to support very slow (emulated) platforms.
175+
173176
#### Makefile variables
174177
When compiling the Command Line Interface `xxhsum` using `make`, the following environment variables can also be set :
175178
- `DISPATCH=1` : use `xxh_x86dispatch.c`, select at runtime between `scalar`, `sse2`, `avx2` or `avx512` instruction set. This option is only valid for `x86`/`x64` systems. It is enabled by default when target `x86`/`x64` is detected. It can be forcefully turned off using `DISPATCH=0`.
176179
- `LIBXXH_DISPATCH=1` : same idea, implemented a runtime vector extension detector, but within `libxxhash`. This parameter is disabled by default. When enabled (only valid for `x86`/`x64` systems), new symbols published in `xxh_x86dispatch.h` become accessible. At the time of this writing, it's required to include `xxh_x86dispatch.h` in order to access the symbols with runtime vector extension detection.
177-
- `XXH_1ST_SPEED_TARGET` : select an initial speed target, expressed in MB/s, for the first speed test in benchmark mode. Benchmark will adjust the target at subsequent iterations, but the first test is made "blindly" by targeting this speed. Currently conservatively set to 10 MB/s, to support very slow (emulated) platforms.
178180
- `NODE_JS=1` : When compiling `xxhsum` for Node.js with Emscripten, this links the `NODERAWFS` library for unrestricted filesystem access and patches `isatty` to make the command line utility correctly detect the terminal. This does make the binary specific to Node.js.
179181

180182
### Building xxHash - Using vcpkg

0 commit comments

Comments
 (0)