Skip to content

Update WebAssembly SIMD/Atomics #1073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- mips64-unknown-linux-gnuabi64
- mips64el-unknown-linux-gnuabi64
- s390x-unknown-linux-gnu
# - wasm32-wasi
- wasm32-wasi
- i586-unknown-linux-gnu
- x86_64-linux-android
- arm-linux-androideabi
Expand Down Expand Up @@ -131,8 +131,8 @@ jobs:
disable_assert_instr: true
- target: s390x-unknown-linux-gnu
os: ubuntu-latest
# - target: wasm32-wasi
# os: ubuntu-latest
- target: wasm32-wasi
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
norun: true
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/wasm32-wasi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
xz-utils \
clang

RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v0.22.1/wasmtime-v0.22.1-x86_64-linux.tar.xz | tar xJf -
ENV PATH=$PATH:/wasmtime-v0.22.1-x86_64-linux
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v0.24.0/wasmtime-v0.24.0-x86_64-linux.tar.xz | tar xJf -
ENV PATH=$PATH:/wasmtime-v0.24.0-x86_64-linux

ENV CARGO_TARGET_WASM32_WASI_RUNNER="wasmtime \
--enable-simd \
Expand Down
10 changes: 6 additions & 4 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ case ${TARGET} in
cargo_test "--release"
;;
wasm32*)
prev="$RUSTFLAGS"
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128,+unimplemented-simd128"
cargo_test "--release"
export RUSTFLAGS="$prev"
# TODO: need to re-enable simd testing for wasm32
# TODO: should enable atomics testing for wasm32
# prev="$RUSTFLAGS"
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128,+unimplemented-simd128"
# cargo_test "--release"
# export RUSTFLAGS="$prev"
;;
# FIXME: don't build anymore
#mips-*gnu* | mipsel-*gnu*)
Expand Down
14 changes: 0 additions & 14 deletions crates/core_arch/build.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
use std::env;

fn main() {
println!("cargo:rustc-cfg=core_arch_docs");

// Used to tell our `#[assert_instr]` annotations that all simd intrinsics
// are available to test their codegen, since some are gated behind an extra
// `-Ctarget-feature=+unimplemented-simd128` that doesn't have any
// equivalent in `#[target_feature]` right now.
println!("cargo:rerun-if-env-changed=RUSTFLAGS");
if env::var("RUSTFLAGS")
.unwrap_or_default()
.contains("unimplemented-simd128")
{
println!("cargo:rustc-cfg=all_simd");
}
}
6 changes: 3 additions & 3 deletions crates/core_arch/src/wasm32/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use stdarch_test::assert_instr;

extern "C" {
#[link_name = "llvm.wasm.atomic.wait.i32"]
#[link_name = "llvm.wasm.memory.atomic.wait.i32"]
fn llvm_atomic_wait_i32(ptr: *mut i32, exp: i32, timeout: i64) -> i32;
#[link_name = "llvm.wasm.atomic.wait.i64"]
#[link_name = "llvm.wasm.memory.atomic.wait.i64"]
fn llvm_atomic_wait_i64(ptr: *mut i64, exp: i64, timeout: i64) -> i32;
#[link_name = "llvm.wasm.atomic.notify"]
#[link_name = "llvm.wasm.memory.atomic.notify"]
fn llvm_atomic_notify(ptr: *mut i32, cnt: i32) -> i32;
}

Expand Down
Loading