From 349a61143c81f7e15baf07f457938f469d4b9e7b Mon Sep 17 00:00:00 2001 From: Caleb Zulawski Date: Mon, 18 Oct 2021 23:20:31 +0000 Subject: [PATCH] Delete travis config, move tests to github actions. --- .github/workflows/ci.yml | 35 +++++++++- .travis.yml | 82 ------------------------ crates/core_simd/src/masks/full_masks.rs | 4 +- crates/core_simd/tests/masks.rs | 4 ++ 4 files changed, 39 insertions(+), 86 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9768f53852..3a2c4477f76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,8 +94,7 @@ jobs: - { target: i586-pc-windows-msvc, target_feature: +sse2, os: windows-latest } # Annoyingly, the x86_64-unknown-linux-gnu runner *almost* always has - # avx512vl, but occasionally doesn't. As a result, we still run that - # one under travis. + # avx512vl, but occasionally doesn't. Maybe one day we can enable it. steps: - uses: actions/checkout@v2 @@ -141,6 +140,31 @@ jobs: - name: Test (release) run: cargo test --verbose --target=${{ matrix.target }} --release + wasm-tests: + name: "wasm (firefox, ${{ matrix.name }})" + runs-on: ubuntu-latest + strategy: + matrix: + include: + - { name: default, RUSTFLAGS: "" } + - { name: simd128, RUSTFLAGS: "-C target-feature=+simd128" } + steps: + - uses: actions/checkout@v2 + - name: Setup Rust + run: | + rustup update nightly --no-self-update + rustup default nightly + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Test (debug) + run: wasm-pack test --firefox --headless crates/core_simd + env: + RUSTFLAGS: ${{ matrix.rustflags }} + - name: Test (release) + run: wasm-pack test --firefox --headless crates/core_simd --release + env: + RUSTFLAGS: ${{ matrix.rustflags }} + cross-tests: name: "${{ matrix.target }} (via cross)" runs-on: ubuntu-latest @@ -163,12 +187,19 @@ jobs: # 32-bit arm has a few idiosyncracies like having subnormal flushing # to zero on by default. Ideally we'd set - armv7-unknown-linux-gnueabihf + - aarch64-unknown-linux-gnu # Note: The issue above means neither of these mips targets will use # MSA (mips simd) but MIPS uses a nonstandard binary representation # for NaNs which makes it worth testing on despite that. - mips-unknown-linux-gnu - mips64-unknown-linux-gnuabi64 - riscv64gc-unknown-linux-gnu + # TODO this test works, but it appears to time out + # - powerpc-unknown-linux-gnu + # TODO this test is broken, but it appears to be a problem with QEMU, not us. + # - powerpc64le-unknown-linux-gnu + # TODO enable this once a new version of cross is released + # - powerpc64-unknown-linux-gnu steps: - uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b284c87ecb..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,82 +0,0 @@ -branches: - only: - - master - -language: rust -rust: - - nightly - -matrix: - fast_finish: true - include: - # Linux (aarch64) - - name: "aarch64-unknown-linux-gnu (neon)" - os: linux - arch: arm64 - - - name: "aarch64-unknown-linux-gnu (neon, sve)" - os: linux - arch: arm64 - env: RUSTFLAGS=-Ctarget-feature=+sve - - - name: "aarch64-unknown-linux-gnu (native, see log for cfg)" - os: linux - arch: arm64 - env: RUSTFLAGS=-Ctarget-cpu=native - - # Linux (powerpc64le) - - name: "powerpc64le-unknown-linux-gnu (altivec, vsx, power8-*)" - os: linux - arch: ppc64le - - - name: "powerpc64le-unknown-linux-gnu (native, see log for cfg)" - os: linux - arch: ppc64le - env: RUSTFLAGS=-Ctarget-cpu=native - - # Linux (x86_64) (for AVX512, which sadly seems to only *usually* be present - # on the github actions linux runner...) - - name: "x86_64-unknown-linux-gnu+avx512vl" - os: linux - arch: amd64 - env: RUSTFLAGS=-Ctarget-feature=+avx512vl - - # WebAssembly (wasm-bindgen) - - name: "wasm32-unknown-unknown (firefox)" - os: linux - arch: amd64 - addons: - firefox: latest-nightly - install: - - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - script: - - wasm-pack test --firefox --headless crates/core_simd - - wasm-pack test --firefox --headless crates/core_simd --release - - # FIXME: See https://github.com/rust-lang/stdsimd/issues/92 - # - name: "wasm32-unknown-unknown+simd128 (firefox)" - # os: linux - # arch: amd64 - # addons: - # firefox: latest-nightly - # install: - # - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - # script: - # - export RUSTFLAGS="-C target-feature=+simd128" - # - wasm-pack test --firefox --headless crates/core_simd - # - wasm-pack test --firefox --headless crates/core_simd --release - -script: - - echo "## Requested target configuration (RUSTFLAGS=$RUSTFLAGS)" - - rustc --print=cfg $RUSTFLAGS - - - echo "## Supported target configuration" - - rustc --print=cfg -Ctarget-cpu=native - - - echo "\n---\n" - - - echo "## Running tests (debug)" - - cargo test -v - - - echo "## Running tests (release)" - - cargo test -v --release diff --git a/crates/core_simd/src/masks/full_masks.rs b/crates/core_simd/src/masks/full_masks.rs index b653bce05b9..dd981cedb93 100644 --- a/crates/core_simd/src/masks/full_masks.rs +++ b/crates/core_simd/src/masks/full_masks.rs @@ -119,7 +119,7 @@ pub fn convert(self) -> Mask // There is a bug where LLVM appears to implement this operation with the wrong // bit order. // TODO fix this in a better way - if cfg!(any(target_arch = "mips", target_arch = "mips64")) { + if cfg!(target_endian = "big") { for x in bitmask.as_mut() { *x = x.reverse_bits(); } @@ -136,7 +136,7 @@ pub fn convert(self) -> Mask // There is a bug where LLVM appears to implement this operation with the wrong // bit order. // TODO fix this in a better way - if cfg!(any(target_arch = "mips", target_arch = "mips64")) { + if cfg!(target_endian = "big") { for x in bitmask.as_mut() { *x = x.reverse_bits(); } diff --git a/crates/core_simd/tests/masks.rs b/crates/core_simd/tests/masks.rs index c2d400d79d4..6a8ecd33a73 100644 --- a/crates/core_simd/tests/masks.rs +++ b/crates/core_simd/tests/masks.rs @@ -86,6 +86,10 @@ fn roundtrip_bitmask_conversion() { mod mask_api { test_mask_api! { i8 } + test_mask_api! { i16 } + test_mask_api! { i32 } + test_mask_api! { i64 } + test_mask_api! { isize } } #[test]