Skip to content

Commit

Permalink
Merge pull request #394 from rust-lang/sync-upstream-2024-02-17
Browse files Browse the repository at this point in the history
Sync upstream 2024 Feb 17
  • Loading branch information
calebzulawski authored Feb 17, 2024
2 parents 7348d2d + 9aec60e commit e06e54c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/core_simd/src/core_simd_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Instead, they map to a reasonable implementation of the operation for the target

Consistency between targets is not compromised to use faster or fewer instructions.
In some cases, `std::arch` will provide a faster function that has slightly different behavior than the `std::simd` equivalent.
For example, [`_mm_min_ps`](`core::arch::x86_64::_mm_min_ps`)[^1] can be slightly faster than [`SimdFloat::simd_min`](`num::SimdFloat::simd_min`), but does not conform to the IEEE standard also used by [`f32::min`].
For example, `_mm_min_ps`[^1] can be slightly faster than [`SimdFloat::simd_min`](`num::SimdFloat::simd_min`), but does not conform to the IEEE standard also used by [`f32::min`].
When necessary, [`Simd<T, N>`] can be converted to the types provided by `std::arch` to make use of target-specific functions.

Many targets simply don't have SIMD, or don't support SIMD for a particular element type.
Expand Down
2 changes: 1 addition & 1 deletion crates/core_simd/src/swizzle_dyn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where
16 => transize(vqtbl1q_u8, self, idxs),
#[cfg(all(target_feature = "avx2", not(target_feature = "avx512vbmi")))]
32 => transize_raw(avx2_pshufb, self, idxs),
#[cfg(target_feature = "avx512vl,avx512vbmi")]
#[cfg(all(target_feature = "avx512vl", target_feature = "avx512vbmi"))]
32 => transize(x86::_mm256_permutexvar_epi8, self, idxs),
// Notable absence: avx512bw shuffle
// If avx512bw is available, odds of avx512vbmi are good
Expand Down
9 changes: 6 additions & 3 deletions crates/core_simd/src/vendor/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ use core::arch::arm::*;
#[cfg(target_arch = "aarch64")]
use core::arch::aarch64::*;

#[cfg(any(
target_arch = "aarch64",
all(target_arch = "arm", target_feature = "v7"),
#[cfg(all(
any(
target_arch = "aarch64",
all(target_arch = "arm", target_feature = "v7"),
),
target_endian = "little"
))]
mod neon {
use super::*;
Expand Down

0 comments on commit e06e54c

Please sign in to comment.