Skip to content

Account some warnings to fix CI #315

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 4 commits into from
Apr 2, 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
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ jobs:
stage: 32bit-tier1
- env: TARGET=x86_64-unknown-linux-gnu RUSTFLAGS="-C target-feature=+sse4.2"
name: "x86_64-unknown-linux-gnu + SSE4.2"
install: rustup component add rustfmt-preview
stage: build-test-verify
- env: TARGET=x86_64-unknown-linux-gnu RUSTFLAGS="-C target-feature=+avx2"
name: "x86_64-unknown-linux-gnu + AVX2"
install: rustup component add rustfmt-preview
stage: build-test-verify
- env: TARGET=arm-unknown-linux-gnueabihf
name: "arm-unknown-linux-gnueabihf"
Expand Down Expand Up @@ -172,16 +170,14 @@ jobs:
- name: "rustfmt"
install: true
script: |
if rustup component add rustfmt-preview ; then
ci/all.sh check_fmt || true
fi
rustup toolchain install nightly -c rustfmt --allow-downgrade
ci/all.sh check_fmt || true
stage: tools
- name: "clippy"
install: true
script: |
if rustup component add clippy-preview ; then
ci/all.sh clippy
fi
rustup component add clippy
ci/all.sh clippy
stage: tools

allow_failures:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ packed_simd = { version = "0.3.4", package = "packed_simd_2" }
[![Travis-CI Status]][travis] <!-- [![Appveyor Status]][appveyor] --> [![Latest Version]][crates.io] [![docs]][master_docs]

**WARNING**: this crate only supports the most recent nightly Rust toolchain
and will be superceded by [stdsimd](https://github.com/rust-lang/stdsimd).
and will be superseded by [stdsimd](https://github.com/rust-lang/stdsimd).

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion examples/aobench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ fn main() {
for a in ALGORITHMS {
error.push_str(&format!("\n- {}", a));
}
panic!(error);
panic!("{}", error);
}
}
2 changes: 1 addition & 1 deletion examples/fannkuch_redux/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn run<O: std::io::Write>(o: &mut O, n: usize, alg: usize) {
fn main() {
let n: usize =
std::env::args().nth(1).expect("need one arg").parse().unwrap();
assert!(3 <= n && n <= 14, "n = {} is out-of-range [3, 14]", n);
assert!((3..=14).contains(&n), "n = {} is out-of-range [3, 14]", n);
let alg = if let Some(v) = std::env::args().nth(2) {
v.parse().unwrap()
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/api/ops/scalar_shifts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ macro_rules! impl_ops_scalar_shifts {
unused_mut)
)]
// ^^^ FIXME: https://github.com/rust-lang/rust/issues/55344
#[cfg(not(target_arch = "aarch64"))]
//~^ FIXME: https://github.com/rust-lang/packed_simd/issues/317
fn ops_scalar_shifts() {
let z = $id::splat(0 as $elem_ty);
let o = $id::splat(1 as $elem_ty);
Expand Down
2 changes: 2 additions & 0 deletions src/api/ops/vector_rotates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ macro_rules! impl_ops_vector_rotates {
pub mod [<$id _ops_vector_rotate>] {
use super::*;
#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg(not(target_arch = "aarch64"))]
//~^ FIXME: https://github.com/rust-lang/packed_simd/issues/317
fn rotate_ops() {
let z = $id::splat(0 as $elem_ty);
let o = $id::splat(1 as $elem_ty);
Expand Down
2 changes: 2 additions & 0 deletions src/api/ops/vector_shifts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ macro_rules! impl_ops_vector_shifts {
unused_mut)
)]
// ^^^ FIXME: https://github.com/rust-lang/rust/issues/55344
#[cfg(not(target_arch = "aarch64"))]
//~^ FIXME: https://github.com/rust-lang/packed_simd/issues/317
fn ops_vector_shifts() {
let z = $id::splat(0 as $elem_ty);
let o = $id::splat(1 as $elem_ty);
Expand Down
53 changes: 16 additions & 37 deletions src/api/reductions/min_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,35 +160,25 @@ macro_rules! test_reduction_float_min_max {
// targets:
if i == $id::lanes() - 1 &&
target_with_broken_last_lane_nan {
// FIXME:
// https://github.com/rust-lang-nursery/packed_simd/issues/5
//
// If there is a NaN, the result should always
// the smallest element, but currently when the
// last element is NaN the current
// implementation incorrectly returns NaN.
//
// The targets mentioned above use different
// codegen that produces the correct result.
//
// These asserts detect if this behavior changes
assert!(v.min_element().is_nan(),
// FIXME: ^^^ should be -3.
assert_eq!(v.min_element(), -3.,
"[A]: nan at {} => {} | {:?}",
i, v.min_element(), v);

// If we replace all the elements in the vector
// up-to the `i-th` lane with `NaN`s, the result
// is still always `-3.` unless all elements of
// the vector are `NaN`s:
//
// This is also broken:
for j in 0..i {
v = v.replace(j, n);
assert!(v.min_element().is_nan(),
// FIXME: ^^^ should be -3.
if j == i-1 {
assert!(v.min_element().is_nan(),
"[B]: nan at {} => {} | {:?}",
i, v.min_element(), v);
} else {
assert_eq!(v.min_element(), -3.,
"[B]: nan at {} => {} | {:?}",
i, v.min_element(), v);
}
}

// We are done here, since we were in the last
Expand Down Expand Up @@ -280,36 +270,25 @@ macro_rules! test_reduction_float_min_max {
// targets:
if i == $id::lanes() - 1 &&
target_with_broken_last_lane_nan {
// FIXME:
// https://github.com/rust-lang-nursery/packed_simd/issues/5
//
// If there is a NaN, the result should
// always the largest element, but currently
// when the last element is NaN the current
// implementation incorrectly returns NaN.
//
// The targets mentioned above use different
// codegen that produces the correct result.
//
// These asserts detect if this behavior
// changes
assert!(v.max_element().is_nan(),
// FIXME: ^^^ should be -3.
assert_eq!(v.max_element(), -3.,
"[A]: nan at {} => {} | {:?}",
i, v.max_element(), v);

// If we replace all the elements in the vector
// up-to the `i-th` lane with `NaN`s, the result
// is still always `-3.` unless all elements of
// the vector are `NaN`s:
//
// This is also broken:
for j in 0..i {
v = v.replace(j, n);
assert!(v.max_element().is_nan(),
// FIXME: ^^^ should be -3.
if j == i-1 {
assert!(v.min_element().is_nan(),
"[B]: nan at {} => {} | {:?}",
i, v.min_element(), v);
} else {
assert_eq!(v.max_element(), -3.,
"[B]: nan at {} => {} | {:?}",
i, v.max_element(), v);
}
}

// We are done here, since we were in the last
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ mod api;
mod codegen;
mod sealed;

pub use crate::sealed::{Simd as SimdVector, Shuffle, SimdArray, Mask};
pub use crate::sealed::{Mask, Shuffle, Simd as SimdVector, SimdArray};

/// Packed SIMD vector type.
///
Expand Down