Skip to content

Commit 064df9b

Browse files
author
Rémi Lauzier
committed
Update cgf-if and a few fix
1 parent f60e900 commit 064df9b

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ homepage = "https://github.com/rust-lang/packed_simd"
88
repository = "https://github.com/rust-lang/packed_simd"
99
keywords = ["simd", "vector", "portability"]
1010
categories = ["hardware-support", "concurrency", "no-std", "data-structures"]
11-
license = "MIT/Apache-2.0"
11+
license = "MIT OR Apache-2.0"
1212
build = "build.rs"
1313
edition = "2018"
1414

@@ -21,7 +21,7 @@ is-it-maintained-open-issues = { repository = "rust-lang/packed_simd" }
2121
maintenance = { status = "experimental" }
2222

2323
[dependencies]
24-
cfg-if = "0.1.10"
24+
cfg-if = "1.0.0"
2525
core_arch = { version = "0.1.5", optional = true }
2626
libm = "0.1.4"
2727

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If LLVM is indeed the cause, the issue will be reported upstream to the
3535
## Submitting Pull Requests
3636

3737
New code is submitted to the crate using GitHub's [pull request] mechanism.
38-
You should first fork this repository, make your changes (preferrably in a new
38+
You should first fork this repository, make your changes (preferably in a new
3939
branch), then use GitHub's web UI to create a new PR.
4040

4141
[pull request]: https://help.github.com/articles/about-pull-requests/

src/api/into_bits/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ macro_rules! impl_from_bits_ {
2424
use crate::IntoBits;
2525
assert_eq!(size_of::<$id>(),
2626
size_of::<$from_ty>());
27-
// This is safe becasue we never create a reference to
27+
// This is safe because we never create a reference to
2828
// uninitialized memory:
2929
let a: $from_ty = unsafe { zeroed() };
3030

src/api/ptr/gather_scatter.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ macro_rules! impl_ptr_write {
146146
use super::*;
147147
#[test]
148148
fn write() {
149-
// fourty_two = [42, 42, 42, ...]
150-
let fourty_two
149+
// forty_two = [42, 42, 42, ...]
150+
let forty_two
151151
= Simd::<[i32; $elem_count]>::splat(42_i32);
152152

153153
// This test will write to this array
@@ -165,11 +165,11 @@ macro_rules! impl_ptr_write {
165165
}
166166
// ptr = [&arr[0], &arr[1], ...]
167167

168-
// write `fourty_two` to all elements of `v`
168+
// write `forty_two` to all elements of `v`
169169
{
170170
let backup = arr;
171171
unsafe {
172-
ptr.write($mask_ty::splat(true), fourty_two)
172+
ptr.write($mask_ty::splat(true), forty_two)
173173
};
174174
assert_eq!(arr, [42_i32; $elem_count]);
175175
arr = backup; // arr = [0, 1, 2, ...]
@@ -195,7 +195,7 @@ macro_rules! impl_ptr_write {
195195
}
196196

197197
let backup = arr;
198-
unsafe { ptr.write(mask, fourty_two) };
198+
unsafe { ptr.write(mask, forty_two) };
199199
assert_eq!(arr, r);
200200
arr = backup; // arr = [0, 1, 2, 3, ...]
201201
}
@@ -204,7 +204,7 @@ macro_rules! impl_ptr_write {
204204
{
205205
let backup = arr;
206206
unsafe {
207-
ptr.write($mask_ty::splat(false), fourty_two)
207+
ptr.write($mask_ty::splat(false), forty_two)
208208
};
209209
assert_eq!(arr, backup);
210210
}

src/codegen/reductions/mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Code generation workaround for `all()` mask horizontal reduction.
22
//!
3-
//! Works arround [LLVM bug 36702].
3+
//! Works around [LLVM bug 36702].
44
//!
55
//! [LLVM bug 36702]: https://bugs.llvm.org/show_bug.cgi?id=36702
66
#![allow(unused_macros)]

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
//! ```
5050
//! # use packed_simd_2::*;
5151
//! fn reduce(x: &[i32]) -> i32 {
52-
//! assert!(x.len() % 4 == 0);
52+
//! assert_eq!(x.len() % 4, 0);
5353
//! let mut sum = i32x4::splat(0); // [0, 0, 0, 0]
5454
//! for i in (0..x.len()).step_by(4) {
5555
//! sum += i32x4::from_slice_unaligned(&x[i..]);
@@ -134,7 +134,7 @@
134134
//! > of lanes as the mask. The example shows this by using [`m16x4`] instead
135135
//! > of [`m32x4`]. It is _typically_ more performant to use a mask element
136136
//! > width equal to the element width of the vectors being operated upon.
137-
//! > This is, however, not true for 512-bit wide vectors when targetting
137+
//! > This is, however, not true for 512-bit wide vectors when targeting
138138
//! > AVX-512, where the most efficient masks use only 1-bit per element.
139139
//!
140140
//! All vertical comparison operations returns masks:
@@ -168,11 +168,11 @@
168168
//! u8x8 = m8x8::splat(true).into_bits();` is provided because all `m8x8` bit
169169
//! patterns are valid `u8x8` bit patterns. However, the opposite is not
170170
//! true, not all `u8x8` bit patterns are valid `m8x8` bit-patterns, so this
171-
//! operation cannot be peformed safely using `x.into_bits()`; one needs to
171+
//! operation cannot be performed safely using `x.into_bits()`; one needs to
172172
//! use `unsafe { crate::mem::transmute(x) }` for that, making sure that the
173173
//! value in the `u8x8` is a valid bit-pattern of `m8x8`.
174174
//!
175-
//! * **numeric casts** (`as`): are peformed using [`FromCast`]/[`Cast`]
175+
//! * **numeric casts** (`as`): are performed using [`FromCast`]/[`Cast`]
176176
//! (`x.cast()`), just like `as`:
177177
//!
178178
//! * casting integer vectors whose lane types have the same size (e.g.

src/testing/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ where
1515
assert!(b > a, "{:?}, {:?}", a, b);
1616

1717
assert!(!(a == b), "{:?}, {:?}", a, b);
18-
assert!(a != b, "{:?}, {:?}", a, b);
18+
assert_ne!(a, b, "{:?}, {:?}", a, b);
1919

2020
assert!(a <= b, "{:?}, {:?}", a, b);
2121
assert!(b >= a, "{:?}, {:?}", a, b);
@@ -52,7 +52,7 @@ where
5252

5353
assert!(!(a != b), "{:?}, {:?}", a, b);
5454
} else {
55-
assert!(a != b, "{:?}, {:?}", a, b);
55+
assert_ne!(a, b, "{:?}, {:?}", a, b);
5656
test_lt(a, b);
5757
}
5858
}

0 commit comments

Comments
 (0)