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