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