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