| 1 | // Copyright 2024 the Fearless_SIMD Authors |
| 2 | // SPDX-License-Identifier: Apache-2.0 OR MIT |
| 3 | |
| 4 | //! Access to SSE3 intrinsics. |
| 5 | |
| 6 | use craterust-analyzer cargo fearless_simd 0.4.1 crate/::impl_macrosrust-analyzer cargo fearless_simd 0.4.1 impl_macros/::delegaterust-analyzer cargo fearless_simd 0.4.1 impl_macros/delegate!; |
| 7 | #[cfg(target_arch = "x86")] |
| 8 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::x86 as arch; |
| 9 | #[cfg(target_arch = "x86_64")] |
| 10 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::x86_64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/ as archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/; |
| 11 | |
| 12 | use archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/::*; |
| 13 | |
| 14 | /// A token for SSE3 intrinsics on `x86` and `x86_64`. |
| 15 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 16 | pub struct Sse3rust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/Sse3# { |
| 17 | _privaterust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/Sse3#_private.: (), |
| 18 | } |
| 19 | |
| 20 | #[expect( |
| 21 | clippy::missing_safety_doc, |
| 22 | reason = "TODO: https://github.com/linebender/fearless_simd/issues/40" |
| 23 | )] |
| 24 | impl Sse3rust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/Sse3# { |
| 25 | /// Create a SIMD token. |
| 26 | /// |
| 27 | /// # Safety |
| 28 | /// |
| 29 | /// The required CPU features must be available. |
| 30 | #[inline] |
| 31 | pub const unsafe fn new_uncheckedrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]new_unchecked().() -> Selfrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3] { |
| 32 | Selfrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3] { _privaterust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/Sse3#_private.: () } |
| 33 | } |
| 34 | |
| 35 | delegaterust-analyzer cargo fearless_simd 0.4.1 impl_macros/delegate!! { arch: |
| 36 | fn _mm_addsub_psrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_addsub_ps().(a: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#, b: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#) -> __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#; |
| 37 | fn _mm_addsub_pdrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_addsub_pd().(a: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#, b: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#) -> __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#; |
| 38 | fn _mm_hadd_pdrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_hadd_pd().(a: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#, b: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#) -> __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#; |
| 39 | fn _mm_hadd_psrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_hadd_ps().(a: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#, b: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#) -> __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#; |
| 40 | fn _mm_hsub_pdrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_hsub_pd().(a: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#, b: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#) -> __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#; |
| 41 | fn _mm_hsub_psrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_hsub_ps().(a: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#, b: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#) -> __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#; |
| 42 | unsafe fn _mm_lddqu_si128rust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_lddqu_si128().(mem_addr: *const __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#) -> __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#; |
| 43 | fn _mm_movedup_pdrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_movedup_pd().(a: __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#) -> __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#; |
| 44 | unsafe fn _mm_loaddup_pdrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_loaddup_pd().(mem_addr: *const f64) -> __m128drust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128d#; |
| 45 | fn _mm_movehdup_psrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_movehdup_ps().(a: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#) -> __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#; |
| 46 | fn _mm_moveldup_psrust-analyzer cargo fearless_simd 0.4.1 core_arch/x86/sse3/impl#[Sse3]_mm_moveldup_ps().(a: __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#) -> __m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#; |
| 47 | } |
| 48 | } |