glam/isize/
isizevec4.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, I8Vec4, ISizeVec2, ISizeVec3, IVec4, U16Vec4, U64Vec4, U8Vec4,
7    USizeVec4, 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 isizevec4(x: isize, y: isize, z: isize, w: isize) -> ISizeVec4 {
21    ISizeVec4::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(16)))]
32#[repr(C)]
33#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
34pub struct ISizeVec4 {
35    pub x: isize,
36    pub y: isize,
37    pub z: isize,
38    pub w: isize,
39}
40
41impl ISizeVec4 {
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 `isize::MIN`.
52    pub const MIN: Self = Self::splat(isize::MIN);
53
54    /// All `isize::MAX`.
55    pub const MAX: Self = Self::splat(isize::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: isize, y: isize, z: isize, w: isize) -> 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: isize) -> 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(isize) -> isize,
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: [isize; 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) -> [isize; 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: &[isize]) -> 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 [isize]) {
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 [`ISizeVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()].
171    #[inline]
172    #[must_use]
173    pub fn truncate(self) -> ISizeVec3 {
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: isize) -> 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: isize) -> 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: isize) -> 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: isize) -> 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) -> isize {
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 [`isize::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) -> isize {
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) -> isize {
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) -> isize {
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) -> isize {
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) -> isize {
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) -> isize {
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]: isize::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 [`usize::MAX`].
537    ///
538    /// See also [`checked_manhattan_distance`][ISizeVec4::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) -> usize {
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 [`usize::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<usize> {
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) -> usize {
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 `i8`.
597    #[inline]
598    #[must_use]
599    pub fn as_i8vec4(self) -> crate::I8Vec4 {
600        crate::I8Vec4::new(self.x as i8, self.y as i8, self.z as i8, self.w as i8)
601    }
602
603    /// Casts all elements of `self` to `u8`.
604    #[inline]
605    #[must_use]
606    pub fn as_u8vec4(self) -> crate::U8Vec4 {
607        crate::U8Vec4::new(self.x as u8, self.y as u8, self.z as u8, self.w as u8)
608    }
609
610    /// Casts all elements of `self` to `i16`.
611    #[inline]
612    #[must_use]
613    pub fn as_i16vec4(self) -> crate::I16Vec4 {
614        crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
615    }
616
617    /// Casts all elements of `self` to `u16`.
618    #[inline]
619    #[must_use]
620    pub fn as_u16vec4(self) -> crate::U16Vec4 {
621        crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
622    }
623
624    /// Casts all elements of `self` to `i32`.
625    #[inline]
626    #[must_use]
627    pub fn as_ivec4(self) -> crate::IVec4 {
628        crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
629    }
630
631    /// Casts all elements of `self` to `u32`.
632    #[inline]
633    #[must_use]
634    pub fn as_uvec4(self) -> crate::UVec4 {
635        crate::UVec4::new(self.x as u32, self.y as u32, self.z as u32, self.w as u32)
636    }
637
638    /// Casts all elements of `self` to `i64`.
639    #[inline]
640    #[must_use]
641    pub fn as_i64vec4(self) -> crate::I64Vec4 {
642        crate::I64Vec4::new(self.x as i64, self.y as i64, self.z as i64, self.w as i64)
643    }
644
645    /// Casts all elements of `self` to `u64`.
646    #[inline]
647    #[must_use]
648    pub fn as_u64vec4(self) -> crate::U64Vec4 {
649        crate::U64Vec4::new(self.x as u64, self.y as u64, self.z as u64, self.w as u64)
650    }
651
652    /// Casts all elements of `self` to `usize`.
653    #[inline]
654    #[must_use]
655    pub fn as_usizevec4(self) -> crate::USizeVec4 {
656        crate::USizeVec4::new(
657            self.x as usize,
658            self.y as usize,
659            self.z as usize,
660            self.w as usize,
661        )
662    }
663
664    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
665    ///
666    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
667    #[inline]
668    #[must_use]
669    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
670        let x = match self.x.checked_add(rhs.x) {
671            Some(v) => v,
672            None => return None,
673        };
674        let y = match self.y.checked_add(rhs.y) {
675            Some(v) => v,
676            None => return None,
677        };
678        let z = match self.z.checked_add(rhs.z) {
679            Some(v) => v,
680            None => return None,
681        };
682        let w = match self.w.checked_add(rhs.w) {
683            Some(v) => v,
684            None => return None,
685        };
686
687        Some(Self { x, y, z, w })
688    }
689
690    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
691    ///
692    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
693    #[inline]
694    #[must_use]
695    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
696        let x = match self.x.checked_sub(rhs.x) {
697            Some(v) => v,
698            None => return None,
699        };
700        let y = match self.y.checked_sub(rhs.y) {
701            Some(v) => v,
702            None => return None,
703        };
704        let z = match self.z.checked_sub(rhs.z) {
705            Some(v) => v,
706            None => return None,
707        };
708        let w = match self.w.checked_sub(rhs.w) {
709            Some(v) => v,
710            None => return None,
711        };
712
713        Some(Self { x, y, z, w })
714    }
715
716    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
717    ///
718    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
719    #[inline]
720    #[must_use]
721    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
722        let x = match self.x.checked_mul(rhs.x) {
723            Some(v) => v,
724            None => return None,
725        };
726        let y = match self.y.checked_mul(rhs.y) {
727            Some(v) => v,
728            None => return None,
729        };
730        let z = match self.z.checked_mul(rhs.z) {
731            Some(v) => v,
732            None => return None,
733        };
734        let w = match self.w.checked_mul(rhs.w) {
735            Some(v) => v,
736            None => return None,
737        };
738
739        Some(Self { x, y, z, w })
740    }
741
742    /// Returns a vector containing the wrapping division of `self` and `rhs`.
743    ///
744    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
745    #[inline]
746    #[must_use]
747    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
748        let x = match self.x.checked_div(rhs.x) {
749            Some(v) => v,
750            None => return None,
751        };
752        let y = match self.y.checked_div(rhs.y) {
753            Some(v) => v,
754            None => return None,
755        };
756        let z = match self.z.checked_div(rhs.z) {
757            Some(v) => v,
758            None => return None,
759        };
760        let w = match self.w.checked_div(rhs.w) {
761            Some(v) => v,
762            None => return None,
763        };
764
765        Some(Self { x, y, z, w })
766    }
767
768    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
769    ///
770    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
771    #[inline]
772    #[must_use]
773    pub const fn wrapping_add(self, rhs: Self) -> Self {
774        Self {
775            x: self.x.wrapping_add(rhs.x),
776            y: self.y.wrapping_add(rhs.y),
777            z: self.z.wrapping_add(rhs.z),
778            w: self.w.wrapping_add(rhs.w),
779        }
780    }
781
782    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
783    ///
784    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
785    #[inline]
786    #[must_use]
787    pub const fn wrapping_sub(self, rhs: Self) -> Self {
788        Self {
789            x: self.x.wrapping_sub(rhs.x),
790            y: self.y.wrapping_sub(rhs.y),
791            z: self.z.wrapping_sub(rhs.z),
792            w: self.w.wrapping_sub(rhs.w),
793        }
794    }
795
796    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
797    ///
798    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
799    #[inline]
800    #[must_use]
801    pub const fn wrapping_mul(self, rhs: Self) -> Self {
802        Self {
803            x: self.x.wrapping_mul(rhs.x),
804            y: self.y.wrapping_mul(rhs.y),
805            z: self.z.wrapping_mul(rhs.z),
806            w: self.w.wrapping_mul(rhs.w),
807        }
808    }
809
810    /// Returns a vector containing the wrapping division of `self` and `rhs`.
811    ///
812    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
813    #[inline]
814    #[must_use]
815    pub const fn wrapping_div(self, rhs: Self) -> Self {
816        Self {
817            x: self.x.wrapping_div(rhs.x),
818            y: self.y.wrapping_div(rhs.y),
819            z: self.z.wrapping_div(rhs.z),
820            w: self.w.wrapping_div(rhs.w),
821        }
822    }
823
824    /// Returns a vector containing the saturating addition of `self` and `rhs`.
825    ///
826    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
827    #[inline]
828    #[must_use]
829    pub const fn saturating_add(self, rhs: Self) -> Self {
830        Self {
831            x: self.x.saturating_add(rhs.x),
832            y: self.y.saturating_add(rhs.y),
833            z: self.z.saturating_add(rhs.z),
834            w: self.w.saturating_add(rhs.w),
835        }
836    }
837
838    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
839    ///
840    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
841    #[inline]
842    #[must_use]
843    pub const fn saturating_sub(self, rhs: Self) -> Self {
844        Self {
845            x: self.x.saturating_sub(rhs.x),
846            y: self.y.saturating_sub(rhs.y),
847            z: self.z.saturating_sub(rhs.z),
848            w: self.w.saturating_sub(rhs.w),
849        }
850    }
851
852    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
853    ///
854    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
855    #[inline]
856    #[must_use]
857    pub const fn saturating_mul(self, rhs: Self) -> Self {
858        Self {
859            x: self.x.saturating_mul(rhs.x),
860            y: self.y.saturating_mul(rhs.y),
861            z: self.z.saturating_mul(rhs.z),
862            w: self.w.saturating_mul(rhs.w),
863        }
864    }
865
866    /// Returns a vector containing the saturating division of `self` and `rhs`.
867    ///
868    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
869    #[inline]
870    #[must_use]
871    pub const fn saturating_div(self, rhs: Self) -> Self {
872        Self {
873            x: self.x.saturating_div(rhs.x),
874            y: self.y.saturating_div(rhs.y),
875            z: self.z.saturating_div(rhs.z),
876            w: self.w.saturating_div(rhs.w),
877        }
878    }
879
880    /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`.
881    ///
882    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
883    #[inline]
884    #[must_use]
885    pub const fn checked_add_unsigned(self, rhs: USizeVec4) -> Option<Self> {
886        let x = match self.x.checked_add_unsigned(rhs.x) {
887            Some(v) => v,
888            None => return None,
889        };
890        let y = match self.y.checked_add_unsigned(rhs.y) {
891            Some(v) => v,
892            None => return None,
893        };
894        let z = match self.z.checked_add_unsigned(rhs.z) {
895            Some(v) => v,
896            None => return None,
897        };
898        let w = match self.w.checked_add_unsigned(rhs.w) {
899            Some(v) => v,
900            None => return None,
901        };
902
903        Some(Self { x, y, z, w })
904    }
905
906    /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`.
907    ///
908    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
909    #[inline]
910    #[must_use]
911    pub const fn checked_sub_unsigned(self, rhs: USizeVec4) -> Option<Self> {
912        let x = match self.x.checked_sub_unsigned(rhs.x) {
913            Some(v) => v,
914            None => return None,
915        };
916        let y = match self.y.checked_sub_unsigned(rhs.y) {
917            Some(v) => v,
918            None => return None,
919        };
920        let z = match self.z.checked_sub_unsigned(rhs.z) {
921            Some(v) => v,
922            None => return None,
923        };
924        let w = match self.w.checked_sub_unsigned(rhs.w) {
925            Some(v) => v,
926            None => return None,
927        };
928
929        Some(Self { x, y, z, w })
930    }
931
932    /// Returns a vector containing the wrapping addition of `self` and unsigned vector `rhs`.
933    ///
934    /// In other words this computes `[self.x.wrapping_add_unsigned(rhs.x), self.y.wrapping_add_unsigned(rhs.y), ..]`.
935    #[inline]
936    #[must_use]
937    pub const fn wrapping_add_unsigned(self, rhs: USizeVec4) -> Self {
938        Self {
939            x: self.x.wrapping_add_unsigned(rhs.x),
940            y: self.y.wrapping_add_unsigned(rhs.y),
941            z: self.z.wrapping_add_unsigned(rhs.z),
942            w: self.w.wrapping_add_unsigned(rhs.w),
943        }
944    }
945
946    /// Returns a vector containing the wrapping subtraction of `self` and unsigned vector `rhs`.
947    ///
948    /// In other words this computes `[self.x.wrapping_sub_unsigned(rhs.x), self.y.wrapping_sub_unsigned(rhs.y), ..]`.
949    #[inline]
950    #[must_use]
951    pub const fn wrapping_sub_unsigned(self, rhs: USizeVec4) -> Self {
952        Self {
953            x: self.x.wrapping_sub_unsigned(rhs.x),
954            y: self.y.wrapping_sub_unsigned(rhs.y),
955            z: self.z.wrapping_sub_unsigned(rhs.z),
956            w: self.w.wrapping_sub_unsigned(rhs.w),
957        }
958    }
959
960    // Returns a vector containing the saturating addition of `self` and unsigned vector `rhs`.
961    ///
962    /// In other words this computes `[self.x.saturating_add_unsigned(rhs.x), self.y.saturating_add_unsigned(rhs.y), ..]`.
963    #[inline]
964    #[must_use]
965    pub const fn saturating_add_unsigned(self, rhs: USizeVec4) -> Self {
966        Self {
967            x: self.x.saturating_add_unsigned(rhs.x),
968            y: self.y.saturating_add_unsigned(rhs.y),
969            z: self.z.saturating_add_unsigned(rhs.z),
970            w: self.w.saturating_add_unsigned(rhs.w),
971        }
972    }
973
974    /// Returns a vector containing the saturating subtraction of `self` and unsigned vector `rhs`.
975    ///
976    /// In other words this computes `[self.x.saturating_sub_unsigned(rhs.x), self.y.saturating_sub_unsigned(rhs.y), ..]`.
977    #[inline]
978    #[must_use]
979    pub const fn saturating_sub_unsigned(self, rhs: USizeVec4) -> Self {
980        Self {
981            x: self.x.saturating_sub_unsigned(rhs.x),
982            y: self.y.saturating_sub_unsigned(rhs.y),
983            z: self.z.saturating_sub_unsigned(rhs.z),
984            w: self.w.saturating_sub_unsigned(rhs.w),
985        }
986    }
987}
988
989impl Default for ISizeVec4 {
990    #[inline(always)]
991    fn default() -> Self {
992        Self::ZERO
993    }
994}
995
996impl Div for ISizeVec4 {
997    type Output = Self;
998    #[inline]
999    fn div(self, rhs: Self) -> Self {
1000        Self {
1001            x: self.x.div(rhs.x),
1002            y: self.y.div(rhs.y),
1003            z: self.z.div(rhs.z),
1004            w: self.w.div(rhs.w),
1005        }
1006    }
1007}
1008
1009impl Div<&Self> for ISizeVec4 {
1010    type Output = Self;
1011    #[inline]
1012    fn div(self, rhs: &Self) -> Self {
1013        self.div(*rhs)
1014    }
1015}
1016
1017impl Div<&ISizeVec4> for &ISizeVec4 {
1018    type Output = ISizeVec4;
1019    #[inline]
1020    fn div(self, rhs: &ISizeVec4) -> ISizeVec4 {
1021        (*self).div(*rhs)
1022    }
1023}
1024
1025impl Div<ISizeVec4> for &ISizeVec4 {
1026    type Output = ISizeVec4;
1027    #[inline]
1028    fn div(self, rhs: ISizeVec4) -> ISizeVec4 {
1029        (*self).div(rhs)
1030    }
1031}
1032
1033impl DivAssign for ISizeVec4 {
1034    #[inline]
1035    fn div_assign(&mut self, rhs: Self) {
1036        self.x.div_assign(rhs.x);
1037        self.y.div_assign(rhs.y);
1038        self.z.div_assign(rhs.z);
1039        self.w.div_assign(rhs.w);
1040    }
1041}
1042
1043impl DivAssign<&Self> for ISizeVec4 {
1044    #[inline]
1045    fn div_assign(&mut self, rhs: &Self) {
1046        self.div_assign(*rhs);
1047    }
1048}
1049
1050impl Div<isize> for ISizeVec4 {
1051    type Output = Self;
1052    #[inline]
1053    fn div(self, rhs: isize) -> Self {
1054        Self {
1055            x: self.x.div(rhs),
1056            y: self.y.div(rhs),
1057            z: self.z.div(rhs),
1058            w: self.w.div(rhs),
1059        }
1060    }
1061}
1062
1063impl Div<&isize> for ISizeVec4 {
1064    type Output = Self;
1065    #[inline]
1066    fn div(self, rhs: &isize) -> Self {
1067        self.div(*rhs)
1068    }
1069}
1070
1071impl Div<&isize> for &ISizeVec4 {
1072    type Output = ISizeVec4;
1073    #[inline]
1074    fn div(self, rhs: &isize) -> ISizeVec4 {
1075        (*self).div(*rhs)
1076    }
1077}
1078
1079impl Div<isize> for &ISizeVec4 {
1080    type Output = ISizeVec4;
1081    #[inline]
1082    fn div(self, rhs: isize) -> ISizeVec4 {
1083        (*self).div(rhs)
1084    }
1085}
1086
1087impl DivAssign<isize> for ISizeVec4 {
1088    #[inline]
1089    fn div_assign(&mut self, rhs: isize) {
1090        self.x.div_assign(rhs);
1091        self.y.div_assign(rhs);
1092        self.z.div_assign(rhs);
1093        self.w.div_assign(rhs);
1094    }
1095}
1096
1097impl DivAssign<&isize> for ISizeVec4 {
1098    #[inline]
1099    fn div_assign(&mut self, rhs: &isize) {
1100        self.div_assign(*rhs);
1101    }
1102}
1103
1104impl Div<ISizeVec4> for isize {
1105    type Output = ISizeVec4;
1106    #[inline]
1107    fn div(self, rhs: ISizeVec4) -> ISizeVec4 {
1108        ISizeVec4 {
1109            x: self.div(rhs.x),
1110            y: self.div(rhs.y),
1111            z: self.div(rhs.z),
1112            w: self.div(rhs.w),
1113        }
1114    }
1115}
1116
1117impl Div<&ISizeVec4> for isize {
1118    type Output = ISizeVec4;
1119    #[inline]
1120    fn div(self, rhs: &ISizeVec4) -> ISizeVec4 {
1121        self.div(*rhs)
1122    }
1123}
1124
1125impl Div<&ISizeVec4> for &isize {
1126    type Output = ISizeVec4;
1127    #[inline]
1128    fn div(self, rhs: &ISizeVec4) -> ISizeVec4 {
1129        (*self).div(*rhs)
1130    }
1131}
1132
1133impl Div<ISizeVec4> for &isize {
1134    type Output = ISizeVec4;
1135    #[inline]
1136    fn div(self, rhs: ISizeVec4) -> ISizeVec4 {
1137        (*self).div(rhs)
1138    }
1139}
1140
1141impl Mul for ISizeVec4 {
1142    type Output = Self;
1143    #[inline]
1144    fn mul(self, rhs: Self) -> Self {
1145        Self {
1146            x: self.x.mul(rhs.x),
1147            y: self.y.mul(rhs.y),
1148            z: self.z.mul(rhs.z),
1149            w: self.w.mul(rhs.w),
1150        }
1151    }
1152}
1153
1154impl Mul<&Self> for ISizeVec4 {
1155    type Output = Self;
1156    #[inline]
1157    fn mul(self, rhs: &Self) -> Self {
1158        self.mul(*rhs)
1159    }
1160}
1161
1162impl Mul<&ISizeVec4> for &ISizeVec4 {
1163    type Output = ISizeVec4;
1164    #[inline]
1165    fn mul(self, rhs: &ISizeVec4) -> ISizeVec4 {
1166        (*self).mul(*rhs)
1167    }
1168}
1169
1170impl Mul<ISizeVec4> for &ISizeVec4 {
1171    type Output = ISizeVec4;
1172    #[inline]
1173    fn mul(self, rhs: ISizeVec4) -> ISizeVec4 {
1174        (*self).mul(rhs)
1175    }
1176}
1177
1178impl MulAssign for ISizeVec4 {
1179    #[inline]
1180    fn mul_assign(&mut self, rhs: Self) {
1181        self.x.mul_assign(rhs.x);
1182        self.y.mul_assign(rhs.y);
1183        self.z.mul_assign(rhs.z);
1184        self.w.mul_assign(rhs.w);
1185    }
1186}
1187
1188impl MulAssign<&Self> for ISizeVec4 {
1189    #[inline]
1190    fn mul_assign(&mut self, rhs: &Self) {
1191        self.mul_assign(*rhs);
1192    }
1193}
1194
1195impl Mul<isize> for ISizeVec4 {
1196    type Output = Self;
1197    #[inline]
1198    fn mul(self, rhs: isize) -> Self {
1199        Self {
1200            x: self.x.mul(rhs),
1201            y: self.y.mul(rhs),
1202            z: self.z.mul(rhs),
1203            w: self.w.mul(rhs),
1204        }
1205    }
1206}
1207
1208impl Mul<&isize> for ISizeVec4 {
1209    type Output = Self;
1210    #[inline]
1211    fn mul(self, rhs: &isize) -> Self {
1212        self.mul(*rhs)
1213    }
1214}
1215
1216impl Mul<&isize> for &ISizeVec4 {
1217    type Output = ISizeVec4;
1218    #[inline]
1219    fn mul(self, rhs: &isize) -> ISizeVec4 {
1220        (*self).mul(*rhs)
1221    }
1222}
1223
1224impl Mul<isize> for &ISizeVec4 {
1225    type Output = ISizeVec4;
1226    #[inline]
1227    fn mul(self, rhs: isize) -> ISizeVec4 {
1228        (*self).mul(rhs)
1229    }
1230}
1231
1232impl MulAssign<isize> for ISizeVec4 {
1233    #[inline]
1234    fn mul_assign(&mut self, rhs: isize) {
1235        self.x.mul_assign(rhs);
1236        self.y.mul_assign(rhs);
1237        self.z.mul_assign(rhs);
1238        self.w.mul_assign(rhs);
1239    }
1240}
1241
1242impl MulAssign<&isize> for ISizeVec4 {
1243    #[inline]
1244    fn mul_assign(&mut self, rhs: &isize) {
1245        self.mul_assign(*rhs);
1246    }
1247}
1248
1249impl Mul<ISizeVec4> for isize {
1250    type Output = ISizeVec4;
1251    #[inline]
1252    fn mul(self, rhs: ISizeVec4) -> ISizeVec4 {
1253        ISizeVec4 {
1254            x: self.mul(rhs.x),
1255            y: self.mul(rhs.y),
1256            z: self.mul(rhs.z),
1257            w: self.mul(rhs.w),
1258        }
1259    }
1260}
1261
1262impl Mul<&ISizeVec4> for isize {
1263    type Output = ISizeVec4;
1264    #[inline]
1265    fn mul(self, rhs: &ISizeVec4) -> ISizeVec4 {
1266        self.mul(*rhs)
1267    }
1268}
1269
1270impl Mul<&ISizeVec4> for &isize {
1271    type Output = ISizeVec4;
1272    #[inline]
1273    fn mul(self, rhs: &ISizeVec4) -> ISizeVec4 {
1274        (*self).mul(*rhs)
1275    }
1276}
1277
1278impl Mul<ISizeVec4> for &isize {
1279    type Output = ISizeVec4;
1280    #[inline]
1281    fn mul(self, rhs: ISizeVec4) -> ISizeVec4 {
1282        (*self).mul(rhs)
1283    }
1284}
1285
1286impl Add for ISizeVec4 {
1287    type Output = Self;
1288    #[inline]
1289    fn add(self, rhs: Self) -> Self {
1290        Self {
1291            x: self.x.add(rhs.x),
1292            y: self.y.add(rhs.y),
1293            z: self.z.add(rhs.z),
1294            w: self.w.add(rhs.w),
1295        }
1296    }
1297}
1298
1299impl Add<&Self> for ISizeVec4 {
1300    type Output = Self;
1301    #[inline]
1302    fn add(self, rhs: &Self) -> Self {
1303        self.add(*rhs)
1304    }
1305}
1306
1307impl Add<&ISizeVec4> for &ISizeVec4 {
1308    type Output = ISizeVec4;
1309    #[inline]
1310    fn add(self, rhs: &ISizeVec4) -> ISizeVec4 {
1311        (*self).add(*rhs)
1312    }
1313}
1314
1315impl Add<ISizeVec4> for &ISizeVec4 {
1316    type Output = ISizeVec4;
1317    #[inline]
1318    fn add(self, rhs: ISizeVec4) -> ISizeVec4 {
1319        (*self).add(rhs)
1320    }
1321}
1322
1323impl AddAssign for ISizeVec4 {
1324    #[inline]
1325    fn add_assign(&mut self, rhs: Self) {
1326        self.x.add_assign(rhs.x);
1327        self.y.add_assign(rhs.y);
1328        self.z.add_assign(rhs.z);
1329        self.w.add_assign(rhs.w);
1330    }
1331}
1332
1333impl AddAssign<&Self> for ISizeVec4 {
1334    #[inline]
1335    fn add_assign(&mut self, rhs: &Self) {
1336        self.add_assign(*rhs);
1337    }
1338}
1339
1340impl Add<isize> for ISizeVec4 {
1341    type Output = Self;
1342    #[inline]
1343    fn add(self, rhs: isize) -> Self {
1344        Self {
1345            x: self.x.add(rhs),
1346            y: self.y.add(rhs),
1347            z: self.z.add(rhs),
1348            w: self.w.add(rhs),
1349        }
1350    }
1351}
1352
1353impl Add<&isize> for ISizeVec4 {
1354    type Output = Self;
1355    #[inline]
1356    fn add(self, rhs: &isize) -> Self {
1357        self.add(*rhs)
1358    }
1359}
1360
1361impl Add<&isize> for &ISizeVec4 {
1362    type Output = ISizeVec4;
1363    #[inline]
1364    fn add(self, rhs: &isize) -> ISizeVec4 {
1365        (*self).add(*rhs)
1366    }
1367}
1368
1369impl Add<isize> for &ISizeVec4 {
1370    type Output = ISizeVec4;
1371    #[inline]
1372    fn add(self, rhs: isize) -> ISizeVec4 {
1373        (*self).add(rhs)
1374    }
1375}
1376
1377impl AddAssign<isize> for ISizeVec4 {
1378    #[inline]
1379    fn add_assign(&mut self, rhs: isize) {
1380        self.x.add_assign(rhs);
1381        self.y.add_assign(rhs);
1382        self.z.add_assign(rhs);
1383        self.w.add_assign(rhs);
1384    }
1385}
1386
1387impl AddAssign<&isize> for ISizeVec4 {
1388    #[inline]
1389    fn add_assign(&mut self, rhs: &isize) {
1390        self.add_assign(*rhs);
1391    }
1392}
1393
1394impl Add<ISizeVec4> for isize {
1395    type Output = ISizeVec4;
1396    #[inline]
1397    fn add(self, rhs: ISizeVec4) -> ISizeVec4 {
1398        ISizeVec4 {
1399            x: self.add(rhs.x),
1400            y: self.add(rhs.y),
1401            z: self.add(rhs.z),
1402            w: self.add(rhs.w),
1403        }
1404    }
1405}
1406
1407impl Add<&ISizeVec4> for isize {
1408    type Output = ISizeVec4;
1409    #[inline]
1410    fn add(self, rhs: &ISizeVec4) -> ISizeVec4 {
1411        self.add(*rhs)
1412    }
1413}
1414
1415impl Add<&ISizeVec4> for &isize {
1416    type Output = ISizeVec4;
1417    #[inline]
1418    fn add(self, rhs: &ISizeVec4) -> ISizeVec4 {
1419        (*self).add(*rhs)
1420    }
1421}
1422
1423impl Add<ISizeVec4> for &isize {
1424    type Output = ISizeVec4;
1425    #[inline]
1426    fn add(self, rhs: ISizeVec4) -> ISizeVec4 {
1427        (*self).add(rhs)
1428    }
1429}
1430
1431impl Sub for ISizeVec4 {
1432    type Output = Self;
1433    #[inline]
1434    fn sub(self, rhs: Self) -> Self {
1435        Self {
1436            x: self.x.sub(rhs.x),
1437            y: self.y.sub(rhs.y),
1438            z: self.z.sub(rhs.z),
1439            w: self.w.sub(rhs.w),
1440        }
1441    }
1442}
1443
1444impl Sub<&Self> for ISizeVec4 {
1445    type Output = Self;
1446    #[inline]
1447    fn sub(self, rhs: &Self) -> Self {
1448        self.sub(*rhs)
1449    }
1450}
1451
1452impl Sub<&ISizeVec4> for &ISizeVec4 {
1453    type Output = ISizeVec4;
1454    #[inline]
1455    fn sub(self, rhs: &ISizeVec4) -> ISizeVec4 {
1456        (*self).sub(*rhs)
1457    }
1458}
1459
1460impl Sub<ISizeVec4> for &ISizeVec4 {
1461    type Output = ISizeVec4;
1462    #[inline]
1463    fn sub(self, rhs: ISizeVec4) -> ISizeVec4 {
1464        (*self).sub(rhs)
1465    }
1466}
1467
1468impl SubAssign for ISizeVec4 {
1469    #[inline]
1470    fn sub_assign(&mut self, rhs: Self) {
1471        self.x.sub_assign(rhs.x);
1472        self.y.sub_assign(rhs.y);
1473        self.z.sub_assign(rhs.z);
1474        self.w.sub_assign(rhs.w);
1475    }
1476}
1477
1478impl SubAssign<&Self> for ISizeVec4 {
1479    #[inline]
1480    fn sub_assign(&mut self, rhs: &Self) {
1481        self.sub_assign(*rhs);
1482    }
1483}
1484
1485impl Sub<isize> for ISizeVec4 {
1486    type Output = Self;
1487    #[inline]
1488    fn sub(self, rhs: isize) -> Self {
1489        Self {
1490            x: self.x.sub(rhs),
1491            y: self.y.sub(rhs),
1492            z: self.z.sub(rhs),
1493            w: self.w.sub(rhs),
1494        }
1495    }
1496}
1497
1498impl Sub<&isize> for ISizeVec4 {
1499    type Output = Self;
1500    #[inline]
1501    fn sub(self, rhs: &isize) -> Self {
1502        self.sub(*rhs)
1503    }
1504}
1505
1506impl Sub<&isize> for &ISizeVec4 {
1507    type Output = ISizeVec4;
1508    #[inline]
1509    fn sub(self, rhs: &isize) -> ISizeVec4 {
1510        (*self).sub(*rhs)
1511    }
1512}
1513
1514impl Sub<isize> for &ISizeVec4 {
1515    type Output = ISizeVec4;
1516    #[inline]
1517    fn sub(self, rhs: isize) -> ISizeVec4 {
1518        (*self).sub(rhs)
1519    }
1520}
1521
1522impl SubAssign<isize> for ISizeVec4 {
1523    #[inline]
1524    fn sub_assign(&mut self, rhs: isize) {
1525        self.x.sub_assign(rhs);
1526        self.y.sub_assign(rhs);
1527        self.z.sub_assign(rhs);
1528        self.w.sub_assign(rhs);
1529    }
1530}
1531
1532impl SubAssign<&isize> for ISizeVec4 {
1533    #[inline]
1534    fn sub_assign(&mut self, rhs: &isize) {
1535        self.sub_assign(*rhs);
1536    }
1537}
1538
1539impl Sub<ISizeVec4> for isize {
1540    type Output = ISizeVec4;
1541    #[inline]
1542    fn sub(self, rhs: ISizeVec4) -> ISizeVec4 {
1543        ISizeVec4 {
1544            x: self.sub(rhs.x),
1545            y: self.sub(rhs.y),
1546            z: self.sub(rhs.z),
1547            w: self.sub(rhs.w),
1548        }
1549    }
1550}
1551
1552impl Sub<&ISizeVec4> for isize {
1553    type Output = ISizeVec4;
1554    #[inline]
1555    fn sub(self, rhs: &ISizeVec4) -> ISizeVec4 {
1556        self.sub(*rhs)
1557    }
1558}
1559
1560impl Sub<&ISizeVec4> for &isize {
1561    type Output = ISizeVec4;
1562    #[inline]
1563    fn sub(self, rhs: &ISizeVec4) -> ISizeVec4 {
1564        (*self).sub(*rhs)
1565    }
1566}
1567
1568impl Sub<ISizeVec4> for &isize {
1569    type Output = ISizeVec4;
1570    #[inline]
1571    fn sub(self, rhs: ISizeVec4) -> ISizeVec4 {
1572        (*self).sub(rhs)
1573    }
1574}
1575
1576impl Rem for ISizeVec4 {
1577    type Output = Self;
1578    #[inline]
1579    fn rem(self, rhs: Self) -> Self {
1580        Self {
1581            x: self.x.rem(rhs.x),
1582            y: self.y.rem(rhs.y),
1583            z: self.z.rem(rhs.z),
1584            w: self.w.rem(rhs.w),
1585        }
1586    }
1587}
1588
1589impl Rem<&Self> for ISizeVec4 {
1590    type Output = Self;
1591    #[inline]
1592    fn rem(self, rhs: &Self) -> Self {
1593        self.rem(*rhs)
1594    }
1595}
1596
1597impl Rem<&ISizeVec4> for &ISizeVec4 {
1598    type Output = ISizeVec4;
1599    #[inline]
1600    fn rem(self, rhs: &ISizeVec4) -> ISizeVec4 {
1601        (*self).rem(*rhs)
1602    }
1603}
1604
1605impl Rem<ISizeVec4> for &ISizeVec4 {
1606    type Output = ISizeVec4;
1607    #[inline]
1608    fn rem(self, rhs: ISizeVec4) -> ISizeVec4 {
1609        (*self).rem(rhs)
1610    }
1611}
1612
1613impl RemAssign for ISizeVec4 {
1614    #[inline]
1615    fn rem_assign(&mut self, rhs: Self) {
1616        self.x.rem_assign(rhs.x);
1617        self.y.rem_assign(rhs.y);
1618        self.z.rem_assign(rhs.z);
1619        self.w.rem_assign(rhs.w);
1620    }
1621}
1622
1623impl RemAssign<&Self> for ISizeVec4 {
1624    #[inline]
1625    fn rem_assign(&mut self, rhs: &Self) {
1626        self.rem_assign(*rhs);
1627    }
1628}
1629
1630impl Rem<isize> for ISizeVec4 {
1631    type Output = Self;
1632    #[inline]
1633    fn rem(self, rhs: isize) -> Self {
1634        Self {
1635            x: self.x.rem(rhs),
1636            y: self.y.rem(rhs),
1637            z: self.z.rem(rhs),
1638            w: self.w.rem(rhs),
1639        }
1640    }
1641}
1642
1643impl Rem<&isize> for ISizeVec4 {
1644    type Output = Self;
1645    #[inline]
1646    fn rem(self, rhs: &isize) -> Self {
1647        self.rem(*rhs)
1648    }
1649}
1650
1651impl Rem<&isize> for &ISizeVec4 {
1652    type Output = ISizeVec4;
1653    #[inline]
1654    fn rem(self, rhs: &isize) -> ISizeVec4 {
1655        (*self).rem(*rhs)
1656    }
1657}
1658
1659impl Rem<isize> for &ISizeVec4 {
1660    type Output = ISizeVec4;
1661    #[inline]
1662    fn rem(self, rhs: isize) -> ISizeVec4 {
1663        (*self).rem(rhs)
1664    }
1665}
1666
1667impl RemAssign<isize> for ISizeVec4 {
1668    #[inline]
1669    fn rem_assign(&mut self, rhs: isize) {
1670        self.x.rem_assign(rhs);
1671        self.y.rem_assign(rhs);
1672        self.z.rem_assign(rhs);
1673        self.w.rem_assign(rhs);
1674    }
1675}
1676
1677impl RemAssign<&isize> for ISizeVec4 {
1678    #[inline]
1679    fn rem_assign(&mut self, rhs: &isize) {
1680        self.rem_assign(*rhs);
1681    }
1682}
1683
1684impl Rem<ISizeVec4> for isize {
1685    type Output = ISizeVec4;
1686    #[inline]
1687    fn rem(self, rhs: ISizeVec4) -> ISizeVec4 {
1688        ISizeVec4 {
1689            x: self.rem(rhs.x),
1690            y: self.rem(rhs.y),
1691            z: self.rem(rhs.z),
1692            w: self.rem(rhs.w),
1693        }
1694    }
1695}
1696
1697impl Rem<&ISizeVec4> for isize {
1698    type Output = ISizeVec4;
1699    #[inline]
1700    fn rem(self, rhs: &ISizeVec4) -> ISizeVec4 {
1701        self.rem(*rhs)
1702    }
1703}
1704
1705impl Rem<&ISizeVec4> for &isize {
1706    type Output = ISizeVec4;
1707    #[inline]
1708    fn rem(self, rhs: &ISizeVec4) -> ISizeVec4 {
1709        (*self).rem(*rhs)
1710    }
1711}
1712
1713impl Rem<ISizeVec4> for &isize {
1714    type Output = ISizeVec4;
1715    #[inline]
1716    fn rem(self, rhs: ISizeVec4) -> ISizeVec4 {
1717        (*self).rem(rhs)
1718    }
1719}
1720
1721impl AsRef<[isize; 4]> for ISizeVec4 {
1722    #[inline]
1723    fn as_ref(&self) -> &[isize; 4] {
1724        unsafe { &*(self as *const Self as *const [isize; 4]) }
1725    }
1726}
1727
1728impl AsMut<[isize; 4]> for ISizeVec4 {
1729    #[inline]
1730    fn as_mut(&mut self) -> &mut [isize; 4] {
1731        unsafe { &mut *(self as *mut Self as *mut [isize; 4]) }
1732    }
1733}
1734
1735impl Sum for ISizeVec4 {
1736    #[inline]
1737    fn sum<I>(iter: I) -> Self
1738    where
1739        I: Iterator<Item = Self>,
1740    {
1741        iter.fold(Self::ZERO, Self::add)
1742    }
1743}
1744
1745impl<'a> Sum<&'a Self> for ISizeVec4 {
1746    #[inline]
1747    fn sum<I>(iter: I) -> Self
1748    where
1749        I: Iterator<Item = &'a Self>,
1750    {
1751        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
1752    }
1753}
1754
1755impl Product for ISizeVec4 {
1756    #[inline]
1757    fn product<I>(iter: I) -> Self
1758    where
1759        I: Iterator<Item = Self>,
1760    {
1761        iter.fold(Self::ONE, Self::mul)
1762    }
1763}
1764
1765impl<'a> Product<&'a Self> for ISizeVec4 {
1766    #[inline]
1767    fn product<I>(iter: I) -> Self
1768    where
1769        I: Iterator<Item = &'a Self>,
1770    {
1771        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
1772    }
1773}
1774
1775impl Neg for ISizeVec4 {
1776    type Output = Self;
1777    #[inline]
1778    fn neg(self) -> Self {
1779        Self {
1780            x: self.x.neg(),
1781            y: self.y.neg(),
1782            z: self.z.neg(),
1783            w: self.w.neg(),
1784        }
1785    }
1786}
1787
1788impl Neg for &ISizeVec4 {
1789    type Output = ISizeVec4;
1790    #[inline]
1791    fn neg(self) -> ISizeVec4 {
1792        (*self).neg()
1793    }
1794}
1795
1796impl Not for ISizeVec4 {
1797    type Output = Self;
1798    #[inline]
1799    fn not(self) -> Self {
1800        Self {
1801            x: self.x.not(),
1802            y: self.y.not(),
1803            z: self.z.not(),
1804            w: self.w.not(),
1805        }
1806    }
1807}
1808
1809impl Not for &ISizeVec4 {
1810    type Output = ISizeVec4;
1811    #[inline]
1812    fn not(self) -> ISizeVec4 {
1813        (*self).not()
1814    }
1815}
1816
1817impl BitAnd for ISizeVec4 {
1818    type Output = Self;
1819    #[inline]
1820    fn bitand(self, rhs: Self) -> Self::Output {
1821        Self {
1822            x: self.x.bitand(rhs.x),
1823            y: self.y.bitand(rhs.y),
1824            z: self.z.bitand(rhs.z),
1825            w: self.w.bitand(rhs.w),
1826        }
1827    }
1828}
1829
1830impl BitAnd<&Self> for ISizeVec4 {
1831    type Output = Self;
1832    #[inline]
1833    fn bitand(self, rhs: &Self) -> Self {
1834        self.bitand(*rhs)
1835    }
1836}
1837
1838impl BitAnd<&ISizeVec4> for &ISizeVec4 {
1839    type Output = ISizeVec4;
1840    #[inline]
1841    fn bitand(self, rhs: &ISizeVec4) -> ISizeVec4 {
1842        (*self).bitand(*rhs)
1843    }
1844}
1845
1846impl BitAnd<ISizeVec4> for &ISizeVec4 {
1847    type Output = ISizeVec4;
1848    #[inline]
1849    fn bitand(self, rhs: ISizeVec4) -> ISizeVec4 {
1850        (*self).bitand(rhs)
1851    }
1852}
1853
1854impl BitAndAssign for ISizeVec4 {
1855    #[inline]
1856    fn bitand_assign(&mut self, rhs: Self) {
1857        *self = self.bitand(rhs);
1858    }
1859}
1860
1861impl BitAndAssign<&Self> for ISizeVec4 {
1862    #[inline]
1863    fn bitand_assign(&mut self, rhs: &Self) {
1864        self.bitand_assign(*rhs);
1865    }
1866}
1867
1868impl BitOr for ISizeVec4 {
1869    type Output = Self;
1870    #[inline]
1871    fn bitor(self, rhs: Self) -> Self::Output {
1872        Self {
1873            x: self.x.bitor(rhs.x),
1874            y: self.y.bitor(rhs.y),
1875            z: self.z.bitor(rhs.z),
1876            w: self.w.bitor(rhs.w),
1877        }
1878    }
1879}
1880
1881impl BitOr<&Self> for ISizeVec4 {
1882    type Output = Self;
1883    #[inline]
1884    fn bitor(self, rhs: &Self) -> Self {
1885        self.bitor(*rhs)
1886    }
1887}
1888
1889impl BitOr<&ISizeVec4> for &ISizeVec4 {
1890    type Output = ISizeVec4;
1891    #[inline]
1892    fn bitor(self, rhs: &ISizeVec4) -> ISizeVec4 {
1893        (*self).bitor(*rhs)
1894    }
1895}
1896
1897impl BitOr<ISizeVec4> for &ISizeVec4 {
1898    type Output = ISizeVec4;
1899    #[inline]
1900    fn bitor(self, rhs: ISizeVec4) -> ISizeVec4 {
1901        (*self).bitor(rhs)
1902    }
1903}
1904
1905impl BitOrAssign for ISizeVec4 {
1906    #[inline]
1907    fn bitor_assign(&mut self, rhs: Self) {
1908        *self = self.bitor(rhs);
1909    }
1910}
1911
1912impl BitOrAssign<&Self> for ISizeVec4 {
1913    #[inline]
1914    fn bitor_assign(&mut self, rhs: &Self) {
1915        self.bitor_assign(*rhs);
1916    }
1917}
1918
1919impl BitXor for ISizeVec4 {
1920    type Output = Self;
1921    #[inline]
1922    fn bitxor(self, rhs: Self) -> Self::Output {
1923        Self {
1924            x: self.x.bitxor(rhs.x),
1925            y: self.y.bitxor(rhs.y),
1926            z: self.z.bitxor(rhs.z),
1927            w: self.w.bitxor(rhs.w),
1928        }
1929    }
1930}
1931
1932impl BitXor<&Self> for ISizeVec4 {
1933    type Output = Self;
1934    #[inline]
1935    fn bitxor(self, rhs: &Self) -> Self {
1936        self.bitxor(*rhs)
1937    }
1938}
1939
1940impl BitXor<&ISizeVec4> for &ISizeVec4 {
1941    type Output = ISizeVec4;
1942    #[inline]
1943    fn bitxor(self, rhs: &ISizeVec4) -> ISizeVec4 {
1944        (*self).bitxor(*rhs)
1945    }
1946}
1947
1948impl BitXor<ISizeVec4> for &ISizeVec4 {
1949    type Output = ISizeVec4;
1950    #[inline]
1951    fn bitxor(self, rhs: ISizeVec4) -> ISizeVec4 {
1952        (*self).bitxor(rhs)
1953    }
1954}
1955
1956impl BitXorAssign for ISizeVec4 {
1957    #[inline]
1958    fn bitxor_assign(&mut self, rhs: Self) {
1959        *self = self.bitxor(rhs);
1960    }
1961}
1962
1963impl BitXorAssign<&Self> for ISizeVec4 {
1964    #[inline]
1965    fn bitxor_assign(&mut self, rhs: &Self) {
1966        self.bitxor_assign(*rhs);
1967    }
1968}
1969
1970impl BitAnd<isize> for ISizeVec4 {
1971    type Output = Self;
1972    #[inline]
1973    fn bitand(self, rhs: isize) -> Self::Output {
1974        Self {
1975            x: self.x.bitand(rhs),
1976            y: self.y.bitand(rhs),
1977            z: self.z.bitand(rhs),
1978            w: self.w.bitand(rhs),
1979        }
1980    }
1981}
1982
1983impl BitAnd<&isize> for ISizeVec4 {
1984    type Output = Self;
1985    #[inline]
1986    fn bitand(self, rhs: &isize) -> Self {
1987        self.bitand(*rhs)
1988    }
1989}
1990
1991impl BitAnd<&isize> for &ISizeVec4 {
1992    type Output = ISizeVec4;
1993    #[inline]
1994    fn bitand(self, rhs: &isize) -> ISizeVec4 {
1995        (*self).bitand(*rhs)
1996    }
1997}
1998
1999impl BitAnd<isize> for &ISizeVec4 {
2000    type Output = ISizeVec4;
2001    #[inline]
2002    fn bitand(self, rhs: isize) -> ISizeVec4 {
2003        (*self).bitand(rhs)
2004    }
2005}
2006
2007impl BitAndAssign<isize> for ISizeVec4 {
2008    #[inline]
2009    fn bitand_assign(&mut self, rhs: isize) {
2010        *self = self.bitand(rhs);
2011    }
2012}
2013
2014impl BitAndAssign<&isize> for ISizeVec4 {
2015    #[inline]
2016    fn bitand_assign(&mut self, rhs: &isize) {
2017        self.bitand_assign(*rhs);
2018    }
2019}
2020
2021impl BitOr<isize> for ISizeVec4 {
2022    type Output = Self;
2023    #[inline]
2024    fn bitor(self, rhs: isize) -> Self::Output {
2025        Self {
2026            x: self.x.bitor(rhs),
2027            y: self.y.bitor(rhs),
2028            z: self.z.bitor(rhs),
2029            w: self.w.bitor(rhs),
2030        }
2031    }
2032}
2033
2034impl BitOr<&isize> for ISizeVec4 {
2035    type Output = Self;
2036    #[inline]
2037    fn bitor(self, rhs: &isize) -> Self {
2038        self.bitor(*rhs)
2039    }
2040}
2041
2042impl BitOr<&isize> for &ISizeVec4 {
2043    type Output = ISizeVec4;
2044    #[inline]
2045    fn bitor(self, rhs: &isize) -> ISizeVec4 {
2046        (*self).bitor(*rhs)
2047    }
2048}
2049
2050impl BitOr<isize> for &ISizeVec4 {
2051    type Output = ISizeVec4;
2052    #[inline]
2053    fn bitor(self, rhs: isize) -> ISizeVec4 {
2054        (*self).bitor(rhs)
2055    }
2056}
2057
2058impl BitOrAssign<isize> for ISizeVec4 {
2059    #[inline]
2060    fn bitor_assign(&mut self, rhs: isize) {
2061        *self = self.bitor(rhs);
2062    }
2063}
2064
2065impl BitOrAssign<&isize> for ISizeVec4 {
2066    #[inline]
2067    fn bitor_assign(&mut self, rhs: &isize) {
2068        self.bitor_assign(*rhs);
2069    }
2070}
2071
2072impl BitXor<isize> for ISizeVec4 {
2073    type Output = Self;
2074    #[inline]
2075    fn bitxor(self, rhs: isize) -> Self::Output {
2076        Self {
2077            x: self.x.bitxor(rhs),
2078            y: self.y.bitxor(rhs),
2079            z: self.z.bitxor(rhs),
2080            w: self.w.bitxor(rhs),
2081        }
2082    }
2083}
2084
2085impl BitXor<&isize> for ISizeVec4 {
2086    type Output = Self;
2087    #[inline]
2088    fn bitxor(self, rhs: &isize) -> Self {
2089        self.bitxor(*rhs)
2090    }
2091}
2092
2093impl BitXor<&isize> for &ISizeVec4 {
2094    type Output = ISizeVec4;
2095    #[inline]
2096    fn bitxor(self, rhs: &isize) -> ISizeVec4 {
2097        (*self).bitxor(*rhs)
2098    }
2099}
2100
2101impl BitXor<isize> for &ISizeVec4 {
2102    type Output = ISizeVec4;
2103    #[inline]
2104    fn bitxor(self, rhs: isize) -> ISizeVec4 {
2105        (*self).bitxor(rhs)
2106    }
2107}
2108
2109impl BitXorAssign<isize> for ISizeVec4 {
2110    #[inline]
2111    fn bitxor_assign(&mut self, rhs: isize) {
2112        *self = self.bitxor(rhs);
2113    }
2114}
2115
2116impl BitXorAssign<&isize> for ISizeVec4 {
2117    #[inline]
2118    fn bitxor_assign(&mut self, rhs: &isize) {
2119        self.bitxor_assign(*rhs);
2120    }
2121}
2122
2123impl Shl<i8> for ISizeVec4 {
2124    type Output = Self;
2125    #[inline]
2126    fn shl(self, rhs: i8) -> Self::Output {
2127        Self {
2128            x: self.x.shl(rhs),
2129            y: self.y.shl(rhs),
2130            z: self.z.shl(rhs),
2131            w: self.w.shl(rhs),
2132        }
2133    }
2134}
2135
2136impl Shl<&i8> for ISizeVec4 {
2137    type Output = Self;
2138    #[inline]
2139    fn shl(self, rhs: &i8) -> Self {
2140        self.shl(*rhs)
2141    }
2142}
2143
2144impl Shl<&i8> for &ISizeVec4 {
2145    type Output = ISizeVec4;
2146    #[inline]
2147    fn shl(self, rhs: &i8) -> ISizeVec4 {
2148        (*self).shl(*rhs)
2149    }
2150}
2151
2152impl Shl<i8> for &ISizeVec4 {
2153    type Output = ISizeVec4;
2154    #[inline]
2155    fn shl(self, rhs: i8) -> ISizeVec4 {
2156        (*self).shl(rhs)
2157    }
2158}
2159
2160impl ShlAssign<i8> for ISizeVec4 {
2161    #[inline]
2162    fn shl_assign(&mut self, rhs: i8) {
2163        *self = self.shl(rhs);
2164    }
2165}
2166
2167impl ShlAssign<&i8> for ISizeVec4 {
2168    #[inline]
2169    fn shl_assign(&mut self, rhs: &i8) {
2170        self.shl_assign(*rhs);
2171    }
2172}
2173
2174impl Shr<i8> for ISizeVec4 {
2175    type Output = Self;
2176    #[inline]
2177    fn shr(self, rhs: i8) -> Self::Output {
2178        Self {
2179            x: self.x.shr(rhs),
2180            y: self.y.shr(rhs),
2181            z: self.z.shr(rhs),
2182            w: self.w.shr(rhs),
2183        }
2184    }
2185}
2186
2187impl Shr<&i8> for ISizeVec4 {
2188    type Output = Self;
2189    #[inline]
2190    fn shr(self, rhs: &i8) -> Self {
2191        self.shr(*rhs)
2192    }
2193}
2194
2195impl Shr<&i8> for &ISizeVec4 {
2196    type Output = ISizeVec4;
2197    #[inline]
2198    fn shr(self, rhs: &i8) -> ISizeVec4 {
2199        (*self).shr(*rhs)
2200    }
2201}
2202
2203impl Shr<i8> for &ISizeVec4 {
2204    type Output = ISizeVec4;
2205    #[inline]
2206    fn shr(self, rhs: i8) -> ISizeVec4 {
2207        (*self).shr(rhs)
2208    }
2209}
2210
2211impl ShrAssign<i8> for ISizeVec4 {
2212    #[inline]
2213    fn shr_assign(&mut self, rhs: i8) {
2214        *self = self.shr(rhs);
2215    }
2216}
2217
2218impl ShrAssign<&i8> for ISizeVec4 {
2219    #[inline]
2220    fn shr_assign(&mut self, rhs: &i8) {
2221        self.shr_assign(*rhs);
2222    }
2223}
2224
2225impl Shl<i16> for ISizeVec4 {
2226    type Output = Self;
2227    #[inline]
2228    fn shl(self, rhs: i16) -> Self::Output {
2229        Self {
2230            x: self.x.shl(rhs),
2231            y: self.y.shl(rhs),
2232            z: self.z.shl(rhs),
2233            w: self.w.shl(rhs),
2234        }
2235    }
2236}
2237
2238impl Shl<&i16> for ISizeVec4 {
2239    type Output = Self;
2240    #[inline]
2241    fn shl(self, rhs: &i16) -> Self {
2242        self.shl(*rhs)
2243    }
2244}
2245
2246impl Shl<&i16> for &ISizeVec4 {
2247    type Output = ISizeVec4;
2248    #[inline]
2249    fn shl(self, rhs: &i16) -> ISizeVec4 {
2250        (*self).shl(*rhs)
2251    }
2252}
2253
2254impl Shl<i16> for &ISizeVec4 {
2255    type Output = ISizeVec4;
2256    #[inline]
2257    fn shl(self, rhs: i16) -> ISizeVec4 {
2258        (*self).shl(rhs)
2259    }
2260}
2261
2262impl ShlAssign<i16> for ISizeVec4 {
2263    #[inline]
2264    fn shl_assign(&mut self, rhs: i16) {
2265        *self = self.shl(rhs);
2266    }
2267}
2268
2269impl ShlAssign<&i16> for ISizeVec4 {
2270    #[inline]
2271    fn shl_assign(&mut self, rhs: &i16) {
2272        self.shl_assign(*rhs);
2273    }
2274}
2275
2276impl Shr<i16> for ISizeVec4 {
2277    type Output = Self;
2278    #[inline]
2279    fn shr(self, rhs: i16) -> Self::Output {
2280        Self {
2281            x: self.x.shr(rhs),
2282            y: self.y.shr(rhs),
2283            z: self.z.shr(rhs),
2284            w: self.w.shr(rhs),
2285        }
2286    }
2287}
2288
2289impl Shr<&i16> for ISizeVec4 {
2290    type Output = Self;
2291    #[inline]
2292    fn shr(self, rhs: &i16) -> Self {
2293        self.shr(*rhs)
2294    }
2295}
2296
2297impl Shr<&i16> for &ISizeVec4 {
2298    type Output = ISizeVec4;
2299    #[inline]
2300    fn shr(self, rhs: &i16) -> ISizeVec4 {
2301        (*self).shr(*rhs)
2302    }
2303}
2304
2305impl Shr<i16> for &ISizeVec4 {
2306    type Output = ISizeVec4;
2307    #[inline]
2308    fn shr(self, rhs: i16) -> ISizeVec4 {
2309        (*self).shr(rhs)
2310    }
2311}
2312
2313impl ShrAssign<i16> for ISizeVec4 {
2314    #[inline]
2315    fn shr_assign(&mut self, rhs: i16) {
2316        *self = self.shr(rhs);
2317    }
2318}
2319
2320impl ShrAssign<&i16> for ISizeVec4 {
2321    #[inline]
2322    fn shr_assign(&mut self, rhs: &i16) {
2323        self.shr_assign(*rhs);
2324    }
2325}
2326
2327impl Shl<i32> for ISizeVec4 {
2328    type Output = Self;
2329    #[inline]
2330    fn shl(self, rhs: i32) -> Self::Output {
2331        Self {
2332            x: self.x.shl(rhs),
2333            y: self.y.shl(rhs),
2334            z: self.z.shl(rhs),
2335            w: self.w.shl(rhs),
2336        }
2337    }
2338}
2339
2340impl Shl<&i32> for ISizeVec4 {
2341    type Output = Self;
2342    #[inline]
2343    fn shl(self, rhs: &i32) -> Self {
2344        self.shl(*rhs)
2345    }
2346}
2347
2348impl Shl<&i32> for &ISizeVec4 {
2349    type Output = ISizeVec4;
2350    #[inline]
2351    fn shl(self, rhs: &i32) -> ISizeVec4 {
2352        (*self).shl(*rhs)
2353    }
2354}
2355
2356impl Shl<i32> for &ISizeVec4 {
2357    type Output = ISizeVec4;
2358    #[inline]
2359    fn shl(self, rhs: i32) -> ISizeVec4 {
2360        (*self).shl(rhs)
2361    }
2362}
2363
2364impl ShlAssign<i32> for ISizeVec4 {
2365    #[inline]
2366    fn shl_assign(&mut self, rhs: i32) {
2367        *self = self.shl(rhs);
2368    }
2369}
2370
2371impl ShlAssign<&i32> for ISizeVec4 {
2372    #[inline]
2373    fn shl_assign(&mut self, rhs: &i32) {
2374        self.shl_assign(*rhs);
2375    }
2376}
2377
2378impl Shr<i32> for ISizeVec4 {
2379    type Output = Self;
2380    #[inline]
2381    fn shr(self, rhs: i32) -> Self::Output {
2382        Self {
2383            x: self.x.shr(rhs),
2384            y: self.y.shr(rhs),
2385            z: self.z.shr(rhs),
2386            w: self.w.shr(rhs),
2387        }
2388    }
2389}
2390
2391impl Shr<&i32> for ISizeVec4 {
2392    type Output = Self;
2393    #[inline]
2394    fn shr(self, rhs: &i32) -> Self {
2395        self.shr(*rhs)
2396    }
2397}
2398
2399impl Shr<&i32> for &ISizeVec4 {
2400    type Output = ISizeVec4;
2401    #[inline]
2402    fn shr(self, rhs: &i32) -> ISizeVec4 {
2403        (*self).shr(*rhs)
2404    }
2405}
2406
2407impl Shr<i32> for &ISizeVec4 {
2408    type Output = ISizeVec4;
2409    #[inline]
2410    fn shr(self, rhs: i32) -> ISizeVec4 {
2411        (*self).shr(rhs)
2412    }
2413}
2414
2415impl ShrAssign<i32> for ISizeVec4 {
2416    #[inline]
2417    fn shr_assign(&mut self, rhs: i32) {
2418        *self = self.shr(rhs);
2419    }
2420}
2421
2422impl ShrAssign<&i32> for ISizeVec4 {
2423    #[inline]
2424    fn shr_assign(&mut self, rhs: &i32) {
2425        self.shr_assign(*rhs);
2426    }
2427}
2428
2429impl Shl<i64> for ISizeVec4 {
2430    type Output = Self;
2431    #[inline]
2432    fn shl(self, rhs: i64) -> Self::Output {
2433        Self {
2434            x: self.x.shl(rhs),
2435            y: self.y.shl(rhs),
2436            z: self.z.shl(rhs),
2437            w: self.w.shl(rhs),
2438        }
2439    }
2440}
2441
2442impl Shl<&i64> for ISizeVec4 {
2443    type Output = Self;
2444    #[inline]
2445    fn shl(self, rhs: &i64) -> Self {
2446        self.shl(*rhs)
2447    }
2448}
2449
2450impl Shl<&i64> for &ISizeVec4 {
2451    type Output = ISizeVec4;
2452    #[inline]
2453    fn shl(self, rhs: &i64) -> ISizeVec4 {
2454        (*self).shl(*rhs)
2455    }
2456}
2457
2458impl Shl<i64> for &ISizeVec4 {
2459    type Output = ISizeVec4;
2460    #[inline]
2461    fn shl(self, rhs: i64) -> ISizeVec4 {
2462        (*self).shl(rhs)
2463    }
2464}
2465
2466impl ShlAssign<i64> for ISizeVec4 {
2467    #[inline]
2468    fn shl_assign(&mut self, rhs: i64) {
2469        *self = self.shl(rhs);
2470    }
2471}
2472
2473impl ShlAssign<&i64> for ISizeVec4 {
2474    #[inline]
2475    fn shl_assign(&mut self, rhs: &i64) {
2476        self.shl_assign(*rhs);
2477    }
2478}
2479
2480impl Shr<i64> for ISizeVec4 {
2481    type Output = Self;
2482    #[inline]
2483    fn shr(self, rhs: i64) -> Self::Output {
2484        Self {
2485            x: self.x.shr(rhs),
2486            y: self.y.shr(rhs),
2487            z: self.z.shr(rhs),
2488            w: self.w.shr(rhs),
2489        }
2490    }
2491}
2492
2493impl Shr<&i64> for ISizeVec4 {
2494    type Output = Self;
2495    #[inline]
2496    fn shr(self, rhs: &i64) -> Self {
2497        self.shr(*rhs)
2498    }
2499}
2500
2501impl Shr<&i64> for &ISizeVec4 {
2502    type Output = ISizeVec4;
2503    #[inline]
2504    fn shr(self, rhs: &i64) -> ISizeVec4 {
2505        (*self).shr(*rhs)
2506    }
2507}
2508
2509impl Shr<i64> for &ISizeVec4 {
2510    type Output = ISizeVec4;
2511    #[inline]
2512    fn shr(self, rhs: i64) -> ISizeVec4 {
2513        (*self).shr(rhs)
2514    }
2515}
2516
2517impl ShrAssign<i64> for ISizeVec4 {
2518    #[inline]
2519    fn shr_assign(&mut self, rhs: i64) {
2520        *self = self.shr(rhs);
2521    }
2522}
2523
2524impl ShrAssign<&i64> for ISizeVec4 {
2525    #[inline]
2526    fn shr_assign(&mut self, rhs: &i64) {
2527        self.shr_assign(*rhs);
2528    }
2529}
2530
2531impl Shl<u8> for ISizeVec4 {
2532    type Output = Self;
2533    #[inline]
2534    fn shl(self, rhs: u8) -> Self::Output {
2535        Self {
2536            x: self.x.shl(rhs),
2537            y: self.y.shl(rhs),
2538            z: self.z.shl(rhs),
2539            w: self.w.shl(rhs),
2540        }
2541    }
2542}
2543
2544impl Shl<&u8> for ISizeVec4 {
2545    type Output = Self;
2546    #[inline]
2547    fn shl(self, rhs: &u8) -> Self {
2548        self.shl(*rhs)
2549    }
2550}
2551
2552impl Shl<&u8> for &ISizeVec4 {
2553    type Output = ISizeVec4;
2554    #[inline]
2555    fn shl(self, rhs: &u8) -> ISizeVec4 {
2556        (*self).shl(*rhs)
2557    }
2558}
2559
2560impl Shl<u8> for &ISizeVec4 {
2561    type Output = ISizeVec4;
2562    #[inline]
2563    fn shl(self, rhs: u8) -> ISizeVec4 {
2564        (*self).shl(rhs)
2565    }
2566}
2567
2568impl ShlAssign<u8> for ISizeVec4 {
2569    #[inline]
2570    fn shl_assign(&mut self, rhs: u8) {
2571        *self = self.shl(rhs);
2572    }
2573}
2574
2575impl ShlAssign<&u8> for ISizeVec4 {
2576    #[inline]
2577    fn shl_assign(&mut self, rhs: &u8) {
2578        self.shl_assign(*rhs);
2579    }
2580}
2581
2582impl Shr<u8> for ISizeVec4 {
2583    type Output = Self;
2584    #[inline]
2585    fn shr(self, rhs: u8) -> Self::Output {
2586        Self {
2587            x: self.x.shr(rhs),
2588            y: self.y.shr(rhs),
2589            z: self.z.shr(rhs),
2590            w: self.w.shr(rhs),
2591        }
2592    }
2593}
2594
2595impl Shr<&u8> for ISizeVec4 {
2596    type Output = Self;
2597    #[inline]
2598    fn shr(self, rhs: &u8) -> Self {
2599        self.shr(*rhs)
2600    }
2601}
2602
2603impl Shr<&u8> for &ISizeVec4 {
2604    type Output = ISizeVec4;
2605    #[inline]
2606    fn shr(self, rhs: &u8) -> ISizeVec4 {
2607        (*self).shr(*rhs)
2608    }
2609}
2610
2611impl Shr<u8> for &ISizeVec4 {
2612    type Output = ISizeVec4;
2613    #[inline]
2614    fn shr(self, rhs: u8) -> ISizeVec4 {
2615        (*self).shr(rhs)
2616    }
2617}
2618
2619impl ShrAssign<u8> for ISizeVec4 {
2620    #[inline]
2621    fn shr_assign(&mut self, rhs: u8) {
2622        *self = self.shr(rhs);
2623    }
2624}
2625
2626impl ShrAssign<&u8> for ISizeVec4 {
2627    #[inline]
2628    fn shr_assign(&mut self, rhs: &u8) {
2629        self.shr_assign(*rhs);
2630    }
2631}
2632
2633impl Shl<u16> for ISizeVec4 {
2634    type Output = Self;
2635    #[inline]
2636    fn shl(self, rhs: u16) -> Self::Output {
2637        Self {
2638            x: self.x.shl(rhs),
2639            y: self.y.shl(rhs),
2640            z: self.z.shl(rhs),
2641            w: self.w.shl(rhs),
2642        }
2643    }
2644}
2645
2646impl Shl<&u16> for ISizeVec4 {
2647    type Output = Self;
2648    #[inline]
2649    fn shl(self, rhs: &u16) -> Self {
2650        self.shl(*rhs)
2651    }
2652}
2653
2654impl Shl<&u16> for &ISizeVec4 {
2655    type Output = ISizeVec4;
2656    #[inline]
2657    fn shl(self, rhs: &u16) -> ISizeVec4 {
2658        (*self).shl(*rhs)
2659    }
2660}
2661
2662impl Shl<u16> for &ISizeVec4 {
2663    type Output = ISizeVec4;
2664    #[inline]
2665    fn shl(self, rhs: u16) -> ISizeVec4 {
2666        (*self).shl(rhs)
2667    }
2668}
2669
2670impl ShlAssign<u16> for ISizeVec4 {
2671    #[inline]
2672    fn shl_assign(&mut self, rhs: u16) {
2673        *self = self.shl(rhs);
2674    }
2675}
2676
2677impl ShlAssign<&u16> for ISizeVec4 {
2678    #[inline]
2679    fn shl_assign(&mut self, rhs: &u16) {
2680        self.shl_assign(*rhs);
2681    }
2682}
2683
2684impl Shr<u16> for ISizeVec4 {
2685    type Output = Self;
2686    #[inline]
2687    fn shr(self, rhs: u16) -> Self::Output {
2688        Self {
2689            x: self.x.shr(rhs),
2690            y: self.y.shr(rhs),
2691            z: self.z.shr(rhs),
2692            w: self.w.shr(rhs),
2693        }
2694    }
2695}
2696
2697impl Shr<&u16> for ISizeVec4 {
2698    type Output = Self;
2699    #[inline]
2700    fn shr(self, rhs: &u16) -> Self {
2701        self.shr(*rhs)
2702    }
2703}
2704
2705impl Shr<&u16> for &ISizeVec4 {
2706    type Output = ISizeVec4;
2707    #[inline]
2708    fn shr(self, rhs: &u16) -> ISizeVec4 {
2709        (*self).shr(*rhs)
2710    }
2711}
2712
2713impl Shr<u16> for &ISizeVec4 {
2714    type Output = ISizeVec4;
2715    #[inline]
2716    fn shr(self, rhs: u16) -> ISizeVec4 {
2717        (*self).shr(rhs)
2718    }
2719}
2720
2721impl ShrAssign<u16> for ISizeVec4 {
2722    #[inline]
2723    fn shr_assign(&mut self, rhs: u16) {
2724        *self = self.shr(rhs);
2725    }
2726}
2727
2728impl ShrAssign<&u16> for ISizeVec4 {
2729    #[inline]
2730    fn shr_assign(&mut self, rhs: &u16) {
2731        self.shr_assign(*rhs);
2732    }
2733}
2734
2735impl Shl<u32> for ISizeVec4 {
2736    type Output = Self;
2737    #[inline]
2738    fn shl(self, rhs: u32) -> Self::Output {
2739        Self {
2740            x: self.x.shl(rhs),
2741            y: self.y.shl(rhs),
2742            z: self.z.shl(rhs),
2743            w: self.w.shl(rhs),
2744        }
2745    }
2746}
2747
2748impl Shl<&u32> for ISizeVec4 {
2749    type Output = Self;
2750    #[inline]
2751    fn shl(self, rhs: &u32) -> Self {
2752        self.shl(*rhs)
2753    }
2754}
2755
2756impl Shl<&u32> for &ISizeVec4 {
2757    type Output = ISizeVec4;
2758    #[inline]
2759    fn shl(self, rhs: &u32) -> ISizeVec4 {
2760        (*self).shl(*rhs)
2761    }
2762}
2763
2764impl Shl<u32> for &ISizeVec4 {
2765    type Output = ISizeVec4;
2766    #[inline]
2767    fn shl(self, rhs: u32) -> ISizeVec4 {
2768        (*self).shl(rhs)
2769    }
2770}
2771
2772impl ShlAssign<u32> for ISizeVec4 {
2773    #[inline]
2774    fn shl_assign(&mut self, rhs: u32) {
2775        *self = self.shl(rhs);
2776    }
2777}
2778
2779impl ShlAssign<&u32> for ISizeVec4 {
2780    #[inline]
2781    fn shl_assign(&mut self, rhs: &u32) {
2782        self.shl_assign(*rhs);
2783    }
2784}
2785
2786impl Shr<u32> for ISizeVec4 {
2787    type Output = Self;
2788    #[inline]
2789    fn shr(self, rhs: u32) -> Self::Output {
2790        Self {
2791            x: self.x.shr(rhs),
2792            y: self.y.shr(rhs),
2793            z: self.z.shr(rhs),
2794            w: self.w.shr(rhs),
2795        }
2796    }
2797}
2798
2799impl Shr<&u32> for ISizeVec4 {
2800    type Output = Self;
2801    #[inline]
2802    fn shr(self, rhs: &u32) -> Self {
2803        self.shr(*rhs)
2804    }
2805}
2806
2807impl Shr<&u32> for &ISizeVec4 {
2808    type Output = ISizeVec4;
2809    #[inline]
2810    fn shr(self, rhs: &u32) -> ISizeVec4 {
2811        (*self).shr(*rhs)
2812    }
2813}
2814
2815impl Shr<u32> for &ISizeVec4 {
2816    type Output = ISizeVec4;
2817    #[inline]
2818    fn shr(self, rhs: u32) -> ISizeVec4 {
2819        (*self).shr(rhs)
2820    }
2821}
2822
2823impl ShrAssign<u32> for ISizeVec4 {
2824    #[inline]
2825    fn shr_assign(&mut self, rhs: u32) {
2826        *self = self.shr(rhs);
2827    }
2828}
2829
2830impl ShrAssign<&u32> for ISizeVec4 {
2831    #[inline]
2832    fn shr_assign(&mut self, rhs: &u32) {
2833        self.shr_assign(*rhs);
2834    }
2835}
2836
2837impl Shl<u64> for ISizeVec4 {
2838    type Output = Self;
2839    #[inline]
2840    fn shl(self, rhs: u64) -> Self::Output {
2841        Self {
2842            x: self.x.shl(rhs),
2843            y: self.y.shl(rhs),
2844            z: self.z.shl(rhs),
2845            w: self.w.shl(rhs),
2846        }
2847    }
2848}
2849
2850impl Shl<&u64> for ISizeVec4 {
2851    type Output = Self;
2852    #[inline]
2853    fn shl(self, rhs: &u64) -> Self {
2854        self.shl(*rhs)
2855    }
2856}
2857
2858impl Shl<&u64> for &ISizeVec4 {
2859    type Output = ISizeVec4;
2860    #[inline]
2861    fn shl(self, rhs: &u64) -> ISizeVec4 {
2862        (*self).shl(*rhs)
2863    }
2864}
2865
2866impl Shl<u64> for &ISizeVec4 {
2867    type Output = ISizeVec4;
2868    #[inline]
2869    fn shl(self, rhs: u64) -> ISizeVec4 {
2870        (*self).shl(rhs)
2871    }
2872}
2873
2874impl ShlAssign<u64> for ISizeVec4 {
2875    #[inline]
2876    fn shl_assign(&mut self, rhs: u64) {
2877        *self = self.shl(rhs);
2878    }
2879}
2880
2881impl ShlAssign<&u64> for ISizeVec4 {
2882    #[inline]
2883    fn shl_assign(&mut self, rhs: &u64) {
2884        self.shl_assign(*rhs);
2885    }
2886}
2887
2888impl Shr<u64> for ISizeVec4 {
2889    type Output = Self;
2890    #[inline]
2891    fn shr(self, rhs: u64) -> Self::Output {
2892        Self {
2893            x: self.x.shr(rhs),
2894            y: self.y.shr(rhs),
2895            z: self.z.shr(rhs),
2896            w: self.w.shr(rhs),
2897        }
2898    }
2899}
2900
2901impl Shr<&u64> for ISizeVec4 {
2902    type Output = Self;
2903    #[inline]
2904    fn shr(self, rhs: &u64) -> Self {
2905        self.shr(*rhs)
2906    }
2907}
2908
2909impl Shr<&u64> for &ISizeVec4 {
2910    type Output = ISizeVec4;
2911    #[inline]
2912    fn shr(self, rhs: &u64) -> ISizeVec4 {
2913        (*self).shr(*rhs)
2914    }
2915}
2916
2917impl Shr<u64> for &ISizeVec4 {
2918    type Output = ISizeVec4;
2919    #[inline]
2920    fn shr(self, rhs: u64) -> ISizeVec4 {
2921        (*self).shr(rhs)
2922    }
2923}
2924
2925impl ShrAssign<u64> for ISizeVec4 {
2926    #[inline]
2927    fn shr_assign(&mut self, rhs: u64) {
2928        *self = self.shr(rhs);
2929    }
2930}
2931
2932impl ShrAssign<&u64> for ISizeVec4 {
2933    #[inline]
2934    fn shr_assign(&mut self, rhs: &u64) {
2935        self.shr_assign(*rhs);
2936    }
2937}
2938
2939impl Shl<IVec4> for ISizeVec4 {
2940    type Output = Self;
2941    #[inline]
2942    fn shl(self, rhs: IVec4) -> Self {
2943        Self {
2944            x: self.x.shl(rhs.x),
2945            y: self.y.shl(rhs.y),
2946            z: self.z.shl(rhs.z),
2947            w: self.w.shl(rhs.w),
2948        }
2949    }
2950}
2951
2952impl Shl<&IVec4> for ISizeVec4 {
2953    type Output = Self;
2954    #[inline]
2955    fn shl(self, rhs: &IVec4) -> Self {
2956        self.shl(*rhs)
2957    }
2958}
2959
2960impl Shl<&IVec4> for &ISizeVec4 {
2961    type Output = ISizeVec4;
2962    #[inline]
2963    fn shl(self, rhs: &IVec4) -> ISizeVec4 {
2964        (*self).shl(*rhs)
2965    }
2966}
2967
2968impl Shl<IVec4> for &ISizeVec4 {
2969    type Output = ISizeVec4;
2970    #[inline]
2971    fn shl(self, rhs: IVec4) -> ISizeVec4 {
2972        (*self).shl(rhs)
2973    }
2974}
2975
2976impl Shr<IVec4> for ISizeVec4 {
2977    type Output = Self;
2978    #[inline]
2979    fn shr(self, rhs: IVec4) -> Self {
2980        Self {
2981            x: self.x.shr(rhs.x),
2982            y: self.y.shr(rhs.y),
2983            z: self.z.shr(rhs.z),
2984            w: self.w.shr(rhs.w),
2985        }
2986    }
2987}
2988
2989impl Shr<&IVec4> for ISizeVec4 {
2990    type Output = Self;
2991    #[inline]
2992    fn shr(self, rhs: &IVec4) -> Self {
2993        self.shr(*rhs)
2994    }
2995}
2996
2997impl Shr<&IVec4> for &ISizeVec4 {
2998    type Output = ISizeVec4;
2999    #[inline]
3000    fn shr(self, rhs: &IVec4) -> ISizeVec4 {
3001        (*self).shr(*rhs)
3002    }
3003}
3004
3005impl Shr<IVec4> for &ISizeVec4 {
3006    type Output = ISizeVec4;
3007    #[inline]
3008    fn shr(self, rhs: IVec4) -> ISizeVec4 {
3009        (*self).shr(rhs)
3010    }
3011}
3012
3013impl Shl<UVec4> for ISizeVec4 {
3014    type Output = Self;
3015    #[inline]
3016    fn shl(self, rhs: UVec4) -> Self {
3017        Self {
3018            x: self.x.shl(rhs.x),
3019            y: self.y.shl(rhs.y),
3020            z: self.z.shl(rhs.z),
3021            w: self.w.shl(rhs.w),
3022        }
3023    }
3024}
3025
3026impl Shl<&UVec4> for ISizeVec4 {
3027    type Output = Self;
3028    #[inline]
3029    fn shl(self, rhs: &UVec4) -> Self {
3030        self.shl(*rhs)
3031    }
3032}
3033
3034impl Shl<&UVec4> for &ISizeVec4 {
3035    type Output = ISizeVec4;
3036    #[inline]
3037    fn shl(self, rhs: &UVec4) -> ISizeVec4 {
3038        (*self).shl(*rhs)
3039    }
3040}
3041
3042impl Shl<UVec4> for &ISizeVec4 {
3043    type Output = ISizeVec4;
3044    #[inline]
3045    fn shl(self, rhs: UVec4) -> ISizeVec4 {
3046        (*self).shl(rhs)
3047    }
3048}
3049
3050impl Shr<UVec4> for ISizeVec4 {
3051    type Output = Self;
3052    #[inline]
3053    fn shr(self, rhs: UVec4) -> Self {
3054        Self {
3055            x: self.x.shr(rhs.x),
3056            y: self.y.shr(rhs.y),
3057            z: self.z.shr(rhs.z),
3058            w: self.w.shr(rhs.w),
3059        }
3060    }
3061}
3062
3063impl Shr<&UVec4> for ISizeVec4 {
3064    type Output = Self;
3065    #[inline]
3066    fn shr(self, rhs: &UVec4) -> Self {
3067        self.shr(*rhs)
3068    }
3069}
3070
3071impl Shr<&UVec4> for &ISizeVec4 {
3072    type Output = ISizeVec4;
3073    #[inline]
3074    fn shr(self, rhs: &UVec4) -> ISizeVec4 {
3075        (*self).shr(*rhs)
3076    }
3077}
3078
3079impl Shr<UVec4> for &ISizeVec4 {
3080    type Output = ISizeVec4;
3081    #[inline]
3082    fn shr(self, rhs: UVec4) -> ISizeVec4 {
3083        (*self).shr(rhs)
3084    }
3085}
3086
3087impl Index<usize> for ISizeVec4 {
3088    type Output = isize;
3089    #[inline]
3090    fn index(&self, index: usize) -> &Self::Output {
3091        match index {
3092            0 => &self.x,
3093            1 => &self.y,
3094            2 => &self.z,
3095            3 => &self.w,
3096            _ => panic!("index out of bounds"),
3097        }
3098    }
3099}
3100
3101impl IndexMut<usize> for ISizeVec4 {
3102    #[inline]
3103    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3104        match index {
3105            0 => &mut self.x,
3106            1 => &mut self.y,
3107            2 => &mut self.z,
3108            3 => &mut self.w,
3109            _ => panic!("index out of bounds"),
3110        }
3111    }
3112}
3113
3114impl fmt::Display for ISizeVec4 {
3115    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3116        write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
3117    }
3118}
3119
3120impl fmt::Debug for ISizeVec4 {
3121    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3122        fmt.debug_tuple(stringify!(ISizeVec4))
3123            .field(&self.x)
3124            .field(&self.y)
3125            .field(&self.z)
3126            .field(&self.w)
3127            .finish()
3128    }
3129}
3130
3131impl From<[isize; 4]> for ISizeVec4 {
3132    #[inline]
3133    fn from(a: [isize; 4]) -> Self {
3134        Self::new(a[0], a[1], a[2], a[3])
3135    }
3136}
3137
3138impl From<ISizeVec4> for [isize; 4] {
3139    #[inline]
3140    fn from(v: ISizeVec4) -> Self {
3141        [v.x, v.y, v.z, v.w]
3142    }
3143}
3144
3145impl From<(isize, isize, isize, isize)> for ISizeVec4 {
3146    #[inline]
3147    fn from(t: (isize, isize, isize, isize)) -> Self {
3148        Self::new(t.0, t.1, t.2, t.3)
3149    }
3150}
3151
3152impl From<ISizeVec4> for (isize, isize, isize, isize) {
3153    #[inline]
3154    fn from(v: ISizeVec4) -> Self {
3155        (v.x, v.y, v.z, v.w)
3156    }
3157}
3158
3159impl From<(ISizeVec3, isize)> for ISizeVec4 {
3160    #[inline]
3161    fn from((v, w): (ISizeVec3, isize)) -> Self {
3162        Self::new(v.x, v.y, v.z, w)
3163    }
3164}
3165
3166impl From<(isize, ISizeVec3)> for ISizeVec4 {
3167    #[inline]
3168    fn from((x, v): (isize, ISizeVec3)) -> Self {
3169        Self::new(x, v.x, v.y, v.z)
3170    }
3171}
3172
3173impl From<(ISizeVec2, isize, isize)> for ISizeVec4 {
3174    #[inline]
3175    fn from((v, z, w): (ISizeVec2, isize, isize)) -> Self {
3176        Self::new(v.x, v.y, z, w)
3177    }
3178}
3179
3180impl From<(ISizeVec2, ISizeVec2)> for ISizeVec4 {
3181    #[inline]
3182    fn from((v, u): (ISizeVec2, ISizeVec2)) -> Self {
3183        Self::new(v.x, v.y, u.x, u.y)
3184    }
3185}
3186
3187impl From<I8Vec4> for ISizeVec4 {
3188    #[inline]
3189    fn from(v: I8Vec4) -> Self {
3190        Self::new(
3191            isize::from(v.x),
3192            isize::from(v.y),
3193            isize::from(v.z),
3194            isize::from(v.w),
3195        )
3196    }
3197}
3198
3199impl From<I16Vec4> for ISizeVec4 {
3200    #[inline]
3201    fn from(v: I16Vec4) -> Self {
3202        Self::new(
3203            isize::from(v.x),
3204            isize::from(v.y),
3205            isize::from(v.z),
3206            isize::from(v.w),
3207        )
3208    }
3209}
3210
3211impl From<U8Vec4> for ISizeVec4 {
3212    #[inline]
3213    fn from(v: U8Vec4) -> Self {
3214        Self::new(
3215            isize::from(v.x),
3216            isize::from(v.y),
3217            isize::from(v.z),
3218            isize::from(v.w),
3219        )
3220    }
3221}
3222
3223impl TryFrom<U16Vec4> for ISizeVec4 {
3224    type Error = core::num::TryFromIntError;
3225
3226    #[inline]
3227    fn try_from(v: U16Vec4) -> Result<Self, Self::Error> {
3228        Ok(Self::new(
3229            isize::try_from(v.x)?,
3230            isize::try_from(v.y)?,
3231            isize::try_from(v.z)?,
3232            isize::try_from(v.w)?,
3233        ))
3234    }
3235}
3236
3237impl TryFrom<UVec4> for ISizeVec4 {
3238    type Error = core::num::TryFromIntError;
3239
3240    #[inline]
3241    fn try_from(v: UVec4) -> Result<Self, Self::Error> {
3242        Ok(Self::new(
3243            isize::try_from(v.x)?,
3244            isize::try_from(v.y)?,
3245            isize::try_from(v.z)?,
3246            isize::try_from(v.w)?,
3247        ))
3248    }
3249}
3250
3251impl TryFrom<U64Vec4> for ISizeVec4 {
3252    type Error = core::num::TryFromIntError;
3253
3254    #[inline]
3255    fn try_from(v: U64Vec4) -> Result<Self, Self::Error> {
3256        Ok(Self::new(
3257            isize::try_from(v.x)?,
3258            isize::try_from(v.y)?,
3259            isize::try_from(v.z)?,
3260            isize::try_from(v.w)?,
3261        ))
3262    }
3263}
3264
3265impl TryFrom<USizeVec4> for ISizeVec4 {
3266    type Error = core::num::TryFromIntError;
3267
3268    #[inline]
3269    fn try_from(v: USizeVec4) -> Result<Self, Self::Error> {
3270        Ok(Self::new(
3271            isize::try_from(v.x)?,
3272            isize::try_from(v.y)?,
3273            isize::try_from(v.z)?,
3274            isize::try_from(v.w)?,
3275        ))
3276    }
3277}
3278
3279impl TryFrom<IVec4> for ISizeVec4 {
3280    type Error = core::num::TryFromIntError;
3281
3282    #[inline]
3283    fn try_from(v: IVec4) -> Result<Self, Self::Error> {
3284        Ok(Self::new(
3285            isize::try_from(v.x)?,
3286            isize::try_from(v.y)?,
3287            isize::try_from(v.z)?,
3288            isize::try_from(v.w)?,
3289        ))
3290    }
3291}
3292
3293impl TryFrom<I64Vec4> for ISizeVec4 {
3294    type Error = core::num::TryFromIntError;
3295
3296    #[inline]
3297    fn try_from(v: I64Vec4) -> Result<Self, Self::Error> {
3298        Ok(Self::new(
3299            isize::try_from(v.x)?,
3300            isize::try_from(v.y)?,
3301            isize::try_from(v.z)?,
3302            isize::try_from(v.w)?,
3303        ))
3304    }
3305}
3306
3307impl From<BVec4> for ISizeVec4 {
3308    #[inline]
3309    fn from(v: BVec4) -> Self {
3310        Self::new(
3311            isize::from(v.x),
3312            isize::from(v.y),
3313            isize::from(v.z),
3314            isize::from(v.w),
3315        )
3316    }
3317}
3318
3319#[cfg(not(feature = "scalar-math"))]
3320impl From<BVec4A> for ISizeVec4 {
3321    #[inline]
3322    fn from(v: BVec4A) -> Self {
3323        let bool_array: [bool; 4] = v.into();
3324        Self::new(
3325            isize::from(bool_array[0]),
3326            isize::from(bool_array[1]),
3327            isize::from(bool_array[2]),
3328            isize::from(bool_array[3]),
3329        )
3330    }
3331}