Skip to content

Commit

Permalink
Merge pull request #326 from remilauzier/master
Browse files Browse the repository at this point in the history
Update cgf-if and a few fix
  • Loading branch information
workingjubilee committed Sep 9, 2021
2 parents b278573 + 064df9b commit db8810e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion src/api/into_bits/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() };

Expand Down
12 changes: 6 additions & 6 deletions src/api/ptr/gather_scatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, ...]
Expand All @@ -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, ...]
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/reductions/mask.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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..]);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/testing/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit db8810e

Please sign in to comment.