Skip to main content

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