Skip to main content

glam/i64/
i64vec4.rs

1// Generated from vec.rs.tera template. Edit the template, not the generated file.
2
3#[cfg(not(feature = "scalar-math"))]
4use crate::BVec4A;
5use crate::{BVec4, I64Vec2, I64Vec3};
6
7#[cfg(feature = "i8")]
8use crate::I8Vec4;
9
10#[cfg(feature = "u8")]
11use crate::U8Vec4;
12
13#[cfg(feature = "i16")]
14use crate::I16Vec4;
15
16#[cfg(feature = "u16")]
17use crate::U16Vec4;
18
19#[cfg(feature = "i32")]
20use crate::IVec4;
21
22#[cfg(feature = "u32")]
23use crate::UVec4;
24
25#[cfg(feature = "u64")]
26use crate::U64Vec4;
27
28#[cfg(feature = "isize")]
29use crate::ISizeVec4;
30
31#[cfg(feature = "usize")]
32use crate::USizeVec4;
33
34use core::fmt;
35use core::iter::{Product, Sum};
36use core::{f32, ops::*};
37
38#[cfg(feature = "zerocopy")]
39use zerocopy_derive::*;
40
41/// Creates a 4-dimensional vector.
42#[inline(always)]
43#[must_use]
44pub const fn i64vec4(x: i64, y: i64, z: i64, w: i64) -> I64Vec4 {
45    I64Vec4::new(x, y, z, w)
46}
47
48/// A 4-dimensional vector.
49#[derive(Clone, Copy, PartialEq, Eq, Hash)]
50#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
51#[cfg_attr(
52    feature = "zerocopy",
53    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
54)]
55#[cfg_attr(feature = "cuda", repr(align(16)))]
56#[repr(C)]
57#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
58pub struct I64Vec4 {
59    pub x: i64,
60    pub y: i64,
61    pub z: i64,
62    pub w: i64,
63}
64
65impl I64Vec4 {
66    /// All zeroes.
67    pub const ZERO: Self = Self::splat(0);
68
69    /// All ones.
70    pub const ONE: Self = Self::splat(1);
71
72    /// All negative ones.
73    pub const NEG_ONE: Self = Self::splat(-1);
74
75    /// All `i64::MIN`.
76    pub const MIN: Self = Self::splat(i64::MIN);
77
78    /// All `i64::MAX`.
79    pub const MAX: Self = Self::splat(i64::MAX);
80
81    /// A unit vector pointing along the positive X axis.
82    pub const X: Self = Self::new(1, 0, 0, 0);
83
84    /// A unit vector pointing along the positive Y axis.
85    pub const Y: Self = Self::new(0, 1, 0, 0);
86
87    /// A unit vector pointing along the positive Z axis.
88    pub const Z: Self = Self::new(0, 0, 1, 0);
89
90    /// A unit vector pointing along the positive W axis.
91    pub const W: Self = Self::new(0, 0, 0, 1);
92
93    /// A unit vector pointing along the negative X axis.
94    pub const NEG_X: Self = Self::new(-1, 0, 0, 0);
95
96    /// A unit vector pointing along the negative Y axis.
97    pub const NEG_Y: Self = Self::new(0, -1, 0, 0);
98
99    /// A unit vector pointing along the negative Z axis.
100    pub const NEG_Z: Self = Self::new(0, 0, -1, 0);
101
102    /// A unit vector pointing along the negative W axis.
103    pub const NEG_W: Self = Self::new(0, 0, 0, -1);
104
105    /// The unit axes.
106    pub const AXES: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W];
107
108    /// Creates a new vector.
109    #[inline(always)]
110    #[must_use]
111    pub const fn new(x: i64, y: i64, z: i64, w: i64) -> Self {
112        Self { x, y, z, w }
113    }
114
115    /// Creates a vector with all elements set to `v`.
116    #[inline]
117    #[must_use]
118    pub const fn splat(v: i64) -> Self {
119        Self {
120            x: v,
121
122            y: v,
123
124            z: v,
125
126            w: v,
127        }
128    }
129
130    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
131    #[inline]
132    #[must_use]
133    pub fn map<F>(self, mut f: F) -> Self
134    where
135        F: FnMut(i64) -> i64,
136    {
137        Self::new(f(self.x), f(self.y), f(self.z), f(self.w))
138    }
139
140    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
141    /// for each element of `self`.
142    ///
143    /// A true element in the mask uses the corresponding element from `if_true`, and false
144    /// uses the element from `if_false`.
145    #[inline]
146    #[must_use]
147    pub fn select(mask: BVec4, if_true: Self, if_false: Self) -> Self {
148        Self {
149            x: if mask.test(0) { if_true.x } else { if_false.x },
150            y: if mask.test(1) { if_true.y } else { if_false.y },
151            z: if mask.test(2) { if_true.z } else { if_false.z },
152            w: if mask.test(3) { if_true.w } else { if_false.w },
153        }
154    }
155
156    /// Creates a new vector from an array.
157    #[inline]
158    #[must_use]
159    pub const fn from_array(a: [i64; 4]) -> Self {
160        Self::new(a[0], a[1], a[2], a[3])
161    }
162
163    /// Converts `self` to `[x, y, z, w]`
164    #[inline]
165    #[must_use]
166    pub const fn to_array(&self) -> [i64; 4] {
167        [self.x, self.y, self.z, self.w]
168    }
169
170    /// Creates a vector from the first 4 values in `slice`.
171    ///
172    /// # Panics
173    ///
174    /// Panics if `slice` is less than 4 elements long.
175    #[inline]
176    #[must_use]
177    pub const fn from_slice(slice: &[i64]) -> Self {
178        assert!(slice.len() >= 4);
179        Self::new(slice[0], slice[1], slice[2], slice[3])
180    }
181
182    /// Writes the elements of `self` to the first 4 elements in `slice`.
183    ///
184    /// # Panics
185    ///
186    /// Panics if `slice` is less than 4 elements long.
187    #[inline]
188    pub fn write_to_slice(self, slice: &mut [i64]) {
189        slice[..4].copy_from_slice(&self.to_array());
190    }
191
192    /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`.
193    ///
194    /// Truncation to [`I64Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()].
195    #[inline]
196    #[must_use]
197    pub fn truncate(self) -> I64Vec3 {
198        use crate::swizzles::Vec4Swizzles;
199        self.xyz()
200    }
201
202    /// Creates a 4D vector from `self` with the given value of `x`.
203    #[inline]
204    #[must_use]
205    pub fn with_x(mut self, x: i64) -> Self {
206        self.x = x;
207        self
208    }
209
210    /// Creates a 4D vector from `self` with the given value of `y`.
211    #[inline]
212    #[must_use]
213    pub fn with_y(mut self, y: i64) -> Self {
214        self.y = y;
215        self
216    }
217
218    /// Creates a 4D vector from `self` with the given value of `z`.
219    #[inline]
220    #[must_use]
221    pub fn with_z(mut self, z: i64) -> Self {
222        self.z = z;
223        self
224    }
225
226    /// Creates a 4D vector from `self` with the given value of `w`.
227    #[inline]
228    #[must_use]
229    pub fn with_w(mut self, w: i64) -> Self {
230        self.w = w;
231        self
232    }
233
234    /// Computes the dot product of `self` and `rhs`.
235    #[inline]
236    #[must_use]
237    pub fn dot(self, rhs: Self) -> i64 {
238        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z) + (self.w * rhs.w)
239    }
240
241    /// Returns a vector where every component is the dot product of `self` and `rhs`.
242    #[inline]
243    #[must_use]
244    pub fn dot_into_vec(self, rhs: Self) -> Self {
245        Self::splat(self.dot(rhs))
246    }
247
248    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
249    ///
250    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
251    #[inline]
252    #[must_use]
253    pub fn min(self, rhs: Self) -> Self {
254        Self {
255            x: if self.x < rhs.x { self.x } else { rhs.x },
256            y: if self.y < rhs.y { self.y } else { rhs.y },
257            z: if self.z < rhs.z { self.z } else { rhs.z },
258            w: if self.w < rhs.w { self.w } else { rhs.w },
259        }
260    }
261
262    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
263    ///
264    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
265    #[inline]
266    #[must_use]
267    pub fn max(self, rhs: Self) -> Self {
268        Self {
269            x: if self.x > rhs.x { self.x } else { rhs.x },
270            y: if self.y > rhs.y { self.y } else { rhs.y },
271            z: if self.z > rhs.z { self.z } else { rhs.z },
272            w: if self.w > rhs.w { self.w } else { rhs.w },
273        }
274    }
275
276    /// Component-wise clamping of values, similar to [`i64::clamp`].
277    ///
278    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
279    ///
280    /// # Panics
281    ///
282    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
283    #[inline]
284    #[must_use]
285    pub fn clamp(self, min: Self, max: Self) -> Self {
286        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
287        self.max(min).min(max)
288    }
289
290    /// Returns the horizontal minimum of `self`.
291    ///
292    /// In other words this computes `min(x, y, ..)`.
293    #[inline]
294    #[must_use]
295    pub fn min_element(self) -> i64 {
296        let min = |a, b| if a < b { a } else { b };
297        min(self.x, min(self.y, min(self.z, self.w)))
298    }
299
300    /// Returns the horizontal maximum of `self`.
301    ///
302    /// In other words this computes `max(x, y, ..)`.
303    #[inline]
304    #[must_use]
305    pub fn max_element(self) -> i64 {
306        let max = |a, b| if a > b { a } else { b };
307        max(self.x, max(self.y, max(self.z, self.w)))
308    }
309
310    /// Returns the index of the first minimum element of `self`.
311    #[doc(alias = "argmin")]
312    #[inline]
313    #[must_use]
314    pub fn min_position(self) -> usize {
315        let mut min = self.x;
316        let mut index = 0;
317        if self.y < min {
318            min = self.y;
319            index = 1;
320        }
321        if self.z < min {
322            min = self.z;
323            index = 2;
324        }
325        if self.w < min {
326            index = 3;
327        }
328        index
329    }
330
331    /// Returns the index of the first maximum element of `self`.
332    #[doc(alias = "argmax")]
333    #[inline]
334    #[must_use]
335    pub fn max_position(self) -> usize {
336        let mut max = self.x;
337        let mut index = 0;
338        if self.y > max {
339            max = self.y;
340            index = 1;
341        }
342        if self.z > max {
343            max = self.z;
344            index = 2;
345        }
346        if self.w > max {
347            index = 3;
348        }
349        index
350    }
351
352    /// Returns the sum of all elements of `self`.
353    ///
354    /// In other words, this computes `self.x + self.y + ..`.
355    #[inline]
356    #[must_use]
357    pub fn element_sum(self) -> i64 {
358        self.x + self.y + self.z + self.w
359    }
360
361    /// Returns the product of all elements of `self`.
362    ///
363    /// In other words, this computes `self.x * self.y * ..`.
364    #[inline]
365    #[must_use]
366    pub fn element_product(self) -> i64 {
367        self.x * self.y * self.z * self.w
368    }
369
370    /// Returns a vector mask containing the result of a `==` comparison for each element of
371    /// `self` and `rhs`.
372    ///
373    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
374    /// elements.
375    #[inline]
376    #[must_use]
377    pub fn cmpeq(self, rhs: Self) -> BVec4 {
378        BVec4::new(
379            self.x.eq(&rhs.x),
380            self.y.eq(&rhs.y),
381            self.z.eq(&rhs.z),
382            self.w.eq(&rhs.w),
383        )
384    }
385
386    /// Returns a vector mask containing the result of a `!=` comparison for each element of
387    /// `self` and `rhs`.
388    ///
389    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
390    /// elements.
391    #[inline]
392    #[must_use]
393    pub fn cmpne(self, rhs: Self) -> BVec4 {
394        BVec4::new(
395            self.x.ne(&rhs.x),
396            self.y.ne(&rhs.y),
397            self.z.ne(&rhs.z),
398            self.w.ne(&rhs.w),
399        )
400    }
401
402    /// Returns a vector mask containing the result of a `>=` comparison for each element of
403    /// `self` and `rhs`.
404    ///
405    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
406    /// elements.
407    #[inline]
408    #[must_use]
409    pub fn cmpge(self, rhs: Self) -> BVec4 {
410        BVec4::new(
411            self.x.ge(&rhs.x),
412            self.y.ge(&rhs.y),
413            self.z.ge(&rhs.z),
414            self.w.ge(&rhs.w),
415        )
416    }
417
418    /// Returns a vector mask containing the result of a `>` comparison for each element of
419    /// `self` and `rhs`.
420    ///
421    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
422    /// elements.
423    #[inline]
424    #[must_use]
425    pub fn cmpgt(self, rhs: Self) -> BVec4 {
426        BVec4::new(
427            self.x.gt(&rhs.x),
428            self.y.gt(&rhs.y),
429            self.z.gt(&rhs.z),
430            self.w.gt(&rhs.w),
431        )
432    }
433
434    /// Returns a vector mask containing the result of a `<=` comparison for each element of
435    /// `self` and `rhs`.
436    ///
437    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
438    /// elements.
439    #[inline]
440    #[must_use]
441    pub fn cmple(self, rhs: Self) -> BVec4 {
442        BVec4::new(
443            self.x.le(&rhs.x),
444            self.y.le(&rhs.y),
445            self.z.le(&rhs.z),
446            self.w.le(&rhs.w),
447        )
448    }
449
450    /// Returns a vector mask containing the result of a `<` comparison for each element of
451    /// `self` and `rhs`.
452    ///
453    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
454    /// elements.
455    #[inline]
456    #[must_use]
457    pub fn cmplt(self, rhs: Self) -> BVec4 {
458        BVec4::new(
459            self.x.lt(&rhs.x),
460            self.y.lt(&rhs.y),
461            self.z.lt(&rhs.z),
462            self.w.lt(&rhs.w),
463        )
464    }
465
466    /// Returns a vector containing the absolute value of each element of `self`.
467    #[inline]
468    #[must_use]
469    pub fn abs(self) -> Self {
470        Self {
471            x: self.x.abs(),
472            y: self.y.abs(),
473            z: self.z.abs(),
474            w: self.w.abs(),
475        }
476    }
477
478    /// Returns a vector with elements representing the sign of `self`.
479    ///
480    ///  - `0` if the number is zero
481    ///  - `1` if the number is positive
482    ///  - `-1` if the number is negative
483    #[inline]
484    #[must_use]
485    pub fn signum(self) -> Self {
486        Self {
487            x: self.x.signum(),
488            y: self.y.signum(),
489            z: self.z.signum(),
490            w: self.w.signum(),
491        }
492    }
493
494    /// Returns a bitmask with the lowest 4 bits set to the sign bits from the elements of `self`.
495    ///
496    /// A negative element results in a `1` bit and a positive element in a `0` bit.  Element `x` goes
497    /// into the first lowest bit, element `y` into the second, etc.
498    ///
499    /// An element is negative if it has a negative sign, including -0.0, NaNs with negative sign
500    /// bit and negative infinity.
501    #[inline]
502    #[must_use]
503    pub fn is_negative_bitmask(self) -> u32 {
504        (self.x.is_negative() as u32)
505            | ((self.y.is_negative() as u32) << 1)
506            | ((self.z.is_negative() as u32) << 2)
507            | ((self.w.is_negative() as u32) << 3)
508    }
509
510    /// Returns a mask indicating which components are negative.
511    ///
512    /// An element is negative if it has a negative sign, including -0.0, NaNs with negative sign
513    /// bit and negative infinity.
514    #[inline]
515    #[must_use]
516    pub fn is_negative_mask(self) -> BVec4 {
517        BVec4::new(
518            self.x.is_negative(),
519            self.y.is_negative(),
520            self.z.is_negative(),
521            self.w.is_negative(),
522        )
523    }
524
525    /// Computes the squared length of `self`.
526    #[doc(alias = "magnitude2")]
527    #[inline]
528    #[must_use]
529    pub fn length_squared(self) -> i64 {
530        self.dot(self)
531    }
532
533    /// Compute the squared euclidean distance between two points in space.
534    #[inline]
535    #[must_use]
536    pub fn distance_squared(self, rhs: Self) -> i64 {
537        (self - rhs).length_squared()
538    }
539
540    /// Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`.
541    ///
542    /// # Panics
543    /// This function will panic if any `rhs` element is 0 or the division results in overflow.
544    #[inline]
545    #[must_use]
546    pub fn div_euclid(self, rhs: Self) -> Self {
547        Self::new(
548            self.x.div_euclid(rhs.x),
549            self.y.div_euclid(rhs.y),
550            self.z.div_euclid(rhs.z),
551            self.w.div_euclid(rhs.w),
552        )
553    }
554
555    /// Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`.
556    ///
557    /// # Panics
558    /// This function will panic if any `rhs` element is 0 or the division results in overflow.
559    ///
560    /// [Euclidean division]: i64::rem_euclid
561    #[inline]
562    #[must_use]
563    pub fn rem_euclid(self, rhs: Self) -> Self {
564        Self::new(
565            self.x.rem_euclid(rhs.x),
566            self.y.rem_euclid(rhs.y),
567            self.z.rem_euclid(rhs.z),
568            self.w.rem_euclid(rhs.w),
569        )
570    }
571
572    /// Computes the [manhattan distance] between two points.
573    ///
574    /// # Overflow
575    /// This method may overflow if the result is greater than [`u64::MAX`].
576    ///
577    /// See also [`checked_manhattan_distance`][I64Vec4::checked_manhattan_distance].
578    ///
579    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
580    #[inline]
581    #[must_use]
582    pub fn manhattan_distance(self, rhs: Self) -> u64 {
583        self.x.abs_diff(rhs.x)
584            + self.y.abs_diff(rhs.y)
585            + self.z.abs_diff(rhs.z)
586            + self.w.abs_diff(rhs.w)
587    }
588
589    /// Computes the [manhattan distance] between two points.
590    ///
591    /// This will returns [`None`] if the result is greater than [`u64::MAX`].
592    ///
593    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
594    #[inline]
595    #[must_use]
596    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<u64> {
597        let d = self.x.abs_diff(rhs.x);
598        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
599        let d = d.checked_add(self.z.abs_diff(rhs.z))?;
600        d.checked_add(self.w.abs_diff(rhs.w))
601    }
602
603    /// Computes the [chebyshev distance] between two points.
604    ///
605    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
606    #[inline]
607    #[must_use]
608    pub fn chebyshev_distance(self, rhs: Self) -> u64 {
609        // Note: the compiler will eventually optimize out the loop
610        [
611            self.x.abs_diff(rhs.x),
612            self.y.abs_diff(rhs.y),
613            self.z.abs_diff(rhs.z),
614            self.w.abs_diff(rhs.w),
615        ]
616        .into_iter()
617        .max()
618        .unwrap()
619    }
620
621    /// Casts all elements of `self` to `f32`.
622    #[inline]
623    #[must_use]
624    pub fn as_vec4(self) -> crate::Vec4 {
625        crate::Vec4::new(self.x as f32, self.y as f32, self.z as f32, self.w as f32)
626    }
627
628    /// Casts all elements of `self` to `f64`.
629    #[cfg(feature = "f64")]
630    #[inline]
631    #[must_use]
632    pub fn as_dvec4(self) -> crate::DVec4 {
633        crate::DVec4::new(self.x as f64, self.y as f64, self.z as f64, self.w as f64)
634    }
635
636    /// Casts all elements of `self` to `i8`.
637    #[cfg(feature = "i8")]
638    #[inline]
639    #[must_use]
640    pub fn as_i8vec4(self) -> crate::I8Vec4 {
641        crate::I8Vec4::new(self.x as i8, self.y as i8, self.z as i8, self.w as i8)
642    }
643
644    /// Casts all elements of `self` to `u8`.
645    #[cfg(feature = "u8")]
646    #[inline]
647    #[must_use]
648    pub fn as_u8vec4(self) -> crate::U8Vec4 {
649        crate::U8Vec4::new(self.x as u8, self.y as u8, self.z as u8, self.w as u8)
650    }
651
652    /// Casts all elements of `self` to `i16`.
653    #[cfg(feature = "i16")]
654    #[inline]
655    #[must_use]
656    pub fn as_i16vec4(self) -> crate::I16Vec4 {
657        crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
658    }
659
660    /// Casts all elements of `self` to `u16`.
661    #[cfg(feature = "u16")]
662    #[inline]
663    #[must_use]
664    pub fn as_u16vec4(self) -> crate::U16Vec4 {
665        crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
666    }
667
668    /// Casts all elements of `self` to `i32`.
669    #[cfg(feature = "i32")]
670    #[inline]
671    #[must_use]
672    pub fn as_ivec4(self) -> crate::IVec4 {
673        crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
674    }
675
676    /// Casts all elements of `self` to `u32`.
677    #[cfg(feature = "u32")]
678    #[inline]
679    #[must_use]
680    pub fn as_uvec4(self) -> crate::UVec4 {
681        crate::UVec4::new(self.x as u32, self.y as u32, self.z as u32, self.w as u32)
682    }
683
684    /// Casts all elements of `self` to `u64`.
685    #[cfg(feature = "u64")]
686    #[inline]
687    #[must_use]
688    pub fn as_u64vec4(self) -> crate::U64Vec4 {
689        crate::U64Vec4::new(self.x as u64, self.y as u64, self.z as u64, self.w as u64)
690    }
691
692    /// Casts all elements of `self` to `isize`.
693    #[cfg(feature = "isize")]
694    #[inline]
695    #[must_use]
696    pub fn as_isizevec4(self) -> crate::ISizeVec4 {
697        crate::ISizeVec4::new(
698            self.x as isize,
699            self.y as isize,
700            self.z as isize,
701            self.w as isize,
702        )
703    }
704
705    /// Casts all elements of `self` to `usize`.
706    #[cfg(feature = "usize")]
707    #[inline]
708    #[must_use]
709    pub fn as_usizevec4(self) -> crate::USizeVec4 {
710        crate::USizeVec4::new(
711            self.x as usize,
712            self.y as usize,
713            self.z as usize,
714            self.w as usize,
715        )
716    }
717
718    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
719    ///
720    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
721    #[inline]
722    #[must_use]
723    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
724        let x = match self.x.checked_add(rhs.x) {
725            Some(v) => v,
726            None => return None,
727        };
728        let y = match self.y.checked_add(rhs.y) {
729            Some(v) => v,
730            None => return None,
731        };
732        let z = match self.z.checked_add(rhs.z) {
733            Some(v) => v,
734            None => return None,
735        };
736        let w = match self.w.checked_add(rhs.w) {
737            Some(v) => v,
738            None => return None,
739        };
740
741        Some(Self { x, y, z, w })
742    }
743
744    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
745    ///
746    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
747    #[inline]
748    #[must_use]
749    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
750        let x = match self.x.checked_sub(rhs.x) {
751            Some(v) => v,
752            None => return None,
753        };
754        let y = match self.y.checked_sub(rhs.y) {
755            Some(v) => v,
756            None => return None,
757        };
758        let z = match self.z.checked_sub(rhs.z) {
759            Some(v) => v,
760            None => return None,
761        };
762        let w = match self.w.checked_sub(rhs.w) {
763            Some(v) => v,
764            None => return None,
765        };
766
767        Some(Self { x, y, z, w })
768    }
769
770    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
771    ///
772    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
773    #[inline]
774    #[must_use]
775    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
776        let x = match self.x.checked_mul(rhs.x) {
777            Some(v) => v,
778            None => return None,
779        };
780        let y = match self.y.checked_mul(rhs.y) {
781            Some(v) => v,
782            None => return None,
783        };
784        let z = match self.z.checked_mul(rhs.z) {
785            Some(v) => v,
786            None => return None,
787        };
788        let w = match self.w.checked_mul(rhs.w) {
789            Some(v) => v,
790            None => return None,
791        };
792
793        Some(Self { x, y, z, w })
794    }
795
796    /// Returns a vector containing the wrapping division of `self` and `rhs`.
797    ///
798    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
799    #[inline]
800    #[must_use]
801    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
802        let x = match self.x.checked_div(rhs.x) {
803            Some(v) => v,
804            None => return None,
805        };
806        let y = match self.y.checked_div(rhs.y) {
807            Some(v) => v,
808            None => return None,
809        };
810        let z = match self.z.checked_div(rhs.z) {
811            Some(v) => v,
812            None => return None,
813        };
814        let w = match self.w.checked_div(rhs.w) {
815            Some(v) => v,
816            None => return None,
817        };
818
819        Some(Self { x, y, z, w })
820    }
821
822    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
823    ///
824    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
825    #[inline]
826    #[must_use]
827    pub const fn wrapping_add(self, rhs: Self) -> Self {
828        Self {
829            x: self.x.wrapping_add(rhs.x),
830            y: self.y.wrapping_add(rhs.y),
831            z: self.z.wrapping_add(rhs.z),
832            w: self.w.wrapping_add(rhs.w),
833        }
834    }
835
836    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
837    ///
838    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
839    #[inline]
840    #[must_use]
841    pub const fn wrapping_sub(self, rhs: Self) -> Self {
842        Self {
843            x: self.x.wrapping_sub(rhs.x),
844            y: self.y.wrapping_sub(rhs.y),
845            z: self.z.wrapping_sub(rhs.z),
846            w: self.w.wrapping_sub(rhs.w),
847        }
848    }
849
850    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
851    ///
852    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
853    #[inline]
854    #[must_use]
855    pub const fn wrapping_mul(self, rhs: Self) -> Self {
856        Self {
857            x: self.x.wrapping_mul(rhs.x),
858            y: self.y.wrapping_mul(rhs.y),
859            z: self.z.wrapping_mul(rhs.z),
860            w: self.w.wrapping_mul(rhs.w),
861        }
862    }
863
864    /// Returns a vector containing the wrapping division of `self` and `rhs`.
865    ///
866    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
867    #[inline]
868    #[must_use]
869    pub const fn wrapping_div(self, rhs: Self) -> Self {
870        Self {
871            x: self.x.wrapping_div(rhs.x),
872            y: self.y.wrapping_div(rhs.y),
873            z: self.z.wrapping_div(rhs.z),
874            w: self.w.wrapping_div(rhs.w),
875        }
876    }
877
878    /// Returns a vector containing the saturating addition of `self` and `rhs`.
879    ///
880    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
881    #[inline]
882    #[must_use]
883    pub const fn saturating_add(self, rhs: Self) -> Self {
884        Self {
885            x: self.x.saturating_add(rhs.x),
886            y: self.y.saturating_add(rhs.y),
887            z: self.z.saturating_add(rhs.z),
888            w: self.w.saturating_add(rhs.w),
889        }
890    }
891
892    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
893    ///
894    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
895    #[inline]
896    #[must_use]
897    pub const fn saturating_sub(self, rhs: Self) -> Self {
898        Self {
899            x: self.x.saturating_sub(rhs.x),
900            y: self.y.saturating_sub(rhs.y),
901            z: self.z.saturating_sub(rhs.z),
902            w: self.w.saturating_sub(rhs.w),
903        }
904    }
905
906    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
907    ///
908    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
909    #[inline]
910    #[must_use]
911    pub const fn saturating_mul(self, rhs: Self) -> Self {
912        Self {
913            x: self.x.saturating_mul(rhs.x),
914            y: self.y.saturating_mul(rhs.y),
915            z: self.z.saturating_mul(rhs.z),
916            w: self.w.saturating_mul(rhs.w),
917        }
918    }
919
920    /// Returns a vector containing the saturating division of `self` and `rhs`.
921    ///
922    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
923    #[inline]
924    #[must_use]
925    pub const fn saturating_div(self, rhs: Self) -> Self {
926        Self {
927            x: self.x.saturating_div(rhs.x),
928            y: self.y.saturating_div(rhs.y),
929            z: self.z.saturating_div(rhs.z),
930            w: self.w.saturating_div(rhs.w),
931        }
932    }
933
934    /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`.
935    ///
936    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
937    #[cfg(feature = "u64")]
938    #[inline]
939    #[must_use]
940    pub const fn checked_add_unsigned(self, rhs: U64Vec4) -> Option<Self> {
941        let x = match self.x.checked_add_unsigned(rhs.x) {
942            Some(v) => v,
943            None => return None,
944        };
945        let y = match self.y.checked_add_unsigned(rhs.y) {
946            Some(v) => v,
947            None => return None,
948        };
949        let z = match self.z.checked_add_unsigned(rhs.z) {
950            Some(v) => v,
951            None => return None,
952        };
953        let w = match self.w.checked_add_unsigned(rhs.w) {
954            Some(v) => v,
955            None => return None,
956        };
957
958        Some(Self { x, y, z, w })
959    }
960
961    /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`.
962    ///
963    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
964    #[cfg(feature = "u64")]
965    #[inline]
966    #[must_use]
967    pub const fn checked_sub_unsigned(self, rhs: U64Vec4) -> Option<Self> {
968        let x = match self.x.checked_sub_unsigned(rhs.x) {
969            Some(v) => v,
970            None => return None,
971        };
972        let y = match self.y.checked_sub_unsigned(rhs.y) {
973            Some(v) => v,
974            None => return None,
975        };
976        let z = match self.z.checked_sub_unsigned(rhs.z) {
977            Some(v) => v,
978            None => return None,
979        };
980        let w = match self.w.checked_sub_unsigned(rhs.w) {
981            Some(v) => v,
982            None => return None,
983        };
984
985        Some(Self { x, y, z, w })
986    }
987
988    /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`.
989    ///
990    /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`.
991    #[cfg(feature = "u64")]
992    #[inline]
993    #[must_use]
994    pub const fn wrapping_add_unsigned(self, rhs: U64Vec4) -> Self {
995        Self {
996            x: self.x.wrapping_add_unsigned(rhs.x),
997            y: self.y.wrapping_add_unsigned(rhs.y),
998            z: self.z.wrapping_add_unsigned(rhs.z),
999            w: self.w.wrapping_add_unsigned(rhs.w),
1000        }
1001    }
1002
1003    /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`.
1004    ///
1005    /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`.
1006    #[cfg(feature = "u64")]
1007    #[inline]
1008    #[must_use]
1009    pub const fn wrapping_sub_unsigned(self, rhs: U64Vec4) -> Self {
1010        Self {
1011            x: self.x.wrapping_sub_unsigned(rhs.x),
1012            y: self.y.wrapping_sub_unsigned(rhs.y),
1013            z: self.z.wrapping_sub_unsigned(rhs.z),
1014            w: self.w.wrapping_sub_unsigned(rhs.w),
1015        }
1016    }
1017
1018    // Returns a vector containing the saturating addition of `self` and unsigned vector `rhs`.
1019    ///
1020    /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`.
1021    #[cfg(feature = "u64")]
1022    #[inline]
1023    #[must_use]
1024    pub const fn saturating_add_unsigned(self, rhs: U64Vec4) -> Self {
1025        Self {
1026            x: self.x.saturating_add_unsigned(rhs.x),
1027            y: self.y.saturating_add_unsigned(rhs.y),
1028            z: self.z.saturating_add_unsigned(rhs.z),
1029            w: self.w.saturating_add_unsigned(rhs.w),
1030        }
1031    }
1032
1033    /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`.
1034    ///
1035    /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`.
1036    #[cfg(feature = "u64")]
1037    #[inline]
1038    #[must_use]
1039    pub const fn saturating_sub_unsigned(self, rhs: U64Vec4) -> Self {
1040        Self {
1041            x: self.x.saturating_sub_unsigned(rhs.x),
1042            y: self.y.saturating_sub_unsigned(rhs.y),
1043            z: self.z.saturating_sub_unsigned(rhs.z),
1044            w: self.w.saturating_sub_unsigned(rhs.w),
1045        }
1046    }
1047}
1048
1049impl Default for I64Vec4 {
1050    #[inline(always)]
1051    fn default() -> Self {
1052        Self::ZERO
1053    }
1054}
1055
1056impl Div for I64Vec4 {
1057    type Output = Self;
1058    #[inline]
1059    fn div(self, rhs: Self) -> Self {
1060        Self {
1061            x: self.x.div(rhs.x),
1062            y: self.y.div(rhs.y),
1063            z: self.z.div(rhs.z),
1064            w: self.w.div(rhs.w),
1065        }
1066    }
1067}
1068
1069impl Div<&Self> for I64Vec4 {
1070    type Output = Self;
1071    #[inline]
1072    fn div(self, rhs: &Self) -> Self {
1073        self.div(*rhs)
1074    }
1075}
1076
1077impl Div<&I64Vec4> for &I64Vec4 {
1078    type Output = I64Vec4;
1079    #[inline]
1080    fn div(self, rhs: &I64Vec4) -> I64Vec4 {
1081        (*self).div(*rhs)
1082    }
1083}
1084
1085impl Div<I64Vec4> for &I64Vec4 {
1086    type Output = I64Vec4;
1087    #[inline]
1088    fn div(self, rhs: I64Vec4) -> I64Vec4 {
1089        (*self).div(rhs)
1090    }
1091}
1092
1093impl DivAssign for I64Vec4 {
1094    #[inline]
1095    fn div_assign(&mut self, rhs: Self) {
1096        self.x.div_assign(rhs.x);
1097        self.y.div_assign(rhs.y);
1098        self.z.div_assign(rhs.z);
1099        self.w.div_assign(rhs.w);
1100    }
1101}
1102
1103impl DivAssign<&Self> for I64Vec4 {
1104    #[inline]
1105    fn div_assign(&mut self, rhs: &Self) {
1106        self.div_assign(*rhs);
1107    }
1108}
1109
1110impl Div<i64> for I64Vec4 {
1111    type Output = Self;
1112    #[inline]
1113    fn div(self, rhs: i64) -> Self {
1114        Self {
1115            x: self.x.div(rhs),
1116            y: self.y.div(rhs),
1117            z: self.z.div(rhs),
1118            w: self.w.div(rhs),
1119        }
1120    }
1121}
1122
1123impl Div<&i64> for I64Vec4 {
1124    type Output = Self;
1125    #[inline]
1126    fn div(self, rhs: &i64) -> Self {
1127        self.div(*rhs)
1128    }
1129}
1130
1131impl Div<&i64> for &I64Vec4 {
1132    type Output = I64Vec4;
1133    #[inline]
1134    fn div(self, rhs: &i64) -> I64Vec4 {
1135        (*self).div(*rhs)
1136    }
1137}
1138
1139impl Div<i64> for &I64Vec4 {
1140    type Output = I64Vec4;
1141    #[inline]
1142    fn div(self, rhs: i64) -> I64Vec4 {
1143        (*self).div(rhs)
1144    }
1145}
1146
1147impl DivAssign<i64> for I64Vec4 {
1148    #[inline]
1149    fn div_assign(&mut self, rhs: i64) {
1150        self.x.div_assign(rhs);
1151        self.y.div_assign(rhs);
1152        self.z.div_assign(rhs);
1153        self.w.div_assign(rhs);
1154    }
1155}
1156
1157impl DivAssign<&i64> for I64Vec4 {
1158    #[inline]
1159    fn div_assign(&mut self, rhs: &i64) {
1160        self.div_assign(*rhs);
1161    }
1162}
1163
1164impl Div<I64Vec4> for i64 {
1165    type Output = I64Vec4;
1166    #[inline]
1167    fn div(self, rhs: I64Vec4) -> I64Vec4 {
1168        I64Vec4 {
1169            x: self.div(rhs.x),
1170            y: self.div(rhs.y),
1171            z: self.div(rhs.z),
1172            w: self.div(rhs.w),
1173        }
1174    }
1175}
1176
1177impl Div<&I64Vec4> for i64 {
1178    type Output = I64Vec4;
1179    #[inline]
1180    fn div(self, rhs: &I64Vec4) -> I64Vec4 {
1181        self.div(*rhs)
1182    }
1183}
1184
1185impl Div<&I64Vec4> for &i64 {
1186    type Output = I64Vec4;
1187    #[inline]
1188    fn div(self, rhs: &I64Vec4) -> I64Vec4 {
1189        (*self).div(*rhs)
1190    }
1191}
1192
1193impl Div<I64Vec4> for &i64 {
1194    type Output = I64Vec4;
1195    #[inline]
1196    fn div(self, rhs: I64Vec4) -> I64Vec4 {
1197        (*self).div(rhs)
1198    }
1199}
1200
1201impl Mul for I64Vec4 {
1202    type Output = Self;
1203    #[inline]
1204    fn mul(self, rhs: Self) -> Self {
1205        Self {
1206            x: self.x.mul(rhs.x),
1207            y: self.y.mul(rhs.y),
1208            z: self.z.mul(rhs.z),
1209            w: self.w.mul(rhs.w),
1210        }
1211    }
1212}
1213
1214impl Mul<&Self> for I64Vec4 {
1215    type Output = Self;
1216    #[inline]
1217    fn mul(self, rhs: &Self) -> Self {
1218        self.mul(*rhs)
1219    }
1220}
1221
1222impl Mul<&I64Vec4> for &I64Vec4 {
1223    type Output = I64Vec4;
1224    #[inline]
1225    fn mul(self, rhs: &I64Vec4) -> I64Vec4 {
1226        (*self).mul(*rhs)
1227    }
1228}
1229
1230impl Mul<I64Vec4> for &I64Vec4 {
1231    type Output = I64Vec4;
1232    #[inline]
1233    fn mul(self, rhs: I64Vec4) -> I64Vec4 {
1234        (*self).mul(rhs)
1235    }
1236}
1237
1238impl MulAssign for I64Vec4 {
1239    #[inline]
1240    fn mul_assign(&mut self, rhs: Self) {
1241        self.x.mul_assign(rhs.x);
1242        self.y.mul_assign(rhs.y);
1243        self.z.mul_assign(rhs.z);
1244        self.w.mul_assign(rhs.w);
1245    }
1246}
1247
1248impl MulAssign<&Self> for I64Vec4 {
1249    #[inline]
1250    fn mul_assign(&mut self, rhs: &Self) {
1251        self.mul_assign(*rhs);
1252    }
1253}
1254
1255impl Mul<i64> for I64Vec4 {
1256    type Output = Self;
1257    #[inline]
1258    fn mul(self, rhs: i64) -> Self {
1259        Self {
1260            x: self.x.mul(rhs),
1261            y: self.y.mul(rhs),
1262            z: self.z.mul(rhs),
1263            w: self.w.mul(rhs),
1264        }
1265    }
1266}
1267
1268impl Mul<&i64> for I64Vec4 {
1269    type Output = Self;
1270    #[inline]
1271    fn mul(self, rhs: &i64) -> Self {
1272        self.mul(*rhs)
1273    }
1274}
1275
1276impl Mul<&i64> for &I64Vec4 {
1277    type Output = I64Vec4;
1278    #[inline]
1279    fn mul(self, rhs: &i64) -> I64Vec4 {
1280        (*self).mul(*rhs)
1281    }
1282}
1283
1284impl Mul<i64> for &I64Vec4 {
1285    type Output = I64Vec4;
1286    #[inline]
1287    fn mul(self, rhs: i64) -> I64Vec4 {
1288        (*self).mul(rhs)
1289    }
1290}
1291
1292impl MulAssign<i64> for I64Vec4 {
1293    #[inline]
1294    fn mul_assign(&mut self, rhs: i64) {
1295        self.x.mul_assign(rhs);
1296        self.y.mul_assign(rhs);
1297        self.z.mul_assign(rhs);
1298        self.w.mul_assign(rhs);
1299    }
1300}
1301
1302impl MulAssign<&i64> for I64Vec4 {
1303    #[inline]
1304    fn mul_assign(&mut self, rhs: &i64) {
1305        self.mul_assign(*rhs);
1306    }
1307}
1308
1309impl Mul<I64Vec4> for i64 {
1310    type Output = I64Vec4;
1311    #[inline]
1312    fn mul(self, rhs: I64Vec4) -> I64Vec4 {
1313        I64Vec4 {
1314            x: self.mul(rhs.x),
1315            y: self.mul(rhs.y),
1316            z: self.mul(rhs.z),
1317            w: self.mul(rhs.w),
1318        }
1319    }
1320}
1321
1322impl Mul<&I64Vec4> for i64 {
1323    type Output = I64Vec4;
1324    #[inline]
1325    fn mul(self, rhs: &I64Vec4) -> I64Vec4 {
1326        self.mul(*rhs)
1327    }
1328}
1329
1330impl Mul<&I64Vec4> for &i64 {
1331    type Output = I64Vec4;
1332    #[inline]
1333    fn mul(self, rhs: &I64Vec4) -> I64Vec4 {
1334        (*self).mul(*rhs)
1335    }
1336}
1337
1338impl Mul<I64Vec4> for &i64 {
1339    type Output = I64Vec4;
1340    #[inline]
1341    fn mul(self, rhs: I64Vec4) -> I64Vec4 {
1342        (*self).mul(rhs)
1343    }
1344}
1345
1346impl Add for I64Vec4 {
1347    type Output = Self;
1348    #[inline]
1349    fn add(self, rhs: Self) -> Self {
1350        Self {
1351            x: self.x.add(rhs.x),
1352            y: self.y.add(rhs.y),
1353            z: self.z.add(rhs.z),
1354            w: self.w.add(rhs.w),
1355        }
1356    }
1357}
1358
1359impl Add<&Self> for I64Vec4 {
1360    type Output = Self;
1361    #[inline]
1362    fn add(self, rhs: &Self) -> Self {
1363        self.add(*rhs)
1364    }
1365}
1366
1367impl Add<&I64Vec4> for &I64Vec4 {
1368    type Output = I64Vec4;
1369    #[inline]
1370    fn add(self, rhs: &I64Vec4) -> I64Vec4 {
1371        (*self).add(*rhs)
1372    }
1373}
1374
1375impl Add<I64Vec4> for &I64Vec4 {
1376    type Output = I64Vec4;
1377    #[inline]
1378    fn add(self, rhs: I64Vec4) -> I64Vec4 {
1379        (*self).add(rhs)
1380    }
1381}
1382
1383impl AddAssign for I64Vec4 {
1384    #[inline]
1385    fn add_assign(&mut self, rhs: Self) {
1386        self.x.add_assign(rhs.x);
1387        self.y.add_assign(rhs.y);
1388        self.z.add_assign(rhs.z);
1389        self.w.add_assign(rhs.w);
1390    }
1391}
1392
1393impl AddAssign<&Self> for I64Vec4 {
1394    #[inline]
1395    fn add_assign(&mut self, rhs: &Self) {
1396        self.add_assign(*rhs);
1397    }
1398}
1399
1400impl Add<i64> for I64Vec4 {
1401    type Output = Self;
1402    #[inline]
1403    fn add(self, rhs: i64) -> Self {
1404        Self {
1405            x: self.x.add(rhs),
1406            y: self.y.add(rhs),
1407            z: self.z.add(rhs),
1408            w: self.w.add(rhs),
1409        }
1410    }
1411}
1412
1413impl Add<&i64> for I64Vec4 {
1414    type Output = Self;
1415    #[inline]
1416    fn add(self, rhs: &i64) -> Self {
1417        self.add(*rhs)
1418    }
1419}
1420
1421impl Add<&i64> for &I64Vec4 {
1422    type Output = I64Vec4;
1423    #[inline]
1424    fn add(self, rhs: &i64) -> I64Vec4 {
1425        (*self).add(*rhs)
1426    }
1427}
1428
1429impl Add<i64> for &I64Vec4 {
1430    type Output = I64Vec4;
1431    #[inline]
1432    fn add(self, rhs: i64) -> I64Vec4 {
1433        (*self).add(rhs)
1434    }
1435}
1436
1437impl AddAssign<i64> for I64Vec4 {
1438    #[inline]
1439    fn add_assign(&mut self, rhs: i64) {
1440        self.x.add_assign(rhs);
1441        self.y.add_assign(rhs);
1442        self.z.add_assign(rhs);
1443        self.w.add_assign(rhs);
1444    }
1445}
1446
1447impl AddAssign<&i64> for I64Vec4 {
1448    #[inline]
1449    fn add_assign(&mut self, rhs: &i64) {
1450        self.add_assign(*rhs);
1451    }
1452}
1453
1454impl Add<I64Vec4> for i64 {
1455    type Output = I64Vec4;
1456    #[inline]
1457    fn add(self, rhs: I64Vec4) -> I64Vec4 {
1458        I64Vec4 {
1459            x: self.add(rhs.x),
1460            y: self.add(rhs.y),
1461            z: self.add(rhs.z),
1462            w: self.add(rhs.w),
1463        }
1464    }
1465}
1466
1467impl Add<&I64Vec4> for i64 {
1468    type Output = I64Vec4;
1469    #[inline]
1470    fn add(self, rhs: &I64Vec4) -> I64Vec4 {
1471        self.add(*rhs)
1472    }
1473}
1474
1475impl Add<&I64Vec4> for &i64 {
1476    type Output = I64Vec4;
1477    #[inline]
1478    fn add(self, rhs: &I64Vec4) -> I64Vec4 {
1479        (*self).add(*rhs)
1480    }
1481}
1482
1483impl Add<I64Vec4> for &i64 {
1484    type Output = I64Vec4;
1485    #[inline]
1486    fn add(self, rhs: I64Vec4) -> I64Vec4 {
1487        (*self).add(rhs)
1488    }
1489}
1490
1491impl Sub for I64Vec4 {
1492    type Output = Self;
1493    #[inline]
1494    fn sub(self, rhs: Self) -> Self {
1495        Self {
1496            x: self.x.sub(rhs.x),
1497            y: self.y.sub(rhs.y),
1498            z: self.z.sub(rhs.z),
1499            w: self.w.sub(rhs.w),
1500        }
1501    }
1502}
1503
1504impl Sub<&Self> for I64Vec4 {
1505    type Output = Self;
1506    #[inline]
1507    fn sub(self, rhs: &Self) -> Self {
1508        self.sub(*rhs)
1509    }
1510}
1511
1512impl Sub<&I64Vec4> for &I64Vec4 {
1513    type Output = I64Vec4;
1514    #[inline]
1515    fn sub(self, rhs: &I64Vec4) -> I64Vec4 {
1516        (*self).sub(*rhs)
1517    }
1518}
1519
1520impl Sub<I64Vec4> for &I64Vec4 {
1521    type Output = I64Vec4;
1522    #[inline]
1523    fn sub(self, rhs: I64Vec4) -> I64Vec4 {
1524        (*self).sub(rhs)
1525    }
1526}
1527
1528impl SubAssign for I64Vec4 {
1529    #[inline]
1530    fn sub_assign(&mut self, rhs: Self) {
1531        self.x.sub_assign(rhs.x);
1532        self.y.sub_assign(rhs.y);
1533        self.z.sub_assign(rhs.z);
1534        self.w.sub_assign(rhs.w);
1535    }
1536}
1537
1538impl SubAssign<&Self> for I64Vec4 {
1539    #[inline]
1540    fn sub_assign(&mut self, rhs: &Self) {
1541        self.sub_assign(*rhs);
1542    }
1543}
1544
1545impl Sub<i64> for I64Vec4 {
1546    type Output = Self;
1547    #[inline]
1548    fn sub(self, rhs: i64) -> Self {
1549        Self {
1550            x: self.x.sub(rhs),
1551            y: self.y.sub(rhs),
1552            z: self.z.sub(rhs),
1553            w: self.w.sub(rhs),
1554        }
1555    }
1556}
1557
1558impl Sub<&i64> for I64Vec4 {
1559    type Output = Self;
1560    #[inline]
1561    fn sub(self, rhs: &i64) -> Self {
1562        self.sub(*rhs)
1563    }
1564}
1565
1566impl Sub<&i64> for &I64Vec4 {
1567    type Output = I64Vec4;
1568    #[inline]
1569    fn sub(self, rhs: &i64) -> I64Vec4 {
1570        (*self).sub(*rhs)
1571    }
1572}
1573
1574impl Sub<i64> for &I64Vec4 {
1575    type Output = I64Vec4;
1576    #[inline]
1577    fn sub(self, rhs: i64) -> I64Vec4 {
1578        (*self).sub(rhs)
1579    }
1580}
1581
1582impl SubAssign<i64> for I64Vec4 {
1583    #[inline]
1584    fn sub_assign(&mut self, rhs: i64) {
1585        self.x.sub_assign(rhs);
1586        self.y.sub_assign(rhs);
1587        self.z.sub_assign(rhs);
1588        self.w.sub_assign(rhs);
1589    }
1590}
1591
1592impl SubAssign<&i64> for I64Vec4 {
1593    #[inline]
1594    fn sub_assign(&mut self, rhs: &i64) {
1595        self.sub_assign(*rhs);
1596    }
1597}
1598
1599impl Sub<I64Vec4> for i64 {
1600    type Output = I64Vec4;
1601    #[inline]
1602    fn sub(self, rhs: I64Vec4) -> I64Vec4 {
1603        I64Vec4 {
1604            x: self.sub(rhs.x),
1605            y: self.sub(rhs.y),
1606            z: self.sub(rhs.z),
1607            w: self.sub(rhs.w),
1608        }
1609    }
1610}
1611
1612impl Sub<&I64Vec4> for i64 {
1613    type Output = I64Vec4;
1614    #[inline]
1615    fn sub(self, rhs: &I64Vec4) -> I64Vec4 {
1616        self.sub(*rhs)
1617    }
1618}
1619
1620impl Sub<&I64Vec4> for &i64 {
1621    type Output = I64Vec4;
1622    #[inline]
1623    fn sub(self, rhs: &I64Vec4) -> I64Vec4 {
1624        (*self).sub(*rhs)
1625    }
1626}
1627
1628impl Sub<I64Vec4> for &i64 {
1629    type Output = I64Vec4;
1630    #[inline]
1631    fn sub(self, rhs: I64Vec4) -> I64Vec4 {
1632        (*self).sub(rhs)
1633    }
1634}
1635
1636impl Rem for I64Vec4 {
1637    type Output = Self;
1638    #[inline]
1639    fn rem(self, rhs: Self) -> Self {
1640        Self {
1641            x: self.x.rem(rhs.x),
1642            y: self.y.rem(rhs.y),
1643            z: self.z.rem(rhs.z),
1644            w: self.w.rem(rhs.w),
1645        }
1646    }
1647}
1648
1649impl Rem<&Self> for I64Vec4 {
1650    type Output = Self;
1651    #[inline]
1652    fn rem(self, rhs: &Self) -> Self {
1653        self.rem(*rhs)
1654    }
1655}
1656
1657impl Rem<&I64Vec4> for &I64Vec4 {
1658    type Output = I64Vec4;
1659    #[inline]
1660    fn rem(self, rhs: &I64Vec4) -> I64Vec4 {
1661        (*self).rem(*rhs)
1662    }
1663}
1664
1665impl Rem<I64Vec4> for &I64Vec4 {
1666    type Output = I64Vec4;
1667    #[inline]
1668    fn rem(self, rhs: I64Vec4) -> I64Vec4 {
1669        (*self).rem(rhs)
1670    }
1671}
1672
1673impl RemAssign for I64Vec4 {
1674    #[inline]
1675    fn rem_assign(&mut self, rhs: Self) {
1676        self.x.rem_assign(rhs.x);
1677        self.y.rem_assign(rhs.y);
1678        self.z.rem_assign(rhs.z);
1679        self.w.rem_assign(rhs.w);
1680    }
1681}
1682
1683impl RemAssign<&Self> for I64Vec4 {
1684    #[inline]
1685    fn rem_assign(&mut self, rhs: &Self) {
1686        self.rem_assign(*rhs);
1687    }
1688}
1689
1690impl Rem<i64> for I64Vec4 {
1691    type Output = Self;
1692    #[inline]
1693    fn rem(self, rhs: i64) -> Self {
1694        Self {
1695            x: self.x.rem(rhs),
1696            y: self.y.rem(rhs),
1697            z: self.z.rem(rhs),
1698            w: self.w.rem(rhs),
1699        }
1700    }
1701}
1702
1703impl Rem<&i64> for I64Vec4 {
1704    type Output = Self;
1705    #[inline]
1706    fn rem(self, rhs: &i64) -> Self {
1707        self.rem(*rhs)
1708    }
1709}
1710
1711impl Rem<&i64> for &I64Vec4 {
1712    type Output = I64Vec4;
1713    #[inline]
1714    fn rem(self, rhs: &i64) -> I64Vec4 {
1715        (*self).rem(*rhs)
1716    }
1717}
1718
1719impl Rem<i64> for &I64Vec4 {
1720    type Output = I64Vec4;
1721    #[inline]
1722    fn rem(self, rhs: i64) -> I64Vec4 {
1723        (*self).rem(rhs)
1724    }
1725}
1726
1727impl RemAssign<i64> for I64Vec4 {
1728    #[inline]
1729    fn rem_assign(&mut self, rhs: i64) {
1730        self.x.rem_assign(rhs);
1731        self.y.rem_assign(rhs);
1732        self.z.rem_assign(rhs);
1733        self.w.rem_assign(rhs);
1734    }
1735}
1736
1737impl RemAssign<&i64> for I64Vec4 {
1738    #[inline]
1739    fn rem_assign(&mut self, rhs: &i64) {
1740        self.rem_assign(*rhs);
1741    }
1742}
1743
1744impl Rem<I64Vec4> for i64 {
1745    type Output = I64Vec4;
1746    #[inline]
1747    fn rem(self, rhs: I64Vec4) -> I64Vec4 {
1748        I64Vec4 {
1749            x: self.rem(rhs.x),
1750            y: self.rem(rhs.y),
1751            z: self.rem(rhs.z),
1752            w: self.rem(rhs.w),
1753        }
1754    }
1755}
1756
1757impl Rem<&I64Vec4> for i64 {
1758    type Output = I64Vec4;
1759    #[inline]
1760    fn rem(self, rhs: &I64Vec4) -> I64Vec4 {
1761        self.rem(*rhs)
1762    }
1763}
1764
1765impl Rem<&I64Vec4> for &i64 {
1766    type Output = I64Vec4;
1767    #[inline]
1768    fn rem(self, rhs: &I64Vec4) -> I64Vec4 {
1769        (*self).rem(*rhs)
1770    }
1771}
1772
1773impl Rem<I64Vec4> for &i64 {
1774    type Output = I64Vec4;
1775    #[inline]
1776    fn rem(self, rhs: I64Vec4) -> I64Vec4 {
1777        (*self).rem(rhs)
1778    }
1779}
1780
1781impl AsRef<[i64; 4]> for I64Vec4 {
1782    #[inline]
1783    fn as_ref(&self) -> &[i64; 4] {
1784        unsafe { &*(self as *const Self as *const [i64; 4]) }
1785    }
1786}
1787
1788impl AsMut<[i64; 4]> for I64Vec4 {
1789    #[inline]
1790    fn as_mut(&mut self) -> &mut [i64; 4] {
1791        unsafe { &mut *(self as *mut Self as *mut [i64; 4]) }
1792    }
1793}
1794
1795impl Sum for I64Vec4 {
1796    #[inline]
1797    fn sum<I>(iter: I) -> Self
1798    where
1799        I: Iterator<Item = Self>,
1800    {
1801        iter.fold(Self::ZERO, Self::add)
1802    }
1803}
1804
1805impl<'a> Sum<&'a Self> for I64Vec4 {
1806    #[inline]
1807    fn sum<I>(iter: I) -> Self
1808    where
1809        I: Iterator<Item = &'a Self>,
1810    {
1811        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
1812    }
1813}
1814
1815impl Product for I64Vec4 {
1816    #[inline]
1817    fn product<I>(iter: I) -> Self
1818    where
1819        I: Iterator<Item = Self>,
1820    {
1821        iter.fold(Self::ONE, Self::mul)
1822    }
1823}
1824
1825impl<'a> Product<&'a Self> for I64Vec4 {
1826    #[inline]
1827    fn product<I>(iter: I) -> Self
1828    where
1829        I: Iterator<Item = &'a Self>,
1830    {
1831        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
1832    }
1833}
1834
1835impl Neg for I64Vec4 {
1836    type Output = Self;
1837    #[inline]
1838    fn neg(self) -> Self {
1839        Self {
1840            x: self.x.neg(),
1841            y: self.y.neg(),
1842            z: self.z.neg(),
1843            w: self.w.neg(),
1844        }
1845    }
1846}
1847
1848impl Neg for &I64Vec4 {
1849    type Output = I64Vec4;
1850    #[inline]
1851    fn neg(self) -> I64Vec4 {
1852        (*self).neg()
1853    }
1854}
1855
1856impl Not for I64Vec4 {
1857    type Output = Self;
1858    #[inline]
1859    fn not(self) -> Self {
1860        Self {
1861            x: self.x.not(),
1862            y: self.y.not(),
1863            z: self.z.not(),
1864            w: self.w.not(),
1865        }
1866    }
1867}
1868
1869impl Not for &I64Vec4 {
1870    type Output = I64Vec4;
1871    #[inline]
1872    fn not(self) -> I64Vec4 {
1873        (*self).not()
1874    }
1875}
1876
1877impl BitAnd for I64Vec4 {
1878    type Output = Self;
1879    #[inline]
1880    fn bitand(self, rhs: Self) -> Self::Output {
1881        Self {
1882            x: self.x.bitand(rhs.x),
1883            y: self.y.bitand(rhs.y),
1884            z: self.z.bitand(rhs.z),
1885            w: self.w.bitand(rhs.w),
1886        }
1887    }
1888}
1889
1890impl BitAnd<&Self> for I64Vec4 {
1891    type Output = Self;
1892    #[inline]
1893    fn bitand(self, rhs: &Self) -> Self {
1894        self.bitand(*rhs)
1895    }
1896}
1897
1898impl BitAnd<&I64Vec4> for &I64Vec4 {
1899    type Output = I64Vec4;
1900    #[inline]
1901    fn bitand(self, rhs: &I64Vec4) -> I64Vec4 {
1902        (*self).bitand(*rhs)
1903    }
1904}
1905
1906impl BitAnd<I64Vec4> for &I64Vec4 {
1907    type Output = I64Vec4;
1908    #[inline]
1909    fn bitand(self, rhs: I64Vec4) -> I64Vec4 {
1910        (*self).bitand(rhs)
1911    }
1912}
1913
1914impl BitAndAssign for I64Vec4 {
1915    #[inline]
1916    fn bitand_assign(&mut self, rhs: Self) {
1917        *self = self.bitand(rhs);
1918    }
1919}
1920
1921impl BitAndAssign<&Self> for I64Vec4 {
1922    #[inline]
1923    fn bitand_assign(&mut self, rhs: &Self) {
1924        self.bitand_assign(*rhs);
1925    }
1926}
1927
1928impl BitOr for I64Vec4 {
1929    type Output = Self;
1930    #[inline]
1931    fn bitor(self, rhs: Self) -> Self::Output {
1932        Self {
1933            x: self.x.bitor(rhs.x),
1934            y: self.y.bitor(rhs.y),
1935            z: self.z.bitor(rhs.z),
1936            w: self.w.bitor(rhs.w),
1937        }
1938    }
1939}
1940
1941impl BitOr<&Self> for I64Vec4 {
1942    type Output = Self;
1943    #[inline]
1944    fn bitor(self, rhs: &Self) -> Self {
1945        self.bitor(*rhs)
1946    }
1947}
1948
1949impl BitOr<&I64Vec4> for &I64Vec4 {
1950    type Output = I64Vec4;
1951    #[inline]
1952    fn bitor(self, rhs: &I64Vec4) -> I64Vec4 {
1953        (*self).bitor(*rhs)
1954    }
1955}
1956
1957impl BitOr<I64Vec4> for &I64Vec4 {
1958    type Output = I64Vec4;
1959    #[inline]
1960    fn bitor(self, rhs: I64Vec4) -> I64Vec4 {
1961        (*self).bitor(rhs)
1962    }
1963}
1964
1965impl BitOrAssign for I64Vec4 {
1966    #[inline]
1967    fn bitor_assign(&mut self, rhs: Self) {
1968        *self = self.bitor(rhs);
1969    }
1970}
1971
1972impl BitOrAssign<&Self> for I64Vec4 {
1973    #[inline]
1974    fn bitor_assign(&mut self, rhs: &Self) {
1975        self.bitor_assign(*rhs);
1976    }
1977}
1978
1979impl BitXor for I64Vec4 {
1980    type Output = Self;
1981    #[inline]
1982    fn bitxor(self, rhs: Self) -> Self::Output {
1983        Self {
1984            x: self.x.bitxor(rhs.x),
1985            y: self.y.bitxor(rhs.y),
1986            z: self.z.bitxor(rhs.z),
1987            w: self.w.bitxor(rhs.w),
1988        }
1989    }
1990}
1991
1992impl BitXor<&Self> for I64Vec4 {
1993    type Output = Self;
1994    #[inline]
1995    fn bitxor(self, rhs: &Self) -> Self {
1996        self.bitxor(*rhs)
1997    }
1998}
1999
2000impl BitXor<&I64Vec4> for &I64Vec4 {
2001    type Output = I64Vec4;
2002    #[inline]
2003    fn bitxor(self, rhs: &I64Vec4) -> I64Vec4 {
2004        (*self).bitxor(*rhs)
2005    }
2006}
2007
2008impl BitXor<I64Vec4> for &I64Vec4 {
2009    type Output = I64Vec4;
2010    #[inline]
2011    fn bitxor(self, rhs: I64Vec4) -> I64Vec4 {
2012        (*self).bitxor(rhs)
2013    }
2014}
2015
2016impl BitXorAssign for I64Vec4 {
2017    #[inline]
2018    fn bitxor_assign(&mut self, rhs: Self) {
2019        *self = self.bitxor(rhs);
2020    }
2021}
2022
2023impl BitXorAssign<&Self> for I64Vec4 {
2024    #[inline]
2025    fn bitxor_assign(&mut self, rhs: &Self) {
2026        self.bitxor_assign(*rhs);
2027    }
2028}
2029
2030impl BitAnd<i64> for I64Vec4 {
2031    type Output = Self;
2032    #[inline]
2033    fn bitand(self, rhs: i64) -> Self::Output {
2034        Self {
2035            x: self.x.bitand(rhs),
2036            y: self.y.bitand(rhs),
2037            z: self.z.bitand(rhs),
2038            w: self.w.bitand(rhs),
2039        }
2040    }
2041}
2042
2043impl BitAnd<&i64> for I64Vec4 {
2044    type Output = Self;
2045    #[inline]
2046    fn bitand(self, rhs: &i64) -> Self {
2047        self.bitand(*rhs)
2048    }
2049}
2050
2051impl BitAnd<&i64> for &I64Vec4 {
2052    type Output = I64Vec4;
2053    #[inline]
2054    fn bitand(self, rhs: &i64) -> I64Vec4 {
2055        (*self).bitand(*rhs)
2056    }
2057}
2058
2059impl BitAnd<i64> for &I64Vec4 {
2060    type Output = I64Vec4;
2061    #[inline]
2062    fn bitand(self, rhs: i64) -> I64Vec4 {
2063        (*self).bitand(rhs)
2064    }
2065}
2066
2067impl BitAndAssign<i64> for I64Vec4 {
2068    #[inline]
2069    fn bitand_assign(&mut self, rhs: i64) {
2070        *self = self.bitand(rhs);
2071    }
2072}
2073
2074impl BitAndAssign<&i64> for I64Vec4 {
2075    #[inline]
2076    fn bitand_assign(&mut self, rhs: &i64) {
2077        self.bitand_assign(*rhs);
2078    }
2079}
2080
2081impl BitOr<i64> for I64Vec4 {
2082    type Output = Self;
2083    #[inline]
2084    fn bitor(self, rhs: i64) -> Self::Output {
2085        Self {
2086            x: self.x.bitor(rhs),
2087            y: self.y.bitor(rhs),
2088            z: self.z.bitor(rhs),
2089            w: self.w.bitor(rhs),
2090        }
2091    }
2092}
2093
2094impl BitOr<&i64> for I64Vec4 {
2095    type Output = Self;
2096    #[inline]
2097    fn bitor(self, rhs: &i64) -> Self {
2098        self.bitor(*rhs)
2099    }
2100}
2101
2102impl BitOr<&i64> for &I64Vec4 {
2103    type Output = I64Vec4;
2104    #[inline]
2105    fn bitor(self, rhs: &i64) -> I64Vec4 {
2106        (*self).bitor(*rhs)
2107    }
2108}
2109
2110impl BitOr<i64> for &I64Vec4 {
2111    type Output = I64Vec4;
2112    #[inline]
2113    fn bitor(self, rhs: i64) -> I64Vec4 {
2114        (*self).bitor(rhs)
2115    }
2116}
2117
2118impl BitOrAssign<i64> for I64Vec4 {
2119    #[inline]
2120    fn bitor_assign(&mut self, rhs: i64) {
2121        *self = self.bitor(rhs);
2122    }
2123}
2124
2125impl BitOrAssign<&i64> for I64Vec4 {
2126    #[inline]
2127    fn bitor_assign(&mut self, rhs: &i64) {
2128        self.bitor_assign(*rhs);
2129    }
2130}
2131
2132impl BitXor<i64> for I64Vec4 {
2133    type Output = Self;
2134    #[inline]
2135    fn bitxor(self, rhs: i64) -> Self::Output {
2136        Self {
2137            x: self.x.bitxor(rhs),
2138            y: self.y.bitxor(rhs),
2139            z: self.z.bitxor(rhs),
2140            w: self.w.bitxor(rhs),
2141        }
2142    }
2143}
2144
2145impl BitXor<&i64> for I64Vec4 {
2146    type Output = Self;
2147    #[inline]
2148    fn bitxor(self, rhs: &i64) -> Self {
2149        self.bitxor(*rhs)
2150    }
2151}
2152
2153impl BitXor<&i64> for &I64Vec4 {
2154    type Output = I64Vec4;
2155    #[inline]
2156    fn bitxor(self, rhs: &i64) -> I64Vec4 {
2157        (*self).bitxor(*rhs)
2158    }
2159}
2160
2161impl BitXor<i64> for &I64Vec4 {
2162    type Output = I64Vec4;
2163    #[inline]
2164    fn bitxor(self, rhs: i64) -> I64Vec4 {
2165        (*self).bitxor(rhs)
2166    }
2167}
2168
2169impl BitXorAssign<i64> for I64Vec4 {
2170    #[inline]
2171    fn bitxor_assign(&mut self, rhs: i64) {
2172        *self = self.bitxor(rhs);
2173    }
2174}
2175
2176impl BitXorAssign<&i64> for I64Vec4 {
2177    #[inline]
2178    fn bitxor_assign(&mut self, rhs: &i64) {
2179        self.bitxor_assign(*rhs);
2180    }
2181}
2182
2183impl Shl<i8> for I64Vec4 {
2184    type Output = Self;
2185    #[inline]
2186    fn shl(self, rhs: i8) -> Self::Output {
2187        Self {
2188            x: self.x.shl(rhs),
2189            y: self.y.shl(rhs),
2190            z: self.z.shl(rhs),
2191            w: self.w.shl(rhs),
2192        }
2193    }
2194}
2195
2196impl Shl<&i8> for I64Vec4 {
2197    type Output = Self;
2198    #[inline]
2199    fn shl(self, rhs: &i8) -> Self {
2200        self.shl(*rhs)
2201    }
2202}
2203
2204impl Shl<&i8> for &I64Vec4 {
2205    type Output = I64Vec4;
2206    #[inline]
2207    fn shl(self, rhs: &i8) -> I64Vec4 {
2208        (*self).shl(*rhs)
2209    }
2210}
2211
2212impl Shl<i8> for &I64Vec4 {
2213    type Output = I64Vec4;
2214    #[inline]
2215    fn shl(self, rhs: i8) -> I64Vec4 {
2216        (*self).shl(rhs)
2217    }
2218}
2219
2220impl ShlAssign<i8> for I64Vec4 {
2221    #[inline]
2222    fn shl_assign(&mut self, rhs: i8) {
2223        *self = self.shl(rhs);
2224    }
2225}
2226
2227impl ShlAssign<&i8> for I64Vec4 {
2228    #[inline]
2229    fn shl_assign(&mut self, rhs: &i8) {
2230        self.shl_assign(*rhs);
2231    }
2232}
2233
2234impl Shr<i8> for I64Vec4 {
2235    type Output = Self;
2236    #[inline]
2237    fn shr(self, rhs: i8) -> Self::Output {
2238        Self {
2239            x: self.x.shr(rhs),
2240            y: self.y.shr(rhs),
2241            z: self.z.shr(rhs),
2242            w: self.w.shr(rhs),
2243        }
2244    }
2245}
2246
2247impl Shr<&i8> for I64Vec4 {
2248    type Output = Self;
2249    #[inline]
2250    fn shr(self, rhs: &i8) -> Self {
2251        self.shr(*rhs)
2252    }
2253}
2254
2255impl Shr<&i8> for &I64Vec4 {
2256    type Output = I64Vec4;
2257    #[inline]
2258    fn shr(self, rhs: &i8) -> I64Vec4 {
2259        (*self).shr(*rhs)
2260    }
2261}
2262
2263impl Shr<i8> for &I64Vec4 {
2264    type Output = I64Vec4;
2265    #[inline]
2266    fn shr(self, rhs: i8) -> I64Vec4 {
2267        (*self).shr(rhs)
2268    }
2269}
2270
2271impl ShrAssign<i8> for I64Vec4 {
2272    #[inline]
2273    fn shr_assign(&mut self, rhs: i8) {
2274        *self = self.shr(rhs);
2275    }
2276}
2277
2278impl ShrAssign<&i8> for I64Vec4 {
2279    #[inline]
2280    fn shr_assign(&mut self, rhs: &i8) {
2281        self.shr_assign(*rhs);
2282    }
2283}
2284
2285impl Shl<i16> for I64Vec4 {
2286    type Output = Self;
2287    #[inline]
2288    fn shl(self, rhs: i16) -> Self::Output {
2289        Self {
2290            x: self.x.shl(rhs),
2291            y: self.y.shl(rhs),
2292            z: self.z.shl(rhs),
2293            w: self.w.shl(rhs),
2294        }
2295    }
2296}
2297
2298impl Shl<&i16> for I64Vec4 {
2299    type Output = Self;
2300    #[inline]
2301    fn shl(self, rhs: &i16) -> Self {
2302        self.shl(*rhs)
2303    }
2304}
2305
2306impl Shl<&i16> for &I64Vec4 {
2307    type Output = I64Vec4;
2308    #[inline]
2309    fn shl(self, rhs: &i16) -> I64Vec4 {
2310        (*self).shl(*rhs)
2311    }
2312}
2313
2314impl Shl<i16> for &I64Vec4 {
2315    type Output = I64Vec4;
2316    #[inline]
2317    fn shl(self, rhs: i16) -> I64Vec4 {
2318        (*self).shl(rhs)
2319    }
2320}
2321
2322impl ShlAssign<i16> for I64Vec4 {
2323    #[inline]
2324    fn shl_assign(&mut self, rhs: i16) {
2325        *self = self.shl(rhs);
2326    }
2327}
2328
2329impl ShlAssign<&i16> for I64Vec4 {
2330    #[inline]
2331    fn shl_assign(&mut self, rhs: &i16) {
2332        self.shl_assign(*rhs);
2333    }
2334}
2335
2336impl Shr<i16> for I64Vec4 {
2337    type Output = Self;
2338    #[inline]
2339    fn shr(self, rhs: i16) -> Self::Output {
2340        Self {
2341            x: self.x.shr(rhs),
2342            y: self.y.shr(rhs),
2343            z: self.z.shr(rhs),
2344            w: self.w.shr(rhs),
2345        }
2346    }
2347}
2348
2349impl Shr<&i16> for I64Vec4 {
2350    type Output = Self;
2351    #[inline]
2352    fn shr(self, rhs: &i16) -> Self {
2353        self.shr(*rhs)
2354    }
2355}
2356
2357impl Shr<&i16> for &I64Vec4 {
2358    type Output = I64Vec4;
2359    #[inline]
2360    fn shr(self, rhs: &i16) -> I64Vec4 {
2361        (*self).shr(*rhs)
2362    }
2363}
2364
2365impl Shr<i16> for &I64Vec4 {
2366    type Output = I64Vec4;
2367    #[inline]
2368    fn shr(self, rhs: i16) -> I64Vec4 {
2369        (*self).shr(rhs)
2370    }
2371}
2372
2373impl ShrAssign<i16> for I64Vec4 {
2374    #[inline]
2375    fn shr_assign(&mut self, rhs: i16) {
2376        *self = self.shr(rhs);
2377    }
2378}
2379
2380impl ShrAssign<&i16> for I64Vec4 {
2381    #[inline]
2382    fn shr_assign(&mut self, rhs: &i16) {
2383        self.shr_assign(*rhs);
2384    }
2385}
2386
2387impl Shl<i32> for I64Vec4 {
2388    type Output = Self;
2389    #[inline]
2390    fn shl(self, rhs: i32) -> Self::Output {
2391        Self {
2392            x: self.x.shl(rhs),
2393            y: self.y.shl(rhs),
2394            z: self.z.shl(rhs),
2395            w: self.w.shl(rhs),
2396        }
2397    }
2398}
2399
2400impl Shl<&i32> for I64Vec4 {
2401    type Output = Self;
2402    #[inline]
2403    fn shl(self, rhs: &i32) -> Self {
2404        self.shl(*rhs)
2405    }
2406}
2407
2408impl Shl<&i32> for &I64Vec4 {
2409    type Output = I64Vec4;
2410    #[inline]
2411    fn shl(self, rhs: &i32) -> I64Vec4 {
2412        (*self).shl(*rhs)
2413    }
2414}
2415
2416impl Shl<i32> for &I64Vec4 {
2417    type Output = I64Vec4;
2418    #[inline]
2419    fn shl(self, rhs: i32) -> I64Vec4 {
2420        (*self).shl(rhs)
2421    }
2422}
2423
2424impl ShlAssign<i32> for I64Vec4 {
2425    #[inline]
2426    fn shl_assign(&mut self, rhs: i32) {
2427        *self = self.shl(rhs);
2428    }
2429}
2430
2431impl ShlAssign<&i32> for I64Vec4 {
2432    #[inline]
2433    fn shl_assign(&mut self, rhs: &i32) {
2434        self.shl_assign(*rhs);
2435    }
2436}
2437
2438impl Shr<i32> for I64Vec4 {
2439    type Output = Self;
2440    #[inline]
2441    fn shr(self, rhs: i32) -> Self::Output {
2442        Self {
2443            x: self.x.shr(rhs),
2444            y: self.y.shr(rhs),
2445            z: self.z.shr(rhs),
2446            w: self.w.shr(rhs),
2447        }
2448    }
2449}
2450
2451impl Shr<&i32> for I64Vec4 {
2452    type Output = Self;
2453    #[inline]
2454    fn shr(self, rhs: &i32) -> Self {
2455        self.shr(*rhs)
2456    }
2457}
2458
2459impl Shr<&i32> for &I64Vec4 {
2460    type Output = I64Vec4;
2461    #[inline]
2462    fn shr(self, rhs: &i32) -> I64Vec4 {
2463        (*self).shr(*rhs)
2464    }
2465}
2466
2467impl Shr<i32> for &I64Vec4 {
2468    type Output = I64Vec4;
2469    #[inline]
2470    fn shr(self, rhs: i32) -> I64Vec4 {
2471        (*self).shr(rhs)
2472    }
2473}
2474
2475impl ShrAssign<i32> for I64Vec4 {
2476    #[inline]
2477    fn shr_assign(&mut self, rhs: i32) {
2478        *self = self.shr(rhs);
2479    }
2480}
2481
2482impl ShrAssign<&i32> for I64Vec4 {
2483    #[inline]
2484    fn shr_assign(&mut self, rhs: &i32) {
2485        self.shr_assign(*rhs);
2486    }
2487}
2488
2489impl Shl<i64> for I64Vec4 {
2490    type Output = Self;
2491    #[inline]
2492    fn shl(self, rhs: i64) -> Self::Output {
2493        Self {
2494            x: self.x.shl(rhs),
2495            y: self.y.shl(rhs),
2496            z: self.z.shl(rhs),
2497            w: self.w.shl(rhs),
2498        }
2499    }
2500}
2501
2502impl Shl<&i64> for I64Vec4 {
2503    type Output = Self;
2504    #[inline]
2505    fn shl(self, rhs: &i64) -> Self {
2506        self.shl(*rhs)
2507    }
2508}
2509
2510impl Shl<&i64> for &I64Vec4 {
2511    type Output = I64Vec4;
2512    #[inline]
2513    fn shl(self, rhs: &i64) -> I64Vec4 {
2514        (*self).shl(*rhs)
2515    }
2516}
2517
2518impl Shl<i64> for &I64Vec4 {
2519    type Output = I64Vec4;
2520    #[inline]
2521    fn shl(self, rhs: i64) -> I64Vec4 {
2522        (*self).shl(rhs)
2523    }
2524}
2525
2526impl ShlAssign<i64> for I64Vec4 {
2527    #[inline]
2528    fn shl_assign(&mut self, rhs: i64) {
2529        *self = self.shl(rhs);
2530    }
2531}
2532
2533impl ShlAssign<&i64> for I64Vec4 {
2534    #[inline]
2535    fn shl_assign(&mut self, rhs: &i64) {
2536        self.shl_assign(*rhs);
2537    }
2538}
2539
2540impl Shr<i64> for I64Vec4 {
2541    type Output = Self;
2542    #[inline]
2543    fn shr(self, rhs: i64) -> Self::Output {
2544        Self {
2545            x: self.x.shr(rhs),
2546            y: self.y.shr(rhs),
2547            z: self.z.shr(rhs),
2548            w: self.w.shr(rhs),
2549        }
2550    }
2551}
2552
2553impl Shr<&i64> for I64Vec4 {
2554    type Output = Self;
2555    #[inline]
2556    fn shr(self, rhs: &i64) -> Self {
2557        self.shr(*rhs)
2558    }
2559}
2560
2561impl Shr<&i64> for &I64Vec4 {
2562    type Output = I64Vec4;
2563    #[inline]
2564    fn shr(self, rhs: &i64) -> I64Vec4 {
2565        (*self).shr(*rhs)
2566    }
2567}
2568
2569impl Shr<i64> for &I64Vec4 {
2570    type Output = I64Vec4;
2571    #[inline]
2572    fn shr(self, rhs: i64) -> I64Vec4 {
2573        (*self).shr(rhs)
2574    }
2575}
2576
2577impl ShrAssign<i64> for I64Vec4 {
2578    #[inline]
2579    fn shr_assign(&mut self, rhs: i64) {
2580        *self = self.shr(rhs);
2581    }
2582}
2583
2584impl ShrAssign<&i64> for I64Vec4 {
2585    #[inline]
2586    fn shr_assign(&mut self, rhs: &i64) {
2587        self.shr_assign(*rhs);
2588    }
2589}
2590
2591impl Shl<u8> for I64Vec4 {
2592    type Output = Self;
2593    #[inline]
2594    fn shl(self, rhs: u8) -> Self::Output {
2595        Self {
2596            x: self.x.shl(rhs),
2597            y: self.y.shl(rhs),
2598            z: self.z.shl(rhs),
2599            w: self.w.shl(rhs),
2600        }
2601    }
2602}
2603
2604impl Shl<&u8> for I64Vec4 {
2605    type Output = Self;
2606    #[inline]
2607    fn shl(self, rhs: &u8) -> Self {
2608        self.shl(*rhs)
2609    }
2610}
2611
2612impl Shl<&u8> for &I64Vec4 {
2613    type Output = I64Vec4;
2614    #[inline]
2615    fn shl(self, rhs: &u8) -> I64Vec4 {
2616        (*self).shl(*rhs)
2617    }
2618}
2619
2620impl Shl<u8> for &I64Vec4 {
2621    type Output = I64Vec4;
2622    #[inline]
2623    fn shl(self, rhs: u8) -> I64Vec4 {
2624        (*self).shl(rhs)
2625    }
2626}
2627
2628impl ShlAssign<u8> for I64Vec4 {
2629    #[inline]
2630    fn shl_assign(&mut self, rhs: u8) {
2631        *self = self.shl(rhs);
2632    }
2633}
2634
2635impl ShlAssign<&u8> for I64Vec4 {
2636    #[inline]
2637    fn shl_assign(&mut self, rhs: &u8) {
2638        self.shl_assign(*rhs);
2639    }
2640}
2641
2642impl Shr<u8> for I64Vec4 {
2643    type Output = Self;
2644    #[inline]
2645    fn shr(self, rhs: u8) -> Self::Output {
2646        Self {
2647            x: self.x.shr(rhs),
2648            y: self.y.shr(rhs),
2649            z: self.z.shr(rhs),
2650            w: self.w.shr(rhs),
2651        }
2652    }
2653}
2654
2655impl Shr<&u8> for I64Vec4 {
2656    type Output = Self;
2657    #[inline]
2658    fn shr(self, rhs: &u8) -> Self {
2659        self.shr(*rhs)
2660    }
2661}
2662
2663impl Shr<&u8> for &I64Vec4 {
2664    type Output = I64Vec4;
2665    #[inline]
2666    fn shr(self, rhs: &u8) -> I64Vec4 {
2667        (*self).shr(*rhs)
2668    }
2669}
2670
2671impl Shr<u8> for &I64Vec4 {
2672    type Output = I64Vec4;
2673    #[inline]
2674    fn shr(self, rhs: u8) -> I64Vec4 {
2675        (*self).shr(rhs)
2676    }
2677}
2678
2679impl ShrAssign<u8> for I64Vec4 {
2680    #[inline]
2681    fn shr_assign(&mut self, rhs: u8) {
2682        *self = self.shr(rhs);
2683    }
2684}
2685
2686impl ShrAssign<&u8> for I64Vec4 {
2687    #[inline]
2688    fn shr_assign(&mut self, rhs: &u8) {
2689        self.shr_assign(*rhs);
2690    }
2691}
2692
2693impl Shl<u16> for I64Vec4 {
2694    type Output = Self;
2695    #[inline]
2696    fn shl(self, rhs: u16) -> Self::Output {
2697        Self {
2698            x: self.x.shl(rhs),
2699            y: self.y.shl(rhs),
2700            z: self.z.shl(rhs),
2701            w: self.w.shl(rhs),
2702        }
2703    }
2704}
2705
2706impl Shl<&u16> for I64Vec4 {
2707    type Output = Self;
2708    #[inline]
2709    fn shl(self, rhs: &u16) -> Self {
2710        self.shl(*rhs)
2711    }
2712}
2713
2714impl Shl<&u16> for &I64Vec4 {
2715    type Output = I64Vec4;
2716    #[inline]
2717    fn shl(self, rhs: &u16) -> I64Vec4 {
2718        (*self).shl(*rhs)
2719    }
2720}
2721
2722impl Shl<u16> for &I64Vec4 {
2723    type Output = I64Vec4;
2724    #[inline]
2725    fn shl(self, rhs: u16) -> I64Vec4 {
2726        (*self).shl(rhs)
2727    }
2728}
2729
2730impl ShlAssign<u16> for I64Vec4 {
2731    #[inline]
2732    fn shl_assign(&mut self, rhs: u16) {
2733        *self = self.shl(rhs);
2734    }
2735}
2736
2737impl ShlAssign<&u16> for I64Vec4 {
2738    #[inline]
2739    fn shl_assign(&mut self, rhs: &u16) {
2740        self.shl_assign(*rhs);
2741    }
2742}
2743
2744impl Shr<u16> for I64Vec4 {
2745    type Output = Self;
2746    #[inline]
2747    fn shr(self, rhs: u16) -> Self::Output {
2748        Self {
2749            x: self.x.shr(rhs),
2750            y: self.y.shr(rhs),
2751            z: self.z.shr(rhs),
2752            w: self.w.shr(rhs),
2753        }
2754    }
2755}
2756
2757impl Shr<&u16> for I64Vec4 {
2758    type Output = Self;
2759    #[inline]
2760    fn shr(self, rhs: &u16) -> Self {
2761        self.shr(*rhs)
2762    }
2763}
2764
2765impl Shr<&u16> for &I64Vec4 {
2766    type Output = I64Vec4;
2767    #[inline]
2768    fn shr(self, rhs: &u16) -> I64Vec4 {
2769        (*self).shr(*rhs)
2770    }
2771}
2772
2773impl Shr<u16> for &I64Vec4 {
2774    type Output = I64Vec4;
2775    #[inline]
2776    fn shr(self, rhs: u16) -> I64Vec4 {
2777        (*self).shr(rhs)
2778    }
2779}
2780
2781impl ShrAssign<u16> for I64Vec4 {
2782    #[inline]
2783    fn shr_assign(&mut self, rhs: u16) {
2784        *self = self.shr(rhs);
2785    }
2786}
2787
2788impl ShrAssign<&u16> for I64Vec4 {
2789    #[inline]
2790    fn shr_assign(&mut self, rhs: &u16) {
2791        self.shr_assign(*rhs);
2792    }
2793}
2794
2795impl Shl<u32> for I64Vec4 {
2796    type Output = Self;
2797    #[inline]
2798    fn shl(self, rhs: u32) -> Self::Output {
2799        Self {
2800            x: self.x.shl(rhs),
2801            y: self.y.shl(rhs),
2802            z: self.z.shl(rhs),
2803            w: self.w.shl(rhs),
2804        }
2805    }
2806}
2807
2808impl Shl<&u32> for I64Vec4 {
2809    type Output = Self;
2810    #[inline]
2811    fn shl(self, rhs: &u32) -> Self {
2812        self.shl(*rhs)
2813    }
2814}
2815
2816impl Shl<&u32> for &I64Vec4 {
2817    type Output = I64Vec4;
2818    #[inline]
2819    fn shl(self, rhs: &u32) -> I64Vec4 {
2820        (*self).shl(*rhs)
2821    }
2822}
2823
2824impl Shl<u32> for &I64Vec4 {
2825    type Output = I64Vec4;
2826    #[inline]
2827    fn shl(self, rhs: u32) -> I64Vec4 {
2828        (*self).shl(rhs)
2829    }
2830}
2831
2832impl ShlAssign<u32> for I64Vec4 {
2833    #[inline]
2834    fn shl_assign(&mut self, rhs: u32) {
2835        *self = self.shl(rhs);
2836    }
2837}
2838
2839impl ShlAssign<&u32> for I64Vec4 {
2840    #[inline]
2841    fn shl_assign(&mut self, rhs: &u32) {
2842        self.shl_assign(*rhs);
2843    }
2844}
2845
2846impl Shr<u32> for I64Vec4 {
2847    type Output = Self;
2848    #[inline]
2849    fn shr(self, rhs: u32) -> Self::Output {
2850        Self {
2851            x: self.x.shr(rhs),
2852            y: self.y.shr(rhs),
2853            z: self.z.shr(rhs),
2854            w: self.w.shr(rhs),
2855        }
2856    }
2857}
2858
2859impl Shr<&u32> for I64Vec4 {
2860    type Output = Self;
2861    #[inline]
2862    fn shr(self, rhs: &u32) -> Self {
2863        self.shr(*rhs)
2864    }
2865}
2866
2867impl Shr<&u32> for &I64Vec4 {
2868    type Output = I64Vec4;
2869    #[inline]
2870    fn shr(self, rhs: &u32) -> I64Vec4 {
2871        (*self).shr(*rhs)
2872    }
2873}
2874
2875impl Shr<u32> for &I64Vec4 {
2876    type Output = I64Vec4;
2877    #[inline]
2878    fn shr(self, rhs: u32) -> I64Vec4 {
2879        (*self).shr(rhs)
2880    }
2881}
2882
2883impl ShrAssign<u32> for I64Vec4 {
2884    #[inline]
2885    fn shr_assign(&mut self, rhs: u32) {
2886        *self = self.shr(rhs);
2887    }
2888}
2889
2890impl ShrAssign<&u32> for I64Vec4 {
2891    #[inline]
2892    fn shr_assign(&mut self, rhs: &u32) {
2893        self.shr_assign(*rhs);
2894    }
2895}
2896
2897impl Shl<u64> for I64Vec4 {
2898    type Output = Self;
2899    #[inline]
2900    fn shl(self, rhs: u64) -> Self::Output {
2901        Self {
2902            x: self.x.shl(rhs),
2903            y: self.y.shl(rhs),
2904            z: self.z.shl(rhs),
2905            w: self.w.shl(rhs),
2906        }
2907    }
2908}
2909
2910impl Shl<&u64> for I64Vec4 {
2911    type Output = Self;
2912    #[inline]
2913    fn shl(self, rhs: &u64) -> Self {
2914        self.shl(*rhs)
2915    }
2916}
2917
2918impl Shl<&u64> for &I64Vec4 {
2919    type Output = I64Vec4;
2920    #[inline]
2921    fn shl(self, rhs: &u64) -> I64Vec4 {
2922        (*self).shl(*rhs)
2923    }
2924}
2925
2926impl Shl<u64> for &I64Vec4 {
2927    type Output = I64Vec4;
2928    #[inline]
2929    fn shl(self, rhs: u64) -> I64Vec4 {
2930        (*self).shl(rhs)
2931    }
2932}
2933
2934impl ShlAssign<u64> for I64Vec4 {
2935    #[inline]
2936    fn shl_assign(&mut self, rhs: u64) {
2937        *self = self.shl(rhs);
2938    }
2939}
2940
2941impl ShlAssign<&u64> for I64Vec4 {
2942    #[inline]
2943    fn shl_assign(&mut self, rhs: &u64) {
2944        self.shl_assign(*rhs);
2945    }
2946}
2947
2948impl Shr<u64> for I64Vec4 {
2949    type Output = Self;
2950    #[inline]
2951    fn shr(self, rhs: u64) -> Self::Output {
2952        Self {
2953            x: self.x.shr(rhs),
2954            y: self.y.shr(rhs),
2955            z: self.z.shr(rhs),
2956            w: self.w.shr(rhs),
2957        }
2958    }
2959}
2960
2961impl Shr<&u64> for I64Vec4 {
2962    type Output = Self;
2963    #[inline]
2964    fn shr(self, rhs: &u64) -> Self {
2965        self.shr(*rhs)
2966    }
2967}
2968
2969impl Shr<&u64> for &I64Vec4 {
2970    type Output = I64Vec4;
2971    #[inline]
2972    fn shr(self, rhs: &u64) -> I64Vec4 {
2973        (*self).shr(*rhs)
2974    }
2975}
2976
2977impl Shr<u64> for &I64Vec4 {
2978    type Output = I64Vec4;
2979    #[inline]
2980    fn shr(self, rhs: u64) -> I64Vec4 {
2981        (*self).shr(rhs)
2982    }
2983}
2984
2985impl ShrAssign<u64> for I64Vec4 {
2986    #[inline]
2987    fn shr_assign(&mut self, rhs: u64) {
2988        *self = self.shr(rhs);
2989    }
2990}
2991
2992impl ShrAssign<&u64> for I64Vec4 {
2993    #[inline]
2994    fn shr_assign(&mut self, rhs: &u64) {
2995        self.shr_assign(*rhs);
2996    }
2997}
2998
2999#[cfg(feature = "i32")]
3000impl Shl<IVec4> for I64Vec4 {
3001    type Output = Self;
3002    #[inline]
3003    fn shl(self, rhs: IVec4) -> Self {
3004        Self {
3005            x: self.x.shl(rhs.x),
3006            y: self.y.shl(rhs.y),
3007            z: self.z.shl(rhs.z),
3008            w: self.w.shl(rhs.w),
3009        }
3010    }
3011}
3012
3013#[cfg(feature = "i32")]
3014impl Shl<&IVec4> for I64Vec4 {
3015    type Output = Self;
3016    #[inline]
3017    fn shl(self, rhs: &IVec4) -> Self {
3018        self.shl(*rhs)
3019    }
3020}
3021
3022#[cfg(feature = "i32")]
3023impl Shl<&IVec4> for &I64Vec4 {
3024    type Output = I64Vec4;
3025    #[inline]
3026    fn shl(self, rhs: &IVec4) -> I64Vec4 {
3027        (*self).shl(*rhs)
3028    }
3029}
3030
3031#[cfg(feature = "i32")]
3032impl Shl<IVec4> for &I64Vec4 {
3033    type Output = I64Vec4;
3034    #[inline]
3035    fn shl(self, rhs: IVec4) -> I64Vec4 {
3036        (*self).shl(rhs)
3037    }
3038}
3039
3040#[cfg(feature = "i32")]
3041impl Shr<IVec4> for I64Vec4 {
3042    type Output = Self;
3043    #[inline]
3044    fn shr(self, rhs: IVec4) -> Self {
3045        Self {
3046            x: self.x.shr(rhs.x),
3047            y: self.y.shr(rhs.y),
3048            z: self.z.shr(rhs.z),
3049            w: self.w.shr(rhs.w),
3050        }
3051    }
3052}
3053
3054#[cfg(feature = "i32")]
3055impl Shr<&IVec4> for I64Vec4 {
3056    type Output = Self;
3057    #[inline]
3058    fn shr(self, rhs: &IVec4) -> Self {
3059        self.shr(*rhs)
3060    }
3061}
3062
3063#[cfg(feature = "i32")]
3064impl Shr<&IVec4> for &I64Vec4 {
3065    type Output = I64Vec4;
3066    #[inline]
3067    fn shr(self, rhs: &IVec4) -> I64Vec4 {
3068        (*self).shr(*rhs)
3069    }
3070}
3071
3072#[cfg(feature = "i32")]
3073impl Shr<IVec4> for &I64Vec4 {
3074    type Output = I64Vec4;
3075    #[inline]
3076    fn shr(self, rhs: IVec4) -> I64Vec4 {
3077        (*self).shr(rhs)
3078    }
3079}
3080
3081#[cfg(feature = "u32")]
3082impl Shl<UVec4> for I64Vec4 {
3083    type Output = Self;
3084    #[inline]
3085    fn shl(self, rhs: UVec4) -> Self {
3086        Self {
3087            x: self.x.shl(rhs.x),
3088            y: self.y.shl(rhs.y),
3089            z: self.z.shl(rhs.z),
3090            w: self.w.shl(rhs.w),
3091        }
3092    }
3093}
3094
3095#[cfg(feature = "u32")]
3096impl Shl<&UVec4> for I64Vec4 {
3097    type Output = Self;
3098    #[inline]
3099    fn shl(self, rhs: &UVec4) -> Self {
3100        self.shl(*rhs)
3101    }
3102}
3103
3104#[cfg(feature = "u32")]
3105impl Shl<&UVec4> for &I64Vec4 {
3106    type Output = I64Vec4;
3107    #[inline]
3108    fn shl(self, rhs: &UVec4) -> I64Vec4 {
3109        (*self).shl(*rhs)
3110    }
3111}
3112
3113#[cfg(feature = "u32")]
3114impl Shl<UVec4> for &I64Vec4 {
3115    type Output = I64Vec4;
3116    #[inline]
3117    fn shl(self, rhs: UVec4) -> I64Vec4 {
3118        (*self).shl(rhs)
3119    }
3120}
3121
3122#[cfg(feature = "u32")]
3123impl Shr<UVec4> for I64Vec4 {
3124    type Output = Self;
3125    #[inline]
3126    fn shr(self, rhs: UVec4) -> Self {
3127        Self {
3128            x: self.x.shr(rhs.x),
3129            y: self.y.shr(rhs.y),
3130            z: self.z.shr(rhs.z),
3131            w: self.w.shr(rhs.w),
3132        }
3133    }
3134}
3135
3136#[cfg(feature = "u32")]
3137impl Shr<&UVec4> for I64Vec4 {
3138    type Output = Self;
3139    #[inline]
3140    fn shr(self, rhs: &UVec4) -> Self {
3141        self.shr(*rhs)
3142    }
3143}
3144
3145#[cfg(feature = "u32")]
3146impl Shr<&UVec4> for &I64Vec4 {
3147    type Output = I64Vec4;
3148    #[inline]
3149    fn shr(self, rhs: &UVec4) -> I64Vec4 {
3150        (*self).shr(*rhs)
3151    }
3152}
3153
3154#[cfg(feature = "u32")]
3155impl Shr<UVec4> for &I64Vec4 {
3156    type Output = I64Vec4;
3157    #[inline]
3158    fn shr(self, rhs: UVec4) -> I64Vec4 {
3159        (*self).shr(rhs)
3160    }
3161}
3162
3163impl Index<usize> for I64Vec4 {
3164    type Output = i64;
3165    #[inline]
3166    fn index(&self, index: usize) -> &Self::Output {
3167        match index {
3168            0 => &self.x,
3169            1 => &self.y,
3170            2 => &self.z,
3171            3 => &self.w,
3172            _ => panic!("index out of bounds"),
3173        }
3174    }
3175}
3176
3177impl IndexMut<usize> for I64Vec4 {
3178    #[inline]
3179    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3180        match index {
3181            0 => &mut self.x,
3182            1 => &mut self.y,
3183            2 => &mut self.z,
3184            3 => &mut self.w,
3185            _ => panic!("index out of bounds"),
3186        }
3187    }
3188}
3189
3190impl fmt::Display for I64Vec4 {
3191    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3192        write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
3193    }
3194}
3195
3196impl fmt::Debug for I64Vec4 {
3197    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3198        fmt.debug_tuple(stringify!(I64Vec4))
3199            .field(&self.x)
3200            .field(&self.y)
3201            .field(&self.z)
3202            .field(&self.w)
3203            .finish()
3204    }
3205}
3206
3207impl From<[i64; 4]> for I64Vec4 {
3208    #[inline]
3209    fn from(a: [i64; 4]) -> Self {
3210        Self::new(a[0], a[1], a[2], a[3])
3211    }
3212}
3213
3214impl From<I64Vec4> for [i64; 4] {
3215    #[inline]
3216    fn from(v: I64Vec4) -> Self {
3217        [v.x, v.y, v.z, v.w]
3218    }
3219}
3220
3221impl From<(i64, i64, i64, i64)> for I64Vec4 {
3222    #[inline]
3223    fn from(t: (i64, i64, i64, i64)) -> Self {
3224        Self::new(t.0, t.1, t.2, t.3)
3225    }
3226}
3227
3228impl From<I64Vec4> for (i64, i64, i64, i64) {
3229    #[inline]
3230    fn from(v: I64Vec4) -> Self {
3231        (v.x, v.y, v.z, v.w)
3232    }
3233}
3234
3235impl From<(I64Vec3, i64)> for I64Vec4 {
3236    #[inline]
3237    fn from((v, w): (I64Vec3, i64)) -> Self {
3238        Self::new(v.x, v.y, v.z, w)
3239    }
3240}
3241
3242impl From<(i64, I64Vec3)> for I64Vec4 {
3243    #[inline]
3244    fn from((x, v): (i64, I64Vec3)) -> Self {
3245        Self::new(x, v.x, v.y, v.z)
3246    }
3247}
3248
3249impl From<(I64Vec2, i64, i64)> for I64Vec4 {
3250    #[inline]
3251    fn from((v, z, w): (I64Vec2, i64, i64)) -> Self {
3252        Self::new(v.x, v.y, z, w)
3253    }
3254}
3255
3256impl From<(I64Vec2, I64Vec2)> for I64Vec4 {
3257    #[inline]
3258    fn from((v, u): (I64Vec2, I64Vec2)) -> Self {
3259        Self::new(v.x, v.y, u.x, u.y)
3260    }
3261}
3262
3263#[cfg(feature = "i8")]
3264impl From<I8Vec4> for I64Vec4 {
3265    #[inline]
3266    fn from(v: I8Vec4) -> Self {
3267        Self::new(
3268            i64::from(v.x),
3269            i64::from(v.y),
3270            i64::from(v.z),
3271            i64::from(v.w),
3272        )
3273    }
3274}
3275
3276#[cfg(feature = "u8")]
3277impl From<U8Vec4> for I64Vec4 {
3278    #[inline]
3279    fn from(v: U8Vec4) -> Self {
3280        Self::new(
3281            i64::from(v.x),
3282            i64::from(v.y),
3283            i64::from(v.z),
3284            i64::from(v.w),
3285        )
3286    }
3287}
3288
3289#[cfg(feature = "i16")]
3290impl From<I16Vec4> for I64Vec4 {
3291    #[inline]
3292    fn from(v: I16Vec4) -> Self {
3293        Self::new(
3294            i64::from(v.x),
3295            i64::from(v.y),
3296            i64::from(v.z),
3297            i64::from(v.w),
3298        )
3299    }
3300}
3301
3302#[cfg(feature = "u16")]
3303impl From<U16Vec4> for I64Vec4 {
3304    #[inline]
3305    fn from(v: U16Vec4) -> Self {
3306        Self::new(
3307            i64::from(v.x),
3308            i64::from(v.y),
3309            i64::from(v.z),
3310            i64::from(v.w),
3311        )
3312    }
3313}
3314
3315#[cfg(feature = "i32")]
3316impl From<IVec4> for I64Vec4 {
3317    #[inline]
3318    fn from(v: IVec4) -> Self {
3319        Self::new(
3320            i64::from(v.x),
3321            i64::from(v.y),
3322            i64::from(v.z),
3323            i64::from(v.w),
3324        )
3325    }
3326}
3327
3328#[cfg(feature = "u32")]
3329impl From<UVec4> for I64Vec4 {
3330    #[inline]
3331    fn from(v: UVec4) -> Self {
3332        Self::new(
3333            i64::from(v.x),
3334            i64::from(v.y),
3335            i64::from(v.z),
3336            i64::from(v.w),
3337        )
3338    }
3339}
3340
3341#[cfg(feature = "u64")]
3342impl TryFrom<U64Vec4> for I64Vec4 {
3343    type Error = core::num::TryFromIntError;
3344
3345    #[inline]
3346    fn try_from(v: U64Vec4) -> Result<Self, Self::Error> {
3347        Ok(Self::new(
3348            i64::try_from(v.x)?,
3349            i64::try_from(v.y)?,
3350            i64::try_from(v.z)?,
3351            i64::try_from(v.w)?,
3352        ))
3353    }
3354}
3355
3356#[cfg(feature = "isize")]
3357impl TryFrom<ISizeVec4> for I64Vec4 {
3358    type Error = core::num::TryFromIntError;
3359
3360    #[inline]
3361    fn try_from(v: ISizeVec4) -> Result<Self, Self::Error> {
3362        Ok(Self::new(
3363            i64::try_from(v.x)?,
3364            i64::try_from(v.y)?,
3365            i64::try_from(v.z)?,
3366            i64::try_from(v.w)?,
3367        ))
3368    }
3369}
3370
3371#[cfg(feature = "usize")]
3372impl TryFrom<USizeVec4> for I64Vec4 {
3373    type Error = core::num::TryFromIntError;
3374
3375    #[inline]
3376    fn try_from(v: USizeVec4) -> Result<Self, Self::Error> {
3377        Ok(Self::new(
3378            i64::try_from(v.x)?,
3379            i64::try_from(v.y)?,
3380            i64::try_from(v.z)?,
3381            i64::try_from(v.w)?,
3382        ))
3383    }
3384}
3385
3386impl From<BVec4> for I64Vec4 {
3387    #[inline]
3388    fn from(v: BVec4) -> Self {
3389        Self::new(
3390            i64::from(v.x),
3391            i64::from(v.y),
3392            i64::from(v.z),
3393            i64::from(v.w),
3394        )
3395    }
3396}
3397
3398#[cfg(not(feature = "scalar-math"))]
3399impl From<BVec4A> for I64Vec4 {
3400    #[inline]
3401    fn from(v: BVec4A) -> Self {
3402        let bool_array: [bool; 4] = v.into();
3403        Self::new(
3404            i64::from(bool_array[0]),
3405            i64::from(bool_array[1]),
3406            i64::from(bool_array[2]),
3407            i64::from(bool_array[3]),
3408        )
3409    }
3410}