Skip to content

Update emscripten to default enable mavx2 #5353

@sashwinbalaji

Description

@sashwinbalaji

Due to emscripten-core/emscripten#24076, we hit error like:

error: no matching function for call to '_mm256_loadu_si256'
137 | m = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(p));
| ^~~~~~~~~~~~~~~~~~

Now this issue has been fixed upstream but we haven't updated emscripten yet resulting in the todo in gn/standalone/BUILD.gn

# TODO: Remove this after updating emscripten.
config("wasm_avx2") {
  # Opt-in config for targets that use x86 AVX2 hand-rolled SIMD compiled for
  # WASM. Apply explicitly via configs += ["//gn/standalone:wasm_avx2"]; do NOT
  # add to default_configs — third-party code (e.g. Abseil CRC) uses AVX2
  # intrinsics with types incompatible with Emscripten's strict AVX2 headers.
  # See https://github.com/emscripten-core/emscripten/issues/24076.
  if (is_wasm) {
    cflags = [ "-mavx2" ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions