Skip to main content

simdeez/
lib.rs

1//! A library that abstracts over SIMD instruction sets, including ones with differing widths.
2//! SIMDeez is designed to allow you to write a function one time and produce scalar, SSE2, SSE41, AVX2, AVX-512, Neon, and WebAssembly SIMD versions of the function.
3//! You can either have the version you want selected automatically at runtime, at compiletime, or
4//! select yourself by hand.
5//!
6//! SIMDeez is currently in Beta, if there are intrinsics you need that are not currently implemented, create an issue
7//! and I'll add them. PRs to add more intrinsics are welcome. Currently things are well fleshed out for i32, i64, f32, and f64 types.
8//!
9//! AVX-512 support is available on x86/x86_64 targets with `avx512f`, `avx512bw`, and `avx512dq`.
10//! Runtime dispatch selects it ahead of AVX2 when those features are available.
11//!
12//! Refer to the excellent [Intel Intrinsics Guide](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#) for documentation on these functions.
13//!
14//! # Features
15//!
16//! * SSE2, SSE41, AVX2, AVX-512, Neon, WebAssembly SIMD, and scalar fallback
17//! * Can be used with compile time or run time selection
18//! * No runtime overhead
19//! * Uses familiar intel intrinsic naming conventions, easy to port.
20//!   * `_mm_add_ps(a,b)` becomes `add_ps(a,b)`
21//! * Fills in missing intrinsics in older APIs with fast SIMD workarounds.
22//!   * ceil, floor, round,blend, etc
23//! * Can be used by `#[no_std]` projects
24//! * Operator overloading: `let sum = va + vb` or `s *= s`
25//! * Extract or set a single lane with the index operator: `let v1 = v[1];`
26//!
27//! # SIMD math
28//! SIMDeez now provides a native, pure-Rust SIMD math surface via extension traits:
29//! `log2_u35`, `exp2_u35`, `ln_u35`, `exp_u35`, `sin_u35`, `cos_u35`, `tan_u35`,
30//! `asin_u35`, `acos_u35`, `atan_u35`, `atan2_u35`,
31//! `sinh_u35`, `cosh_u35`, `tanh_u35`, `asinh_u35`, `acosh_u35`, `atanh_u35`,
32//! `log10_u35`, `hypot_u35`, and `fmod`.
33//!
34//! These methods are available through `simdeez::math` and re-exported by `simdeez::prelude`.
35//! The implementation follows a layered blueprint: portable kernels first,
36//! backend-specific overrides where justified (currently a hand-tuned AVX2 `log2_u35`),
37//! and scalar fallback patching for exceptional lanes. The stabilized map is intentionally mixed:
38//! most `f32` families and the revived `f64` log/exp, inverse-trig, and binary-misc families
39//! keep SIMD defaults, while the known losing holdouts remain explicit scalar-reference mappings.
40//!
41//! # Compared to stdsimd
42//!
43//! * SIMDeez can abstract over differing simd widths. stdsimd does not
44//! * SIMDeez builds on stable rust now, stdsimd does not
45//!
46//! # Compared to Faster
47//!
48//! * SIMDeez can be used with runtime selection, Faster cannot.
49//! * SIMDeez has faster fallbacks for some functions
50//! * SIMDeez does not currently work with iterators, Faster does.
51//! * SIMDeez uses more idiomatic intrinsic syntax while Faster uses more idiomatic Rust syntax
52//! * SIMDeez can be used by `#[no_std]` projects
53//! * SIMDeez builds on stable rust now, Faster does not.
54//!
55//! All of the above could change! Faster seems to generally have the same
56//! performance as long as you don't run into some of the slower fallback functions.
57//!
58//!
59//! # Example
60//!
61//! ```rust
62//!use simdeez::{prelude::*, simd_runtime_generate};
63//!
64//! // If you want your SIMD function to use use runtime feature detection to call
65//!// the fastest available version, use the simd_runtime_generate macro:
66//!simd_runtime_generate!(
67//!    fn distance(x1: &[f32], y1: &[f32], x2: &[f32], y2: &[f32]) -> Vec<f32> {
68//!        let mut result: Vec<f32> = Vec::with_capacity(x1.len());
69//!        result.set_len(x1.len()); // for efficiency
70//!
71//!        // Set each slice to the same length for iteration efficiency
72//!        let mut x1 = &x1[..x1.len()];
73//!        let mut y1 = &y1[..x1.len()];
74//!        let mut x2 = &x2[..x1.len()];
75//!        let mut y2 = &y2[..x1.len()];
76//!        let mut res = &mut result[..x1.len()];
77//!
78//!        // Operations have to be done in terms of the vector width
79//!        // so that it will work with any size vector.
80//!        // the width of a vector type is provided as a constant
81//!        // so the compiler is free to optimize it more.
82//!        // Vf32::WIDTH is a constant, 4 when using SSE, 8 when using AVX2, etc
83//!        while x1.len() >= S::Vf32::WIDTH {
84//!            //load data from your vec into an SIMD value
85//!            let xv1 = S::Vf32::load_from_slice(&x1);
86//!            let yv1 = S::Vf32::load_from_slice(&y1);
87//!            let xv2 = S::Vf32::load_from_slice(&x2);
88//!            let yv2 = S::Vf32::load_from_slice(&y2);
89//!
90//!            // Use the usual intrinsic syntax if you prefer
91//!            let mut xdiff = xv1 - xv2;
92//!            // Or use operater overloading if you like
93//!            let mut ydiff = yv1 - yv2;
94//!            xdiff *= xdiff;
95//!            ydiff *= ydiff;
96//!            let distance = (xdiff + ydiff).sqrt();
97//!            // Store the SIMD value into the result vec
98//!            distance.copy_to_slice(res);
99//!
100//!            // Move each slice to the next position
101//!            x1 = &x1[S::Vf32::WIDTH..];
102//!            y1 = &y1[S::Vf32::WIDTH..];
103//!            x2 = &x2[S::Vf32::WIDTH..];
104//!            y2 = &y2[S::Vf32::WIDTH..];
105//!            res = &mut res[S::Vf32::WIDTH..];
106//!        }
107//!
108//!        // (Optional) Compute the remaining elements. Not necessary if you are sure the length
109//!        // of your data is always a multiple of the maximum S::Vf32_WIDTH you compile for (4 for SSE, 8 for AVX2, etc).
110//!        // This can be asserted by putting `assert_eq!(x1.len(), 0);` here
111//!        for i in 0..x1.len() {
112//!            let mut xdiff = x1[i] - x2[i];
113//!            let mut ydiff = y1[i] - y2[i];
114//!            xdiff *= xdiff;
115//!            ydiff *= ydiff;
116//!            let distance = (xdiff + ydiff).sqrt();
117//!            res[i] = distance;
118//!        }
119//!
120//!        result
121//!    }
122//!);
123//!
124//!const SIZE: usize = 200;
125//!
126//!fn main() {
127//!    let raw = (0..4)
128//!        .map(|i| (0..SIZE).map(|j| (i*j) as f32).collect::<Vec<f32>>())
129//!        .collect::<Vec<Vec<f32>>>();
130//!
131//!    let distances = distance(
132//!        raw[0].as_slice(),
133//!        raw[1].as_slice(),
134//!        raw[2].as_slice(),
135//!        raw[3].as_slice(),
136//!    );
137//!    assert_eq!(distances.len(), SIZE);
138//!    dbg!(distances);
139//!}
140//! ```
141//!
142//! This will generate the following functions for you:
143//! * `distance<S:Simd>` the generic version of your function
144//! * `distance_scalar`  a scalar fallback
145//! * `distance_sse2`    SSE2 version
146//! * `distance_sse41`   SSE41 version
147//! * `distance_avx2`    AVX2 version
148//! * `distance_avx512`  AVX-512 version
149//! * `distance_neon`    Neon version
150//! * `distance_runtime_select`  picks the fastest of the above at runtime
151//!
152//! You can use any of these you wish, though typically you would use the runtime_select version
153//! unless you want to force an older instruction set to avoid throttling or for other arcane
154//! reasons.
155//!
156//! Optionally you can use the `simd_compiletime_generate!` macro in the same way.  This will
157//! produce 2 active functions via the `cfg` attribute feature:
158//!
159//! * `distance<S:Simd>`      the generic version of your function
160//! * `distance_compiletime`  the fastest instruction set available for the given compile time
161//!   feature set
162//!
163//! You may also forgo the macros if you know what you are doing, just keep in mind there are lots
164//! of arcane subtleties with inlining and target_features that must be managed. See how the macros
165//! expand for more detail.
166#![allow(clippy::missing_safety_doc)] // TODO: Work on the safety of functions
167#![cfg_attr(all(feature = "no_std", not(test)), no_std)]
168#[macro_use]
169#[cfg(test)]
170extern crate std;
171pub extern crate paste;
172
173#[cfg(test)]
174mod tests;
175
176mod ops;
177
178pub mod prelude;
179
180use core::ops::*;
181
182mod invoking;
183
184#[macro_use]
185mod overloads;
186
187mod base;
188pub use base::*;
189
190mod libm_ext;
191
192pub mod math;
193pub use math::{SimdMathF32, SimdMathF64};
194
195pub mod engines;
196
197pub use engines::scalar;
198
199/// The abstract SIMD trait which is implemented by Avx2, Sse41, etc
200pub trait Simd: 'static + Sync + Send {
201    /// Vector of i8s.  Corresponds to __m128i when used
202    /// with the Sse impl, __m256i when used with Avx2, or a single i8
203    /// when used with Scalar.
204    type Vi8: SimdInt8<Scalar = i8> + SimdBaseIo;
205
206    /// Vector of i16s.  Corresponds to __m128i when used
207    /// with the Sse impl, __m256i when used with Avx2, or a single i16
208    /// when used with Scalar.
209    type Vi16: SimdInt16<Scalar = i16> + SimdBaseIo;
210
211    /// Vector of i32s.  Corresponds to __m128i when used
212    /// with the Sse impl, __m256i when used with Avx2, or a single i32
213    /// when used with Scalar.
214    type Vi32: SimdInt32<Engine = Self, Scalar = i32> + SimdBaseIo;
215
216    /// Vector of i64s.  Corresponds to __m128i when used
217    /// with the Sse impl, __m256i when used with Avx2, or a single i64
218    /// when used with Scalar.
219    type Vi64: SimdInt64<Engine = Self, Scalar = i64> + SimdBaseIo;
220
221    /// Vector of f32s.  Corresponds to __m128 when used
222    /// with the Sse impl, __m256 when used with Avx2, or a single f32
223    /// when used with Scalar.
224    type Vf32: SimdFloat32<Engine = Self, Scalar = f32> + SimdBaseIo;
225
226    /// Vector of f64s.  Corresponds to __m128d when used
227    /// with the Sse impl, __m256d when used with Avx2, or a single f64
228    /// when used with Scalar.
229    type Vf64: SimdFloat64<Engine = Self, Scalar = f64> + SimdBaseIo;
230
231    // The width of the vector lane.  Necessary for creating
232    // lane width agnostic code.
233    #[deprecated(note = "The VF32_WIDTH is deprecated, please use the Vf32::WIDTH instead.")]
234    const VF32_WIDTH: usize = Self::Vf32::WIDTH;
235    #[deprecated(note = "The VF64_WIDTH is deprecated, please use the Vf64::WIDTH instead.")]
236    const VF64_WIDTH: usize = Self::Vf64::WIDTH;
237    #[deprecated(note = "The VI16_WIDTH is deprecated, please use the Vi16::WIDTH instead.")]
238    const VI16_WIDTH: usize = Self::Vi16::WIDTH;
239    #[deprecated(note = "The VI32_WIDTH is deprecated, please use the Vi32::WIDTH instead.")]
240    const VI32_WIDTH: usize = Self::Vi32::WIDTH;
241    #[deprecated(note = "The VI64_WIDTH is deprecated, please use the Vi64::WIDTH instead.")]
242    const VI64_WIDTH: usize = Self::Vi64::WIDTH;
243
244    fn invoke<R>(f: impl FnOnce() -> R) -> R;
245
246    #[inline(always)]
247    #[deprecated(
248        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
249    )]
250    unsafe fn mul_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
251        a * b
252    }
253    #[inline(always)]
254    #[deprecated(
255        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
256    )]
257    unsafe fn mul_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
258        a * b
259    }
260    #[inline(always)]
261    #[deprecated(
262        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
263    )]
264    unsafe fn not_epi32(a: Self::Vi32) -> Self::Vi32 {
265        !a
266    }
267    #[inline(always)]
268    #[deprecated(
269        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
270    )]
271    unsafe fn not_epi64(a: Self::Vi64) -> Self::Vi64 {
272        !a
273    }
274    #[inline(always)]
275    #[deprecated(
276        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
277    )]
278    unsafe fn or_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
279        a | b
280    }
281    #[inline(always)]
282    #[deprecated(
283        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
284    )]
285    unsafe fn or_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
286        a | b
287    }
288    #[inline(always)]
289    #[deprecated(
290        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
291    )]
292    unsafe fn or_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
293        a | b
294    }
295    #[inline(always)]
296    #[deprecated(
297        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
298    )]
299    unsafe fn or_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
300        a | b
301    }
302    #[inline(always)]
303    #[deprecated(
304        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
305    )]
306    unsafe fn xor_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
307        a ^ b
308    }
309    #[inline(always)]
310    #[deprecated(
311        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
312    )]
313    unsafe fn xor_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
314        a ^ b
315    }
316    #[inline(always)]
317    #[deprecated(
318        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
319    )]
320    unsafe fn xor_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
321        a ^ b
322    }
323    #[inline(always)]
324    #[deprecated(
325        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
326    )]
327    unsafe fn xor_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
328        a ^ b
329    }
330    /// amt must be a constant
331    #[inline(always)]
332    #[deprecated(
333        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
334    )]
335    unsafe fn slli_epi32(a: Self::Vi32, amt_const: i32) -> Self::Vi32 {
336        a << amt_const
337    }
338    /// amt must be a constant
339    #[inline(always)]
340    #[deprecated(
341        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
342    )]
343    unsafe fn srai_epi32(a: Self::Vi32, amt_const: i32) -> Self::Vi32 {
344        a >> amt_const
345    }
346    #[inline(always)]
347    #[deprecated(
348        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
349    )]
350    unsafe fn div_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
351        a / b
352    }
353    #[inline(always)]
354    #[deprecated(
355        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
356    )]
357    unsafe fn div_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
358        a / b
359    }
360    #[inline(always)]
361    #[deprecated(
362        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
363    )]
364    unsafe fn add_epi16(a: Self::Vi16, b: Self::Vi16) -> Self::Vi16 {
365        a + b
366    }
367    #[inline(always)]
368    #[deprecated(
369        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
370    )]
371    unsafe fn sub_epi16(a: Self::Vi16, b: Self::Vi16) -> Self::Vi16 {
372        a - b
373    }
374    #[inline(always)]
375    #[deprecated(
376        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
377    )]
378    unsafe fn add_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
379        a + b
380    }
381    #[inline(always)]
382    #[deprecated(
383        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
384    )]
385    unsafe fn add_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
386        a + b
387    }
388    #[inline(always)]
389    #[deprecated(
390        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
391    )]
392    unsafe fn add_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
393        a + b
394    }
395    #[inline(always)]
396    #[deprecated(
397        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
398    )]
399    unsafe fn add_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
400        a + b
401    }
402    #[inline(always)]
403    #[deprecated(
404        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
405    )]
406    unsafe fn and_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
407        a & b
408    }
409    #[inline(always)]
410    #[deprecated(
411        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
412    )]
413    unsafe fn and_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
414        a & b
415    }
416    #[inline(always)]
417    #[deprecated(
418        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
419    )]
420    unsafe fn and_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
421        a & b
422    }
423    #[inline(always)]
424    #[deprecated(
425        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
426    )]
427    unsafe fn and_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
428        a & b
429    }
430
431    #[deprecated(
432        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
433    )]
434    unsafe fn abs_ps(a: Self::Vf32) -> Self::Vf32 {
435        a.abs()
436    }
437    #[deprecated(
438        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
439    )]
440    unsafe fn abs_pd(a: Self::Vf64) -> Self::Vf64 {
441        a.abs()
442    }
443
444    // Mullo is implemented for Sse2 by combining other Sse2 operations.
445
446    #[deprecated(
447        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
448    )]
449    unsafe fn mullo_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
450        a * b
451    }
452    #[deprecated(
453        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
454    )]
455    unsafe fn mullo_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
456        a * b
457    }
458    #[deprecated(
459        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
460    )]
461    unsafe fn mullo_epi16(a: Self::Vi16, b: Self::Vi16) -> Self::Vi16 {
462        a * b
463    }
464
465    #[deprecated(
466        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
467    )]
468    unsafe fn andnot_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
469        b.and_not(a)
470    }
471    #[deprecated(
472        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
473    )]
474    unsafe fn andnot_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
475        b.and_not(a)
476    }
477    #[deprecated(
478        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
479    )]
480    unsafe fn andnot_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
481        b.and_not(a)
482    }
483    #[deprecated(
484        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
485    )]
486    unsafe fn andnot_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
487        b.and_not(a)
488    }
489
490    /// Note SSE2 will select B only when all bits are 1, while SSE41 and AVX2 only
491    /// check the high bit. To maintain portability ensure all bits are 1 when using
492    /// blend. Results of comparison operations adhere to this.
493    #[deprecated(
494        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
495    )]
496    unsafe fn blendv_epi32(a: Self::Vi32, b: Self::Vi32, mask: Self::Vi32) -> Self::Vi32 {
497        a.blendv(b, mask)
498    }
499    /// Note SSE2 will select B only when all bits are 1, while SSE41 and AVX2 only
500    /// check the high bit. To maintain portability ensure all bits are 1 when using
501    /// blend. Results of comparison operations adhere to this.
502    #[deprecated(
503        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
504    )]
505    unsafe fn blendv_epi64(a: Self::Vi64, b: Self::Vi64, mask: Self::Vi64) -> Self::Vi64 {
506        a.blendv(b, mask)
507    }
508    /// Note SSE2 will select B only when all bits are 1, while SSE41 and AVX2 only
509    /// check the high bit. To maintain portability ensure all bits are 1 when using
510    /// blend. Results of comparison operations adhere to this.
511    #[deprecated(
512        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
513    )]
514    unsafe fn blendv_ps(a: Self::Vf32, b: Self::Vf32, mask: Self::Vf32) -> Self::Vf32 {
515        a.blendv(b, mask)
516    }
517    /// Note SSE2 will select B only when all bits are 1, while SSE41 and AVX2 only
518    /// check the high bit. To maintain portability ensure all bits are 1 when using
519    /// blend. Results of comparison operations adhere to this.
520    #[deprecated(
521        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
522    )]
523    unsafe fn blendv_pd(a: Self::Vf64, b: Self::Vf64, mask: Self::Vf64) -> Self::Vf64 {
524        a.blendv(b, mask)
525    }
526
527    #[deprecated(
528        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
529    )]
530    unsafe fn castps_epi32(a: Self::Vf32) -> Self::Vi32 {
531        a.bitcast_i32()
532    }
533    #[deprecated(
534        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
535    )]
536    unsafe fn castpd_epi64(a: Self::Vf64) -> Self::Vi64 {
537        a.bitcast_i64()
538    }
539    #[deprecated(
540        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
541    )]
542    unsafe fn castepi32_ps(a: Self::Vi32) -> Self::Vf32 {
543        a.bitcast_f32()
544    }
545    #[deprecated(
546        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
547    )]
548    unsafe fn castepi64_pd(a: Self::Vi64) -> Self::Vf64 {
549        a.bitcast_f64()
550    }
551
552    /// Converts the type of a f32 vector to a f64 vector without changing the underlying bits.
553    #[deprecated(
554        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
555    )]
556    unsafe fn castps_pd(_a: Self::Vf32) -> Self::Vf64 {
557        panic!("Deprecated")
558    }
559    /// Converts the type of a f64 vector to a f32 vector without changing the underlying bits.
560    #[deprecated(
561        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
562    )]
563    unsafe fn castpd_ps(_a: Self::Vf64) -> Self::Vf32 {
564        panic!("Deprecated")
565    }
566
567    /// Currently scalar will have different results in some cases depending on the
568    /// current SSE rounding mode.
569    #[deprecated(
570        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
571    )]
572    unsafe fn cvtps_epi32(a: Self::Vf32) -> Self::Vi32 {
573        a.cast_i32()
574    }
575    #[deprecated(
576        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
577    )]
578    unsafe fn cvtpd_epi64(a: Self::Vf64) -> Self::Vi64 {
579        a.cast_i64()
580    }
581    #[deprecated(
582        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
583    )]
584    unsafe fn cvtepi32_ps(a: Self::Vi32) -> Self::Vf32 {
585        a.cast_f32()
586    }
587    #[deprecated(
588        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
589    )]
590    unsafe fn cvtepi64_pd(a: Self::Vi64) -> Self::Vf64 {
591        a.cast_f64()
592    }
593
594    #[deprecated(
595        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
596    )]
597    unsafe fn cmpeq_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
598        a.cmp_eq(b)
599    }
600    #[deprecated(
601        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
602    )]
603    unsafe fn cmpneq_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
604        a.cmp_neq(b)
605    }
606    #[deprecated(
607        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
608    )]
609    unsafe fn cmpge_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
610        a.cmp_gte(b)
611    }
612    #[deprecated(
613        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
614    )]
615    unsafe fn cmpgt_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
616        a.cmp_gt(b)
617    }
618    #[deprecated(
619        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
620    )]
621    unsafe fn cmple_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
622        a.cmp_lte(b)
623    }
624    #[deprecated(
625        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
626    )]
627    unsafe fn cmplt_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
628        a.cmp_lt(b)
629    }
630    #[deprecated(
631        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
632    )]
633    unsafe fn cmpeq_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
634        a.cmp_eq(b)
635    }
636    #[deprecated(
637        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
638    )]
639    unsafe fn cmpneq_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
640        a.cmp_neq(b)
641    }
642    #[deprecated(
643        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
644    )]
645    unsafe fn cmpge_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
646        a.cmp_gte(b)
647    }
648    #[deprecated(
649        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
650    )]
651    unsafe fn cmpgt_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
652        a.cmp_gt(b)
653    }
654    #[deprecated(
655        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
656    )]
657    unsafe fn cmple_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
658        a.cmp_lte(b)
659    }
660    #[deprecated(
661        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
662    )]
663    unsafe fn cmplt_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
664        a.cmp_lt(b)
665    }
666    #[deprecated(
667        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
668    )]
669    unsafe fn cmpeq_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
670        a.cmp_eq(b)
671    }
672    #[deprecated(
673        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
674    )]
675    unsafe fn cmpneq_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
676        a.cmp_neq(b)
677    }
678    #[deprecated(
679        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
680    )]
681    unsafe fn cmpge_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
682        a.cmp_gte(b)
683    }
684    #[deprecated(
685        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
686    )]
687    unsafe fn cmpgt_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
688        a.cmp_gt(b)
689    }
690    #[deprecated(
691        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
692    )]
693    unsafe fn cmple_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
694        a.cmp_lte(b)
695    }
696    #[deprecated(
697        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
698    )]
699    unsafe fn cmplt_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
700        a.cmp_lt(b)
701    }
702    #[deprecated(
703        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
704    )]
705    unsafe fn cmpeq_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
706        a.cmp_eq(b)
707    }
708    #[deprecated(
709        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
710    )]
711    unsafe fn cmpneq_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
712        a.cmp_neq(b)
713    }
714    #[deprecated(
715        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
716    )]
717    unsafe fn cmpge_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
718        a.cmp_gte(b)
719    }
720    #[deprecated(
721        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
722    )]
723    unsafe fn cmpgt_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
724        a.cmp_gt(b)
725    }
726    #[deprecated(
727        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
728    )]
729    unsafe fn cmple_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
730        a.cmp_lte(b)
731    }
732    #[deprecated(
733        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
734    )]
735    unsafe fn cmplt_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
736        a.cmp_lt(b)
737    }
738
739    #[deprecated(
740        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
741    )]
742    unsafe fn ceil_ps(a: Self::Vf32) -> Self::Vf32 {
743        a.ceil()
744    }
745    #[deprecated(
746        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
747    )]
748    unsafe fn ceil_pd(a: Self::Vf64) -> Self::Vf64 {
749        a.ceil()
750    }
751    #[deprecated(
752        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
753    )]
754    unsafe fn floor_ps(a: Self::Vf32) -> Self::Vf32 {
755        a.floor()
756    }
757    #[deprecated(
758        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
759    )]
760    unsafe fn floor_pd(a: Self::Vf64) -> Self::Vf64 {
761        a.floor()
762    }
763    /// When using Sse2, fastround uses a faster version of floor
764    /// that only works on floating point values small enough to fit in
765    /// an i32.  This is a big performance boost if you don't need
766    /// a complete floor.
767    #[deprecated(
768        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
769    )]
770    unsafe fn fast_round_ps(a: Self::Vf32) -> Self::Vf32 {
771        a.fast_round()
772    }
773    /// When using Sse2, fastceil uses a faster version of floor
774    /// that only works on floating point values small enough to fit in
775    /// an i32.  This is a big performance boost if you don't need
776    /// a complete floor.
777    #[deprecated(
778        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
779    )]
780    unsafe fn fast_ceil_ps(a: Self::Vf32) -> Self::Vf32 {
781        a.fast_ceil()
782    }
783    /// When using Sse2, fastfloor uses a faster version of floor
784    /// that only works on floating point values small enough to fit in
785    /// an i32.  This is a big performance boost if you don't need
786    /// a complete floor.
787    #[deprecated(
788        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
789    )]
790    unsafe fn fast_floor_ps(a: Self::Vf32) -> Self::Vf32 {
791        a.fast_floor()
792    }
793    #[deprecated(
794        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
795    )]
796    unsafe fn fast_floor_pd(a: Self::Vf64) -> Self::Vf64 {
797        a.fast_floor()
798    }
799    /// Actual FMA instructions will be used when Avx2 is used,
800    /// otherwise a mul and add are used to replicate it, allowing you to
801    /// just always use FMA in your code and get best perf in both cases.
802    #[deprecated(
803        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
804    )]
805    unsafe fn fmadd_ps(a: Self::Vf32, b: Self::Vf32, c: Self::Vf32) -> Self::Vf32 {
806        a.mul_add(b, c)
807    }
808    /// Actual FMA instructions will be used when Avx2 is used,
809    /// otherwise a mul and add are used to replicate it, allowing you to
810    /// just always use FMA in your code and get best perf in both cases.
811    #[deprecated(
812        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
813    )]
814    unsafe fn fnmadd_ps(a: Self::Vf32, b: Self::Vf32, c: Self::Vf32) -> Self::Vf32 {
815        a.neg_mul_add(b, c)
816    }
817    /// Actual FMA instructions will be used when Avx2 is used,
818    /// otherwise a mul and add are used to replicate it, allowing you to
819    /// just always use FMA in your code and get best perf in both cases.
820    #[deprecated(
821        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
822    )]
823    unsafe fn fmadd_pd(a: Self::Vf64, b: Self::Vf64, c: Self::Vf64) -> Self::Vf64 {
824        a.mul_add(b, c)
825    }
826    /// Actual FMA instructions will be used when Avx2 is used,
827    /// otherwise a mul and add are used to replicate it, allowing you to
828    /// just always use FMA in your code and get best perf in both cases.
829    #[deprecated(
830        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
831    )]
832    unsafe fn fnmadd_pd(a: Self::Vf64, b: Self::Vf64, c: Self::Vf64) -> Self::Vf64 {
833        a.neg_mul_add(b, c)
834    }
835    /// Actual FMA instructions will be used when Avx2 is used,
836    /// otherwise a mul and sub are used to replicate it, allowing you to
837    /// just always use FMA in your code and get best perf in both cases.
838    #[deprecated(
839        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
840    )]
841    unsafe fn fmsub_ps(a: Self::Vf32, b: Self::Vf32, c: Self::Vf32) -> Self::Vf32 {
842        a.neg_mul_sub(b, c)
843    }
844    /// Actual FMA instructions will be used when Avx2 is used,
845    /// otherwise a mul and sub are used to replicate it, allowing you to
846    /// just always use FMA in your code and get best perf in both cases.
847    #[deprecated(
848        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
849    )]
850    unsafe fn fnmsub_ps(a: Self::Vf32, b: Self::Vf32, c: Self::Vf32) -> Self::Vf32 {
851        a.mul_sub(b, c)
852    }
853    /// Actual FMA instructions will be used when Avx2 is used,
854    /// otherwise a mul and sub are used to replicate it, allowing you to
855    /// just always use FMA in your code and get best perf in both cases.
856    #[deprecated(
857        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
858    )]
859    unsafe fn fmsub_pd(a: Self::Vf64, b: Self::Vf64, c: Self::Vf64) -> Self::Vf64 {
860        a.neg_mul_sub(b, c)
861    }
862    /// Actual FMA instructions will be used when Avx2 is used,
863    /// otherwise a mul and sub are used to replicate it, allowing you to
864    /// just always use FMA in your code and get best perf in both cases.
865    #[deprecated(
866        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
867    )]
868    unsafe fn fnmsub_pd(a: Self::Vf64, b: Self::Vf64, c: Self::Vf64) -> Self::Vf64 {
869        a.mul_sub(b, c)
870    }
871    /// Adds all lanes together. Distinct from h_add which adds pairs.
872    #[deprecated(
873        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
874    )]
875    unsafe fn horizontal_add_ps(a: Self::Vf32) -> f32 {
876        a.horizontal_add()
877    }
878    /// Adds all lanes together. Distinct from h_add which adds pairs.
879    #[deprecated(
880        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
881    )]
882    unsafe fn horizontal_add_pd(a: Self::Vf64) -> f64 {
883        a.horizontal_add()
884    }
885    /// Sse2 and Sse41 paths will simulate a gather by breaking out and
886    /// doing scalar array accesses, because gather doesn't exist until Avx2.
887    #[deprecated(
888        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
889    )]
890    unsafe fn i32gather_epi32(_arr: &[i32], _index: Self::Vi32) -> Self::Vi32 {
891        panic!("Deprecated")
892    }
893    #[deprecated(
894        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
895    )]
896    unsafe fn i64gather_epi64(_arr: &[i64], _index: Self::Vi64) -> Self::Vi64 {
897        panic!("Deprecated")
898    }
899    /// Sse2 and Sse41 paths will simulate a gather by breaking out and
900    /// doing scalar array accesses, because gather doesn't exist until Avx2.
901    #[deprecated(
902        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
903    )]
904    unsafe fn i32gather_ps(_arr: &[f32], _index: Self::Vi32) -> Self::Vf32 {
905        panic!("Deprecated")
906    }
907
908    #[deprecated(
909        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
910    )]
911    unsafe fn load_ps(a: &f32) -> Self::Vf32 {
912        SimdBaseIo::load_from_ptr_aligned(a)
913    }
914    #[deprecated(
915        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
916    )]
917    unsafe fn load_pd(a: &f64) -> Self::Vf64 {
918        SimdBaseIo::load_from_ptr_aligned(a)
919    }
920    #[deprecated(
921        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
922    )]
923    unsafe fn load_epi16(a: &i16) -> Self::Vi16 {
924        SimdBaseIo::load_from_ptr_aligned(a)
925    }
926    #[deprecated(
927        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
928    )]
929    unsafe fn load_epi32(a: &i32) -> Self::Vi32 {
930        SimdBaseIo::load_from_ptr_aligned(a)
931    }
932    #[deprecated(
933        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
934    )]
935    unsafe fn load_epi64(a: &i64) -> Self::Vi64 {
936        SimdBaseIo::load_from_ptr_aligned(a)
937    }
938    #[deprecated(
939        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
940    )]
941    unsafe fn loadu_ps(a: &f32) -> Self::Vf32 {
942        SimdBaseIo::load_from_ptr_unaligned(a)
943    }
944    #[deprecated(
945        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
946    )]
947    unsafe fn loadu_pd(a: &f64) -> Self::Vf64 {
948        SimdBaseIo::load_from_ptr_unaligned(a)
949    }
950    #[deprecated(
951        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
952    )]
953    unsafe fn loadu_epi32(a: &i32) -> Self::Vi32 {
954        SimdBaseIo::load_from_ptr_unaligned(a)
955    }
956    #[deprecated(
957        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
958    )]
959    unsafe fn loadu_epi64(a: &i64) -> Self::Vi64 {
960        SimdBaseIo::load_from_ptr_unaligned(a)
961    }
962
963    /// Note, SSE2 and SSE4 will load when mask\[i\] is nonzero, where AVX2
964    /// will store only when the high bit is set. To ensure portability
965    /// ensure that the high bit is set.
966    #[deprecated(
967        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
968    )]
969    unsafe fn maskload_epi32(_mem_addr: &i32, _mask: Self::Vi32) -> Self::Vi32 {
970        panic!("Deprecated")
971    }
972    /// Note, SSE2 and SSE4 will load when mask\[i\] is nonzero, where AVX2
973    /// will store only when the high bit is set. To ensure portability
974    /// ensure that the high bit is set.
975    #[deprecated(
976        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
977    )]
978    unsafe fn maskload_epi64(_mem_addr: &i64, _mask: Self::Vi64) -> Self::Vi64 {
979        panic!("Deprecated")
980    }
981    /// Note, SSE2 and SSE4 will load when mask\[i\] is nonzero, where AVX2
982    /// will store only when the high bit is set. To ensure portability
983    /// ensure that the high bit is set.
984    #[deprecated(
985        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
986    )]
987    unsafe fn maskload_ps(_mem_addr: &f32, _mask: Self::Vi32) -> Self::Vf32 {
988        panic!("Deprecated")
989    }
990    /// Note, SSE2 and SSE4 will load when mask\[i\] is nonzero, where AVX2
991    /// will store only when the high bit is set. To ensure portability
992    /// ensure that the high bit is set.
993    #[deprecated(
994        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
995    )]
996    unsafe fn maskload_pd(_mem_addr: &f64, _mask: Self::Vi64) -> Self::Vf64 {
997        panic!("Deprecated")
998    }
999
1000    #[deprecated(
1001        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1002    )]
1003    unsafe fn store_ps(mem_addr: &mut f32, a: Self::Vf32) {
1004        SimdBaseIo::copy_to_ptr_aligned(a, mem_addr)
1005    }
1006    #[deprecated(
1007        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1008    )]
1009    unsafe fn store_pd(mem_addr: &mut f64, a: Self::Vf64) {
1010        SimdBaseIo::copy_to_ptr_aligned(a, mem_addr)
1011    }
1012    #[deprecated(
1013        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1014    )]
1015    unsafe fn store_epi32(mem_addr: &mut i32, a: Self::Vi32) {
1016        SimdBaseIo::copy_to_ptr_aligned(a, mem_addr)
1017    }
1018    #[deprecated(
1019        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1020    )]
1021    unsafe fn store_epi64(mem_addr: &mut i64, a: Self::Vi64) {
1022        SimdBaseIo::copy_to_ptr_aligned(a, mem_addr)
1023    }
1024    #[deprecated(
1025        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1026    )]
1027    unsafe fn storeu_ps(mem_addr: &mut f32, a: Self::Vf32) {
1028        SimdBaseIo::copy_to_ptr_unaligned(a, mem_addr)
1029    }
1030    #[deprecated(
1031        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1032    )]
1033    unsafe fn storeu_pd(mem_addr: &mut f64, a: Self::Vf64) {
1034        SimdBaseIo::copy_to_ptr_unaligned(a, mem_addr)
1035    }
1036    #[deprecated(
1037        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1038    )]
1039    unsafe fn storeu_epi32(mem_addr: &mut i32, a: Self::Vi32) {
1040        SimdBaseIo::copy_to_ptr_unaligned(a, mem_addr)
1041    }
1042    #[deprecated(
1043        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1044    )]
1045    unsafe fn storeu_epi64(mem_addr: &mut i64, a: Self::Vi64) {
1046        SimdBaseIo::copy_to_ptr_unaligned(a, mem_addr)
1047    }
1048
1049    /// Note, SSE2 and SSE4 will store when mask\[i\] is nonzero, where AVX2
1050    /// will store only when the high bit is set. To ensure portability ensure the
1051    /// high bit is set.
1052    #[deprecated(
1053        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1054    )]
1055    unsafe fn maskstore_epi32(mem_addr: &mut i32, mask: Self::Vi32, a: Self::Vi32) {
1056        if mask[0] != 0 {
1057            *mem_addr = a[0];
1058        }
1059    }
1060    /// Note, SSE2 and SSE4 will store when mask\[i\] is nonzero, where AVX2
1061    /// will store only when the high bit is set. To ensure portability ensure the
1062    /// high bit is set.
1063    #[deprecated(
1064        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1065    )]
1066    unsafe fn maskstore_epi64(mem_addr: &mut i64, mask: Self::Vi64, a: Self::Vi64) {
1067        if mask[0] != 0 {
1068            *mem_addr = a[0];
1069        }
1070    }
1071    /// Note, SSE2 and SSE4 will store when mask\[i\] is nonzero, where AVX2
1072    /// will store only when the high bit is set. To ensure portability ensure the
1073    /// high bit is set.
1074    #[deprecated(
1075        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1076    )]
1077    unsafe fn maskstore_ps(mem_addr: &mut f32, mask: Self::Vi32, a: Self::Vf32) {
1078        if mask[0] != 0 {
1079            *mem_addr = a[0];
1080        }
1081    }
1082    /// Note, SSE2 and SSE4 will store when mask\[i\] is nonzero, where AVX2
1083    /// will store only when the high bit is set. To ensure portability ensure the
1084    /// high bit is set.
1085    #[deprecated(
1086        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1087    )]
1088    unsafe fn maskstore_pd(mem_addr: &mut f64, mask: Self::Vi64, a: Self::Vf64) {
1089        if mask[0] != 0 {
1090            *mem_addr = a[0];
1091        }
1092    }
1093
1094    #[deprecated(
1095        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1096    )]
1097    unsafe fn max_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
1098        a.max(b)
1099    }
1100    #[deprecated(
1101        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1102    )]
1103    unsafe fn min_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
1104        a.min(b)
1105    }
1106    #[deprecated(
1107        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1108    )]
1109    unsafe fn max_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
1110        a.max(b)
1111    }
1112    #[deprecated(
1113        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1114    )]
1115    unsafe fn min_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
1116        a.min(b)
1117    }
1118    #[deprecated(
1119        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1120    )]
1121    unsafe fn max_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
1122        a.max(b)
1123    }
1124    #[deprecated(
1125        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1126    )]
1127    unsafe fn min_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
1128        a.min(b)
1129    }
1130
1131    #[deprecated(
1132        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1133    )]
1134    unsafe fn rcp_ps(a: Self::Vf32) -> Self::Vf32 {
1135        a.fast_inverse()
1136    }
1137    /// Round is implemented for Sse2 by combining other Sse2 operations.
1138    #[deprecated(
1139        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1140    )]
1141    unsafe fn round_ps(a: Self::Vf32) -> Self::Vf32 {
1142        a.round()
1143    }
1144    #[deprecated(
1145        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1146    )]
1147    unsafe fn round_pd(a: Self::Vf64) -> Self::Vf64 {
1148        a.round()
1149    }
1150    #[deprecated(
1151        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1152    )]
1153    unsafe fn set1_epi32(a: i32) -> Self::Vi32 {
1154        SimdBaseIo::set1(a)
1155    }
1156    #[deprecated(
1157        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1158    )]
1159    unsafe fn set1_epi64(a: i64) -> Self::Vi64 {
1160        SimdBaseIo::set1(a)
1161    }
1162    #[deprecated(
1163        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1164    )]
1165    unsafe fn set1_ps(a: f32) -> Self::Vf32 {
1166        SimdBaseIo::set1(a)
1167    }
1168    #[deprecated(
1169        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1170    )]
1171    unsafe fn set1_pd(a: f64) -> Self::Vf64 {
1172        SimdBaseIo::set1(a)
1173    }
1174    #[deprecated(
1175        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1176    )]
1177    unsafe fn setzero_ps() -> Self::Vf32 {
1178        SimdBaseIo::zeroes()
1179    }
1180    #[deprecated(
1181        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1182    )]
1183    unsafe fn setzero_pd() -> Self::Vf64 {
1184        SimdBaseIo::zeroes()
1185    }
1186    #[deprecated(
1187        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1188    )]
1189    unsafe fn setzero_epi32() -> Self::Vi32 {
1190        SimdBaseIo::zeroes()
1191    }
1192    #[deprecated(
1193        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1194    )]
1195    unsafe fn setzero_epi64() -> Self::Vi64 {
1196        SimdBaseIo::zeroes()
1197    }
1198
1199    /// amt must be a constant
1200    #[deprecated(
1201        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1202    )]
1203    unsafe fn srai_epi64(a: Self::Vi64, amt_const: i32) -> Self::Vi64 {
1204        let shifted = a >> amt_const;
1205        let ones: Self::Vi64 = SimdBaseIo::set1(i64::MAX);
1206        let mask = ones << (64 - amt_const);
1207        shifted ^ mask
1208    }
1209    /// amt must be a constant
1210    #[deprecated(
1211        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1212    )]
1213    unsafe fn srli_epi32(a: Self::Vi32, amt_const: i32) -> Self::Vi32 {
1214        a >> amt_const
1215    }
1216
1217    /// amt does not have to be a constant, but may be slower than the srai version
1218    #[deprecated(
1219        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1220    )]
1221    unsafe fn sra_epi32(a: Self::Vi32, amt: i32) -> Self::Vi32 {
1222        let shifted = a >> amt;
1223        let ones: Self::Vi32 = SimdBaseIo::set1(i32::MAX);
1224        let mask = ones << (32 - amt);
1225        shifted ^ mask
1226    }
1227
1228    /// amt does not have to be a constant, but may be slower than the srli version
1229    #[deprecated(
1230        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1231    )]
1232    unsafe fn srl_epi32(a: Self::Vi32, amt: i32) -> Self::Vi32 {
1233        a >> amt
1234    }
1235    /// amt does not have to be a constant, but may be slower than the slli version
1236    #[deprecated(
1237        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1238    )]
1239    unsafe fn sll_epi32(a: Self::Vi32, amt: i32) -> Self::Vi32 {
1240        a << amt
1241    }
1242
1243    #[deprecated(
1244        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1245    )]
1246    unsafe fn sub_epi32(a: Self::Vi32, b: Self::Vi32) -> Self::Vi32 {
1247        a - b
1248    }
1249    #[deprecated(
1250        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1251    )]
1252    unsafe fn sub_epi64(a: Self::Vi64, b: Self::Vi64) -> Self::Vi64 {
1253        a - b
1254    }
1255    #[deprecated(
1256        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1257    )]
1258    unsafe fn sub_ps(a: Self::Vf32, b: Self::Vf32) -> Self::Vf32 {
1259        a - b
1260    }
1261    #[deprecated(
1262        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1263    )]
1264    unsafe fn sub_pd(a: Self::Vf64, b: Self::Vf64) -> Self::Vf64 {
1265        a - b
1266    }
1267
1268    #[deprecated(
1269        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1270    )]
1271    unsafe fn sqrt_ps(a: Self::Vf32) -> Self::Vf32 {
1272        a.sqrt()
1273    }
1274    #[deprecated(
1275        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1276    )]
1277    unsafe fn rsqrt_ps(a: Self::Vf32) -> Self::Vf32 {
1278        a.rsqrt()
1279    }
1280    #[deprecated(
1281        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1282    )]
1283    unsafe fn sqrt_pd(a: Self::Vf64) -> Self::Vf64 {
1284        a.sqrt()
1285    }
1286    #[deprecated(
1287        note = "Functions on the Simd trait are deprecated, please use the functions on the Vf32, Vf64, Vi16, Vi32, and Vi64 types instead."
1288    )]
1289    unsafe fn rsqrt_pd(a: Self::Vf64) -> Self::Vf64 {
1290        a.rsqrt()
1291    }
1292
1293    /// Using the shuffle function is undefined behavior because imm8 behaves differently on different
1294    /// architectures.
1295    #[deprecated(
1296        note = "These functions have unpredictable behavior and will be deleted in the future. Please use a manual implementation instead."
1297    )]
1298    unsafe fn shuffle_epi32<const IMM8: i32>(_a: Self::Vi32) -> Self::Vi32 {
1299        panic!("Deprecated")
1300    }
1301}