diff --git a/Cargo.toml b/Cargo.toml index 09e4fcd35..309f5c597 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://github.com/rust-lang/packed_simd" repository = "https://github.com/rust-lang/packed_simd" keywords = ["simd", "vector", "portability"] categories = ["hardware-support", "concurrency", "no-std", "data-structures"] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" build = "build.rs" edition = "2018" @@ -20,7 +20,7 @@ is-it-maintained-open-issues = { repository = "rust-lang/packed_simd" } maintenance = { status = "experimental" } [dependencies] -cfg-if = "0.1.10" +cfg-if = "1.0.0" core_arch = { version = "0.1.5", optional = true } libm = "0.1.4" diff --git a/contributing.md b/contributing.md index 93fa92783..79af8c199 100644 --- a/contributing.md +++ b/contributing.md @@ -35,7 +35,7 @@ If LLVM is indeed the cause, the issue will be reported upstream to the ## Submitting Pull Requests New code is submitted to the crate using GitHub's [pull request] mechanism. -You should first fork this repository, make your changes (preferrably in a new +You should first fork this repository, make your changes (preferably in a new branch), then use GitHub's web UI to create a new PR. [pull request]: https://help.github.com/articles/about-pull-requests/ diff --git a/src/api/into_bits/macros.rs b/src/api/into_bits/macros.rs index 8cec5b004..265ab34ae 100644 --- a/src/api/into_bits/macros.rs +++ b/src/api/into_bits/macros.rs @@ -24,7 +24,7 @@ macro_rules! impl_from_bits_ { use crate::IntoBits; assert_eq!(size_of::<$id>(), size_of::<$from_ty>()); - // This is safe becasue we never create a reference to + // This is safe because we never create a reference to // uninitialized memory: let a: $from_ty = unsafe { zeroed() }; diff --git a/src/api/ptr/gather_scatter.rs b/src/api/ptr/gather_scatter.rs index 6764643b7..374482ac3 100644 --- a/src/api/ptr/gather_scatter.rs +++ b/src/api/ptr/gather_scatter.rs @@ -146,8 +146,8 @@ macro_rules! impl_ptr_write { use super::*; #[test] fn write() { - // fourty_two = [42, 42, 42, ...] - let fourty_two + // forty_two = [42, 42, 42, ...] + let forty_two = Simd::<[i32; $elem_count]>::splat(42_i32); // This test will write to this array @@ -165,11 +165,11 @@ macro_rules! impl_ptr_write { } // ptr = [&arr[0], &arr[1], ...] - // write `fourty_two` to all elements of `v` + // write `forty_two` to all elements of `v` { let backup = arr; unsafe { - ptr.write($mask_ty::splat(true), fourty_two) + ptr.write($mask_ty::splat(true), forty_two) }; assert_eq!(arr, [42_i32; $elem_count]); arr = backup; // arr = [0, 1, 2, ...] @@ -195,7 +195,7 @@ macro_rules! impl_ptr_write { } let backup = arr; - unsafe { ptr.write(mask, fourty_two) }; + unsafe { ptr.write(mask, forty_two) }; assert_eq!(arr, r); arr = backup; // arr = [0, 1, 2, 3, ...] } @@ -204,7 +204,7 @@ macro_rules! impl_ptr_write { { let backup = arr; unsafe { - ptr.write($mask_ty::splat(false), fourty_two) + ptr.write($mask_ty::splat(false), forty_two) }; assert_eq!(arr, backup); } diff --git a/src/codegen/reductions/mask.rs b/src/codegen/reductions/mask.rs index 97260c6d4..0aec60969 100644 --- a/src/codegen/reductions/mask.rs +++ b/src/codegen/reductions/mask.rs @@ -1,6 +1,6 @@ //! Code generation workaround for `all()` mask horizontal reduction. //! -//! Works arround [LLVM bug 36702]. +//! Works around [LLVM bug 36702]. //! //! [LLVM bug 36702]: https://bugs.llvm.org/show_bug.cgi?id=36702 #![allow(unused_macros)] diff --git a/src/lib.rs b/src/lib.rs index ffb272c5d..f450361ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,7 +49,7 @@ //! ``` //! # use packed_simd_2::*; //! fn reduce(x: &[i32]) -> i32 { -//! assert!(x.len() % 4 == 0); +//! assert_eq!(x.len() % 4, 0); //! let mut sum = i32x4::splat(0); // [0, 0, 0, 0] //! for i in (0..x.len()).step_by(4) { //! sum += i32x4::from_slice_unaligned(&x[i..]); @@ -134,7 +134,7 @@ //! > of lanes as the mask. The example shows this by using [`m16x4`] instead //! > of [`m32x4`]. It is _typically_ more performant to use a mask element //! > width equal to the element width of the vectors being operated upon. -//! > This is, however, not true for 512-bit wide vectors when targetting +//! > This is, however, not true for 512-bit wide vectors when targeting //! > AVX-512, where the most efficient masks use only 1-bit per element. //! //! All vertical comparison operations returns masks: @@ -168,11 +168,11 @@ //! u8x8 = m8x8::splat(true).into_bits();` is provided because all `m8x8` bit //! patterns are valid `u8x8` bit patterns. However, the opposite is not //! true, not all `u8x8` bit patterns are valid `m8x8` bit-patterns, so this -//! operation cannot be peformed safely using `x.into_bits()`; one needs to +//! operation cannot be performed safely using `x.into_bits()`; one needs to //! use `unsafe { crate::mem::transmute(x) }` for that, making sure that the //! value in the `u8x8` is a valid bit-pattern of `m8x8`. //! -//! * **numeric casts** (`as`): are peformed using [`FromCast`]/[`Cast`] +//! * **numeric casts** (`as`): are performed using [`FromCast`]/[`Cast`] //! (`x.cast()`), just like `as`: //! //! * casting integer vectors whose lane types have the same size (e.g. diff --git a/src/testing/utils.rs b/src/testing/utils.rs index dce8ce71c..7d8f39573 100644 --- a/src/testing/utils.rs +++ b/src/testing/utils.rs @@ -15,7 +15,7 @@ where assert!(b > a, "{:?}, {:?}", a, b); assert!(!(a == b), "{:?}, {:?}", a, b); - assert!(a != b, "{:?}, {:?}", a, b); + assert_ne!(a, b, "{:?}, {:?}", a, b); assert!(a <= b, "{:?}, {:?}", a, b); assert!(b >= a, "{:?}, {:?}", a, b); @@ -52,7 +52,7 @@ where assert!(!(a != b), "{:?}, {:?}", a, b); } else { - assert!(a != b, "{:?}, {:?}", a, b); + assert_ne!(a, b, "{:?}, {:?}", a, b); test_lt(a, b); } }