Skip to content

Commit b404c94

Browse files
jan-wassenbergcopybara-github
authored andcommitted
Again roll back wasm-simd assumption, more fixes required
PiperOrigin-RevId: 907700209
1 parent 0de5aa1 commit b404c94

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

g3doc/quick_reference.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,6 @@ You can detect and influence the set of supported targets:
391391
order to test each supported target. Calling with `b == 0` restores the
392392
normal `SupportedTargets` behavior.
393393

394-
**Note on `HWY_ARCH_WASM`**. The target is automatically detected and enabled;
395-
compiler flags such as -msimd128 are not required. This auto-detection
396-
behavior is consistent with other architectures (e.g., AVX2, NEON).
397-
Developers wishing to disable the `HWY_ARCH_WASM` target (e.g., to increase
398-
browser compatibility, or workaround compiler bugs) should use the
399-
`HWY_DISABLED_TARGETS` macro.
400-
401394
## Operations
402395

403396
In the following, the argument or return type `V` denotes a vector with `N`
@@ -2988,13 +2981,6 @@ binary will likely crash. This can only happen if:
29882981
also not supported by the current CPU, and baseline targets (in particular
29892982
`HWY_SCALAR`) were explicitly disabled.
29902983
2991-
**Note on WebAssembly:**: The browser validates the WebAssembly module during
2992-
instantiation when using `WebAssembly.instantiate` APIs. If SIMD features are
2993-
unsupported, the entire module is rejected. Therefore, dynamic dispatch between
2994-
targets (such as `HWY_SCALAR` and `HWY_WASM`) based on runtime feature detection
2995-
is not feasible, unlike with native targets. Developers should configure the
2996-
`HWY_ARCH_WASM` target at compile time using the `HWY_DISABLED_TARGETS` macro.
2997-
29982984
## Advanced configuration macros
29992985
30002986
The following macros govern which targets to generate. Unless specified

hwy/detect_compiler_arch.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,6 @@
356356
#define HWY_ARCH_ARM_OLD 0
357357
#endif
358358

359-
// Note: The WASM target is auto-detected and enabled; compiler flags like
360-
// "-msimd128" are not required. This behavior is consistent with other
361-
// architectures (e.g., AVX2, NEON). To disable HWY_ARCH_WASM, use the
362-
// HWY_DISABLED_TARGETS macro. For details, see the quick reference manual.
363359
#if defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__WASM__)
364360
#define HWY_ARCH_WASM 1
365361
#else

hwy/detect_targets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@
432432
// Also check HWY_ARCH to ensure that simulating unknown platforms ends up with
433433
// HWY_TARGET == HWY_BASELINE_SCALAR.
434434

435-
#if HWY_ARCH_WASM
435+
#if HWY_ARCH_WASM && defined(__wasm_simd128__)
436436
#if defined(HWY_WANT_WASM2)
437437
#define HWY_BASELINE_WASM HWY_WASM_EMU256
438438
#else

0 commit comments

Comments
 (0)