pub(crate) fn simd_xor<T>(x: T, y: T) -> T;
/// getelementptr (without inbounds)
- #[cfg(not(bootstrap))]
pub(crate) fn simd_arith_offset<T, U>(ptrs: T, offsets: U) -> T;
/// fptoui/fptosi/uitofp/sitofp
//! Private implementation details of public gather/scatter APIs.
-#[cfg(not(bootstrap))]
use crate::simd::intrinsics;
use crate::simd::{LaneCount, Simd, SupportedLaneCount};
-#[cfg(bootstrap)]
-use core::mem;
/// A vector of *const T.
#[derive(Debug, Copy, Clone)]
#[inline]
#[must_use]
pub fn wrapping_add(self, addend: Simd<usize, LANES>) -> Self {
- #[cfg(bootstrap)]
- // Safety: converting pointers to usize and vice-versa is safe
- // (even if using that pointer is not)
- unsafe {
- let x: Simd<usize, LANES> = mem::transmute_copy(&self);
- mem::transmute_copy(&{ x + (addend * Simd::splat(mem::size_of::<T>())) })
- }
- #[cfg(not(bootstrap))]
// Safety: this intrinsic doesn't have a precondition
unsafe { intrinsics::simd_arith_offset(self, addend) }
}
#[inline]
#[must_use]
pub fn wrapping_add(self, addend: Simd<usize, LANES>) -> Self {
- #[cfg(bootstrap)]
- // Safety: converting pointers to usize and vice-versa is safe
- // (even if using that pointer is not)
- unsafe {
- let x: Simd<usize, LANES> = mem::transmute_copy(&self);
- mem::transmute_copy(&{ x + (addend * Simd::splat(mem::size_of::<T>())) })
- }
- #[cfg(not(bootstrap))]
// Safety: this intrinsic doesn't have a precondition
unsafe { intrinsics::simd_arith_offset(self, addend) }
}