diff --git a/.travis.yml b/.travis.yml index 4513e08cec..c9886151ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,14 +13,14 @@ matrix: env: TARGET=x86_64-unknown-linux-gnu install: true - name: "x86_64-unknown-linux-gnu-emulated (runs all assert_instr tests)" - env: TARGET=x86_64-unknown-linux-gnu-emulated STDSIMD_TEST_EVERYTHING=1 RUSTFLAGS="--cfg stdsimd_intel_sde" + env: TARGET=x86_64-unknown-linux-gnu-emulated STDSIMD_TEST_EVERYTHING=1 RUSTFLAGS="--cfg stdsimd_intel_sde" NOLIBSTDBUILD=1 install: true - name: "x86_64-linux-android - no assert_instr" - env: TARGET=x86_64-linux-android STDSIMD_DISABLE_ASSERT_INSTR=1 + env: TARGET=x86_64-linux-android STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 - name: "arm-unknown-linux-gnueabihf" env: TARGET=arm-unknown-linux-gnueabihf - name: "arm-linux-androideabi - no assert_instr" - env: TARGET=arm-linux-androideabi STDSIMD_DISABLE_ASSERT_INSTR=1 + env: TARGET=arm-linux-androideabi STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 - name: "armv7-unknown-linux-gnueabihf - NEON" env: TARGET=armv7-unknown-linux-gnueabihf RUSTFLAGS="-C target-feature=+neon" - name: "aarch64-unknown-linux-gnu" @@ -28,13 +28,13 @@ matrix: - name: "mips-unknown-linux-gnu - build-only" env: TARGET=mips-unknown-linux-gnu NORUN=1 - name: "mipsel-unknown-linux-musl - build-only" - env: TARGET=mipsel-unknown-linux-musl NORUN=1 + env: TARGET=mipsel-unknown-linux-musl NORUN=1 NOLIBSTDBUILD=1 - name: "mips64-unknown-linux-gnuabi64 - build-only" env: TARGET=mips64-unknown-linux-gnuabi64 NORUN=1 - name: "mips64el-unknown-linux-gnuabi64 - build-only" env: TARGET=mips64el-unknown-linux-gnuabi64 NORUN=1 - name: "aarch64-linux-android - no assert_instr" - env: TARGET=aarch64-linux-android STDSIMD_DISABLE_ASSERT_INSTR=1 + env: TARGET=aarch64-linux-android STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 - name: "powerpc-unknown-linux-gnu - no assert_instr" env: TARGET=powerpc-unknown-linux-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 - name: "powerpc64-unknown-linux-gnu - no assert_instr, no simd_test" @@ -57,16 +57,16 @@ matrix: - name: "wasm32-unknown-unknown" env: TARGET=wasm32-unknown-unknown - name: "thumbv6m-none-eabi - build libcore only" - env: TARGET=thumbv6m-none-eabi NORUN=1 NOSTD=1 + env: TARGET=thumbv6m-none-eabi NORUN=1 NOSTD=1 NOLIBSTDBUILD=1 script: ci/run.sh - name: "thumbv7m-none-eabi - build libcore only" - env: TARGET=thumbv7m-none-eabi NORUN=1 NOSTD=1 + env: TARGET=thumbv7m-none-eabi NORUN=1 NOSTD=1 NOLIBSTDBUILD=1 script: ci/run.sh - name: "thumbv7em-none-eabi - build libcore only" - env: TARGET=thumbv7em-none-eabi NORUN=1 NOSTD=1 + env: TARGET=thumbv7em-none-eabi NORUN=1 NOSTD=1 NOLIBSTDBUILD=1 script: ci/run.sh - name: "thumbv7em-none-eabihf - build libcore only" - env: TARGET=thumbv7em-none-eabihf NORUN=1 NOSTD=1 + env: TARGET=thumbv7em-none-eabihf NORUN=1 NOSTD=1 NOLIBSTDBUILD=1 script: ci/run.sh - name: "x86_64-pc-windows-msvc" env: TARGET=x86_64-pc-windows-msvc @@ -75,16 +75,16 @@ matrix: install: true - name: "x86_64-pc-windows-gnu - no assert_instr" # FIXME: https://github.com/rust-lang-nursery/stdsimd/issues/595 - env: TARGET=x86_64-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 + env: TARGET=x86_64-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 os: windows script: ci/run.sh - name: "i686-pc-windows-msvc - no assert_instr" # FIXME: https://github.com/rust-lang-nursery/stdsimd/issues/595 - env: TARGET=i686-pc-windows-msvc STDSIMD_DISABLE_ASSERT_INSTR=1 + env: TARGET=i686-pc-windows-msvc STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 os: windows script: ci/run.sh - name: "i686-pc-windows-gnu" - env: TARGET=i686-pc-windows-gnu + env: TARGET=i686-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 os: windows script: ci/run.sh - name: "Documentation" @@ -109,8 +109,8 @@ matrix: - shellcheck ci/*.sh allow_failures: # FIXME: https://github.com/rust-lang/rust/issues/56153 - - env: TARGET=x86_64-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 - - env: TARGET=i686-pc-windows-gnu + - env: TARGET=x86_64-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 + - env: TARGET=i686-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 NOLIBSTDBUILD=1 install: rustup target add $TARGET script: diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index 68261a2f03..f3fda53b92 100644 --- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -7,7 +7,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev-arm64-cross \ qemu-user \ make \ - file + file \ + g++ \ + g++-aarch64-linux-gnu \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \ diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile index c7bd61f0a7..cd2b86ed9e 100644 --- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -7,7 +7,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev-armhf-cross \ qemu-user \ make \ - file + file \ + g++ \ + g++-arm-linux-gnueabihf \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \ OBJDUMP=arm-linux-gnueabihf-objdump diff --git a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile index e01b87afdf..42c0a2e81e 100644 --- a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile @@ -7,7 +7,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev-armhf-cross \ qemu-user \ make \ - file + file \ + g++ \ + g++-arm-linux-gnueabihf \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \ OBJDUMP=arm-linux-gnueabihf-objdump diff --git a/ci/docker/i586-unknown-linux-gnu/Dockerfile b/ci/docker/i586-unknown-linux-gnu/Dockerfile index 857974a858..9f83e06c04 100644 --- a/ci/docker/i586-unknown-linux-gnu/Dockerfile +++ b/ci/docker/i586-unknown-linux-gnu/Dockerfile @@ -4,4 +4,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev \ file \ make \ - ca-certificates + ca-certificates \ + g++-multilib \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile index 857974a858..9f83e06c04 100644 --- a/ci/docker/i686-unknown-linux-gnu/Dockerfile +++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -4,4 +4,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev \ file \ make \ - ca-certificates + ca-certificates \ + g++-multilib \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + diff --git a/ci/docker/mips-unknown-linux-gnu/Dockerfile b/ci/docker/mips-unknown-linux-gnu/Dockerfile index 4711cead37..49b4297d90 100644 --- a/ci/docker/mips-unknown-linux-gnu/Dockerfile +++ b/ci/docker/mips-unknown-linux-gnu/Dockerfile @@ -6,7 +6,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ qemu-system-mips \ qemu-user \ make \ - file + file \ + g++ \ + g++-mips-linux-gnu \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \ CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_RUNNER="qemu-mips -L /usr/mips-linux-gnu" \ diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile index 1422e8c809..d5b58829fc 100644 --- a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile +++ b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile @@ -3,7 +3,17 @@ FROM ubuntu:17.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \ - qemu-system-mips64 qemu-user + qemu-system-mips64 qemu-user \ + g++ \ + g++-mips64-linux-gnuabi64 \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \ CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64 -L /usr/mips64-linux-gnuabi64" \ diff --git a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile index d94deb5b20..b0568da272 100644 --- a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile +++ b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile @@ -3,7 +3,18 @@ FROM ubuntu:17.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \ - qemu-system-mips64el + qemu-system-mips64el \ + g++ \ + g++-mips64el-linux-gnuabi64 \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \ CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -L /usr/mips64el-linux-gnuabi64" \ diff --git a/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/ci/docker/mipsel-unknown-linux-musl/Dockerfile index 40ac50675b..d1c8f17eae 100644 --- a/ci/docker/mipsel-unknown-linux-musl/Dockerfile +++ b/ci/docker/mipsel-unknown-linux-musl/Dockerfile @@ -12,6 +12,7 @@ RUN apt-get update && \ curl \ file + RUN mkdir /toolchain # Note that this originally came from: diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index 43b174ed87..19cf1f4943 100644 --- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -5,7 +5,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \ qemu-system-ppc \ make \ - file + file \ + g++ \ + g++-powerpc-linux-gnu \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \ CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -cpu Vger -L /usr/powerpc-linux-gnu" \ diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index 7757ad28a4..dbd5fbe8fd 100644 --- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -9,7 +9,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ qemu-user \ qemu-system-ppc \ make \ - file + file \ + g++ \ + g++-powerpc64-linux-gnu \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \ CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -L /usr/powerpc64-linux-gnu" \ diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index 0b0c214fdf..713bf5e3f2 100644 --- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -3,7 +3,18 @@ FROM ubuntu:17.10 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \ - qemu-system-ppc file make + qemu-system-ppc file make \ + g++ \ + g++-powerpc64le-linux-gnu \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext + ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \ CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -L /usr/powerpc64le-linux-gnu" \ diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile index 89d9d87a15..702d1a5231 100644 --- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -6,7 +6,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ gcc-s390x-linux-gnu libc6-dev-s390x-cross \ qemu-user \ make \ - file + file \ + g++ \ + g++-s390x-linux-gnu \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \ CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \ diff --git a/ci/docker/wasm32-unknown-unknown/Dockerfile b/ci/docker/wasm32-unknown-unknown/Dockerfile index e385541f9c..bf638f4b3c 100644 --- a/ci/docker/wasm32-unknown-unknown/Dockerfile +++ b/ci/docker/wasm32-unknown-unknown/Dockerfile @@ -9,7 +9,16 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \ libc6-dev \ make \ python \ - xz-utils + xz-utils \ + g++ \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext # Install `wasm2wat` RUN git clone --recursive https://github.com/WebAssembly/wabt diff --git a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile index 44206fe872..ad7bbc0c19 100644 --- a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile @@ -4,4 +4,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libc6-dev \ file \ make \ - ca-certificates + ca-certificates \ + g++ \ + git \ + python \ + curl \ + bzip2 \ + perl \ + wget \ + autoconf \ + gettext diff --git a/ci/run-docker.sh b/ci/run-docker.sh index bd02dcd9bc..e403429492 100755 --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -9,6 +9,7 @@ run() { echo "Building docker container for TARGET=${1}" docker build -t stdsimd -f "ci/docker/${1}/Dockerfile" ci/ mkdir -p target + mkdir -p ../rustc target=$(echo "${1}" | sed 's/-emulated//') echo "Running docker" # shellcheck disable=SC2016 @@ -25,10 +26,12 @@ run() { --env STDSIMD_DISABLE_ASSERT_INSTR \ --env NOSTD \ --env NORUN \ + --env NOLIBSTDBUILD \ --env RUSTFLAGS \ --env STDSIMD_TEST_NORUN \ --volume "$(pwd)":/checkout:ro \ --volume "$(pwd)"/target:/checkout/target \ + --volume "$(pwd)"/../rustc:/rustc \ --workdir /checkout \ --privileged \ stdsimd \ diff --git a/ci/run.sh b/ci/run.sh index dd4e518038..feb867ed13 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -10,7 +10,7 @@ export RUST_TEST_THREADS=1 #export RUST_BACKTRACE=full #export RUST_TEST_NOCAPTURE=1 -RUSTFLAGS="$RUSTFLAGS --cfg stdsimd_strict" +RUSTFLAGS="${RUSTFLAGS} --cfg stdsimd_strict" case ${TARGET} in # On 32-bit use a static relocation model which avoids some extra @@ -34,13 +34,11 @@ echo "STDSIMD_TEST_EVERYTHING=${STDSIMD_TEST_EVERYTHING}" cargo_test() { subcmd="test" - if [ "$NORUN" = "1" ] - then + if [ "${NORUN}" = "1" ]; then export subcmd="build" fi - cmd="cargo ${subcmd} --target=$TARGET $1" - if [ "$NOSTD" = "1" ] - then + cmd="cargo ${subcmd} --target=${TARGET} ${1}" + if [ "${NOSTD}" = "1" ]; then cmd="$cmd -p coresimd" else cmd="$cmd -p coresimd -p stdsimd" @@ -49,20 +47,62 @@ cargo_test() { $cmd } -cargo_test -cargo_test "--release" +#cargo_test +#cargo_test "--release" # Test targets compiled with extra features. case ${TARGET} in x86*) export STDSIMD_DISABLE_ASSERT_INSTR=1 export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx" - cargo_test "--release" + #cargo_test "--release" ;; wasm32-unknown-unknown*) # export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+simd128" - cargo_test "--release --features=wasm_simd128" + #cargo_test "--release --features=wasm_simd128" ;; *) ;; esac + +if [ "${NOLIBSTDBUILD}" = "1" ]; then + echo "Whether libstd builds with this stdsimd is not tested!" +else + echo "Testing that libcore and libstd build with this stdsimd..." + stdsimd="$(pwd)" + stdsimd_hash="$(git rev-parse HEAD)" + + case ${TARGET} in + *apple*) + export RUSTC_DIR=~/rustc + ;; + *windows*) + export RUSTC_DIR=~/rustc + ;; + *) + export RUSTC_DIR=/rustc + ;; + esac + + git clone --depth 1 https://github.com/rust-lang/rust.git "${RUSTC_DIR}" + cd "${RUSTC_DIR}" + + git submodule init + git config -f .gitmodules submodule.stdsimd.url "${stdsimd}" + git add -u + git -c user.name='Travis CI' -c user.email='travis@ci.org' commit -m 'Update stdsimd submodule' + + git submodule sync + ./x.py clean + + ( + cd src/stdsimd + git checkout "${stdsimd_hash}" + ) + + git add src/stdsimd + git -c user.name='Travis CI' -c user.email='travis@ci.org' commit -m 'Update stdsimd' + + ./x.py check src/libcore --stage 1 --target "${TARGET}" + ./x.py check src/libstd --stage 1 --target "${TARGET}" +fi diff --git a/coresimd/mod.rs b/coresimd/mod.rs index 470d76f906..192d8219a9 100644 --- a/coresimd/mod.rs +++ b/coresimd/mod.rs @@ -5,6 +5,8 @@ mod macros; mod simd; +mod fooooooo; + /// Platform dependent vendor intrinsics. /// /// This documentation is for the version of this module in the `coresimd`