• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitshifter / glam-rs / 24918269367

25 Apr 2026 12:40AM UTC coverage: 97.134%. Remained the same
24918269367

push

github

bitshifter
Add types are conditional.

57276 of 58966 relevant lines covered (97.13%)

3.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.52
/src/u32/uvec4.rs
1
// Generated from vec.rs.tera template. Edit the template, not the generated file.
2

3
#[cfg(not(feature = "scalar-math"))]
4
use crate::BVec4A;
5
use crate::{BVec4, U16Vec4, U8Vec4, UVec2, UVec3};
6

7
#[cfg(feature = "i8")]
8
use crate::I8Vec4;
9

10
#[cfg(feature = "i16")]
11
use crate::I16Vec4;
12

13
#[cfg(feature = "i32")]
14
use crate::IVec4;
15

16
#[cfg(feature = "i64")]
17
use crate::I64Vec4;
18

19
#[cfg(feature = "u64")]
20
use crate::U64Vec4;
21

22
#[cfg(feature = "isize")]
23
use crate::ISizeVec4;
24

25
#[cfg(feature = "usize")]
26
use crate::USizeVec4;
27

28
use core::fmt;
29
use core::iter::{Product, Sum};
30
use core::{f32, ops::*};
31

32
#[cfg(feature = "zerocopy")]
33
use zerocopy_derive::*;
34

35
/// Creates a 4-dimensional vector.
36
#[inline(always)]
37
#[must_use]
38
pub const fn uvec4(x: u32, y: u32, z: u32, w: u32) -> UVec4 {
6✔
39
    UVec4::new(x, y, z, w)
×
40
}
41

42
/// A 4-dimensional vector.
43
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
44
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
45
#[cfg_attr(
46
    feature = "zerocopy",
47
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
48
)]
49
#[cfg_attr(feature = "cuda", repr(align(16)))]
50
#[repr(C)]
51
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
52
pub struct UVec4 {
53
    pub x: u32,
54
    pub y: u32,
55
    pub z: u32,
56
    pub w: u32,
57
}
58

59
impl UVec4 {
60
    /// All zeroes.
61
    pub const ZERO: Self = Self::splat(0);
62

63
    /// All ones.
64
    pub const ONE: Self = Self::splat(1);
65

66
    /// All `u32::MIN`.
67
    pub const MIN: Self = Self::splat(u32::MIN);
68

69
    /// All `u32::MAX`.
70
    pub const MAX: Self = Self::splat(u32::MAX);
71

72
    /// A unit vector pointing along the positive X axis.
73
    pub const X: Self = Self::new(1, 0, 0, 0);
74

75
    /// A unit vector pointing along the positive Y axis.
76
    pub const Y: Self = Self::new(0, 1, 0, 0);
77

78
    /// A unit vector pointing along the positive Z axis.
79
    pub const Z: Self = Self::new(0, 0, 1, 0);
80

81
    /// A unit vector pointing along the positive W axis.
82
    pub const W: Self = Self::new(0, 0, 0, 1);
83

84
    /// The unit axes.
85
    pub const AXES: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W];
86

87
    /// Creates a new vector.
88
    #[inline(always)]
89
    #[must_use]
90
    pub const fn new(x: u32, y: u32, z: u32, w: u32) -> Self {
12✔
91
        Self { x, y, z, w }
92
    }
93

94
    /// Creates a vector with all elements set to `v`.
95
    #[inline]
96
    #[must_use]
97
    pub const fn splat(v: u32) -> Self {
3✔
98
        Self {
99
            x: v,
100

101
            y: v,
102

103
            z: v,
104

105
            w: v,
106
        }
107
    }
108

109
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
110
    #[inline]
111
    #[must_use]
112
    pub fn map<F>(self, f: F) -> Self
6✔
113
    where
114
        F: Fn(u32) -> u32,
115
    {
116
        Self::new(f(self.x), f(self.y), f(self.z), f(self.w))
12✔
117
    }
118

119
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
120
    /// for each element of `self`.
121
    ///
122
    /// A true element in the mask uses the corresponding element from `if_true`, and false
123
    /// uses the element from `if_false`.
124
    #[inline]
125
    #[must_use]
126
    pub fn select(mask: BVec4, if_true: Self, if_false: Self) -> Self {
3✔
127
        Self {
128
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
129
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
130
            z: if mask.test(2) { if_true.z } else { if_false.z },
3✔
131
            w: if mask.test(3) { if_true.w } else { if_false.w },
3✔
132
        }
133
    }
134

135
    /// Creates a new vector from an array.
136
    #[inline]
137
    #[must_use]
138
    pub const fn from_array(a: [u32; 4]) -> Self {
×
139
        Self::new(a[0], a[1], a[2], a[3])
×
140
    }
141

142
    /// Converts `self` to `[x, y, z, w]`
143
    #[inline]
144
    #[must_use]
145
    pub const fn to_array(&self) -> [u32; 4] {
3✔
146
        [self.x, self.y, self.z, self.w]
3✔
147
    }
148

149
    /// Creates a vector from the first 4 values in `slice`.
150
    ///
151
    /// # Panics
152
    ///
153
    /// Panics if `slice` is less than 4 elements long.
154
    #[inline]
155
    #[must_use]
156
    pub const fn from_slice(slice: &[u32]) -> Self {
3✔
157
        assert!(slice.len() >= 4);
3✔
158
        Self::new(slice[0], slice[1], slice[2], slice[3])
3✔
159
    }
160

161
    /// Writes the elements of `self` to the first 4 elements in `slice`.
162
    ///
163
    /// # Panics
164
    ///
165
    /// Panics if `slice` is less than 4 elements long.
166
    #[inline]
167
    pub fn write_to_slice(self, slice: &mut [u32]) {
3✔
168
        slice[..4].copy_from_slice(&self.to_array());
3✔
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 {
6✔
177
        use crate::swizzles::Vec4Swizzles;
178
        self.xyz()
6✔
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 {
3✔
185
        self.x = x;
3✔
186
        self
3✔
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 {
3✔
193
        self.y = y;
3✔
194
        self
3✔
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 {
3✔
201
        self.z = z;
3✔
202
        self
3✔
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 {
3✔
209
        self.w = w;
3✔
210
        self
3✔
211
    }
212

213
    /// Computes the dot product of `self` and `rhs`.
214
    #[inline]
215
    #[must_use]
216
    pub fn dot(self, rhs: Self) -> u32 {
3✔
217
        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z) + (self.w * rhs.w)
3✔
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 {
3✔
224
        Self::splat(self.dot(rhs))
3✔
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 {
3✔
233
        Self {
234
            x: if self.x < rhs.x { self.x } else { rhs.x },
3✔
235
            y: if self.y < rhs.y { self.y } else { rhs.y },
3✔
236
            z: if self.z < rhs.z { self.z } else { rhs.z },
3✔
237
            w: if self.w < rhs.w { self.w } else { rhs.w },
3✔
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 {
3✔
247
        Self {
248
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
249
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
250
            z: if self.z > rhs.z { self.z } else { rhs.z },
3✔
251
            w: if self.w > rhs.w { self.w } else { rhs.w },
3✔
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
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
265
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
266
        self.max(min).min(max)
3✔
267
    }
268

269
    /// Returns the horizontal minimum of `self`.
270
    ///
271
    /// In other words this computes `min(x, y, ..)`.
272
    #[inline]
273
    #[must_use]
274
    pub fn min_element(self) -> u32 {
3✔
275
        let min = |a, b| if a < b { a } else { b };
6✔
276
        min(self.x, min(self.y, min(self.z, self.w)))
3✔
277
    }
278

279
    /// Returns the horizontal maximum of `self`.
280
    ///
281
    /// In other words this computes `max(x, y, ..)`.
282
    #[inline]
283
    #[must_use]
284
    pub fn max_element(self) -> u32 {
3✔
285
        let max = |a, b| if a > b { a } else { b };
6✔
286
        max(self.x, max(self.y, max(self.z, self.w)))
3✔
287
    }
288

289
    /// Returns the index of the first minimum element of `self`.
290
    #[doc(alias = "argmin")]
291
    #[inline]
292
    #[must_use]
293
    pub fn min_position(self) -> usize {
3✔
294
        let mut min = self.x;
3✔
295
        let mut index = 0;
3✔
296
        if self.y < min {
6✔
297
            min = self.y;
3✔
298
            index = 1;
3✔
299
        }
300
        if self.z < min {
6✔
301
            min = self.z;
3✔
302
            index = 2;
3✔
303
        }
304
        if self.w < min {
6✔
305
            index = 3;
3✔
306
        }
307
        index
3✔
308
    }
309

310
    /// Returns the index of the first maximum element of `self`.
311
    #[doc(alias = "argmax")]
312
    #[inline]
313
    #[must_use]
314
    pub fn max_position(self) -> usize {
3✔
315
        let mut max = self.x;
3✔
316
        let mut index = 0;
3✔
317
        if self.y > max {
6✔
318
            max = self.y;
3✔
319
            index = 1;
3✔
320
        }
321
        if self.z > max {
6✔
322
            max = self.z;
3✔
323
            index = 2;
3✔
324
        }
325
        if self.w > max {
6✔
326
            index = 3;
3✔
327
        }
328
        index
3✔
329
    }
330

331
    /// Returns the sum of all elements of `self`.
332
    ///
333
    /// In other words, this computes `self.x + self.y + ..`.
334
    #[inline]
335
    #[must_use]
336
    pub fn element_sum(self) -> u32 {
3✔
337
        self.x + self.y + self.z + self.w
3✔
338
    }
339

340
    /// Returns the product of all elements of `self`.
341
    ///
342
    /// In other words, this computes `self.x * self.y * ..`.
343
    #[inline]
344
    #[must_use]
345
    pub fn element_product(self) -> u32 {
3✔
346
        self.x * self.y * self.z * self.w
3✔
347
    }
348

349
    /// Returns a vector mask containing the result of a `==` comparison for each element of
350
    /// `self` and `rhs`.
351
    ///
352
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
353
    /// elements.
354
    #[inline]
355
    #[must_use]
356
    pub fn cmpeq(self, rhs: Self) -> BVec4 {
3✔
357
        BVec4::new(
358
            self.x.eq(&rhs.x),
3✔
359
            self.y.eq(&rhs.y),
3✔
360
            self.z.eq(&rhs.z),
3✔
361
            self.w.eq(&rhs.w),
3✔
362
        )
363
    }
364

365
    /// Returns a vector mask containing the result of a `!=` comparison for each element of
366
    /// `self` and `rhs`.
367
    ///
368
    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
369
    /// elements.
370
    #[inline]
371
    #[must_use]
372
    pub fn cmpne(self, rhs: Self) -> BVec4 {
3✔
373
        BVec4::new(
374
            self.x.ne(&rhs.x),
3✔
375
            self.y.ne(&rhs.y),
3✔
376
            self.z.ne(&rhs.z),
3✔
377
            self.w.ne(&rhs.w),
3✔
378
        )
379
    }
380

381
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
382
    /// `self` and `rhs`.
383
    ///
384
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
385
    /// elements.
386
    #[inline]
387
    #[must_use]
388
    pub fn cmpge(self, rhs: Self) -> BVec4 {
3✔
389
        BVec4::new(
390
            self.x.ge(&rhs.x),
3✔
391
            self.y.ge(&rhs.y),
3✔
392
            self.z.ge(&rhs.z),
3✔
393
            self.w.ge(&rhs.w),
3✔
394
        )
395
    }
396

397
    /// Returns a vector mask containing the result of a `>` comparison for each element of
398
    /// `self` and `rhs`.
399
    ///
400
    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
401
    /// elements.
402
    #[inline]
403
    #[must_use]
404
    pub fn cmpgt(self, rhs: Self) -> BVec4 {
3✔
405
        BVec4::new(
406
            self.x.gt(&rhs.x),
3✔
407
            self.y.gt(&rhs.y),
3✔
408
            self.z.gt(&rhs.z),
3✔
409
            self.w.gt(&rhs.w),
3✔
410
        )
411
    }
412

413
    /// Returns a vector mask containing the result of a `<=` comparison for each element of
414
    /// `self` and `rhs`.
415
    ///
416
    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
417
    /// elements.
418
    #[inline]
419
    #[must_use]
420
    pub fn cmple(self, rhs: Self) -> BVec4 {
6✔
421
        BVec4::new(
422
            self.x.le(&rhs.x),
6✔
423
            self.y.le(&rhs.y),
6✔
424
            self.z.le(&rhs.z),
6✔
425
            self.w.le(&rhs.w),
6✔
426
        )
427
    }
428

429
    /// Returns a vector mask containing the result of a `<` comparison for each element of
430
    /// `self` and `rhs`.
431
    ///
432
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
433
    /// elements.
434
    #[inline]
435
    #[must_use]
436
    pub fn cmplt(self, rhs: Self) -> BVec4 {
3✔
437
        BVec4::new(
438
            self.x.lt(&rhs.x),
3✔
439
            self.y.lt(&rhs.y),
3✔
440
            self.z.lt(&rhs.z),
3✔
441
            self.w.lt(&rhs.w),
3✔
442
        )
443
    }
444

445
    /// Computes the squared length of `self`.
446
    #[doc(alias = "magnitude2")]
447
    #[inline]
448
    #[must_use]
449
    pub fn length_squared(self) -> u32 {
3✔
450
        self.dot(self)
3✔
451
    }
452

453
    /// Computes the [manhattan distance] between two points.
454
    ///
455
    /// # Overflow
456
    /// This method may overflow if the result is greater than [`u32::MAX`].
457
    ///
458
    /// See also [`checked_manhattan_distance`][UVec4::checked_manhattan_distance].
459
    ///
460
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
461
    #[inline]
462
    #[must_use]
463
    pub fn manhattan_distance(self, rhs: Self) -> u32 {
3✔
464
        self.x.abs_diff(rhs.x)
12✔
465
            + self.y.abs_diff(rhs.y)
3✔
466
            + self.z.abs_diff(rhs.z)
3✔
467
            + self.w.abs_diff(rhs.w)
3✔
468
    }
469

470
    /// Computes the [manhattan distance] between two points.
471
    ///
472
    /// This will returns [`None`] if the result is greater than [`u32::MAX`].
473
    ///
474
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
475
    #[inline]
476
    #[must_use]
477
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<u32> {
3✔
478
        let d = self.x.abs_diff(rhs.x);
3✔
479
        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
3✔
480
        let d = d.checked_add(self.z.abs_diff(rhs.z))?;
3✔
481
        d.checked_add(self.w.abs_diff(rhs.w))
3✔
482
    }
483

484
    /// Computes the [chebyshev distance] between two points.
485
    ///
486
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
487
    #[inline]
488
    #[must_use]
489
    pub fn chebyshev_distance(self, rhs: Self) -> u32 {
3✔
490
        // Note: the compiler will eventually optimize out the loop
491
        [
492
            self.x.abs_diff(rhs.x),
3✔
493
            self.y.abs_diff(rhs.y),
3✔
494
            self.z.abs_diff(rhs.z),
3✔
495
            self.w.abs_diff(rhs.w),
3✔
496
        ]
497
        .into_iter()
498
        .max()
499
        .unwrap()
500
    }
501

502
    /// Casts all elements of `self` to `f32`.
503
    #[inline]
504
    #[must_use]
505
    pub fn as_vec4(self) -> crate::Vec4 {
3✔
506
        crate::Vec4::new(self.x as f32, self.y as f32, self.z as f32, self.w as f32)
3✔
507
    }
508

509
    /// Casts all elements of `self` to `f64`.
510
    #[cfg(feature = "f64")]
511
    #[inline]
512
    #[must_use]
513
    pub fn as_dvec4(self) -> crate::DVec4 {
3✔
514
        crate::DVec4::new(self.x as f64, self.y as f64, self.z as f64, self.w as f64)
3✔
515
    }
516

517
    /// Casts all elements of `self` to `i8`.
518
    #[cfg(feature = "i8")]
519
    #[inline]
520
    #[must_use]
521
    pub fn as_i8vec4(self) -> crate::I8Vec4 {
3✔
522
        crate::I8Vec4::new(self.x as i8, self.y as i8, self.z as i8, self.w as i8)
3✔
523
    }
524

525
    /// Casts all elements of `self` to `u8`.
526
    #[cfg(feature = "u8")]
527
    #[inline]
528
    #[must_use]
529
    pub fn as_u8vec4(self) -> crate::U8Vec4 {
3✔
530
        crate::U8Vec4::new(self.x as u8, self.y as u8, self.z as u8, self.w as u8)
3✔
531
    }
532

533
    /// Casts all elements of `self` to `i16`.
534
    #[cfg(feature = "i16")]
535
    #[inline]
536
    #[must_use]
537
    pub fn as_i16vec4(self) -> crate::I16Vec4 {
3✔
538
        crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
3✔
539
    }
540

541
    /// Casts all elements of `self` to `u16`.
542
    #[cfg(feature = "u16")]
543
    #[inline]
544
    #[must_use]
545
    pub fn as_u16vec4(self) -> crate::U16Vec4 {
3✔
546
        crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
3✔
547
    }
548

549
    /// Casts all elements of `self` to `i32`.
550
    #[cfg(feature = "i32")]
551
    #[inline]
552
    #[must_use]
553
    pub fn as_ivec4(self) -> crate::IVec4 {
3✔
554
        crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
3✔
555
    }
556

557
    /// Casts all elements of `self` to `i64`.
558
    #[cfg(feature = "i64")]
559
    #[inline]
560
    #[must_use]
561
    pub fn as_i64vec4(self) -> crate::I64Vec4 {
3✔
562
        crate::I64Vec4::new(self.x as i64, self.y as i64, self.z as i64, self.w as i64)
3✔
563
    }
564

565
    /// Casts all elements of `self` to `u64`.
566
    #[cfg(feature = "u64")]
567
    #[inline]
568
    #[must_use]
569
    pub fn as_u64vec4(self) -> crate::U64Vec4 {
3✔
570
        crate::U64Vec4::new(self.x as u64, self.y as u64, self.z as u64, self.w as u64)
3✔
571
    }
572

573
    /// Casts all elements of `self` to `isize`.
574
    #[cfg(feature = "isize")]
575
    #[inline]
576
    #[must_use]
577
    pub fn as_isizevec4(self) -> crate::ISizeVec4 {
3✔
578
        crate::ISizeVec4::new(
579
            self.x as isize,
3✔
580
            self.y as isize,
3✔
581
            self.z as isize,
3✔
582
            self.w as isize,
3✔
583
        )
584
    }
585

586
    /// Casts all elements of `self` to `usize`.
587
    #[cfg(feature = "usize")]
588
    #[inline]
589
    #[must_use]
590
    pub fn as_usizevec4(self) -> crate::USizeVec4 {
3✔
591
        crate::USizeVec4::new(
592
            self.x as usize,
3✔
593
            self.y as usize,
3✔
594
            self.z as usize,
3✔
595
            self.w as usize,
3✔
596
        )
597
    }
598

599
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
600
    ///
601
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
602
    #[inline]
603
    #[must_use]
604
    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
3✔
605
        let x = match self.x.checked_add(rhs.x) {
3✔
606
            Some(v) => v,
3✔
607
            None => return None,
3✔
608
        };
609
        let y = match self.y.checked_add(rhs.y) {
3✔
610
            Some(v) => v,
3✔
611
            None => return None,
3✔
612
        };
613
        let z = match self.z.checked_add(rhs.z) {
3✔
614
            Some(v) => v,
3✔
615
            None => return None,
3✔
616
        };
617
        let w = match self.w.checked_add(rhs.w) {
3✔
618
            Some(v) => v,
3✔
619
            None => return None,
3✔
620
        };
621

622
        Some(Self { x, y, z, w })
3✔
623
    }
624

625
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
626
    ///
627
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
628
    #[inline]
629
    #[must_use]
630
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
631
        let x = match self.x.checked_sub(rhs.x) {
3✔
632
            Some(v) => v,
3✔
633
            None => return None,
3✔
634
        };
635
        let y = match self.y.checked_sub(rhs.y) {
3✔
636
            Some(v) => v,
3✔
637
            None => return None,
3✔
638
        };
639
        let z = match self.z.checked_sub(rhs.z) {
3✔
640
            Some(v) => v,
3✔
641
            None => return None,
3✔
642
        };
643
        let w = match self.w.checked_sub(rhs.w) {
3✔
644
            Some(v) => v,
3✔
645
            None => return None,
3✔
646
        };
647

648
        Some(Self { x, y, z, w })
3✔
649
    }
650

651
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
652
    ///
653
    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
654
    #[inline]
655
    #[must_use]
656
    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
3✔
657
        let x = match self.x.checked_mul(rhs.x) {
3✔
658
            Some(v) => v,
3✔
659
            None => return None,
3✔
660
        };
661
        let y = match self.y.checked_mul(rhs.y) {
3✔
662
            Some(v) => v,
3✔
663
            None => return None,
×
664
        };
665
        let z = match self.z.checked_mul(rhs.z) {
3✔
666
            Some(v) => v,
3✔
667
            None => return None,
×
668
        };
669
        let w = match self.w.checked_mul(rhs.w) {
3✔
670
            Some(v) => v,
3✔
671
            None => return None,
×
672
        };
673

674
        Some(Self { x, y, z, w })
3✔
675
    }
676

677
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
678
    ///
679
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
680
    #[inline]
681
    #[must_use]
682
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
683
        let x = match self.x.checked_div(rhs.x) {
3✔
684
            Some(v) => v,
3✔
685
            None => return None,
3✔
686
        };
687
        let y = match self.y.checked_div(rhs.y) {
3✔
688
            Some(v) => v,
3✔
689
            None => return None,
3✔
690
        };
691
        let z = match self.z.checked_div(rhs.z) {
3✔
692
            Some(v) => v,
3✔
693
            None => return None,
×
694
        };
695
        let w = match self.w.checked_div(rhs.w) {
3✔
696
            Some(v) => v,
3✔
697
            None => return None,
×
698
        };
699

700
        Some(Self { x, y, z, w })
3✔
701
    }
702

703
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
704
    ///
705
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
706
    #[inline]
707
    #[must_use]
708
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
709
        Self {
710
            x: self.x.wrapping_add(rhs.x),
3✔
711
            y: self.y.wrapping_add(rhs.y),
3✔
712
            z: self.z.wrapping_add(rhs.z),
3✔
713
            w: self.w.wrapping_add(rhs.w),
3✔
714
        }
715
    }
716

717
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
718
    ///
719
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
720
    #[inline]
721
    #[must_use]
722
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
723
        Self {
724
            x: self.x.wrapping_sub(rhs.x),
3✔
725
            y: self.y.wrapping_sub(rhs.y),
3✔
726
            z: self.z.wrapping_sub(rhs.z),
3✔
727
            w: self.w.wrapping_sub(rhs.w),
3✔
728
        }
729
    }
730

731
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
732
    ///
733
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
734
    #[inline]
735
    #[must_use]
736
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
737
        Self {
738
            x: self.x.wrapping_mul(rhs.x),
3✔
739
            y: self.y.wrapping_mul(rhs.y),
3✔
740
            z: self.z.wrapping_mul(rhs.z),
3✔
741
            w: self.w.wrapping_mul(rhs.w),
3✔
742
        }
743
    }
744

745
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
746
    ///
747
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
748
    #[inline]
749
    #[must_use]
750
    pub const fn wrapping_div(self, rhs: Self) -> Self {
3✔
751
        Self {
752
            x: self.x.wrapping_div(rhs.x),
3✔
753
            y: self.y.wrapping_div(rhs.y),
3✔
754
            z: self.z.wrapping_div(rhs.z),
3✔
755
            w: self.w.wrapping_div(rhs.w),
3✔
756
        }
757
    }
758

759
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
760
    ///
761
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
762
    #[inline]
763
    #[must_use]
764
    pub const fn saturating_add(self, rhs: Self) -> Self {
3✔
765
        Self {
766
            x: self.x.saturating_add(rhs.x),
3✔
767
            y: self.y.saturating_add(rhs.y),
3✔
768
            z: self.z.saturating_add(rhs.z),
3✔
769
            w: self.w.saturating_add(rhs.w),
3✔
770
        }
771
    }
772

773
    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
774
    ///
775
    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
776
    #[inline]
777
    #[must_use]
778
    pub const fn saturating_sub(self, rhs: Self) -> Self {
3✔
779
        Self {
780
            x: self.x.saturating_sub(rhs.x),
3✔
781
            y: self.y.saturating_sub(rhs.y),
3✔
782
            z: self.z.saturating_sub(rhs.z),
3✔
783
            w: self.w.saturating_sub(rhs.w),
3✔
784
        }
785
    }
786

787
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
788
    ///
789
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
790
    #[inline]
791
    #[must_use]
792
    pub const fn saturating_mul(self, rhs: Self) -> Self {
3✔
793
        Self {
794
            x: self.x.saturating_mul(rhs.x),
3✔
795
            y: self.y.saturating_mul(rhs.y),
3✔
796
            z: self.z.saturating_mul(rhs.z),
3✔
797
            w: self.w.saturating_mul(rhs.w),
3✔
798
        }
799
    }
800

801
    /// Returns a vector containing the saturating division of `self` and `rhs`.
802
    ///
803
    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
804
    #[inline]
805
    #[must_use]
806
    pub const fn saturating_div(self, rhs: Self) -> Self {
3✔
807
        Self {
808
            x: self.x.saturating_div(rhs.x),
3✔
809
            y: self.y.saturating_div(rhs.y),
3✔
810
            z: self.z.saturating_div(rhs.z),
3✔
811
            w: self.w.saturating_div(rhs.w),
3✔
812
        }
813
    }
814

815
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
816
    ///
817
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
818

819
    #[cfg(feature = "i32")]
820
    #[inline]
821
    #[must_use]
822
    pub const fn checked_add_signed(self, rhs: IVec4) -> Option<Self> {
3✔
823
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
824
            Some(v) => v,
3✔
825
            None => return None,
3✔
826
        };
827
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
828
            Some(v) => v,
3✔
829
            None => return None,
×
830
        };
831
        let z = match self.z.checked_add_signed(rhs.z) {
3✔
832
            Some(v) => v,
3✔
833
            None => return None,
×
834
        };
835
        let w = match self.w.checked_add_signed(rhs.w) {
3✔
836
            Some(v) => v,
3✔
837
            None => return None,
×
838
        };
839

840
        Some(Self { x, y, z, w })
3✔
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

847
    #[cfg(feature = "i32")]
848
    #[inline]
849
    #[must_use]
850
    pub const fn wrapping_add_signed(self, rhs: IVec4) -> Self {
3✔
851
        Self {
852
            x: self.x.wrapping_add_signed(rhs.x),
3✔
853
            y: self.y.wrapping_add_signed(rhs.y),
3✔
854
            z: self.z.wrapping_add_signed(rhs.z),
3✔
855
            w: self.w.wrapping_add_signed(rhs.w),
3✔
856
        }
857
    }
858

859
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
860
    ///
861
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
862

863
    #[cfg(feature = "i32")]
864
    #[inline]
865
    #[must_use]
866
    pub const fn saturating_add_signed(self, rhs: IVec4) -> Self {
3✔
867
        Self {
868
            x: self.x.saturating_add_signed(rhs.x),
3✔
869
            y: self.y.saturating_add_signed(rhs.y),
3✔
870
            z: self.z.saturating_add_signed(rhs.z),
3✔
871
            w: self.w.saturating_add_signed(rhs.w),
3✔
872
        }
873
    }
874
}
875

876
impl Default for UVec4 {
877
    #[inline(always)]
878
    fn default() -> Self {
6✔
879
        Self::ZERO
6✔
880
    }
881
}
882

883
impl Div for UVec4 {
884
    type Output = Self;
885
    #[inline]
886
    fn div(self, rhs: Self) -> Self {
3✔
887
        Self {
888
            x: self.x.div(rhs.x),
3✔
889
            y: self.y.div(rhs.y),
3✔
890
            z: self.z.div(rhs.z),
3✔
891
            w: self.w.div(rhs.w),
3✔
892
        }
893
    }
894
}
895

896
impl Div<&Self> for UVec4 {
897
    type Output = Self;
898
    #[inline]
899
    fn div(self, rhs: &Self) -> Self {
3✔
900
        self.div(*rhs)
3✔
901
    }
902
}
903

904
impl Div<&UVec4> for &UVec4 {
905
    type Output = UVec4;
906
    #[inline]
907
    fn div(self, rhs: &UVec4) -> UVec4 {
3✔
908
        (*self).div(*rhs)
3✔
909
    }
910
}
911

912
impl Div<UVec4> for &UVec4 {
913
    type Output = UVec4;
914
    #[inline]
915
    fn div(self, rhs: UVec4) -> UVec4 {
3✔
916
        (*self).div(rhs)
3✔
917
    }
918
}
919

920
impl DivAssign for UVec4 {
921
    #[inline]
922
    fn div_assign(&mut self, rhs: Self) {
3✔
923
        self.x.div_assign(rhs.x);
3✔
924
        self.y.div_assign(rhs.y);
4✔
925
        self.z.div_assign(rhs.z);
4✔
926
        self.w.div_assign(rhs.w);
4✔
927
    }
928
}
929

930
impl DivAssign<&Self> for UVec4 {
931
    #[inline]
932
    fn div_assign(&mut self, rhs: &Self) {
3✔
933
        self.div_assign(*rhs);
3✔
934
    }
935
}
936

937
impl Div<u32> for UVec4 {
938
    type Output = Self;
939
    #[inline]
940
    fn div(self, rhs: u32) -> Self {
6✔
941
        Self {
942
            x: self.x.div(rhs),
6✔
943
            y: self.y.div(rhs),
6✔
944
            z: self.z.div(rhs),
6✔
945
            w: self.w.div(rhs),
6✔
946
        }
947
    }
948
}
949

950
impl Div<&u32> for UVec4 {
951
    type Output = Self;
952
    #[inline]
953
    fn div(self, rhs: &u32) -> Self {
3✔
954
        self.div(*rhs)
3✔
955
    }
956
}
957

958
impl Div<&u32> for &UVec4 {
959
    type Output = UVec4;
960
    #[inline]
961
    fn div(self, rhs: &u32) -> UVec4 {
3✔
962
        (*self).div(*rhs)
3✔
963
    }
964
}
965

966
impl Div<u32> for &UVec4 {
967
    type Output = UVec4;
968
    #[inline]
969
    fn div(self, rhs: u32) -> UVec4 {
3✔
970
        (*self).div(rhs)
3✔
971
    }
972
}
973

974
impl DivAssign<u32> for UVec4 {
975
    #[inline]
976
    fn div_assign(&mut self, rhs: u32) {
3✔
977
        self.x.div_assign(rhs);
3✔
978
        self.y.div_assign(rhs);
3✔
979
        self.z.div_assign(rhs);
3✔
980
        self.w.div_assign(rhs);
4✔
981
    }
982
}
983

984
impl DivAssign<&u32> for UVec4 {
985
    #[inline]
986
    fn div_assign(&mut self, rhs: &u32) {
3✔
987
        self.div_assign(*rhs);
3✔
988
    }
989
}
990

991
impl Div<UVec4> for u32 {
992
    type Output = UVec4;
993
    #[inline]
994
    fn div(self, rhs: UVec4) -> UVec4 {
3✔
995
        UVec4 {
996
            x: self.div(rhs.x),
3✔
997
            y: self.div(rhs.y),
3✔
998
            z: self.div(rhs.z),
3✔
999
            w: self.div(rhs.w),
3✔
1000
        }
1001
    }
1002
}
1003

1004
impl Div<&UVec4> for u32 {
1005
    type Output = UVec4;
1006
    #[inline]
1007
    fn div(self, rhs: &UVec4) -> UVec4 {
3✔
1008
        self.div(*rhs)
3✔
1009
    }
1010
}
1011

1012
impl Div<&UVec4> for &u32 {
1013
    type Output = UVec4;
1014
    #[inline]
1015
    fn div(self, rhs: &UVec4) -> UVec4 {
3✔
1016
        (*self).div(*rhs)
3✔
1017
    }
1018
}
1019

1020
impl Div<UVec4> for &u32 {
1021
    type Output = UVec4;
1022
    #[inline]
1023
    fn div(self, rhs: UVec4) -> UVec4 {
3✔
1024
        (*self).div(rhs)
3✔
1025
    }
1026
}
1027

1028
impl Mul for UVec4 {
1029
    type Output = Self;
1030
    #[inline]
1031
    fn mul(self, rhs: Self) -> Self {
3✔
1032
        Self {
1033
            x: self.x.mul(rhs.x),
3✔
1034
            y: self.y.mul(rhs.y),
3✔
1035
            z: self.z.mul(rhs.z),
3✔
1036
            w: self.w.mul(rhs.w),
3✔
1037
        }
1038
    }
1039
}
1040

1041
impl Mul<&Self> for UVec4 {
1042
    type Output = Self;
1043
    #[inline]
1044
    fn mul(self, rhs: &Self) -> Self {
3✔
1045
        self.mul(*rhs)
3✔
1046
    }
1047
}
1048

1049
impl Mul<&UVec4> for &UVec4 {
1050
    type Output = UVec4;
1051
    #[inline]
1052
    fn mul(self, rhs: &UVec4) -> UVec4 {
3✔
1053
        (*self).mul(*rhs)
3✔
1054
    }
1055
}
1056

1057
impl Mul<UVec4> for &UVec4 {
1058
    type Output = UVec4;
1059
    #[inline]
1060
    fn mul(self, rhs: UVec4) -> UVec4 {
3✔
1061
        (*self).mul(rhs)
3✔
1062
    }
1063
}
1064

1065
impl MulAssign for UVec4 {
1066
    #[inline]
1067
    fn mul_assign(&mut self, rhs: Self) {
3✔
1068
        self.x.mul_assign(rhs.x);
3✔
1069
        self.y.mul_assign(rhs.y);
4✔
1070
        self.z.mul_assign(rhs.z);
4✔
1071
        self.w.mul_assign(rhs.w);
4✔
1072
    }
1073
}
1074

1075
impl MulAssign<&Self> for UVec4 {
1076
    #[inline]
1077
    fn mul_assign(&mut self, rhs: &Self) {
3✔
1078
        self.mul_assign(*rhs);
3✔
1079
    }
1080
}
1081

1082
impl Mul<u32> for UVec4 {
1083
    type Output = Self;
1084
    #[inline]
1085
    fn mul(self, rhs: u32) -> Self {
3✔
1086
        Self {
1087
            x: self.x.mul(rhs),
3✔
1088
            y: self.y.mul(rhs),
3✔
1089
            z: self.z.mul(rhs),
3✔
1090
            w: self.w.mul(rhs),
3✔
1091
        }
1092
    }
1093
}
1094

1095
impl Mul<&u32> for UVec4 {
1096
    type Output = Self;
1097
    #[inline]
1098
    fn mul(self, rhs: &u32) -> Self {
3✔
1099
        self.mul(*rhs)
3✔
1100
    }
1101
}
1102

1103
impl Mul<&u32> for &UVec4 {
1104
    type Output = UVec4;
1105
    #[inline]
1106
    fn mul(self, rhs: &u32) -> UVec4 {
3✔
1107
        (*self).mul(*rhs)
3✔
1108
    }
1109
}
1110

1111
impl Mul<u32> for &UVec4 {
1112
    type Output = UVec4;
1113
    #[inline]
1114
    fn mul(self, rhs: u32) -> UVec4 {
3✔
1115
        (*self).mul(rhs)
3✔
1116
    }
1117
}
1118

1119
impl MulAssign<u32> for UVec4 {
1120
    #[inline]
1121
    fn mul_assign(&mut self, rhs: u32) {
3✔
1122
        self.x.mul_assign(rhs);
3✔
1123
        self.y.mul_assign(rhs);
3✔
1124
        self.z.mul_assign(rhs);
3✔
1125
        self.w.mul_assign(rhs);
3✔
1126
    }
1127
}
1128

1129
impl MulAssign<&u32> for UVec4 {
1130
    #[inline]
1131
    fn mul_assign(&mut self, rhs: &u32) {
3✔
1132
        self.mul_assign(*rhs);
3✔
1133
    }
1134
}
1135

1136
impl Mul<UVec4> for u32 {
1137
    type Output = UVec4;
1138
    #[inline]
1139
    fn mul(self, rhs: UVec4) -> UVec4 {
3✔
1140
        UVec4 {
1141
            x: self.mul(rhs.x),
3✔
1142
            y: self.mul(rhs.y),
3✔
1143
            z: self.mul(rhs.z),
3✔
1144
            w: self.mul(rhs.w),
3✔
1145
        }
1146
    }
1147
}
1148

1149
impl Mul<&UVec4> for u32 {
1150
    type Output = UVec4;
1151
    #[inline]
1152
    fn mul(self, rhs: &UVec4) -> UVec4 {
3✔
1153
        self.mul(*rhs)
3✔
1154
    }
1155
}
1156

1157
impl Mul<&UVec4> for &u32 {
1158
    type Output = UVec4;
1159
    #[inline]
1160
    fn mul(self, rhs: &UVec4) -> UVec4 {
3✔
1161
        (*self).mul(*rhs)
3✔
1162
    }
1163
}
1164

1165
impl Mul<UVec4> for &u32 {
1166
    type Output = UVec4;
1167
    #[inline]
1168
    fn mul(self, rhs: UVec4) -> UVec4 {
3✔
1169
        (*self).mul(rhs)
3✔
1170
    }
1171
}
1172

1173
impl Add for UVec4 {
1174
    type Output = Self;
1175
    #[inline]
1176
    fn add(self, rhs: Self) -> Self {
3✔
1177
        Self {
1178
            x: self.x.add(rhs.x),
3✔
1179
            y: self.y.add(rhs.y),
3✔
1180
            z: self.z.add(rhs.z),
3✔
1181
            w: self.w.add(rhs.w),
3✔
1182
        }
1183
    }
1184
}
1185

1186
impl Add<&Self> for UVec4 {
1187
    type Output = Self;
1188
    #[inline]
1189
    fn add(self, rhs: &Self) -> Self {
3✔
1190
        self.add(*rhs)
3✔
1191
    }
1192
}
1193

1194
impl Add<&UVec4> for &UVec4 {
1195
    type Output = UVec4;
1196
    #[inline]
1197
    fn add(self, rhs: &UVec4) -> UVec4 {
3✔
1198
        (*self).add(*rhs)
3✔
1199
    }
1200
}
1201

1202
impl Add<UVec4> for &UVec4 {
1203
    type Output = UVec4;
1204
    #[inline]
1205
    fn add(self, rhs: UVec4) -> UVec4 {
3✔
1206
        (*self).add(rhs)
3✔
1207
    }
1208
}
1209

1210
impl AddAssign for UVec4 {
1211
    #[inline]
1212
    fn add_assign(&mut self, rhs: Self) {
3✔
1213
        self.x.add_assign(rhs.x);
3✔
1214
        self.y.add_assign(rhs.y);
4✔
1215
        self.z.add_assign(rhs.z);
4✔
1216
        self.w.add_assign(rhs.w);
4✔
1217
    }
1218
}
1219

1220
impl AddAssign<&Self> for UVec4 {
1221
    #[inline]
1222
    fn add_assign(&mut self, rhs: &Self) {
3✔
1223
        self.add_assign(*rhs);
3✔
1224
    }
1225
}
1226

1227
impl Add<u32> for UVec4 {
1228
    type Output = Self;
1229
    #[inline]
1230
    fn add(self, rhs: u32) -> Self {
3✔
1231
        Self {
1232
            x: self.x.add(rhs),
3✔
1233
            y: self.y.add(rhs),
3✔
1234
            z: self.z.add(rhs),
3✔
1235
            w: self.w.add(rhs),
3✔
1236
        }
1237
    }
1238
}
1239

1240
impl Add<&u32> for UVec4 {
1241
    type Output = Self;
1242
    #[inline]
1243
    fn add(self, rhs: &u32) -> Self {
3✔
1244
        self.add(*rhs)
3✔
1245
    }
1246
}
1247

1248
impl Add<&u32> for &UVec4 {
1249
    type Output = UVec4;
1250
    #[inline]
1251
    fn add(self, rhs: &u32) -> UVec4 {
3✔
1252
        (*self).add(*rhs)
3✔
1253
    }
1254
}
1255

1256
impl Add<u32> for &UVec4 {
1257
    type Output = UVec4;
1258
    #[inline]
1259
    fn add(self, rhs: u32) -> UVec4 {
3✔
1260
        (*self).add(rhs)
3✔
1261
    }
1262
}
1263

1264
impl AddAssign<u32> for UVec4 {
1265
    #[inline]
1266
    fn add_assign(&mut self, rhs: u32) {
3✔
1267
        self.x.add_assign(rhs);
3✔
1268
        self.y.add_assign(rhs);
3✔
1269
        self.z.add_assign(rhs);
3✔
1270
        self.w.add_assign(rhs);
3✔
1271
    }
1272
}
1273

1274
impl AddAssign<&u32> for UVec4 {
1275
    #[inline]
1276
    fn add_assign(&mut self, rhs: &u32) {
3✔
1277
        self.add_assign(*rhs);
3✔
1278
    }
1279
}
1280

1281
impl Add<UVec4> for u32 {
1282
    type Output = UVec4;
1283
    #[inline]
1284
    fn add(self, rhs: UVec4) -> UVec4 {
3✔
1285
        UVec4 {
1286
            x: self.add(rhs.x),
3✔
1287
            y: self.add(rhs.y),
3✔
1288
            z: self.add(rhs.z),
3✔
1289
            w: self.add(rhs.w),
3✔
1290
        }
1291
    }
1292
}
1293

1294
impl Add<&UVec4> for u32 {
1295
    type Output = UVec4;
1296
    #[inline]
1297
    fn add(self, rhs: &UVec4) -> UVec4 {
3✔
1298
        self.add(*rhs)
3✔
1299
    }
1300
}
1301

1302
impl Add<&UVec4> for &u32 {
1303
    type Output = UVec4;
1304
    #[inline]
1305
    fn add(self, rhs: &UVec4) -> UVec4 {
3✔
1306
        (*self).add(*rhs)
3✔
1307
    }
1308
}
1309

1310
impl Add<UVec4> for &u32 {
1311
    type Output = UVec4;
1312
    #[inline]
1313
    fn add(self, rhs: UVec4) -> UVec4 {
3✔
1314
        (*self).add(rhs)
3✔
1315
    }
1316
}
1317

1318
impl Sub for UVec4 {
1319
    type Output = Self;
1320
    #[inline]
1321
    fn sub(self, rhs: Self) -> Self {
3✔
1322
        Self {
1323
            x: self.x.sub(rhs.x),
3✔
1324
            y: self.y.sub(rhs.y),
3✔
1325
            z: self.z.sub(rhs.z),
3✔
1326
            w: self.w.sub(rhs.w),
3✔
1327
        }
1328
    }
1329
}
1330

1331
impl Sub<&Self> for UVec4 {
1332
    type Output = Self;
1333
    #[inline]
1334
    fn sub(self, rhs: &Self) -> Self {
3✔
1335
        self.sub(*rhs)
3✔
1336
    }
1337
}
1338

1339
impl Sub<&UVec4> for &UVec4 {
1340
    type Output = UVec4;
1341
    #[inline]
1342
    fn sub(self, rhs: &UVec4) -> UVec4 {
3✔
1343
        (*self).sub(*rhs)
3✔
1344
    }
1345
}
1346

1347
impl Sub<UVec4> for &UVec4 {
1348
    type Output = UVec4;
1349
    #[inline]
1350
    fn sub(self, rhs: UVec4) -> UVec4 {
3✔
1351
        (*self).sub(rhs)
3✔
1352
    }
1353
}
1354

1355
impl SubAssign for UVec4 {
1356
    #[inline]
1357
    fn sub_assign(&mut self, rhs: Self) {
3✔
1358
        self.x.sub_assign(rhs.x);
3✔
1359
        self.y.sub_assign(rhs.y);
4✔
1360
        self.z.sub_assign(rhs.z);
4✔
1361
        self.w.sub_assign(rhs.w);
4✔
1362
    }
1363
}
1364

1365
impl SubAssign<&Self> for UVec4 {
1366
    #[inline]
1367
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1368
        self.sub_assign(*rhs);
3✔
1369
    }
1370
}
1371

1372
impl Sub<u32> for UVec4 {
1373
    type Output = Self;
1374
    #[inline]
1375
    fn sub(self, rhs: u32) -> Self {
3✔
1376
        Self {
1377
            x: self.x.sub(rhs),
3✔
1378
            y: self.y.sub(rhs),
3✔
1379
            z: self.z.sub(rhs),
3✔
1380
            w: self.w.sub(rhs),
3✔
1381
        }
1382
    }
1383
}
1384

1385
impl Sub<&u32> for UVec4 {
1386
    type Output = Self;
1387
    #[inline]
1388
    fn sub(self, rhs: &u32) -> Self {
3✔
1389
        self.sub(*rhs)
3✔
1390
    }
1391
}
1392

1393
impl Sub<&u32> for &UVec4 {
1394
    type Output = UVec4;
1395
    #[inline]
1396
    fn sub(self, rhs: &u32) -> UVec4 {
3✔
1397
        (*self).sub(*rhs)
3✔
1398
    }
1399
}
1400

1401
impl Sub<u32> for &UVec4 {
1402
    type Output = UVec4;
1403
    #[inline]
1404
    fn sub(self, rhs: u32) -> UVec4 {
3✔
1405
        (*self).sub(rhs)
3✔
1406
    }
1407
}
1408

1409
impl SubAssign<u32> for UVec4 {
1410
    #[inline]
1411
    fn sub_assign(&mut self, rhs: u32) {
3✔
1412
        self.x.sub_assign(rhs);
3✔
1413
        self.y.sub_assign(rhs);
3✔
1414
        self.z.sub_assign(rhs);
3✔
1415
        self.w.sub_assign(rhs);
3✔
1416
    }
1417
}
1418

1419
impl SubAssign<&u32> for UVec4 {
1420
    #[inline]
1421
    fn sub_assign(&mut self, rhs: &u32) {
3✔
1422
        self.sub_assign(*rhs);
3✔
1423
    }
1424
}
1425

1426
impl Sub<UVec4> for u32 {
1427
    type Output = UVec4;
1428
    #[inline]
1429
    fn sub(self, rhs: UVec4) -> UVec4 {
3✔
1430
        UVec4 {
1431
            x: self.sub(rhs.x),
3✔
1432
            y: self.sub(rhs.y),
3✔
1433
            z: self.sub(rhs.z),
3✔
1434
            w: self.sub(rhs.w),
3✔
1435
        }
1436
    }
1437
}
1438

1439
impl Sub<&UVec4> for u32 {
1440
    type Output = UVec4;
1441
    #[inline]
1442
    fn sub(self, rhs: &UVec4) -> UVec4 {
3✔
1443
        self.sub(*rhs)
3✔
1444
    }
1445
}
1446

1447
impl Sub<&UVec4> for &u32 {
1448
    type Output = UVec4;
1449
    #[inline]
1450
    fn sub(self, rhs: &UVec4) -> UVec4 {
3✔
1451
        (*self).sub(*rhs)
3✔
1452
    }
1453
}
1454

1455
impl Sub<UVec4> for &u32 {
1456
    type Output = UVec4;
1457
    #[inline]
1458
    fn sub(self, rhs: UVec4) -> UVec4 {
3✔
1459
        (*self).sub(rhs)
3✔
1460
    }
1461
}
1462

1463
impl Rem for UVec4 {
1464
    type Output = Self;
1465
    #[inline]
1466
    fn rem(self, rhs: Self) -> Self {
3✔
1467
        Self {
1468
            x: self.x.rem(rhs.x),
3✔
1469
            y: self.y.rem(rhs.y),
3✔
1470
            z: self.z.rem(rhs.z),
3✔
1471
            w: self.w.rem(rhs.w),
3✔
1472
        }
1473
    }
1474
}
1475

1476
impl Rem<&Self> for UVec4 {
1477
    type Output = Self;
1478
    #[inline]
1479
    fn rem(self, rhs: &Self) -> Self {
3✔
1480
        self.rem(*rhs)
3✔
1481
    }
1482
}
1483

1484
impl Rem<&UVec4> for &UVec4 {
1485
    type Output = UVec4;
1486
    #[inline]
1487
    fn rem(self, rhs: &UVec4) -> UVec4 {
3✔
1488
        (*self).rem(*rhs)
3✔
1489
    }
1490
}
1491

1492
impl Rem<UVec4> for &UVec4 {
1493
    type Output = UVec4;
1494
    #[inline]
1495
    fn rem(self, rhs: UVec4) -> UVec4 {
3✔
1496
        (*self).rem(rhs)
3✔
1497
    }
1498
}
1499

1500
impl RemAssign for UVec4 {
1501
    #[inline]
1502
    fn rem_assign(&mut self, rhs: Self) {
3✔
1503
        self.x.rem_assign(rhs.x);
3✔
1504
        self.y.rem_assign(rhs.y);
3✔
1505
        self.z.rem_assign(rhs.z);
4✔
1506
        self.w.rem_assign(rhs.w);
4✔
1507
    }
1508
}
1509

1510
impl RemAssign<&Self> for UVec4 {
1511
    #[inline]
1512
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1513
        self.rem_assign(*rhs);
3✔
1514
    }
1515
}
1516

1517
impl Rem<u32> for UVec4 {
1518
    type Output = Self;
1519
    #[inline]
1520
    fn rem(self, rhs: u32) -> Self {
3✔
1521
        Self {
1522
            x: self.x.rem(rhs),
3✔
1523
            y: self.y.rem(rhs),
3✔
1524
            z: self.z.rem(rhs),
3✔
1525
            w: self.w.rem(rhs),
3✔
1526
        }
1527
    }
1528
}
1529

1530
impl Rem<&u32> for UVec4 {
1531
    type Output = Self;
1532
    #[inline]
1533
    fn rem(self, rhs: &u32) -> Self {
3✔
1534
        self.rem(*rhs)
3✔
1535
    }
1536
}
1537

1538
impl Rem<&u32> for &UVec4 {
1539
    type Output = UVec4;
1540
    #[inline]
1541
    fn rem(self, rhs: &u32) -> UVec4 {
3✔
1542
        (*self).rem(*rhs)
3✔
1543
    }
1544
}
1545

1546
impl Rem<u32> for &UVec4 {
1547
    type Output = UVec4;
1548
    #[inline]
1549
    fn rem(self, rhs: u32) -> UVec4 {
3✔
1550
        (*self).rem(rhs)
3✔
1551
    }
1552
}
1553

1554
impl RemAssign<u32> for UVec4 {
1555
    #[inline]
1556
    fn rem_assign(&mut self, rhs: u32) {
3✔
1557
        self.x.rem_assign(rhs);
3✔
1558
        self.y.rem_assign(rhs);
4✔
1559
        self.z.rem_assign(rhs);
4✔
1560
        self.w.rem_assign(rhs);
4✔
1561
    }
1562
}
1563

1564
impl RemAssign<&u32> for UVec4 {
1565
    #[inline]
1566
    fn rem_assign(&mut self, rhs: &u32) {
3✔
1567
        self.rem_assign(*rhs);
3✔
1568
    }
1569
}
1570

1571
impl Rem<UVec4> for u32 {
1572
    type Output = UVec4;
1573
    #[inline]
1574
    fn rem(self, rhs: UVec4) -> UVec4 {
3✔
1575
        UVec4 {
1576
            x: self.rem(rhs.x),
3✔
1577
            y: self.rem(rhs.y),
3✔
1578
            z: self.rem(rhs.z),
3✔
1579
            w: self.rem(rhs.w),
3✔
1580
        }
1581
    }
1582
}
1583

1584
impl Rem<&UVec4> for u32 {
1585
    type Output = UVec4;
1586
    #[inline]
1587
    fn rem(self, rhs: &UVec4) -> UVec4 {
3✔
1588
        self.rem(*rhs)
3✔
1589
    }
1590
}
1591

1592
impl Rem<&UVec4> for &u32 {
1593
    type Output = UVec4;
1594
    #[inline]
1595
    fn rem(self, rhs: &UVec4) -> UVec4 {
3✔
1596
        (*self).rem(*rhs)
3✔
1597
    }
1598
}
1599

1600
impl Rem<UVec4> for &u32 {
1601
    type Output = UVec4;
1602
    #[inline]
1603
    fn rem(self, rhs: UVec4) -> UVec4 {
3✔
1604
        (*self).rem(rhs)
3✔
1605
    }
1606
}
1607

1608
impl AsRef<[u32; 4]> for UVec4 {
1609
    #[inline]
1610
    fn as_ref(&self) -> &[u32; 4] {
3✔
1611
        unsafe { &*(self as *const Self as *const [u32; 4]) }
3✔
1612
    }
1613
}
1614

1615
impl AsMut<[u32; 4]> for UVec4 {
1616
    #[inline]
1617
    fn as_mut(&mut self) -> &mut [u32; 4] {
3✔
1618
        unsafe { &mut *(self as *mut Self as *mut [u32; 4]) }
3✔
1619
    }
1620
}
1621

1622
impl Sum for UVec4 {
1623
    #[inline]
1624
    fn sum<I>(iter: I) -> Self
3✔
1625
    where
1626
        I: Iterator<Item = Self>,
1627
    {
1628
        iter.fold(Self::ZERO, Self::add)
3✔
1629
    }
1630
}
1631

1632
impl<'a> Sum<&'a Self> for UVec4 {
1633
    #[inline]
1634
    fn sum<I>(iter: I) -> Self
3✔
1635
    where
1636
        I: Iterator<Item = &'a Self>,
1637
    {
1638
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1639
    }
1640
}
1641

1642
impl Product for UVec4 {
1643
    #[inline]
1644
    fn product<I>(iter: I) -> Self
3✔
1645
    where
1646
        I: Iterator<Item = Self>,
1647
    {
1648
        iter.fold(Self::ONE, Self::mul)
3✔
1649
    }
1650
}
1651

1652
impl<'a> Product<&'a Self> for UVec4 {
1653
    #[inline]
1654
    fn product<I>(iter: I) -> Self
3✔
1655
    where
1656
        I: Iterator<Item = &'a Self>,
1657
    {
1658
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1659
    }
1660
}
1661

1662
impl Not for UVec4 {
1663
    type Output = Self;
1664
    #[inline]
1665
    fn not(self) -> Self {
3✔
1666
        Self {
1667
            x: self.x.not(),
3✔
1668
            y: self.y.not(),
3✔
1669
            z: self.z.not(),
3✔
1670
            w: self.w.not(),
3✔
1671
        }
1672
    }
1673
}
1674

1675
impl Not for &UVec4 {
1676
    type Output = UVec4;
1677
    #[inline]
1678
    fn not(self) -> UVec4 {
3✔
1679
        (*self).not()
3✔
1680
    }
1681
}
1682

1683
impl BitAnd for UVec4 {
1684
    type Output = Self;
1685
    #[inline]
1686
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1687
        Self {
1688
            x: self.x.bitand(rhs.x),
3✔
1689
            y: self.y.bitand(rhs.y),
3✔
1690
            z: self.z.bitand(rhs.z),
3✔
1691
            w: self.w.bitand(rhs.w),
3✔
1692
        }
1693
    }
1694
}
1695

1696
impl BitAnd<&Self> for UVec4 {
1697
    type Output = Self;
1698
    #[inline]
1699
    fn bitand(self, rhs: &Self) -> Self {
3✔
1700
        self.bitand(*rhs)
3✔
1701
    }
1702
}
1703

1704
impl BitAnd<&UVec4> for &UVec4 {
1705
    type Output = UVec4;
1706
    #[inline]
1707
    fn bitand(self, rhs: &UVec4) -> UVec4 {
3✔
1708
        (*self).bitand(*rhs)
3✔
1709
    }
1710
}
1711

1712
impl BitAnd<UVec4> for &UVec4 {
1713
    type Output = UVec4;
1714
    #[inline]
1715
    fn bitand(self, rhs: UVec4) -> UVec4 {
3✔
1716
        (*self).bitand(rhs)
3✔
1717
    }
1718
}
1719

1720
impl BitAndAssign for UVec4 {
1721
    #[inline]
1722
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1723
        *self = self.bitand(rhs);
3✔
1724
    }
1725
}
1726

1727
impl BitAndAssign<&Self> for UVec4 {
1728
    #[inline]
1729
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1730
        self.bitand_assign(*rhs);
3✔
1731
    }
1732
}
1733

1734
impl BitOr for UVec4 {
1735
    type Output = Self;
1736
    #[inline]
1737
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1738
        Self {
1739
            x: self.x.bitor(rhs.x),
3✔
1740
            y: self.y.bitor(rhs.y),
3✔
1741
            z: self.z.bitor(rhs.z),
3✔
1742
            w: self.w.bitor(rhs.w),
3✔
1743
        }
1744
    }
1745
}
1746

1747
impl BitOr<&Self> for UVec4 {
1748
    type Output = Self;
1749
    #[inline]
1750
    fn bitor(self, rhs: &Self) -> Self {
3✔
1751
        self.bitor(*rhs)
3✔
1752
    }
1753
}
1754

1755
impl BitOr<&UVec4> for &UVec4 {
1756
    type Output = UVec4;
1757
    #[inline]
1758
    fn bitor(self, rhs: &UVec4) -> UVec4 {
3✔
1759
        (*self).bitor(*rhs)
3✔
1760
    }
1761
}
1762

1763
impl BitOr<UVec4> for &UVec4 {
1764
    type Output = UVec4;
1765
    #[inline]
1766
    fn bitor(self, rhs: UVec4) -> UVec4 {
3✔
1767
        (*self).bitor(rhs)
3✔
1768
    }
1769
}
1770

1771
impl BitOrAssign for UVec4 {
1772
    #[inline]
1773
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1774
        *self = self.bitor(rhs);
3✔
1775
    }
1776
}
1777

1778
impl BitOrAssign<&Self> for UVec4 {
1779
    #[inline]
1780
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1781
        self.bitor_assign(*rhs);
3✔
1782
    }
1783
}
1784

1785
impl BitXor for UVec4 {
1786
    type Output = Self;
1787
    #[inline]
1788
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1789
        Self {
1790
            x: self.x.bitxor(rhs.x),
3✔
1791
            y: self.y.bitxor(rhs.y),
3✔
1792
            z: self.z.bitxor(rhs.z),
3✔
1793
            w: self.w.bitxor(rhs.w),
3✔
1794
        }
1795
    }
1796
}
1797

1798
impl BitXor<&Self> for UVec4 {
1799
    type Output = Self;
1800
    #[inline]
1801
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1802
        self.bitxor(*rhs)
3✔
1803
    }
1804
}
1805

1806
impl BitXor<&UVec4> for &UVec4 {
1807
    type Output = UVec4;
1808
    #[inline]
1809
    fn bitxor(self, rhs: &UVec4) -> UVec4 {
3✔
1810
        (*self).bitxor(*rhs)
3✔
1811
    }
1812
}
1813

1814
impl BitXor<UVec4> for &UVec4 {
1815
    type Output = UVec4;
1816
    #[inline]
1817
    fn bitxor(self, rhs: UVec4) -> UVec4 {
3✔
1818
        (*self).bitxor(rhs)
3✔
1819
    }
1820
}
1821

1822
impl BitXorAssign for UVec4 {
1823
    #[inline]
1824
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1825
        *self = self.bitxor(rhs);
3✔
1826
    }
1827
}
1828

1829
impl BitXorAssign<&Self> for UVec4 {
1830
    #[inline]
1831
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1832
        self.bitxor_assign(*rhs);
3✔
1833
    }
1834
}
1835

1836
impl BitAnd<u32> for UVec4 {
1837
    type Output = Self;
1838
    #[inline]
1839
    fn bitand(self, rhs: u32) -> Self::Output {
3✔
1840
        Self {
1841
            x: self.x.bitand(rhs),
3✔
1842
            y: self.y.bitand(rhs),
3✔
1843
            z: self.z.bitand(rhs),
3✔
1844
            w: self.w.bitand(rhs),
3✔
1845
        }
1846
    }
1847
}
1848

1849
impl BitAnd<&u32> for UVec4 {
1850
    type Output = Self;
1851
    #[inline]
1852
    fn bitand(self, rhs: &u32) -> Self {
3✔
1853
        self.bitand(*rhs)
3✔
1854
    }
1855
}
1856

1857
impl BitAnd<&u32> for &UVec4 {
1858
    type Output = UVec4;
1859
    #[inline]
1860
    fn bitand(self, rhs: &u32) -> UVec4 {
3✔
1861
        (*self).bitand(*rhs)
3✔
1862
    }
1863
}
1864

1865
impl BitAnd<u32> for &UVec4 {
1866
    type Output = UVec4;
1867
    #[inline]
1868
    fn bitand(self, rhs: u32) -> UVec4 {
3✔
1869
        (*self).bitand(rhs)
3✔
1870
    }
1871
}
1872

1873
impl BitAndAssign<u32> for UVec4 {
1874
    #[inline]
1875
    fn bitand_assign(&mut self, rhs: u32) {
3✔
1876
        *self = self.bitand(rhs);
3✔
1877
    }
1878
}
1879

1880
impl BitAndAssign<&u32> for UVec4 {
1881
    #[inline]
1882
    fn bitand_assign(&mut self, rhs: &u32) {
3✔
1883
        self.bitand_assign(*rhs);
3✔
1884
    }
1885
}
1886

1887
impl BitOr<u32> for UVec4 {
1888
    type Output = Self;
1889
    #[inline]
1890
    fn bitor(self, rhs: u32) -> Self::Output {
3✔
1891
        Self {
1892
            x: self.x.bitor(rhs),
3✔
1893
            y: self.y.bitor(rhs),
3✔
1894
            z: self.z.bitor(rhs),
3✔
1895
            w: self.w.bitor(rhs),
3✔
1896
        }
1897
    }
1898
}
1899

1900
impl BitOr<&u32> for UVec4 {
1901
    type Output = Self;
1902
    #[inline]
1903
    fn bitor(self, rhs: &u32) -> Self {
3✔
1904
        self.bitor(*rhs)
3✔
1905
    }
1906
}
1907

1908
impl BitOr<&u32> for &UVec4 {
1909
    type Output = UVec4;
1910
    #[inline]
1911
    fn bitor(self, rhs: &u32) -> UVec4 {
3✔
1912
        (*self).bitor(*rhs)
3✔
1913
    }
1914
}
1915

1916
impl BitOr<u32> for &UVec4 {
1917
    type Output = UVec4;
1918
    #[inline]
1919
    fn bitor(self, rhs: u32) -> UVec4 {
3✔
1920
        (*self).bitor(rhs)
3✔
1921
    }
1922
}
1923

1924
impl BitOrAssign<u32> for UVec4 {
1925
    #[inline]
1926
    fn bitor_assign(&mut self, rhs: u32) {
3✔
1927
        *self = self.bitor(rhs);
3✔
1928
    }
1929
}
1930

1931
impl BitOrAssign<&u32> for UVec4 {
1932
    #[inline]
1933
    fn bitor_assign(&mut self, rhs: &u32) {
3✔
1934
        self.bitor_assign(*rhs);
3✔
1935
    }
1936
}
1937

1938
impl BitXor<u32> for UVec4 {
1939
    type Output = Self;
1940
    #[inline]
1941
    fn bitxor(self, rhs: u32) -> Self::Output {
3✔
1942
        Self {
1943
            x: self.x.bitxor(rhs),
3✔
1944
            y: self.y.bitxor(rhs),
3✔
1945
            z: self.z.bitxor(rhs),
3✔
1946
            w: self.w.bitxor(rhs),
3✔
1947
        }
1948
    }
1949
}
1950

1951
impl BitXor<&u32> for UVec4 {
1952
    type Output = Self;
1953
    #[inline]
1954
    fn bitxor(self, rhs: &u32) -> Self {
3✔
1955
        self.bitxor(*rhs)
3✔
1956
    }
1957
}
1958

1959
impl BitXor<&u32> for &UVec4 {
1960
    type Output = UVec4;
1961
    #[inline]
1962
    fn bitxor(self, rhs: &u32) -> UVec4 {
3✔
1963
        (*self).bitxor(*rhs)
3✔
1964
    }
1965
}
1966

1967
impl BitXor<u32> for &UVec4 {
1968
    type Output = UVec4;
1969
    #[inline]
1970
    fn bitxor(self, rhs: u32) -> UVec4 {
3✔
1971
        (*self).bitxor(rhs)
3✔
1972
    }
1973
}
1974

1975
impl BitXorAssign<u32> for UVec4 {
1976
    #[inline]
1977
    fn bitxor_assign(&mut self, rhs: u32) {
3✔
1978
        *self = self.bitxor(rhs);
3✔
1979
    }
1980
}
1981

1982
impl BitXorAssign<&u32> for UVec4 {
1983
    #[inline]
1984
    fn bitxor_assign(&mut self, rhs: &u32) {
3✔
1985
        self.bitxor_assign(*rhs);
3✔
1986
    }
1987
}
1988

1989
impl Shl<i8> for UVec4 {
1990
    type Output = Self;
1991
    #[inline]
1992
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1993
        Self {
1994
            x: self.x.shl(rhs),
3✔
1995
            y: self.y.shl(rhs),
3✔
1996
            z: self.z.shl(rhs),
3✔
1997
            w: self.w.shl(rhs),
3✔
1998
        }
1999
    }
2000
}
2001

2002
impl Shl<&i8> for UVec4 {
2003
    type Output = Self;
2004
    #[inline]
2005
    fn shl(self, rhs: &i8) -> Self {
3✔
2006
        self.shl(*rhs)
3✔
2007
    }
2008
}
2009

2010
impl Shl<&i8> for &UVec4 {
2011
    type Output = UVec4;
2012
    #[inline]
2013
    fn shl(self, rhs: &i8) -> UVec4 {
3✔
2014
        (*self).shl(*rhs)
3✔
2015
    }
2016
}
2017

2018
impl Shl<i8> for &UVec4 {
2019
    type Output = UVec4;
2020
    #[inline]
2021
    fn shl(self, rhs: i8) -> UVec4 {
3✔
2022
        (*self).shl(rhs)
3✔
2023
    }
2024
}
2025

2026
impl ShlAssign<i8> for UVec4 {
2027
    #[inline]
2028
    fn shl_assign(&mut self, rhs: i8) {
3✔
2029
        *self = self.shl(rhs);
3✔
2030
    }
2031
}
2032

2033
impl ShlAssign<&i8> for UVec4 {
2034
    #[inline]
2035
    fn shl_assign(&mut self, rhs: &i8) {
3✔
2036
        self.shl_assign(*rhs);
3✔
2037
    }
2038
}
2039

2040
impl Shr<i8> for UVec4 {
2041
    type Output = Self;
2042
    #[inline]
2043
    fn shr(self, rhs: i8) -> Self::Output {
3✔
2044
        Self {
2045
            x: self.x.shr(rhs),
3✔
2046
            y: self.y.shr(rhs),
3✔
2047
            z: self.z.shr(rhs),
3✔
2048
            w: self.w.shr(rhs),
3✔
2049
        }
2050
    }
2051
}
2052

2053
impl Shr<&i8> for UVec4 {
2054
    type Output = Self;
2055
    #[inline]
2056
    fn shr(self, rhs: &i8) -> Self {
3✔
2057
        self.shr(*rhs)
3✔
2058
    }
2059
}
2060

2061
impl Shr<&i8> for &UVec4 {
2062
    type Output = UVec4;
2063
    #[inline]
2064
    fn shr(self, rhs: &i8) -> UVec4 {
3✔
2065
        (*self).shr(*rhs)
3✔
2066
    }
2067
}
2068

2069
impl Shr<i8> for &UVec4 {
2070
    type Output = UVec4;
2071
    #[inline]
2072
    fn shr(self, rhs: i8) -> UVec4 {
3✔
2073
        (*self).shr(rhs)
3✔
2074
    }
2075
}
2076

2077
impl ShrAssign<i8> for UVec4 {
2078
    #[inline]
2079
    fn shr_assign(&mut self, rhs: i8) {
3✔
2080
        *self = self.shr(rhs);
3✔
2081
    }
2082
}
2083

2084
impl ShrAssign<&i8> for UVec4 {
2085
    #[inline]
2086
    fn shr_assign(&mut self, rhs: &i8) {
3✔
2087
        self.shr_assign(*rhs);
3✔
2088
    }
2089
}
2090

2091
impl Shl<i16> for UVec4 {
2092
    type Output = Self;
2093
    #[inline]
2094
    fn shl(self, rhs: i16) -> Self::Output {
3✔
2095
        Self {
2096
            x: self.x.shl(rhs),
3✔
2097
            y: self.y.shl(rhs),
3✔
2098
            z: self.z.shl(rhs),
3✔
2099
            w: self.w.shl(rhs),
3✔
2100
        }
2101
    }
2102
}
2103

2104
impl Shl<&i16> for UVec4 {
2105
    type Output = Self;
2106
    #[inline]
2107
    fn shl(self, rhs: &i16) -> Self {
3✔
2108
        self.shl(*rhs)
3✔
2109
    }
2110
}
2111

2112
impl Shl<&i16> for &UVec4 {
2113
    type Output = UVec4;
2114
    #[inline]
2115
    fn shl(self, rhs: &i16) -> UVec4 {
3✔
2116
        (*self).shl(*rhs)
3✔
2117
    }
2118
}
2119

2120
impl Shl<i16> for &UVec4 {
2121
    type Output = UVec4;
2122
    #[inline]
2123
    fn shl(self, rhs: i16) -> UVec4 {
3✔
2124
        (*self).shl(rhs)
3✔
2125
    }
2126
}
2127

2128
impl ShlAssign<i16> for UVec4 {
2129
    #[inline]
2130
    fn shl_assign(&mut self, rhs: i16) {
3✔
2131
        *self = self.shl(rhs);
3✔
2132
    }
2133
}
2134

2135
impl ShlAssign<&i16> for UVec4 {
2136
    #[inline]
2137
    fn shl_assign(&mut self, rhs: &i16) {
3✔
2138
        self.shl_assign(*rhs);
3✔
2139
    }
2140
}
2141

2142
impl Shr<i16> for UVec4 {
2143
    type Output = Self;
2144
    #[inline]
2145
    fn shr(self, rhs: i16) -> Self::Output {
3✔
2146
        Self {
2147
            x: self.x.shr(rhs),
3✔
2148
            y: self.y.shr(rhs),
3✔
2149
            z: self.z.shr(rhs),
3✔
2150
            w: self.w.shr(rhs),
3✔
2151
        }
2152
    }
2153
}
2154

2155
impl Shr<&i16> for UVec4 {
2156
    type Output = Self;
2157
    #[inline]
2158
    fn shr(self, rhs: &i16) -> Self {
3✔
2159
        self.shr(*rhs)
3✔
2160
    }
2161
}
2162

2163
impl Shr<&i16> for &UVec4 {
2164
    type Output = UVec4;
2165
    #[inline]
2166
    fn shr(self, rhs: &i16) -> UVec4 {
3✔
2167
        (*self).shr(*rhs)
3✔
2168
    }
2169
}
2170

2171
impl Shr<i16> for &UVec4 {
2172
    type Output = UVec4;
2173
    #[inline]
2174
    fn shr(self, rhs: i16) -> UVec4 {
3✔
2175
        (*self).shr(rhs)
3✔
2176
    }
2177
}
2178

2179
impl ShrAssign<i16> for UVec4 {
2180
    #[inline]
2181
    fn shr_assign(&mut self, rhs: i16) {
3✔
2182
        *self = self.shr(rhs);
3✔
2183
    }
2184
}
2185

2186
impl ShrAssign<&i16> for UVec4 {
2187
    #[inline]
2188
    fn shr_assign(&mut self, rhs: &i16) {
3✔
2189
        self.shr_assign(*rhs);
3✔
2190
    }
2191
}
2192

2193
impl Shl<i32> for UVec4 {
2194
    type Output = Self;
2195
    #[inline]
2196
    fn shl(self, rhs: i32) -> Self::Output {
3✔
2197
        Self {
2198
            x: self.x.shl(rhs),
3✔
2199
            y: self.y.shl(rhs),
3✔
2200
            z: self.z.shl(rhs),
3✔
2201
            w: self.w.shl(rhs),
3✔
2202
        }
2203
    }
2204
}
2205

2206
impl Shl<&i32> for UVec4 {
2207
    type Output = Self;
2208
    #[inline]
2209
    fn shl(self, rhs: &i32) -> Self {
3✔
2210
        self.shl(*rhs)
3✔
2211
    }
2212
}
2213

2214
impl Shl<&i32> for &UVec4 {
2215
    type Output = UVec4;
2216
    #[inline]
2217
    fn shl(self, rhs: &i32) -> UVec4 {
3✔
2218
        (*self).shl(*rhs)
3✔
2219
    }
2220
}
2221

2222
impl Shl<i32> for &UVec4 {
2223
    type Output = UVec4;
2224
    #[inline]
2225
    fn shl(self, rhs: i32) -> UVec4 {
3✔
2226
        (*self).shl(rhs)
3✔
2227
    }
2228
}
2229

2230
impl ShlAssign<i32> for UVec4 {
2231
    #[inline]
2232
    fn shl_assign(&mut self, rhs: i32) {
3✔
2233
        *self = self.shl(rhs);
3✔
2234
    }
2235
}
2236

2237
impl ShlAssign<&i32> for UVec4 {
2238
    #[inline]
2239
    fn shl_assign(&mut self, rhs: &i32) {
3✔
2240
        self.shl_assign(*rhs);
3✔
2241
    }
2242
}
2243

2244
impl Shr<i32> for UVec4 {
2245
    type Output = Self;
2246
    #[inline]
2247
    fn shr(self, rhs: i32) -> Self::Output {
3✔
2248
        Self {
2249
            x: self.x.shr(rhs),
3✔
2250
            y: self.y.shr(rhs),
3✔
2251
            z: self.z.shr(rhs),
3✔
2252
            w: self.w.shr(rhs),
3✔
2253
        }
2254
    }
2255
}
2256

2257
impl Shr<&i32> for UVec4 {
2258
    type Output = Self;
2259
    #[inline]
2260
    fn shr(self, rhs: &i32) -> Self {
3✔
2261
        self.shr(*rhs)
3✔
2262
    }
2263
}
2264

2265
impl Shr<&i32> for &UVec4 {
2266
    type Output = UVec4;
2267
    #[inline]
2268
    fn shr(self, rhs: &i32) -> UVec4 {
3✔
2269
        (*self).shr(*rhs)
3✔
2270
    }
2271
}
2272

2273
impl Shr<i32> for &UVec4 {
2274
    type Output = UVec4;
2275
    #[inline]
2276
    fn shr(self, rhs: i32) -> UVec4 {
3✔
2277
        (*self).shr(rhs)
3✔
2278
    }
2279
}
2280

2281
impl ShrAssign<i32> for UVec4 {
2282
    #[inline]
2283
    fn shr_assign(&mut self, rhs: i32) {
3✔
2284
        *self = self.shr(rhs);
3✔
2285
    }
2286
}
2287

2288
impl ShrAssign<&i32> for UVec4 {
2289
    #[inline]
2290
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2291
        self.shr_assign(*rhs);
3✔
2292
    }
2293
}
2294

2295
impl Shl<i64> for UVec4 {
2296
    type Output = Self;
2297
    #[inline]
2298
    fn shl(self, rhs: i64) -> Self::Output {
3✔
2299
        Self {
2300
            x: self.x.shl(rhs),
3✔
2301
            y: self.y.shl(rhs),
3✔
2302
            z: self.z.shl(rhs),
3✔
2303
            w: self.w.shl(rhs),
3✔
2304
        }
2305
    }
2306
}
2307

2308
impl Shl<&i64> for UVec4 {
2309
    type Output = Self;
2310
    #[inline]
2311
    fn shl(self, rhs: &i64) -> Self {
3✔
2312
        self.shl(*rhs)
3✔
2313
    }
2314
}
2315

2316
impl Shl<&i64> for &UVec4 {
2317
    type Output = UVec4;
2318
    #[inline]
2319
    fn shl(self, rhs: &i64) -> UVec4 {
3✔
2320
        (*self).shl(*rhs)
3✔
2321
    }
2322
}
2323

2324
impl Shl<i64> for &UVec4 {
2325
    type Output = UVec4;
2326
    #[inline]
2327
    fn shl(self, rhs: i64) -> UVec4 {
3✔
2328
        (*self).shl(rhs)
3✔
2329
    }
2330
}
2331

2332
impl ShlAssign<i64> for UVec4 {
2333
    #[inline]
2334
    fn shl_assign(&mut self, rhs: i64) {
3✔
2335
        *self = self.shl(rhs);
3✔
2336
    }
2337
}
2338

2339
impl ShlAssign<&i64> for UVec4 {
2340
    #[inline]
2341
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2342
        self.shl_assign(*rhs);
3✔
2343
    }
2344
}
2345

2346
impl Shr<i64> for UVec4 {
2347
    type Output = Self;
2348
    #[inline]
2349
    fn shr(self, rhs: i64) -> Self::Output {
3✔
2350
        Self {
2351
            x: self.x.shr(rhs),
3✔
2352
            y: self.y.shr(rhs),
3✔
2353
            z: self.z.shr(rhs),
3✔
2354
            w: self.w.shr(rhs),
3✔
2355
        }
2356
    }
2357
}
2358

2359
impl Shr<&i64> for UVec4 {
2360
    type Output = Self;
2361
    #[inline]
2362
    fn shr(self, rhs: &i64) -> Self {
3✔
2363
        self.shr(*rhs)
3✔
2364
    }
2365
}
2366

2367
impl Shr<&i64> for &UVec4 {
2368
    type Output = UVec4;
2369
    #[inline]
2370
    fn shr(self, rhs: &i64) -> UVec4 {
3✔
2371
        (*self).shr(*rhs)
3✔
2372
    }
2373
}
2374

2375
impl Shr<i64> for &UVec4 {
2376
    type Output = UVec4;
2377
    #[inline]
2378
    fn shr(self, rhs: i64) -> UVec4 {
3✔
2379
        (*self).shr(rhs)
3✔
2380
    }
2381
}
2382

2383
impl ShrAssign<i64> for UVec4 {
2384
    #[inline]
2385
    fn shr_assign(&mut self, rhs: i64) {
3✔
2386
        *self = self.shr(rhs);
3✔
2387
    }
2388
}
2389

2390
impl ShrAssign<&i64> for UVec4 {
2391
    #[inline]
2392
    fn shr_assign(&mut self, rhs: &i64) {
3✔
2393
        self.shr_assign(*rhs);
3✔
2394
    }
2395
}
2396

2397
impl Shl<u8> for UVec4 {
2398
    type Output = Self;
2399
    #[inline]
2400
    fn shl(self, rhs: u8) -> Self::Output {
3✔
2401
        Self {
2402
            x: self.x.shl(rhs),
3✔
2403
            y: self.y.shl(rhs),
3✔
2404
            z: self.z.shl(rhs),
3✔
2405
            w: self.w.shl(rhs),
3✔
2406
        }
2407
    }
2408
}
2409

2410
impl Shl<&u8> for UVec4 {
2411
    type Output = Self;
2412
    #[inline]
2413
    fn shl(self, rhs: &u8) -> Self {
3✔
2414
        self.shl(*rhs)
3✔
2415
    }
2416
}
2417

2418
impl Shl<&u8> for &UVec4 {
2419
    type Output = UVec4;
2420
    #[inline]
2421
    fn shl(self, rhs: &u8) -> UVec4 {
3✔
2422
        (*self).shl(*rhs)
3✔
2423
    }
2424
}
2425

2426
impl Shl<u8> for &UVec4 {
2427
    type Output = UVec4;
2428
    #[inline]
2429
    fn shl(self, rhs: u8) -> UVec4 {
3✔
2430
        (*self).shl(rhs)
3✔
2431
    }
2432
}
2433

2434
impl ShlAssign<u8> for UVec4 {
2435
    #[inline]
2436
    fn shl_assign(&mut self, rhs: u8) {
3✔
2437
        *self = self.shl(rhs);
3✔
2438
    }
2439
}
2440

2441
impl ShlAssign<&u8> for UVec4 {
2442
    #[inline]
2443
    fn shl_assign(&mut self, rhs: &u8) {
3✔
2444
        self.shl_assign(*rhs);
3✔
2445
    }
2446
}
2447

2448
impl Shr<u8> for UVec4 {
2449
    type Output = Self;
2450
    #[inline]
2451
    fn shr(self, rhs: u8) -> Self::Output {
3✔
2452
        Self {
2453
            x: self.x.shr(rhs),
3✔
2454
            y: self.y.shr(rhs),
3✔
2455
            z: self.z.shr(rhs),
3✔
2456
            w: self.w.shr(rhs),
3✔
2457
        }
2458
    }
2459
}
2460

2461
impl Shr<&u8> for UVec4 {
2462
    type Output = Self;
2463
    #[inline]
2464
    fn shr(self, rhs: &u8) -> Self {
3✔
2465
        self.shr(*rhs)
3✔
2466
    }
2467
}
2468

2469
impl Shr<&u8> for &UVec4 {
2470
    type Output = UVec4;
2471
    #[inline]
2472
    fn shr(self, rhs: &u8) -> UVec4 {
3✔
2473
        (*self).shr(*rhs)
3✔
2474
    }
2475
}
2476

2477
impl Shr<u8> for &UVec4 {
2478
    type Output = UVec4;
2479
    #[inline]
2480
    fn shr(self, rhs: u8) -> UVec4 {
3✔
2481
        (*self).shr(rhs)
3✔
2482
    }
2483
}
2484

2485
impl ShrAssign<u8> for UVec4 {
2486
    #[inline]
2487
    fn shr_assign(&mut self, rhs: u8) {
3✔
2488
        *self = self.shr(rhs);
3✔
2489
    }
2490
}
2491

2492
impl ShrAssign<&u8> for UVec4 {
2493
    #[inline]
2494
    fn shr_assign(&mut self, rhs: &u8) {
3✔
2495
        self.shr_assign(*rhs);
3✔
2496
    }
2497
}
2498

2499
impl Shl<u16> for UVec4 {
2500
    type Output = Self;
2501
    #[inline]
2502
    fn shl(self, rhs: u16) -> Self::Output {
3✔
2503
        Self {
2504
            x: self.x.shl(rhs),
3✔
2505
            y: self.y.shl(rhs),
3✔
2506
            z: self.z.shl(rhs),
3✔
2507
            w: self.w.shl(rhs),
3✔
2508
        }
2509
    }
2510
}
2511

2512
impl Shl<&u16> for UVec4 {
2513
    type Output = Self;
2514
    #[inline]
2515
    fn shl(self, rhs: &u16) -> Self {
3✔
2516
        self.shl(*rhs)
3✔
2517
    }
2518
}
2519

2520
impl Shl<&u16> for &UVec4 {
2521
    type Output = UVec4;
2522
    #[inline]
2523
    fn shl(self, rhs: &u16) -> UVec4 {
3✔
2524
        (*self).shl(*rhs)
3✔
2525
    }
2526
}
2527

2528
impl Shl<u16> for &UVec4 {
2529
    type Output = UVec4;
2530
    #[inline]
2531
    fn shl(self, rhs: u16) -> UVec4 {
3✔
2532
        (*self).shl(rhs)
3✔
2533
    }
2534
}
2535

2536
impl ShlAssign<u16> for UVec4 {
2537
    #[inline]
2538
    fn shl_assign(&mut self, rhs: u16) {
3✔
2539
        *self = self.shl(rhs);
3✔
2540
    }
2541
}
2542

2543
impl ShlAssign<&u16> for UVec4 {
2544
    #[inline]
2545
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2546
        self.shl_assign(*rhs);
3✔
2547
    }
2548
}
2549

2550
impl Shr<u16> for UVec4 {
2551
    type Output = Self;
2552
    #[inline]
2553
    fn shr(self, rhs: u16) -> Self::Output {
3✔
2554
        Self {
2555
            x: self.x.shr(rhs),
3✔
2556
            y: self.y.shr(rhs),
3✔
2557
            z: self.z.shr(rhs),
3✔
2558
            w: self.w.shr(rhs),
3✔
2559
        }
2560
    }
2561
}
2562

2563
impl Shr<&u16> for UVec4 {
2564
    type Output = Self;
2565
    #[inline]
2566
    fn shr(self, rhs: &u16) -> Self {
3✔
2567
        self.shr(*rhs)
3✔
2568
    }
2569
}
2570

2571
impl Shr<&u16> for &UVec4 {
2572
    type Output = UVec4;
2573
    #[inline]
2574
    fn shr(self, rhs: &u16) -> UVec4 {
3✔
2575
        (*self).shr(*rhs)
3✔
2576
    }
2577
}
2578

2579
impl Shr<u16> for &UVec4 {
2580
    type Output = UVec4;
2581
    #[inline]
2582
    fn shr(self, rhs: u16) -> UVec4 {
3✔
2583
        (*self).shr(rhs)
3✔
2584
    }
2585
}
2586

2587
impl ShrAssign<u16> for UVec4 {
2588
    #[inline]
2589
    fn shr_assign(&mut self, rhs: u16) {
3✔
2590
        *self = self.shr(rhs);
3✔
2591
    }
2592
}
2593

2594
impl ShrAssign<&u16> for UVec4 {
2595
    #[inline]
2596
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2597
        self.shr_assign(*rhs);
3✔
2598
    }
2599
}
2600

2601
impl Shl<u32> for UVec4 {
2602
    type Output = Self;
2603
    #[inline]
2604
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2605
        Self {
2606
            x: self.x.shl(rhs),
3✔
2607
            y: self.y.shl(rhs),
3✔
2608
            z: self.z.shl(rhs),
3✔
2609
            w: self.w.shl(rhs),
3✔
2610
        }
2611
    }
2612
}
2613

2614
impl Shl<&u32> for UVec4 {
2615
    type Output = Self;
2616
    #[inline]
2617
    fn shl(self, rhs: &u32) -> Self {
3✔
2618
        self.shl(*rhs)
3✔
2619
    }
2620
}
2621

2622
impl Shl<&u32> for &UVec4 {
2623
    type Output = UVec4;
2624
    #[inline]
2625
    fn shl(self, rhs: &u32) -> UVec4 {
3✔
2626
        (*self).shl(*rhs)
3✔
2627
    }
2628
}
2629

2630
impl Shl<u32> for &UVec4 {
2631
    type Output = UVec4;
2632
    #[inline]
2633
    fn shl(self, rhs: u32) -> UVec4 {
3✔
2634
        (*self).shl(rhs)
3✔
2635
    }
2636
}
2637

2638
impl ShlAssign<u32> for UVec4 {
2639
    #[inline]
2640
    fn shl_assign(&mut self, rhs: u32) {
3✔
2641
        *self = self.shl(rhs);
3✔
2642
    }
2643
}
2644

2645
impl ShlAssign<&u32> for UVec4 {
2646
    #[inline]
2647
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2648
        self.shl_assign(*rhs);
3✔
2649
    }
2650
}
2651

2652
impl Shr<u32> for UVec4 {
2653
    type Output = Self;
2654
    #[inline]
2655
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2656
        Self {
2657
            x: self.x.shr(rhs),
3✔
2658
            y: self.y.shr(rhs),
3✔
2659
            z: self.z.shr(rhs),
3✔
2660
            w: self.w.shr(rhs),
3✔
2661
        }
2662
    }
2663
}
2664

2665
impl Shr<&u32> for UVec4 {
2666
    type Output = Self;
2667
    #[inline]
2668
    fn shr(self, rhs: &u32) -> Self {
3✔
2669
        self.shr(*rhs)
3✔
2670
    }
2671
}
2672

2673
impl Shr<&u32> for &UVec4 {
2674
    type Output = UVec4;
2675
    #[inline]
2676
    fn shr(self, rhs: &u32) -> UVec4 {
3✔
2677
        (*self).shr(*rhs)
3✔
2678
    }
2679
}
2680

2681
impl Shr<u32> for &UVec4 {
2682
    type Output = UVec4;
2683
    #[inline]
2684
    fn shr(self, rhs: u32) -> UVec4 {
3✔
2685
        (*self).shr(rhs)
3✔
2686
    }
2687
}
2688

2689
impl ShrAssign<u32> for UVec4 {
2690
    #[inline]
2691
    fn shr_assign(&mut self, rhs: u32) {
3✔
2692
        *self = self.shr(rhs);
3✔
2693
    }
2694
}
2695

2696
impl ShrAssign<&u32> for UVec4 {
2697
    #[inline]
2698
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2699
        self.shr_assign(*rhs);
3✔
2700
    }
2701
}
2702

2703
impl Shl<u64> for UVec4 {
2704
    type Output = Self;
2705
    #[inline]
2706
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2707
        Self {
2708
            x: self.x.shl(rhs),
3✔
2709
            y: self.y.shl(rhs),
3✔
2710
            z: self.z.shl(rhs),
3✔
2711
            w: self.w.shl(rhs),
3✔
2712
        }
2713
    }
2714
}
2715

2716
impl Shl<&u64> for UVec4 {
2717
    type Output = Self;
2718
    #[inline]
2719
    fn shl(self, rhs: &u64) -> Self {
3✔
2720
        self.shl(*rhs)
3✔
2721
    }
2722
}
2723

2724
impl Shl<&u64> for &UVec4 {
2725
    type Output = UVec4;
2726
    #[inline]
2727
    fn shl(self, rhs: &u64) -> UVec4 {
3✔
2728
        (*self).shl(*rhs)
3✔
2729
    }
2730
}
2731

2732
impl Shl<u64> for &UVec4 {
2733
    type Output = UVec4;
2734
    #[inline]
2735
    fn shl(self, rhs: u64) -> UVec4 {
3✔
2736
        (*self).shl(rhs)
3✔
2737
    }
2738
}
2739

2740
impl ShlAssign<u64> for UVec4 {
2741
    #[inline]
2742
    fn shl_assign(&mut self, rhs: u64) {
3✔
2743
        *self = self.shl(rhs);
3✔
2744
    }
2745
}
2746

2747
impl ShlAssign<&u64> for UVec4 {
2748
    #[inline]
2749
    fn shl_assign(&mut self, rhs: &u64) {
3✔
2750
        self.shl_assign(*rhs);
3✔
2751
    }
2752
}
2753

2754
impl Shr<u64> for UVec4 {
2755
    type Output = Self;
2756
    #[inline]
2757
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2758
        Self {
2759
            x: self.x.shr(rhs),
3✔
2760
            y: self.y.shr(rhs),
3✔
2761
            z: self.z.shr(rhs),
3✔
2762
            w: self.w.shr(rhs),
3✔
2763
        }
2764
    }
2765
}
2766

2767
impl Shr<&u64> for UVec4 {
2768
    type Output = Self;
2769
    #[inline]
2770
    fn shr(self, rhs: &u64) -> Self {
3✔
2771
        self.shr(*rhs)
3✔
2772
    }
2773
}
2774

2775
impl Shr<&u64> for &UVec4 {
2776
    type Output = UVec4;
2777
    #[inline]
2778
    fn shr(self, rhs: &u64) -> UVec4 {
3✔
2779
        (*self).shr(*rhs)
3✔
2780
    }
2781
}
2782

2783
impl Shr<u64> for &UVec4 {
2784
    type Output = UVec4;
2785
    #[inline]
2786
    fn shr(self, rhs: u64) -> UVec4 {
3✔
2787
        (*self).shr(rhs)
3✔
2788
    }
2789
}
2790

2791
impl ShrAssign<u64> for UVec4 {
2792
    #[inline]
2793
    fn shr_assign(&mut self, rhs: u64) {
3✔
2794
        *self = self.shr(rhs);
3✔
2795
    }
2796
}
2797

2798
impl ShrAssign<&u64> for UVec4 {
2799
    #[inline]
2800
    fn shr_assign(&mut self, rhs: &u64) {
3✔
2801
        self.shr_assign(*rhs);
3✔
2802
    }
2803
}
2804

2805
#[cfg(feature = "i32")]
2806

2807
impl Shl<IVec4> for UVec4 {
2808
    type Output = Self;
2809
    #[inline]
2810
    fn shl(self, rhs: IVec4) -> Self {
3✔
2811
        Self {
2812
            x: self.x.shl(rhs.x),
3✔
2813
            y: self.y.shl(rhs.y),
3✔
2814
            z: self.z.shl(rhs.z),
3✔
2815
            w: self.w.shl(rhs.w),
3✔
2816
        }
2817
    }
2818
}
2819

2820
#[cfg(feature = "i32")]
2821

2822
impl Shl<&IVec4> for UVec4 {
2823
    type Output = Self;
2824
    #[inline]
2825
    fn shl(self, rhs: &IVec4) -> Self {
3✔
2826
        self.shl(*rhs)
3✔
2827
    }
2828
}
2829

2830
#[cfg(feature = "i32")]
2831

2832
impl Shl<&IVec4> for &UVec4 {
2833
    type Output = UVec4;
2834
    #[inline]
2835
    fn shl(self, rhs: &IVec4) -> UVec4 {
3✔
2836
        (*self).shl(*rhs)
3✔
2837
    }
2838
}
2839

2840
#[cfg(feature = "i32")]
2841

2842
impl Shl<IVec4> for &UVec4 {
2843
    type Output = UVec4;
2844
    #[inline]
2845
    fn shl(self, rhs: IVec4) -> UVec4 {
3✔
2846
        (*self).shl(rhs)
3✔
2847
    }
2848
}
2849

2850
#[cfg(feature = "i32")]
2851

2852
impl Shr<IVec4> for UVec4 {
2853
    type Output = Self;
2854
    #[inline]
2855
    fn shr(self, rhs: IVec4) -> Self {
3✔
2856
        Self {
2857
            x: self.x.shr(rhs.x),
3✔
2858
            y: self.y.shr(rhs.y),
3✔
2859
            z: self.z.shr(rhs.z),
3✔
2860
            w: self.w.shr(rhs.w),
3✔
2861
        }
2862
    }
2863
}
2864

2865
#[cfg(feature = "i32")]
2866

2867
impl Shr<&IVec4> for UVec4 {
2868
    type Output = Self;
2869
    #[inline]
2870
    fn shr(self, rhs: &IVec4) -> Self {
3✔
2871
        self.shr(*rhs)
3✔
2872
    }
2873
}
2874

2875
#[cfg(feature = "i32")]
2876

2877
impl Shr<&IVec4> for &UVec4 {
2878
    type Output = UVec4;
2879
    #[inline]
2880
    fn shr(self, rhs: &IVec4) -> UVec4 {
3✔
2881
        (*self).shr(*rhs)
3✔
2882
    }
2883
}
2884

2885
#[cfg(feature = "i32")]
2886

2887
impl Shr<IVec4> for &UVec4 {
2888
    type Output = UVec4;
2889
    #[inline]
2890
    fn shr(self, rhs: IVec4) -> UVec4 {
3✔
2891
        (*self).shr(rhs)
3✔
2892
    }
2893
}
2894

2895
impl Shl for UVec4 {
2896
    type Output = Self;
2897
    #[inline]
2898
    fn shl(self, rhs: Self) -> Self {
3✔
2899
        Self {
2900
            x: self.x.shl(rhs.x),
3✔
2901
            y: self.y.shl(rhs.y),
3✔
2902
            z: self.z.shl(rhs.z),
3✔
2903
            w: self.w.shl(rhs.w),
3✔
2904
        }
2905
    }
2906
}
2907

2908
impl Shl<&Self> for UVec4 {
2909
    type Output = Self;
2910
    #[inline]
2911
    fn shl(self, rhs: &Self) -> Self {
3✔
2912
        self.shl(*rhs)
3✔
2913
    }
2914
}
2915

2916
impl Shl<&UVec4> for &UVec4 {
2917
    type Output = UVec4;
2918
    #[inline]
2919
    fn shl(self, rhs: &UVec4) -> UVec4 {
3✔
2920
        (*self).shl(*rhs)
3✔
2921
    }
2922
}
2923

2924
impl Shl<UVec4> for &UVec4 {
2925
    type Output = UVec4;
2926
    #[inline]
2927
    fn shl(self, rhs: UVec4) -> UVec4 {
3✔
2928
        (*self).shl(rhs)
3✔
2929
    }
2930
}
2931

2932
impl Shr for UVec4 {
2933
    type Output = Self;
2934
    #[inline]
2935
    fn shr(self, rhs: Self) -> Self {
3✔
2936
        Self {
2937
            x: self.x.shr(rhs.x),
3✔
2938
            y: self.y.shr(rhs.y),
3✔
2939
            z: self.z.shr(rhs.z),
3✔
2940
            w: self.w.shr(rhs.w),
3✔
2941
        }
2942
    }
2943
}
2944

2945
impl Shr<&Self> for UVec4 {
2946
    type Output = Self;
2947
    #[inline]
2948
    fn shr(self, rhs: &Self) -> Self {
3✔
2949
        self.shr(*rhs)
3✔
2950
    }
2951
}
2952

2953
impl Shr<&UVec4> for &UVec4 {
2954
    type Output = UVec4;
2955
    #[inline]
2956
    fn shr(self, rhs: &UVec4) -> UVec4 {
3✔
2957
        (*self).shr(*rhs)
3✔
2958
    }
2959
}
2960

2961
impl Shr<UVec4> for &UVec4 {
2962
    type Output = UVec4;
2963
    #[inline]
2964
    fn shr(self, rhs: UVec4) -> UVec4 {
3✔
2965
        (*self).shr(rhs)
3✔
2966
    }
2967
}
2968

2969
impl Index<usize> for UVec4 {
2970
    type Output = u32;
2971
    #[inline]
2972
    fn index(&self, index: usize) -> &Self::Output {
3✔
2973
        match index {
6✔
2974
            0 => &self.x,
3✔
2975
            1 => &self.y,
3✔
2976
            2 => &self.z,
3✔
2977
            3 => &self.w,
3✔
2978
            _ => panic!("index out of bounds"),
×
2979
        }
2980
    }
2981
}
2982

2983
impl IndexMut<usize> for UVec4 {
2984
    #[inline]
2985
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2986
        match index {
6✔
2987
            0 => &mut self.x,
3✔
2988
            1 => &mut self.y,
3✔
2989
            2 => &mut self.z,
3✔
2990
            3 => &mut self.w,
3✔
2991
            _ => panic!("index out of bounds"),
×
2992
        }
2993
    }
2994
}
2995

2996
impl fmt::Display for UVec4 {
2997
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2998
        write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
3✔
2999
    }
3000
}
3001

3002
impl fmt::Debug for UVec4 {
3003
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
3004
        fmt.debug_tuple(stringify!(UVec4))
3✔
3005
            .field(&self.x)
3✔
3006
            .field(&self.y)
3✔
3007
            .field(&self.z)
3✔
3008
            .field(&self.w)
3✔
3009
            .finish()
3010
    }
3011
}
3012

3013
impl From<[u32; 4]> for UVec4 {
3014
    #[inline]
3015
    fn from(a: [u32; 4]) -> Self {
6✔
3016
        Self::new(a[0], a[1], a[2], a[3])
6✔
3017
    }
3018
}
3019

3020
impl From<UVec4> for [u32; 4] {
3021
    #[inline]
3022
    fn from(v: UVec4) -> Self {
3✔
3023
        [v.x, v.y, v.z, v.w]
3✔
3024
    }
3025
}
3026

3027
impl From<(u32, u32, u32, u32)> for UVec4 {
3028
    #[inline]
3029
    fn from(t: (u32, u32, u32, u32)) -> Self {
3✔
3030
        Self::new(t.0, t.1, t.2, t.3)
3✔
3031
    }
3032
}
3033

3034
impl From<UVec4> for (u32, u32, u32, u32) {
3035
    #[inline]
3036
    fn from(v: UVec4) -> Self {
9✔
3037
        (v.x, v.y, v.z, v.w)
9✔
3038
    }
3039
}
3040

3041
impl From<(UVec3, u32)> for UVec4 {
3042
    #[inline]
3043
    fn from((v, w): (UVec3, u32)) -> Self {
6✔
3044
        Self::new(v.x, v.y, v.z, w)
3✔
3045
    }
3046
}
3047

3048
impl From<(u32, UVec3)> for UVec4 {
3049
    #[inline]
3050
    fn from((x, v): (u32, UVec3)) -> Self {
6✔
3051
        Self::new(x, v.x, v.y, v.z)
3✔
3052
    }
3053
}
3054

3055
impl From<(UVec2, u32, u32)> for UVec4 {
3056
    #[inline]
3057
    fn from((v, z, w): (UVec2, u32, u32)) -> Self {
6✔
3058
        Self::new(v.x, v.y, z, w)
×
3059
    }
3060
}
3061

3062
impl From<(UVec2, UVec2)> for UVec4 {
3063
    #[inline]
3064
    fn from((v, u): (UVec2, UVec2)) -> Self {
6✔
3065
        Self::new(v.x, v.y, u.x, u.y)
×
3066
    }
3067
}
3068

3069
impl From<U8Vec4> for UVec4 {
3070
    #[inline]
3071
    fn from(v: U8Vec4) -> Self {
3✔
3072
        Self::new(
3073
            u32::from(v.x),
3✔
3074
            u32::from(v.y),
3✔
3075
            u32::from(v.z),
3✔
3076
            u32::from(v.w),
3✔
3077
        )
3078
    }
3079
}
3080

3081
impl From<U16Vec4> for UVec4 {
3082
    #[inline]
3083
    fn from(v: U16Vec4) -> Self {
3✔
3084
        Self::new(
3085
            u32::from(v.x),
3✔
3086
            u32::from(v.y),
3✔
3087
            u32::from(v.z),
3✔
3088
            u32::from(v.w),
3✔
3089
        )
3090
    }
3091
}
3092

3093
#[cfg(feature = "i8")]
3094

3095
impl TryFrom<I8Vec4> for UVec4 {
3096
    type Error = core::num::TryFromIntError;
3097

3098
    #[inline]
3099
    fn try_from(v: I8Vec4) -> Result<Self, Self::Error> {
3✔
3100
        Ok(Self::new(
3✔
3101
            u32::try_from(v.x)?,
3✔
3102
            u32::try_from(v.y)?,
3✔
3103
            u32::try_from(v.z)?,
3✔
3104
            u32::try_from(v.w)?,
3✔
3105
        ))
3106
    }
3107
}
3108

3109
#[cfg(feature = "i16")]
3110

3111
impl TryFrom<I16Vec4> for UVec4 {
3112
    type Error = core::num::TryFromIntError;
3113

3114
    #[inline]
3115
    fn try_from(v: I16Vec4) -> Result<Self, Self::Error> {
3✔
3116
        Ok(Self::new(
3✔
3117
            u32::try_from(v.x)?,
3✔
3118
            u32::try_from(v.y)?,
3✔
3119
            u32::try_from(v.z)?,
3✔
3120
            u32::try_from(v.w)?,
3✔
3121
        ))
3122
    }
3123
}
3124

3125
#[cfg(feature = "i32")]
3126

3127
impl TryFrom<IVec4> for UVec4 {
3128
    type Error = core::num::TryFromIntError;
3129

3130
    #[inline]
3131
    fn try_from(v: IVec4) -> Result<Self, Self::Error> {
3✔
3132
        Ok(Self::new(
3✔
3133
            u32::try_from(v.x)?,
3✔
3134
            u32::try_from(v.y)?,
3✔
3135
            u32::try_from(v.z)?,
3✔
3136
            u32::try_from(v.w)?,
3✔
3137
        ))
3138
    }
3139
}
3140

3141
#[cfg(feature = "i64")]
3142

3143
impl TryFrom<I64Vec4> for UVec4 {
3144
    type Error = core::num::TryFromIntError;
3145

3146
    #[inline]
3147
    fn try_from(v: I64Vec4) -> Result<Self, Self::Error> {
3✔
3148
        Ok(Self::new(
3✔
3149
            u32::try_from(v.x)?,
3✔
3150
            u32::try_from(v.y)?,
3✔
3151
            u32::try_from(v.z)?,
3✔
3152
            u32::try_from(v.w)?,
3✔
3153
        ))
3154
    }
3155
}
3156

3157
#[cfg(feature = "u64")]
3158

3159
impl TryFrom<U64Vec4> for UVec4 {
3160
    type Error = core::num::TryFromIntError;
3161

3162
    #[inline]
3163
    fn try_from(v: U64Vec4) -> Result<Self, Self::Error> {
3✔
3164
        Ok(Self::new(
3✔
3165
            u32::try_from(v.x)?,
3✔
3166
            u32::try_from(v.y)?,
3✔
3167
            u32::try_from(v.z)?,
3✔
3168
            u32::try_from(v.w)?,
3✔
3169
        ))
3170
    }
3171
}
3172

3173
#[cfg(feature = "isize")]
3174

3175
impl TryFrom<ISizeVec4> for UVec4 {
3176
    type Error = core::num::TryFromIntError;
3177

3178
    #[inline]
3179
    fn try_from(v: ISizeVec4) -> Result<Self, Self::Error> {
3✔
3180
        Ok(Self::new(
3✔
3181
            u32::try_from(v.x)?,
3✔
3182
            u32::try_from(v.y)?,
3✔
3183
            u32::try_from(v.z)?,
3✔
3184
            u32::try_from(v.w)?,
3✔
3185
        ))
3186
    }
3187
}
3188

3189
#[cfg(feature = "usize")]
3190

3191
impl TryFrom<USizeVec4> for UVec4 {
3192
    type Error = core::num::TryFromIntError;
3193

3194
    #[inline]
3195
    fn try_from(v: USizeVec4) -> Result<Self, Self::Error> {
3✔
3196
        Ok(Self::new(
3✔
3197
            u32::try_from(v.x)?,
3✔
3198
            u32::try_from(v.y)?,
3✔
3199
            u32::try_from(v.z)?,
3✔
3200
            u32::try_from(v.w)?,
3✔
3201
        ))
3202
    }
3203
}
3204

3205
impl From<BVec4> for UVec4 {
3206
    #[inline]
3207
    fn from(v: BVec4) -> Self {
3✔
3208
        Self::new(
3209
            u32::from(v.x),
3✔
3210
            u32::from(v.y),
3✔
3211
            u32::from(v.z),
3✔
3212
            u32::from(v.w),
3✔
3213
        )
3214
    }
3215
}
3216

3217
#[cfg(not(feature = "scalar-math"))]
3218
impl From<BVec4A> for UVec4 {
3219
    #[inline]
3220
    fn from(v: BVec4A) -> Self {
2✔
3221
        let bool_array: [bool; 4] = v.into();
2✔
3222
        Self::new(
3223
            u32::from(bool_array[0]),
2✔
3224
            u32::from(bool_array[1]),
2✔
3225
            u32::from(bool_array[2]),
2✔
3226
            u32::from(bool_array[3]),
2✔
3227
        )
3228
    }
3229
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc