Skip to content

Sync portable-simd to 2023 May 10 #111429

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

Closed
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
b5f9d43
rust-lang/portable-simd#289: Strengthen warnings about relying on Mas…
thomcc Jul 21, 2022
ddede9f
make some Miri backtraces more pretty
RalfJung Jul 22, 2022
3183afb
Fix interleave/deinterleave for vectors with only one lane
calebzulawski Jul 29, 2022
691c8b2
Merge pull request #295 from RalfJung/miri-backtraces
calebzulawski Jul 29, 2022
8742a86
add all_lane_counts feature to enable non-power-of-2 lane counts <= 64
programmerjake Jul 29, 2022
6bf5128
Simplify interleave/deinterleave and fix for odd-length vectors.
calebzulawski Aug 1, 2022
c739af3
Hide rustc unstable feature from docs
calebzulawski Aug 1, 2022
d030301
Remove special case for length-1 vectors
calebzulawski Aug 1, 2022
5f70664
Simplify expression
calebzulawski Aug 1, 2022
7145dc5
Merge pull request #299 from rust-lang/interleave-one
calebzulawski Aug 4, 2022
d5cd4a8
Merge pull request #300 from programmerjake/all_lane_counts
programmerjake Aug 15, 2022
2c5ebfb
add feature flag
miguelraz Oct 1, 2022
4491309
Mark more mask functions inline
calebzulawski Oct 16, 2022
ee9a23f
Update readme
calebzulawski Oct 16, 2022
f236f57
Update README.md
calebzulawski Oct 16, 2022
2f38f70
Merge pull request #309 from rust-lang/mask-inline
calebzulawski Oct 16, 2022
aad8f0a
Merge pull request #310 from rust-lang/readme
calebzulawski Oct 17, 2022
61a6f18
Specify aliases in one place, and make it more uniform which are defined
calebzulawski Oct 17, 2022
402b50a
Improve variable names
calebzulawski Oct 17, 2022
7c80b69
Merge pull request #311 from rust-lang/alias
calebzulawski Oct 29, 2022
d3cfd7c
Add vectors of pointers
calebzulawski Jun 22, 2022
7e96f5d
Use safe casts
calebzulawski Jun 22, 2022
4076ba8
Implement scatter/gather with new pointer vector and add tests
calebzulawski Jun 23, 2022
6b3c599
Add missing safety comment
calebzulawski Jun 23, 2022
f10e591
Fix wrapping pointer arithmetic
calebzulawski Jun 24, 2022
da25087
Test a more useful pointer
calebzulawski Jun 24, 2022
e7cc021
Fix casts
calebzulawski Jun 25, 2022
8a5a573
Clarify addr and with_addr implementations
calebzulawski Jun 26, 2022
176cc81
Update for new intrinsics
calebzulawski Aug 4, 2022
dadf98a
Remove duplicate intrinsic
calebzulawski Aug 4, 2022
e5db1ec
Fix documentation
calebzulawski Aug 4, 2022
0fcc406
Fix pointer mutability casts and safety lints
calebzulawski Aug 5, 2022
a79718f
Use new intrinsics
calebzulawski Sep 18, 2022
078cb58
Apply suggestions from code review
calebzulawski Sep 19, 2022
469c620
Account for pointer metadata in pointer bounds
calebzulawski Oct 22, 2022
87779ae
Merge pull request #287 from rust-lang/feature/pointer-vectors
calebzulawski Oct 29, 2022
de30820
Update README.md
calebzulawski Oct 30, 2022
572122a
Add missing pointer tests and rename pointer cast fns to match scalars
calebzulawski Nov 10, 2022
ecc2875
Merge pull request #313 from rust-lang/pointer-tests
calebzulawski Nov 10, 2022
7ac1fbb
impl TryFrom<&[T]> for Simd
calebzulawski Nov 11, 2022
9dc690c
Add TryFrom<&[T]> tests
calebzulawski Nov 11, 2022
fd53445
Add pointer scatter/gather
calebzulawski Nov 12, 2022
35c60ce
Merge pull request #314 from rust-lang/try-from-slice
calebzulawski Nov 12, 2022
bef4c41
Add test examples
calebzulawski Nov 12, 2022
c247915
Update crates/core_simd/src/vector.rs
calebzulawski Nov 13, 2022
7e614f0
Fix typo typo
calebzulawski Nov 13, 2022
6e30c6e
Merge pull request #315 from rust-lang/scatter-gather-ptr
calebzulawski Nov 20, 2022
db8b23c
Remove reexport of simd::*
calebzulawski Nov 28, 2022
645ab61
Merge pull request #317 from rust-lang/fix-exports
calebzulawski Nov 28, 2022
54b6f69
Avoid a scalar loop in `Simd::from_slice`
thomcc Nov 28, 2022
1547dd6
Merge pull request #318 from thomcc/simd_from_slice
calebzulawski Nov 28, 2022
df3a639
add dot_product example
miguelraz Jun 4, 2021
c08a4d1
add more basic dot products and comments, README
miguelraz Mar 26, 2022
4615805
add remainder dot_product and cleanup
miguelraz Mar 26, 2022
4ddfd2f
non allocating fold simd
miguelraz Mar 29, 2022
aeac9ed
proper mul_add arg order, added tests
miguelraz Mar 29, 2022
64247a3
add _scalar names for dot_product examples
miguelraz Mar 30, 2022
da3bd6d
Update dot_product example import
workingjubilee Dec 4, 2022
582239a
Merge pull request #128 from miguelraz/dotprodexample
workingjubilee Dec 4, 2022
e3ef226
Fix the typo
howjmay Jan 23, 2023
9bd30e7
Merge pull request #327 from howjmay/typo
calebzulawski Jan 23, 2023
0fd7c8e
Add copy_to_slice
calebzulawski Feb 19, 2023
36829dd
Check that vectors aren't padded
calebzulawski Feb 19, 2023
8dcb4d5
Merge pull request #331 from rust-lang/to_slice
calebzulawski Mar 11, 2023
65b5210
Skip building wasm-bindgen-test on non-wasm targets
bjorn3 Mar 26, 2023
e6bbf49
Merge pull request #336 from bjorn3/faster_tests
calebzulawski Mar 26, 2023
90f2af7
Fix lint
calebzulawski Mar 26, 2023
ceb2611
Remove formats `[T; N]` does not impl (rust-lang/portable-simd#337)
workingjubilee Apr 10, 2023
afad9c3
Don't use direct field access in `Simd` functions
Sp00ph Apr 22, 2023
52833cc
Add notes to avoid direct field accesses
Sp00ph Apr 22, 2023
f1b86ba
Use pointer reads for better codegen in debug mode
Sp00ph Apr 22, 2023
f916add
Don't use direct field access in `Simd` functions (rust-lang/portable…
workingjubilee Apr 23, 2023
71d4c36
lane -> element for core::simd::Simd
workingjubilee Mar 18, 2023
92259a4
Clarify elementwise cmp reduces
workingjubilee Apr 10, 2023
4064678
Explain why to use Simd early
workingjubilee Apr 11, 2023
2b32732
Do not construct Simd
workingjubilee Apr 23, 2023
4f0d822
Implement dynamic byte-swizzle prototype (rust-lang/portable-simd#334)
workingjubilee Apr 23, 2023
ad8afa8
lane -> element for `core::simd::Simd` (rust-lang/portable-simd#338)
workingjubilee Apr 23, 2023
394a884
Fix {to,from}_array UB when repr(simd) produces padding
calebzulawski Apr 23, 2023
c504f01
Use cast and improve comments
calebzulawski Apr 26, 2023
195d4ca
Merge pull request #342 from rust-lang/load-store
calebzulawski Apr 27, 2023
4967f25
Use the new `load`/`store` functions in `{from,to}_slice`
Sp00ph May 7, 2023
b246e45
Fix inaccurate safety comments
Sp00ph May 7, 2023
45413e4
Merge pull request #346 from Sp00ph/update_safety
calebzulawski May 7, 2023
50416fc
Merge pull request #345 from Sp00ph/from_to_slice
calebzulawski May 7, 2023
8f50a17
Fixups for sync
workingjubilee Apr 23, 2023
d361e43
Drop const_ptr_read feature gate
workingjubilee May 10, 2023
8527625
Temp fix for swizzle_dyn
workingjubilee May 10, 2023
d8448c7
Sync portable-simd to 2023 May 10
workingjubilee May 10, 2023
fb42fac
Bless tests for portable-simd sync
workingjubilee May 11, 2023
dac348e
miri: Move patterns for simd tests
workingjubilee May 11, 2023
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
Prev Previous commit
Next Next commit
Add missing pointer tests and rename pointer cast fns to match scalars
calebzulawski committed Nov 10, 2022
commit 572122a95da6f8aaf513f53c426732f4c0a91325
6 changes: 4 additions & 2 deletions crates/core_simd/src/elements/const_ptr.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,9 @@ pub trait SimdConstPtr: Copy + Sealed {
fn is_null(self) -> Self::Mask;

/// Changes constness without changing the type.
fn as_mut(self) -> Self::MutPtr;
///
/// Equivalent to calling [`pointer::cast_mut`] on each lane.
fn cast_mut(self) -> Self::MutPtr;

/// Gets the "address" portion of the pointer.
///
@@ -85,7 +87,7 @@ where
}

#[inline]
fn as_mut(self) -> Self::MutPtr {
fn cast_mut(self) -> Self::MutPtr {
self.cast_ptr()
}

6 changes: 4 additions & 2 deletions crates/core_simd/src/elements/mut_ptr.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,9 @@ pub trait SimdMutPtr: Copy + Sealed {
fn is_null(self) -> Self::Mask;

/// Changes constness without changing the type.
fn as_const(self) -> Self::ConstPtr;
///
/// Equivalent to calling [`pointer::cast_const`] on each lane.
fn cast_const(self) -> Self::ConstPtr;

/// Gets the "address" portion of the pointer.
///
@@ -80,7 +82,7 @@ where
}

#[inline]
fn as_const(self) -> Self::ConstPtr {
fn cast_const(self) -> Self::ConstPtr {
self.cast_ptr()
}

52 changes: 52 additions & 0 deletions crates/core_simd/tests/pointers.rs
Original file line number Diff line number Diff line change
@@ -21,6 +21,22 @@ macro_rules! common_tests {
);
}

fn with_addr<const LANES: usize>() {
test_helpers::test_binary_elementwise(
&Simd::<*$constness u32, LANES>::with_addr,
&<*$constness u32>::with_addr,
&|_, _| true,
);
}

fn expose_addr<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&Simd::<*$constness u32, LANES>::expose_addr,
&<*$constness u32>::expose_addr,
&|_| true,
);
}

fn wrapping_offset<const LANES: usize>() {
test_helpers::test_binary_elementwise(
&Simd::<*$constness u32, LANES>::wrapping_offset,
@@ -51,9 +67,45 @@ macro_rules! common_tests {
mod const_ptr {
use super::*;
common_tests! { const }

test_helpers::test_lanes! {
fn cast_mut<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&Simd::<*const u32, LANES>::cast_mut,
&<*const u32>::cast_mut,
&|_| true,
);
}

fn from_exposed_addr<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&Simd::<*const u32, LANES>::from_exposed_addr,
&core::ptr::from_exposed_addr::<u32>,
&|_| true,
);
}
}
}

mod mut_ptr {
use super::*;
common_tests! { mut }

test_helpers::test_lanes! {
fn cast_const<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&Simd::<*mut u32, LANES>::cast_const,
&<*mut u32>::cast_const,
&|_| true,
);
}

fn from_exposed_addr<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&Simd::<*mut u32, LANES>::from_exposed_addr,
&core::ptr::from_exposed_addr_mut::<u32>,
&|_| true,
);
}
}
}