Skip to content

Commit cf2d269

Browse files
authored
Merge pull request #315 from JohnTitor/make-ci-happy
2 parents f14f691 + 886cbfb commit cf2d269

File tree

9 files changed

+30
-49
lines changed

9 files changed

+30
-49
lines changed

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ jobs:
4747
stage: 32bit-tier1
4848
- env: TARGET=x86_64-unknown-linux-gnu RUSTFLAGS="-C target-feature=+sse4.2"
4949
name: "x86_64-unknown-linux-gnu + SSE4.2"
50-
install: rustup component add rustfmt-preview
5150
stage: build-test-verify
5251
- env: TARGET=x86_64-unknown-linux-gnu RUSTFLAGS="-C target-feature=+avx2"
5352
name: "x86_64-unknown-linux-gnu + AVX2"
54-
install: rustup component add rustfmt-preview
5553
stage: build-test-verify
5654
- env: TARGET=arm-unknown-linux-gnueabihf
5755
name: "arm-unknown-linux-gnueabihf"
@@ -172,16 +170,14 @@ jobs:
172170
- name: "rustfmt"
173171
install: true
174172
script: |
175-
if rustup component add rustfmt-preview ; then
176-
ci/all.sh check_fmt || true
177-
fi
173+
rustup toolchain install nightly -c rustfmt --allow-downgrade
174+
ci/all.sh check_fmt || true
178175
stage: tools
179176
- name: "clippy"
180177
install: true
181178
script: |
182-
if rustup component add clippy-preview ; then
183-
ci/all.sh clippy
184-
fi
179+
rustup component add clippy
180+
ci/all.sh clippy
185181
stage: tools
186182

187183
allow_failures:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ packed_simd = { version = "0.3.4", package = "packed_simd_2" }
1818
[![Travis-CI Status]][travis] <!-- [![Appveyor Status]][appveyor] --> [![Latest Version]][crates.io] [![docs]][master_docs]
1919

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

2323
## Documentation
2424

examples/aobench/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ fn main() {
8989
for a in ALGORITHMS {
9090
error.push_str(&format!("\n- {}", a));
9191
}
92-
panic!(error);
92+
panic!("{}", error);
9393
}
9494
}

examples/fannkuch_redux/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn run<O: std::io::Write>(o: &mut O, n: usize, alg: usize) {
1010
fn main() {
1111
let n: usize =
1212
std::env::args().nth(1).expect("need one arg").parse().unwrap();
13-
assert!(3 <= n && n <= 14, "n = {} is out-of-range [3, 14]", n);
13+
assert!((3..=14).contains(&n), "n = {} is out-of-range [3, 14]", n);
1414
let alg = if let Some(v) = std::env::args().nth(2) {
1515
v.parse().unwrap()
1616
} else {

src/api/ops/scalar_shifts.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ macro_rules! impl_ops_scalar_shifts {
4141
unused_mut)
4242
)]
4343
// ^^^ FIXME: https://github.com/rust-lang/rust/issues/55344
44+
#[cfg(not(target_arch = "aarch64"))]
45+
//~^ FIXME: https://github.com/rust-lang/packed_simd/issues/317
4446
fn ops_scalar_shifts() {
4547
let z = $id::splat(0 as $elem_ty);
4648
let o = $id::splat(1 as $elem_ty);

src/api/ops/vector_rotates.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ macro_rules! impl_ops_vector_rotates {
4747
pub mod [<$id _ops_vector_rotate>] {
4848
use super::*;
4949
#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
50+
#[cfg(not(target_arch = "aarch64"))]
51+
//~^ FIXME: https://github.com/rust-lang/packed_simd/issues/317
5052
fn rotate_ops() {
5153
let z = $id::splat(0 as $elem_ty);
5254
let o = $id::splat(1 as $elem_ty);

src/api/ops/vector_shifts.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ macro_rules! impl_ops_vector_shifts {
4242
unused_mut)
4343
)]
4444
// ^^^ FIXME: https://github.com/rust-lang/rust/issues/55344
45+
#[cfg(not(target_arch = "aarch64"))]
46+
//~^ FIXME: https://github.com/rust-lang/packed_simd/issues/317
4547
fn ops_vector_shifts() {
4648
let z = $id::splat(0 as $elem_ty);
4749
let o = $id::splat(1 as $elem_ty);

src/api/reductions/min_max.rs

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -160,35 +160,25 @@ macro_rules! test_reduction_float_min_max {
160160
// targets:
161161
if i == $id::lanes() - 1 &&
162162
target_with_broken_last_lane_nan {
163-
// FIXME:
164-
// https://github.com/rust-lang-nursery/packed_simd/issues/5
165-
//
166-
// If there is a NaN, the result should always
167-
// the smallest element, but currently when the
168-
// last element is NaN the current
169-
// implementation incorrectly returns NaN.
170-
//
171-
// The targets mentioned above use different
172-
// codegen that produces the correct result.
173-
//
174-
// These asserts detect if this behavior changes
175-
assert!(v.min_element().is_nan(),
176-
// FIXME: ^^^ should be -3.
163+
assert_eq!(v.min_element(), -3.,
177164
"[A]: nan at {} => {} | {:?}",
178165
i, v.min_element(), v);
179166

180167
// If we replace all the elements in the vector
181168
// up-to the `i-th` lane with `NaN`s, the result
182169
// is still always `-3.` unless all elements of
183170
// the vector are `NaN`s:
184-
//
185-
// This is also broken:
186171
for j in 0..i {
187172
v = v.replace(j, n);
188-
assert!(v.min_element().is_nan(),
189-
// FIXME: ^^^ should be -3.
173+
if j == i-1 {
174+
assert!(v.min_element().is_nan(),
190175
"[B]: nan at {} => {} | {:?}",
191176
i, v.min_element(), v);
177+
} else {
178+
assert_eq!(v.min_element(), -3.,
179+
"[B]: nan at {} => {} | {:?}",
180+
i, v.min_element(), v);
181+
}
192182
}
193183

194184
// We are done here, since we were in the last
@@ -280,36 +270,25 @@ macro_rules! test_reduction_float_min_max {
280270
// targets:
281271
if i == $id::lanes() - 1 &&
282272
target_with_broken_last_lane_nan {
283-
// FIXME:
284-
// https://github.com/rust-lang-nursery/packed_simd/issues/5
285-
//
286-
// If there is a NaN, the result should
287-
// always the largest element, but currently
288-
// when the last element is NaN the current
289-
// implementation incorrectly returns NaN.
290-
//
291-
// The targets mentioned above use different
292-
// codegen that produces the correct result.
293-
//
294-
// These asserts detect if this behavior
295-
// changes
296-
assert!(v.max_element().is_nan(),
297-
// FIXME: ^^^ should be -3.
273+
assert_eq!(v.max_element(), -3.,
298274
"[A]: nan at {} => {} | {:?}",
299275
i, v.max_element(), v);
300276

301277
// If we replace all the elements in the vector
302278
// up-to the `i-th` lane with `NaN`s, the result
303279
// is still always `-3.` unless all elements of
304280
// the vector are `NaN`s:
305-
//
306-
// This is also broken:
307281
for j in 0..i {
308282
v = v.replace(j, n);
309-
assert!(v.max_element().is_nan(),
310-
// FIXME: ^^^ should be -3.
283+
if j == i-1 {
284+
assert!(v.min_element().is_nan(),
285+
"[B]: nan at {} => {} | {:?}",
286+
i, v.min_element(), v);
287+
} else {
288+
assert_eq!(v.max_element(), -3.,
311289
"[B]: nan at {} => {} | {:?}",
312290
i, v.max_element(), v);
291+
}
313292
}
314293

315294
// We are done here, since we were in the last

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ mod api;
262262
mod codegen;
263263
mod sealed;
264264

265-
pub use crate::sealed::{Simd as SimdVector, Shuffle, SimdArray, Mask};
265+
pub use crate::sealed::{Mask, Shuffle, Simd as SimdVector, SimdArray};
266266

267267
/// Packed SIMD vector type.
268268
///

0 commit comments

Comments
 (0)