diff options
| author | bors <bors@rust-lang.org> | 2025-04-10 20:19:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-10 20:19:11 +0000 |
| commit | 0fe8f3454dbe9dda52a254991347e96bec579a6f (patch) | |
| tree | 7f09bac539ffe0294fd299f526c21bd748d75526 /tests/codegen/simd | |
| parent | 2205455d444f5f9da3a52e50f43c0306480218fb (diff) | |
| parent | 63dcac8423750369ee251e2bad0945ad765eaf5c (diff) | |
| download | rust-0fe8f3454dbe9dda52a254991347e96bec579a6f.tar.gz rust-0fe8f3454dbe9dda52a254991347e96bec579a6f.zip | |
Auto merge of #137412 - scottmcm:redo-swap, r=cuviper
Ensure `swap_nonoverlapping` is really always untyped This replaces #134954, which was arguably overcomplicated. ## Fixes #134713 Actually using the type passed to `ptr::swap_nonoverlapping` for anything other than its size + align turns out to not work, so this goes back to always erasing the types down to just bytes. (Except in `const`, which keeps doing the same thing as before to preserve `@RalfJung's` fix from #134689) ## Fixes #134946 I'd previously moved the swapping to use auto-vectorization *on bytes*, but someone pointed out on Discord that the tail loop handling from that left a whole bunch of byte-by-byte swapping around. This goes back to manual tail handling to avoid that, then still triggers auto-vectorization on pointer-width values. (So you'll see `<4 x i64>` on `x86-64-v3` for example.)
Diffstat (limited to 'tests/codegen/simd')
| -rw-r--r-- | tests/codegen/simd/swap-simd-types.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/codegen/simd/swap-simd-types.rs b/tests/codegen/simd/swap-simd-types.rs index 69767d0a755..c063cc683a6 100644 --- a/tests/codegen/simd/swap-simd-types.rs +++ b/tests/codegen/simd/swap-simd-types.rs @@ -23,8 +23,8 @@ pub fn swap_single_m256(x: &mut __m256, y: &mut __m256) { #[no_mangle] pub fn swap_m256_slice(x: &mut [__m256], y: &mut [__m256]) { // CHECK-NOT: alloca - // CHECK: load <8 x float>{{.+}}align 32 - // CHECK: store <8 x float>{{.+}}align 32 + // CHECK-COUNT-2: load <4 x i64>{{.+}}align 32 + // CHECK-COUNT-2: store <4 x i64>{{.+}}align 32 if x.len() == y.len() { x.swap_with_slice(y); } @@ -34,7 +34,7 @@ pub fn swap_m256_slice(x: &mut [__m256], y: &mut [__m256]) { #[no_mangle] pub fn swap_bytes32(x: &mut [u8; 32], y: &mut [u8; 32]) { // CHECK-NOT: alloca - // CHECK: load <32 x i8>{{.+}}align 1 - // CHECK: store <32 x i8>{{.+}}align 1 + // CHECK-COUNT-2: load <4 x i64>{{.+}}align 1 + // CHECK-COUNT-2: store <4 x i64>{{.+}}align 1 swap(x, y) } |
