Skip to content

Commit

Permalink
fix errors/warnings from the stabilization of cfg_target_feature and …
Browse files Browse the repository at this point in the history
…target_feature (rust-lang#432)

* fix build after stabilization of cfg_target_feature and target_feature

* fix doc tests

* fix spurious unused_attributes warning

* fix more unused attribute warnings

* More unnecessary target features

* Remove no longer needed trait imports

* Remove fixed upstream workarounds

* Fix parsing the #[assert_instr] macro

Following upstream proc_macro changes

* Fix form and parsing of #[simd_test]

* Don't use Cargo features for testing modes

Instead use RUSTFLAGS with `--cfg`. This'll help us be compatible with the
latest Cargo where a tweak to workspaces and features made the previous
invocations we had invalid.

* Don't thread RUSTFLAGS through docker

* Re-gate on x86 verification

Closes rust-lang#411
  • Loading branch information
gnzlbg authored and alexcrichton committed Apr 27, 2018
1 parent 1ea18a5 commit 1673dbb
Show file tree
Hide file tree
Showing 62 changed files with 1,134 additions and 1,187 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ matrix:
- env: TARGET=i586-unknown-linux-gnu
- env: TARGET=i686-unknown-linux-gnu
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
- env: TARGET=x86_64-unknown-linux-gnu-emulated NO_ADD=1 STDSIMD_TEST_EVERYTHING=1 FEATURES="intel_sde"
- env: TARGET=x86_64-unknown-linux-gnu-emulated NO_ADD=1 STDSIMD_TEST_EVERYTHING=1
- env: TARGET=arm-unknown-linux-gnueabihf
- env: TARGET=armv7-unknown-linux-gnueabihf
- env: TARGET=aarch64-unknown-linux-gnu
Expand Down Expand Up @@ -55,7 +55,6 @@ matrix:
cargo clippy --all -- -D clippy-pedantic
allow_failures:
- env: CLIPPY=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1
- env: VERIFY_X86

before_install:
# FIXME (travis-ci/travis-ci#8920) shouldn't be necessary...
Expand Down
1 change: 1 addition & 0 deletions ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN wget https://github.com/gnzlbg/intel_sde/raw/master/sde-external-8.16.0-2018-01-30-lin.tar.bz2
RUN tar -xjf sde-external-8.16.0-2018-01-30-lin.tar.bz2
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/sde-external-8.16.0-2018-01-30-lin/sde64 --"
ENV RUSTFLAGS --cfg stdsimd_intel_sde
3 changes: 1 addition & 2 deletions ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ run() {
--env CARGO_HOME=/cargo \
--volume `rustc --print sysroot`:/rust:ro \
--env TARGET=$target \
--env FEATURES=$2 \
--env STDSIMD_TEST_EVERYTHING \
--volume `pwd`:/checkout:ro \
--volume `pwd`/target:/checkout/target \
Expand All @@ -33,5 +32,5 @@ if [ -z "$1" ]; then
run $d
done
else
run $1 $2
run $1
fi
5 changes: 2 additions & 3 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export RUST_TEST_THREADS=1
#export RUST_BACKTRACE=full
#export RUST_TEST_NOCAPTURE=1

FEATURES="strict,$FEATURES"
RUSTFLAGS="$RUSTFLAGS --cfg stdsimd_strict"

# FIXME: on armv7 neon intrinsics require the neon target-feature to be
# unconditionally enabled.
Expand All @@ -27,9 +27,8 @@ echo "FEATURES=${FEATURES}"
echo "OBJDUMP=${OBJDUMP}"

cargo_test() {
cmd="cargo test --target=$TARGET --features $FEATURES $1"
cmd="cargo test --target=$TARGET $1"
cmd="$cmd -p coresimd -p stdsimd"
cmd="$cmd --manifest-path crates/stdsimd/Cargo.toml"
cmd="$cmd -- $2"
$cmd
}
Expand Down
28 changes: 14 additions & 14 deletions coresimd/aarch64/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ mod tests {
use std::mem;
use stdsimd_test::simd_test;

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vaeseq_u8() {
let data = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)
.into_bits();
Expand Down Expand Up @@ -219,7 +219,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vaesdq_u8() {
let data = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)
.into_bits();
Expand Down Expand Up @@ -249,7 +249,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vaesmcq_u8() {
let data = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)
.into_bits();
Expand Down Expand Up @@ -277,7 +277,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vaesimcq_u8() {
let data = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8)
.into_bits();
Expand Down Expand Up @@ -305,13 +305,13 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha1h_u32() {
assert_eq!(vsha1h_u32(0x1234), 0x048d);
assert_eq!(vsha1h_u32(0x5678), 0x159e);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha1su0q_u32() {
let r: u32x4 = vsha1su0q_u32(
u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)
Expand All @@ -324,7 +324,7 @@ mod tests {
assert_eq!(r, u32x4::new(0x9abc, 0xdef0, 0x1234, 0x5678));
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha1su1q_u32() {
let r: u32x4 = vsha1su1q_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -336,7 +336,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha1cq_u32() {
let r: u32x4 = vsha1cq_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -349,7 +349,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha1pq_u32() {
let r: u32x4 = vsha1pq_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -362,7 +362,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha1mq_u32() {
let r: u32x4 = vsha1mq_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -375,7 +375,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha256hq_u32() {
let r: u32x4 = vsha256hq_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -388,7 +388,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha256h2q_u32() {
let r: u32x4 = vsha256h2q_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -401,7 +401,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha256su0q_u32() {
let r: u32x4 = vsha256su0q_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand All @@ -413,7 +413,7 @@ mod tests {
);
}

#[simd_test = "crypto"]
#[simd_test(enable = "crypto")]
unsafe fn test_vsha256su1q_u32() {
let r: u32x4 = vsha256su1q_u32(
u32x4::new(0x1234, 0x5678, 0x9abc, 0xdef0).into_bits(),
Expand Down
Loading

0 comments on commit 1673dbb

Please sign in to comment.