1 // Generated from vec.rs.tera template. Edit the template, not the generated file.
2 
3 use crate::{BVec4, I16Vec4, I64Vec4, IVec4, U16Vec4, U64Vec2, U64Vec3, UVec4};
4 
5 #[cfg(not(target_arch = "spirv"))]
6 use core::fmt;
7 use core::iter::{Product, Sum};
8 use core::{f32, ops::*};
9 
10 /// Creates a 4-dimensional vector.
11 #[inline(always)]
12 #[must_use]
u64vec4(x: u64, y: u64, z: u64, w: u64) -> U64Vec413 pub const fn u64vec4(x: u64, y: u64, z: u64, w: u64) -> U64Vec4 {
14     U64Vec4::new(x, y, z, w)
15 }
16 
17 /// A 4-dimensional vector.
18 #[cfg_attr(not(target_arch = "spirv"), derive(Hash))]
19 #[derive(Clone, Copy, PartialEq, Eq)]
20 #[cfg_attr(feature = "cuda", repr(align(16)))]
21 #[cfg_attr(not(target_arch = "spirv"), repr(C))]
22 #[cfg_attr(target_arch = "spirv", repr(simd))]
23 pub struct U64Vec4 {
24     pub x: u64,
25     pub y: u64,
26     pub z: u64,
27     pub w: u64,
28 }
29 
30 impl U64Vec4 {
31     /// All zeroes.
32     pub const ZERO: Self = Self::splat(0);
33 
34     /// All ones.
35     pub const ONE: Self = Self::splat(1);
36 
37     /// All `u64::MIN`.
38     pub const MIN: Self = Self::splat(u64::MIN);
39 
40     /// All `u64::MAX`.
41     pub const MAX: Self = Self::splat(u64::MAX);
42 
43     /// A unit vector pointing along the positive X axis.
44     pub const X: Self = Self::new(1, 0, 0, 0);
45 
46     /// A unit vector pointing along the positive Y axis.
47     pub const Y: Self = Self::new(0, 1, 0, 0);
48 
49     /// A unit vector pointing along the positive Z axis.
50     pub const Z: Self = Self::new(0, 0, 1, 0);
51 
52     /// A unit vector pointing along the positive W axis.
53     pub const W: Self = Self::new(0, 0, 0, 1);
54 
55     /// The unit axes.
56     pub const AXES: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W];
57 
58     /// Creates a new vector.
59     #[inline(always)]
60     #[must_use]
new(x: u64, y: u64, z: u64, w: u64) -> Self61     pub const fn new(x: u64, y: u64, z: u64, w: u64) -> Self {
62         Self { x, y, z, w }
63     }
64 
65     /// Creates a vector with all elements set to `v`.
66     #[inline]
67     #[must_use]
splat(v: u64) -> Self68     pub const fn splat(v: u64) -> Self {
69         Self {
70             x: v,
71 
72             y: v,
73 
74             z: v,
75 
76             w: v,
77         }
78     }
79 
80     /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
81     /// for each element of `self`.
82     ///
83     /// A true element in the mask uses the corresponding element from `if_true`, and false
84     /// uses the element from `if_false`.
85     #[inline]
86     #[must_use]
select(mask: BVec4, if_true: Self, if_false: Self) -> Self87     pub fn select(mask: BVec4, if_true: Self, if_false: Self) -> Self {
88         Self {
89             x: if mask.test(0) { if_true.x } else { if_false.x },
90             y: if mask.test(1) { if_true.y } else { if_false.y },
91             z: if mask.test(2) { if_true.z } else { if_false.z },
92             w: if mask.test(3) { if_true.w } else { if_false.w },
93         }
94     }
95 
96     /// Creates a new vector from an array.
97     #[inline]
98     #[must_use]
from_array(a: [u64; 4]) -> Self99     pub const fn from_array(a: [u64; 4]) -> Self {
100         Self::new(a[0], a[1], a[2], a[3])
101     }
102 
103     /// `[x, y, z, w]`
104     #[inline]
105     #[must_use]
to_array(&self) -> [u64; 4]106     pub const fn to_array(&self) -> [u64; 4] {
107         [self.x, self.y, self.z, self.w]
108     }
109 
110     /// Creates a vector from the first 4 values in `slice`.
111     ///
112     /// # Panics
113     ///
114     /// Panics if `slice` is less than 4 elements long.
115     #[inline]
116     #[must_use]
from_slice(slice: &[u64]) -> Self117     pub const fn from_slice(slice: &[u64]) -> Self {
118         Self::new(slice[0], slice[1], slice[2], slice[3])
119     }
120 
121     /// Writes the elements of `self` to the first 4 elements in `slice`.
122     ///
123     /// # Panics
124     ///
125     /// Panics if `slice` is less than 4 elements long.
126     #[inline]
write_to_slice(self, slice: &mut [u64])127     pub fn write_to_slice(self, slice: &mut [u64]) {
128         slice[0] = self.x;
129         slice[1] = self.y;
130         slice[2] = self.z;
131         slice[3] = self.w;
132     }
133 
134     /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`.
135     ///
136     /// Truncation to [`U64Vec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()].
137     #[inline]
138     #[must_use]
truncate(self) -> U64Vec3139     pub fn truncate(self) -> U64Vec3 {
140         use crate::swizzles::Vec4Swizzles;
141         self.xyz()
142     }
143 
144     /// Computes the dot product of `self` and `rhs`.
145     #[inline]
146     #[must_use]
dot(self, rhs: Self) -> u64147     pub fn dot(self, rhs: Self) -> u64 {
148         (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z) + (self.w * rhs.w)
149     }
150 
151     /// Returns a vector where every component is the dot product of `self` and `rhs`.
152     #[inline]
153     #[must_use]
dot_into_vec(self, rhs: Self) -> Self154     pub fn dot_into_vec(self, rhs: Self) -> Self {
155         Self::splat(self.dot(rhs))
156     }
157 
158     /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
159     ///
160     /// In other words this computes `[self.x.min(rhs.x), self.y.min(rhs.y), ..]`.
161     #[inline]
162     #[must_use]
min(self, rhs: Self) -> Self163     pub fn min(self, rhs: Self) -> Self {
164         Self {
165             x: self.x.min(rhs.x),
166             y: self.y.min(rhs.y),
167             z: self.z.min(rhs.z),
168             w: self.w.min(rhs.w),
169         }
170     }
171 
172     /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
173     ///
174     /// In other words this computes `[self.x.max(rhs.x), self.y.max(rhs.y), ..]`.
175     #[inline]
176     #[must_use]
max(self, rhs: Self) -> Self177     pub fn max(self, rhs: Self) -> Self {
178         Self {
179             x: self.x.max(rhs.x),
180             y: self.y.max(rhs.y),
181             z: self.z.max(rhs.z),
182             w: self.w.max(rhs.w),
183         }
184     }
185 
186     /// Component-wise clamping of values, similar to [`u64::clamp`].
187     ///
188     /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
189     ///
190     /// # Panics
191     ///
192     /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
193     #[inline]
194     #[must_use]
clamp(self, min: Self, max: Self) -> Self195     pub fn clamp(self, min: Self, max: Self) -> Self {
196         glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
197         self.max(min).min(max)
198     }
199 
200     /// Returns the horizontal minimum of `self`.
201     ///
202     /// In other words this computes `min(x, y, ..)`.
203     #[inline]
204     #[must_use]
min_element(self) -> u64205     pub fn min_element(self) -> u64 {
206         self.x.min(self.y.min(self.z.min(self.w)))
207     }
208 
209     /// Returns the horizontal maximum of `self`.
210     ///
211     /// In other words this computes `max(x, y, ..)`.
212     #[inline]
213     #[must_use]
max_element(self) -> u64214     pub fn max_element(self) -> u64 {
215         self.x.max(self.y.max(self.z.max(self.w)))
216     }
217 
218     /// Returns a vector mask containing the result of a `==` comparison for each element of
219     /// `self` and `rhs`.
220     ///
221     /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
222     /// elements.
223     #[inline]
224     #[must_use]
cmpeq(self, rhs: Self) -> BVec4225     pub fn cmpeq(self, rhs: Self) -> BVec4 {
226         BVec4::new(
227             self.x.eq(&rhs.x),
228             self.y.eq(&rhs.y),
229             self.z.eq(&rhs.z),
230             self.w.eq(&rhs.w),
231         )
232     }
233 
234     /// Returns a vector mask containing the result of a `!=` comparison for each element of
235     /// `self` and `rhs`.
236     ///
237     /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
238     /// elements.
239     #[inline]
240     #[must_use]
cmpne(self, rhs: Self) -> BVec4241     pub fn cmpne(self, rhs: Self) -> BVec4 {
242         BVec4::new(
243             self.x.ne(&rhs.x),
244             self.y.ne(&rhs.y),
245             self.z.ne(&rhs.z),
246             self.w.ne(&rhs.w),
247         )
248     }
249 
250     /// Returns a vector mask containing the result of a `>=` comparison for each element of
251     /// `self` and `rhs`.
252     ///
253     /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
254     /// elements.
255     #[inline]
256     #[must_use]
cmpge(self, rhs: Self) -> BVec4257     pub fn cmpge(self, rhs: Self) -> BVec4 {
258         BVec4::new(
259             self.x.ge(&rhs.x),
260             self.y.ge(&rhs.y),
261             self.z.ge(&rhs.z),
262             self.w.ge(&rhs.w),
263         )
264     }
265 
266     /// Returns a vector mask containing the result of a `>` comparison for each element of
267     /// `self` and `rhs`.
268     ///
269     /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
270     /// elements.
271     #[inline]
272     #[must_use]
cmpgt(self, rhs: Self) -> BVec4273     pub fn cmpgt(self, rhs: Self) -> BVec4 {
274         BVec4::new(
275             self.x.gt(&rhs.x),
276             self.y.gt(&rhs.y),
277             self.z.gt(&rhs.z),
278             self.w.gt(&rhs.w),
279         )
280     }
281 
282     /// Returns a vector mask containing the result of a `<=` comparison for each element of
283     /// `self` and `rhs`.
284     ///
285     /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
286     /// elements.
287     #[inline]
288     #[must_use]
cmple(self, rhs: Self) -> BVec4289     pub fn cmple(self, rhs: Self) -> BVec4 {
290         BVec4::new(
291             self.x.le(&rhs.x),
292             self.y.le(&rhs.y),
293             self.z.le(&rhs.z),
294             self.w.le(&rhs.w),
295         )
296     }
297 
298     /// Returns a vector mask containing the result of a `<` comparison for each element of
299     /// `self` and `rhs`.
300     ///
301     /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
302     /// elements.
303     #[inline]
304     #[must_use]
cmplt(self, rhs: Self) -> BVec4305     pub fn cmplt(self, rhs: Self) -> BVec4 {
306         BVec4::new(
307             self.x.lt(&rhs.x),
308             self.y.lt(&rhs.y),
309             self.z.lt(&rhs.z),
310             self.w.lt(&rhs.w),
311         )
312     }
313 
314     /// Computes the squared length of `self`.
315     #[doc(alias = "magnitude2")]
316     #[inline]
317     #[must_use]
length_squared(self) -> u64318     pub fn length_squared(self) -> u64 {
319         self.dot(self)
320     }
321 
322     /// Casts all elements of `self` to `f32`.
323     #[inline]
324     #[must_use]
as_vec4(&self) -> crate::Vec4325     pub fn as_vec4(&self) -> crate::Vec4 {
326         crate::Vec4::new(self.x as f32, self.y as f32, self.z as f32, self.w as f32)
327     }
328 
329     /// Casts all elements of `self` to `f64`.
330     #[inline]
331     #[must_use]
as_dvec4(&self) -> crate::DVec4332     pub fn as_dvec4(&self) -> crate::DVec4 {
333         crate::DVec4::new(self.x as f64, self.y as f64, self.z as f64, self.w as f64)
334     }
335 
336     /// Casts all elements of `self` to `i16`.
337     #[inline]
338     #[must_use]
as_i16vec4(&self) -> crate::I16Vec4339     pub fn as_i16vec4(&self) -> crate::I16Vec4 {
340         crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
341     }
342 
343     /// Casts all elements of `self` to `u16`.
344     #[inline]
345     #[must_use]
as_u16vec4(&self) -> crate::U16Vec4346     pub fn as_u16vec4(&self) -> crate::U16Vec4 {
347         crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
348     }
349 
350     /// Casts all elements of `self` to `i32`.
351     #[inline]
352     #[must_use]
as_ivec4(&self) -> crate::IVec4353     pub fn as_ivec4(&self) -> crate::IVec4 {
354         crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
355     }
356 
357     /// Casts all elements of `self` to `u32`.
358     #[inline]
359     #[must_use]
as_uvec4(&self) -> crate::UVec4360     pub fn as_uvec4(&self) -> crate::UVec4 {
361         crate::UVec4::new(self.x as u32, self.y as u32, self.z as u32, self.w as u32)
362     }
363 
364     /// Casts all elements of `self` to `i64`.
365     #[inline]
366     #[must_use]
as_i64vec4(&self) -> crate::I64Vec4367     pub fn as_i64vec4(&self) -> crate::I64Vec4 {
368         crate::I64Vec4::new(self.x as i64, self.y as i64, self.z as i64, self.w as i64)
369     }
370 
371     /// Returns a vector containing the wrapping addition of `self` and `rhs`.
372     ///
373     /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
374     #[inline]
375     #[must_use]
wrapping_add(self, rhs: Self) -> Self376     pub const fn wrapping_add(self, rhs: Self) -> Self {
377         Self {
378             x: self.x.wrapping_add(rhs.x),
379             y: self.y.wrapping_add(rhs.y),
380             z: self.z.wrapping_add(rhs.z),
381             w: self.w.wrapping_add(rhs.w),
382         }
383     }
384 
385     /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
386     ///
387     /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
388     #[inline]
389     #[must_use]
wrapping_sub(self, rhs: Self) -> Self390     pub const fn wrapping_sub(self, rhs: Self) -> Self {
391         Self {
392             x: self.x.wrapping_sub(rhs.x),
393             y: self.y.wrapping_sub(rhs.y),
394             z: self.z.wrapping_sub(rhs.z),
395             w: self.w.wrapping_sub(rhs.w),
396         }
397     }
398 
399     /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
400     ///
401     /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
402     #[inline]
403     #[must_use]
wrapping_mul(self, rhs: Self) -> Self404     pub const fn wrapping_mul(self, rhs: Self) -> Self {
405         Self {
406             x: self.x.wrapping_mul(rhs.x),
407             y: self.y.wrapping_mul(rhs.y),
408             z: self.z.wrapping_mul(rhs.z),
409             w: self.w.wrapping_mul(rhs.w),
410         }
411     }
412 
413     /// Returns a vector containing the wrapping division of `self` and `rhs`.
414     ///
415     /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
416     #[inline]
417     #[must_use]
wrapping_div(self, rhs: Self) -> Self418     pub const fn wrapping_div(self, rhs: Self) -> Self {
419         Self {
420             x: self.x.wrapping_div(rhs.x),
421             y: self.y.wrapping_div(rhs.y),
422             z: self.z.wrapping_div(rhs.z),
423             w: self.w.wrapping_div(rhs.w),
424         }
425     }
426 
427     /// Returns a vector containing the saturating addition of `self` and `rhs`.
428     ///
429     /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
430     #[inline]
431     #[must_use]
saturating_add(self, rhs: Self) -> Self432     pub const fn saturating_add(self, rhs: Self) -> Self {
433         Self {
434             x: self.x.saturating_add(rhs.x),
435             y: self.y.saturating_add(rhs.y),
436             z: self.z.saturating_add(rhs.z),
437             w: self.w.saturating_add(rhs.w),
438         }
439     }
440 
441     /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
442     ///
443     /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
444     #[inline]
445     #[must_use]
saturating_sub(self, rhs: Self) -> Self446     pub const fn saturating_sub(self, rhs: Self) -> Self {
447         Self {
448             x: self.x.saturating_sub(rhs.x),
449             y: self.y.saturating_sub(rhs.y),
450             z: self.z.saturating_sub(rhs.z),
451             w: self.w.saturating_sub(rhs.w),
452         }
453     }
454 
455     /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
456     ///
457     /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
458     #[inline]
459     #[must_use]
saturating_mul(self, rhs: Self) -> Self460     pub const fn saturating_mul(self, rhs: Self) -> Self {
461         Self {
462             x: self.x.saturating_mul(rhs.x),
463             y: self.y.saturating_mul(rhs.y),
464             z: self.z.saturating_mul(rhs.z),
465             w: self.w.saturating_mul(rhs.w),
466         }
467     }
468 
469     /// Returns a vector containing the saturating division of `self` and `rhs`.
470     ///
471     /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
472     #[inline]
473     #[must_use]
saturating_div(self, rhs: Self) -> Self474     pub const fn saturating_div(self, rhs: Self) -> Self {
475         Self {
476             x: self.x.saturating_div(rhs.x),
477             y: self.y.saturating_div(rhs.y),
478             z: self.z.saturating_div(rhs.z),
479             w: self.w.saturating_div(rhs.w),
480         }
481     }
482 }
483 
484 impl Default for U64Vec4 {
485     #[inline(always)]
default() -> Self486     fn default() -> Self {
487         Self::ZERO
488     }
489 }
490 
491 impl Div<U64Vec4> for U64Vec4 {
492     type Output = Self;
493     #[inline]
div(self, rhs: Self) -> Self494     fn div(self, rhs: Self) -> Self {
495         Self {
496             x: self.x.div(rhs.x),
497             y: self.y.div(rhs.y),
498             z: self.z.div(rhs.z),
499             w: self.w.div(rhs.w),
500         }
501     }
502 }
503 
504 impl DivAssign<U64Vec4> for U64Vec4 {
505     #[inline]
div_assign(&mut self, rhs: Self)506     fn div_assign(&mut self, rhs: Self) {
507         self.x.div_assign(rhs.x);
508         self.y.div_assign(rhs.y);
509         self.z.div_assign(rhs.z);
510         self.w.div_assign(rhs.w);
511     }
512 }
513 
514 impl Div<u64> for U64Vec4 {
515     type Output = Self;
516     #[inline]
div(self, rhs: u64) -> Self517     fn div(self, rhs: u64) -> Self {
518         Self {
519             x: self.x.div(rhs),
520             y: self.y.div(rhs),
521             z: self.z.div(rhs),
522             w: self.w.div(rhs),
523         }
524     }
525 }
526 
527 impl DivAssign<u64> for U64Vec4 {
528     #[inline]
div_assign(&mut self, rhs: u64)529     fn div_assign(&mut self, rhs: u64) {
530         self.x.div_assign(rhs);
531         self.y.div_assign(rhs);
532         self.z.div_assign(rhs);
533         self.w.div_assign(rhs);
534     }
535 }
536 
537 impl Div<U64Vec4> for u64 {
538     type Output = U64Vec4;
539     #[inline]
div(self, rhs: U64Vec4) -> U64Vec4540     fn div(self, rhs: U64Vec4) -> U64Vec4 {
541         U64Vec4 {
542             x: self.div(rhs.x),
543             y: self.div(rhs.y),
544             z: self.div(rhs.z),
545             w: self.div(rhs.w),
546         }
547     }
548 }
549 
550 impl Mul<U64Vec4> for U64Vec4 {
551     type Output = Self;
552     #[inline]
mul(self, rhs: Self) -> Self553     fn mul(self, rhs: Self) -> Self {
554         Self {
555             x: self.x.mul(rhs.x),
556             y: self.y.mul(rhs.y),
557             z: self.z.mul(rhs.z),
558             w: self.w.mul(rhs.w),
559         }
560     }
561 }
562 
563 impl MulAssign<U64Vec4> for U64Vec4 {
564     #[inline]
mul_assign(&mut self, rhs: Self)565     fn mul_assign(&mut self, rhs: Self) {
566         self.x.mul_assign(rhs.x);
567         self.y.mul_assign(rhs.y);
568         self.z.mul_assign(rhs.z);
569         self.w.mul_assign(rhs.w);
570     }
571 }
572 
573 impl Mul<u64> for U64Vec4 {
574     type Output = Self;
575     #[inline]
mul(self, rhs: u64) -> Self576     fn mul(self, rhs: u64) -> Self {
577         Self {
578             x: self.x.mul(rhs),
579             y: self.y.mul(rhs),
580             z: self.z.mul(rhs),
581             w: self.w.mul(rhs),
582         }
583     }
584 }
585 
586 impl MulAssign<u64> for U64Vec4 {
587     #[inline]
mul_assign(&mut self, rhs: u64)588     fn mul_assign(&mut self, rhs: u64) {
589         self.x.mul_assign(rhs);
590         self.y.mul_assign(rhs);
591         self.z.mul_assign(rhs);
592         self.w.mul_assign(rhs);
593     }
594 }
595 
596 impl Mul<U64Vec4> for u64 {
597     type Output = U64Vec4;
598     #[inline]
mul(self, rhs: U64Vec4) -> U64Vec4599     fn mul(self, rhs: U64Vec4) -> U64Vec4 {
600         U64Vec4 {
601             x: self.mul(rhs.x),
602             y: self.mul(rhs.y),
603             z: self.mul(rhs.z),
604             w: self.mul(rhs.w),
605         }
606     }
607 }
608 
609 impl Add<U64Vec4> for U64Vec4 {
610     type Output = Self;
611     #[inline]
add(self, rhs: Self) -> Self612     fn add(self, rhs: Self) -> Self {
613         Self {
614             x: self.x.add(rhs.x),
615             y: self.y.add(rhs.y),
616             z: self.z.add(rhs.z),
617             w: self.w.add(rhs.w),
618         }
619     }
620 }
621 
622 impl AddAssign<U64Vec4> for U64Vec4 {
623     #[inline]
add_assign(&mut self, rhs: Self)624     fn add_assign(&mut self, rhs: Self) {
625         self.x.add_assign(rhs.x);
626         self.y.add_assign(rhs.y);
627         self.z.add_assign(rhs.z);
628         self.w.add_assign(rhs.w);
629     }
630 }
631 
632 impl Add<u64> for U64Vec4 {
633     type Output = Self;
634     #[inline]
add(self, rhs: u64) -> Self635     fn add(self, rhs: u64) -> Self {
636         Self {
637             x: self.x.add(rhs),
638             y: self.y.add(rhs),
639             z: self.z.add(rhs),
640             w: self.w.add(rhs),
641         }
642     }
643 }
644 
645 impl AddAssign<u64> for U64Vec4 {
646     #[inline]
add_assign(&mut self, rhs: u64)647     fn add_assign(&mut self, rhs: u64) {
648         self.x.add_assign(rhs);
649         self.y.add_assign(rhs);
650         self.z.add_assign(rhs);
651         self.w.add_assign(rhs);
652     }
653 }
654 
655 impl Add<U64Vec4> for u64 {
656     type Output = U64Vec4;
657     #[inline]
add(self, rhs: U64Vec4) -> U64Vec4658     fn add(self, rhs: U64Vec4) -> U64Vec4 {
659         U64Vec4 {
660             x: self.add(rhs.x),
661             y: self.add(rhs.y),
662             z: self.add(rhs.z),
663             w: self.add(rhs.w),
664         }
665     }
666 }
667 
668 impl Sub<U64Vec4> for U64Vec4 {
669     type Output = Self;
670     #[inline]
sub(self, rhs: Self) -> Self671     fn sub(self, rhs: Self) -> Self {
672         Self {
673             x: self.x.sub(rhs.x),
674             y: self.y.sub(rhs.y),
675             z: self.z.sub(rhs.z),
676             w: self.w.sub(rhs.w),
677         }
678     }
679 }
680 
681 impl SubAssign<U64Vec4> for U64Vec4 {
682     #[inline]
sub_assign(&mut self, rhs: U64Vec4)683     fn sub_assign(&mut self, rhs: U64Vec4) {
684         self.x.sub_assign(rhs.x);
685         self.y.sub_assign(rhs.y);
686         self.z.sub_assign(rhs.z);
687         self.w.sub_assign(rhs.w);
688     }
689 }
690 
691 impl Sub<u64> for U64Vec4 {
692     type Output = Self;
693     #[inline]
sub(self, rhs: u64) -> Self694     fn sub(self, rhs: u64) -> Self {
695         Self {
696             x: self.x.sub(rhs),
697             y: self.y.sub(rhs),
698             z: self.z.sub(rhs),
699             w: self.w.sub(rhs),
700         }
701     }
702 }
703 
704 impl SubAssign<u64> for U64Vec4 {
705     #[inline]
sub_assign(&mut self, rhs: u64)706     fn sub_assign(&mut self, rhs: u64) {
707         self.x.sub_assign(rhs);
708         self.y.sub_assign(rhs);
709         self.z.sub_assign(rhs);
710         self.w.sub_assign(rhs);
711     }
712 }
713 
714 impl Sub<U64Vec4> for u64 {
715     type Output = U64Vec4;
716     #[inline]
sub(self, rhs: U64Vec4) -> U64Vec4717     fn sub(self, rhs: U64Vec4) -> U64Vec4 {
718         U64Vec4 {
719             x: self.sub(rhs.x),
720             y: self.sub(rhs.y),
721             z: self.sub(rhs.z),
722             w: self.sub(rhs.w),
723         }
724     }
725 }
726 
727 impl Rem<U64Vec4> for U64Vec4 {
728     type Output = Self;
729     #[inline]
rem(self, rhs: Self) -> Self730     fn rem(self, rhs: Self) -> Self {
731         Self {
732             x: self.x.rem(rhs.x),
733             y: self.y.rem(rhs.y),
734             z: self.z.rem(rhs.z),
735             w: self.w.rem(rhs.w),
736         }
737     }
738 }
739 
740 impl RemAssign<U64Vec4> for U64Vec4 {
741     #[inline]
rem_assign(&mut self, rhs: Self)742     fn rem_assign(&mut self, rhs: Self) {
743         self.x.rem_assign(rhs.x);
744         self.y.rem_assign(rhs.y);
745         self.z.rem_assign(rhs.z);
746         self.w.rem_assign(rhs.w);
747     }
748 }
749 
750 impl Rem<u64> for U64Vec4 {
751     type Output = Self;
752     #[inline]
rem(self, rhs: u64) -> Self753     fn rem(self, rhs: u64) -> Self {
754         Self {
755             x: self.x.rem(rhs),
756             y: self.y.rem(rhs),
757             z: self.z.rem(rhs),
758             w: self.w.rem(rhs),
759         }
760     }
761 }
762 
763 impl RemAssign<u64> for U64Vec4 {
764     #[inline]
rem_assign(&mut self, rhs: u64)765     fn rem_assign(&mut self, rhs: u64) {
766         self.x.rem_assign(rhs);
767         self.y.rem_assign(rhs);
768         self.z.rem_assign(rhs);
769         self.w.rem_assign(rhs);
770     }
771 }
772 
773 impl Rem<U64Vec4> for u64 {
774     type Output = U64Vec4;
775     #[inline]
rem(self, rhs: U64Vec4) -> U64Vec4776     fn rem(self, rhs: U64Vec4) -> U64Vec4 {
777         U64Vec4 {
778             x: self.rem(rhs.x),
779             y: self.rem(rhs.y),
780             z: self.rem(rhs.z),
781             w: self.rem(rhs.w),
782         }
783     }
784 }
785 
786 #[cfg(not(target_arch = "spirv"))]
787 impl AsRef<[u64; 4]> for U64Vec4 {
788     #[inline]
as_ref(&self) -> &[u64; 4]789     fn as_ref(&self) -> &[u64; 4] {
790         unsafe { &*(self as *const U64Vec4 as *const [u64; 4]) }
791     }
792 }
793 
794 #[cfg(not(target_arch = "spirv"))]
795 impl AsMut<[u64; 4]> for U64Vec4 {
796     #[inline]
as_mut(&mut self) -> &mut [u64; 4]797     fn as_mut(&mut self) -> &mut [u64; 4] {
798         unsafe { &mut *(self as *mut U64Vec4 as *mut [u64; 4]) }
799     }
800 }
801 
802 impl Sum for U64Vec4 {
803     #[inline]
sum<I>(iter: I) -> Self where I: Iterator<Item = Self>,804     fn sum<I>(iter: I) -> Self
805     where
806         I: Iterator<Item = Self>,
807     {
808         iter.fold(Self::ZERO, Self::add)
809     }
810 }
811 
812 impl<'a> Sum<&'a Self> for U64Vec4 {
813     #[inline]
sum<I>(iter: I) -> Self where I: Iterator<Item = &'a Self>,814     fn sum<I>(iter: I) -> Self
815     where
816         I: Iterator<Item = &'a Self>,
817     {
818         iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
819     }
820 }
821 
822 impl Product for U64Vec4 {
823     #[inline]
product<I>(iter: I) -> Self where I: Iterator<Item = Self>,824     fn product<I>(iter: I) -> Self
825     where
826         I: Iterator<Item = Self>,
827     {
828         iter.fold(Self::ONE, Self::mul)
829     }
830 }
831 
832 impl<'a> Product<&'a Self> for U64Vec4 {
833     #[inline]
product<I>(iter: I) -> Self where I: Iterator<Item = &'a Self>,834     fn product<I>(iter: I) -> Self
835     where
836         I: Iterator<Item = &'a Self>,
837     {
838         iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
839     }
840 }
841 
842 impl Not for U64Vec4 {
843     type Output = Self;
844     #[inline]
not(self) -> Self::Output845     fn not(self) -> Self::Output {
846         Self {
847             x: self.x.not(),
848             y: self.y.not(),
849             z: self.z.not(),
850             w: self.w.not(),
851         }
852     }
853 }
854 
855 impl BitAnd for U64Vec4 {
856     type Output = Self;
857     #[inline]
bitand(self, rhs: Self) -> Self::Output858     fn bitand(self, rhs: Self) -> Self::Output {
859         Self {
860             x: self.x.bitand(rhs.x),
861             y: self.y.bitand(rhs.y),
862             z: self.z.bitand(rhs.z),
863             w: self.w.bitand(rhs.w),
864         }
865     }
866 }
867 
868 impl BitOr for U64Vec4 {
869     type Output = Self;
870     #[inline]
bitor(self, rhs: Self) -> Self::Output871     fn bitor(self, rhs: Self) -> Self::Output {
872         Self {
873             x: self.x.bitor(rhs.x),
874             y: self.y.bitor(rhs.y),
875             z: self.z.bitor(rhs.z),
876             w: self.w.bitor(rhs.w),
877         }
878     }
879 }
880 
881 impl BitXor for U64Vec4 {
882     type Output = Self;
883     #[inline]
bitxor(self, rhs: Self) -> Self::Output884     fn bitxor(self, rhs: Self) -> Self::Output {
885         Self {
886             x: self.x.bitxor(rhs.x),
887             y: self.y.bitxor(rhs.y),
888             z: self.z.bitxor(rhs.z),
889             w: self.w.bitxor(rhs.w),
890         }
891     }
892 }
893 
894 impl BitAnd<u64> for U64Vec4 {
895     type Output = Self;
896     #[inline]
bitand(self, rhs: u64) -> Self::Output897     fn bitand(self, rhs: u64) -> Self::Output {
898         Self {
899             x: self.x.bitand(rhs),
900             y: self.y.bitand(rhs),
901             z: self.z.bitand(rhs),
902             w: self.w.bitand(rhs),
903         }
904     }
905 }
906 
907 impl BitOr<u64> for U64Vec4 {
908     type Output = Self;
909     #[inline]
bitor(self, rhs: u64) -> Self::Output910     fn bitor(self, rhs: u64) -> Self::Output {
911         Self {
912             x: self.x.bitor(rhs),
913             y: self.y.bitor(rhs),
914             z: self.z.bitor(rhs),
915             w: self.w.bitor(rhs),
916         }
917     }
918 }
919 
920 impl BitXor<u64> for U64Vec4 {
921     type Output = Self;
922     #[inline]
bitxor(self, rhs: u64) -> Self::Output923     fn bitxor(self, rhs: u64) -> Self::Output {
924         Self {
925             x: self.x.bitxor(rhs),
926             y: self.y.bitxor(rhs),
927             z: self.z.bitxor(rhs),
928             w: self.w.bitxor(rhs),
929         }
930     }
931 }
932 
933 impl Shl<i8> for U64Vec4 {
934     type Output = Self;
935     #[inline]
shl(self, rhs: i8) -> Self::Output936     fn shl(self, rhs: i8) -> Self::Output {
937         Self {
938             x: self.x.shl(rhs),
939             y: self.y.shl(rhs),
940             z: self.z.shl(rhs),
941             w: self.w.shl(rhs),
942         }
943     }
944 }
945 
946 impl Shr<i8> for U64Vec4 {
947     type Output = Self;
948     #[inline]
shr(self, rhs: i8) -> Self::Output949     fn shr(self, rhs: i8) -> Self::Output {
950         Self {
951             x: self.x.shr(rhs),
952             y: self.y.shr(rhs),
953             z: self.z.shr(rhs),
954             w: self.w.shr(rhs),
955         }
956     }
957 }
958 
959 impl Shl<i16> for U64Vec4 {
960     type Output = Self;
961     #[inline]
shl(self, rhs: i16) -> Self::Output962     fn shl(self, rhs: i16) -> Self::Output {
963         Self {
964             x: self.x.shl(rhs),
965             y: self.y.shl(rhs),
966             z: self.z.shl(rhs),
967             w: self.w.shl(rhs),
968         }
969     }
970 }
971 
972 impl Shr<i16> for U64Vec4 {
973     type Output = Self;
974     #[inline]
shr(self, rhs: i16) -> Self::Output975     fn shr(self, rhs: i16) -> Self::Output {
976         Self {
977             x: self.x.shr(rhs),
978             y: self.y.shr(rhs),
979             z: self.z.shr(rhs),
980             w: self.w.shr(rhs),
981         }
982     }
983 }
984 
985 impl Shl<i32> for U64Vec4 {
986     type Output = Self;
987     #[inline]
shl(self, rhs: i32) -> Self::Output988     fn shl(self, rhs: i32) -> Self::Output {
989         Self {
990             x: self.x.shl(rhs),
991             y: self.y.shl(rhs),
992             z: self.z.shl(rhs),
993             w: self.w.shl(rhs),
994         }
995     }
996 }
997 
998 impl Shr<i32> for U64Vec4 {
999     type Output = Self;
1000     #[inline]
shr(self, rhs: i32) -> Self::Output1001     fn shr(self, rhs: i32) -> Self::Output {
1002         Self {
1003             x: self.x.shr(rhs),
1004             y: self.y.shr(rhs),
1005             z: self.z.shr(rhs),
1006             w: self.w.shr(rhs),
1007         }
1008     }
1009 }
1010 
1011 impl Shl<i64> for U64Vec4 {
1012     type Output = Self;
1013     #[inline]
shl(self, rhs: i64) -> Self::Output1014     fn shl(self, rhs: i64) -> Self::Output {
1015         Self {
1016             x: self.x.shl(rhs),
1017             y: self.y.shl(rhs),
1018             z: self.z.shl(rhs),
1019             w: self.w.shl(rhs),
1020         }
1021     }
1022 }
1023 
1024 impl Shr<i64> for U64Vec4 {
1025     type Output = Self;
1026     #[inline]
shr(self, rhs: i64) -> Self::Output1027     fn shr(self, rhs: i64) -> Self::Output {
1028         Self {
1029             x: self.x.shr(rhs),
1030             y: self.y.shr(rhs),
1031             z: self.z.shr(rhs),
1032             w: self.w.shr(rhs),
1033         }
1034     }
1035 }
1036 
1037 impl Shl<u8> for U64Vec4 {
1038     type Output = Self;
1039     #[inline]
shl(self, rhs: u8) -> Self::Output1040     fn shl(self, rhs: u8) -> Self::Output {
1041         Self {
1042             x: self.x.shl(rhs),
1043             y: self.y.shl(rhs),
1044             z: self.z.shl(rhs),
1045             w: self.w.shl(rhs),
1046         }
1047     }
1048 }
1049 
1050 impl Shr<u8> for U64Vec4 {
1051     type Output = Self;
1052     #[inline]
shr(self, rhs: u8) -> Self::Output1053     fn shr(self, rhs: u8) -> Self::Output {
1054         Self {
1055             x: self.x.shr(rhs),
1056             y: self.y.shr(rhs),
1057             z: self.z.shr(rhs),
1058             w: self.w.shr(rhs),
1059         }
1060     }
1061 }
1062 
1063 impl Shl<u16> for U64Vec4 {
1064     type Output = Self;
1065     #[inline]
shl(self, rhs: u16) -> Self::Output1066     fn shl(self, rhs: u16) -> Self::Output {
1067         Self {
1068             x: self.x.shl(rhs),
1069             y: self.y.shl(rhs),
1070             z: self.z.shl(rhs),
1071             w: self.w.shl(rhs),
1072         }
1073     }
1074 }
1075 
1076 impl Shr<u16> for U64Vec4 {
1077     type Output = Self;
1078     #[inline]
shr(self, rhs: u16) -> Self::Output1079     fn shr(self, rhs: u16) -> Self::Output {
1080         Self {
1081             x: self.x.shr(rhs),
1082             y: self.y.shr(rhs),
1083             z: self.z.shr(rhs),
1084             w: self.w.shr(rhs),
1085         }
1086     }
1087 }
1088 
1089 impl Shl<u32> for U64Vec4 {
1090     type Output = Self;
1091     #[inline]
shl(self, rhs: u32) -> Self::Output1092     fn shl(self, rhs: u32) -> Self::Output {
1093         Self {
1094             x: self.x.shl(rhs),
1095             y: self.y.shl(rhs),
1096             z: self.z.shl(rhs),
1097             w: self.w.shl(rhs),
1098         }
1099     }
1100 }
1101 
1102 impl Shr<u32> for U64Vec4 {
1103     type Output = Self;
1104     #[inline]
shr(self, rhs: u32) -> Self::Output1105     fn shr(self, rhs: u32) -> Self::Output {
1106         Self {
1107             x: self.x.shr(rhs),
1108             y: self.y.shr(rhs),
1109             z: self.z.shr(rhs),
1110             w: self.w.shr(rhs),
1111         }
1112     }
1113 }
1114 
1115 impl Shl<u64> for U64Vec4 {
1116     type Output = Self;
1117     #[inline]
shl(self, rhs: u64) -> Self::Output1118     fn shl(self, rhs: u64) -> Self::Output {
1119         Self {
1120             x: self.x.shl(rhs),
1121             y: self.y.shl(rhs),
1122             z: self.z.shl(rhs),
1123             w: self.w.shl(rhs),
1124         }
1125     }
1126 }
1127 
1128 impl Shr<u64> for U64Vec4 {
1129     type Output = Self;
1130     #[inline]
shr(self, rhs: u64) -> Self::Output1131     fn shr(self, rhs: u64) -> Self::Output {
1132         Self {
1133             x: self.x.shr(rhs),
1134             y: self.y.shr(rhs),
1135             z: self.z.shr(rhs),
1136             w: self.w.shr(rhs),
1137         }
1138     }
1139 }
1140 
1141 impl Shl<crate::IVec4> for U64Vec4 {
1142     type Output = Self;
1143     #[inline]
shl(self, rhs: crate::IVec4) -> Self::Output1144     fn shl(self, rhs: crate::IVec4) -> Self::Output {
1145         Self {
1146             x: self.x.shl(rhs.x),
1147             y: self.y.shl(rhs.y),
1148             z: self.z.shl(rhs.z),
1149             w: self.w.shl(rhs.w),
1150         }
1151     }
1152 }
1153 
1154 impl Shr<crate::IVec4> for U64Vec4 {
1155     type Output = Self;
1156     #[inline]
shr(self, rhs: crate::IVec4) -> Self::Output1157     fn shr(self, rhs: crate::IVec4) -> Self::Output {
1158         Self {
1159             x: self.x.shr(rhs.x),
1160             y: self.y.shr(rhs.y),
1161             z: self.z.shr(rhs.z),
1162             w: self.w.shr(rhs.w),
1163         }
1164     }
1165 }
1166 
1167 impl Shl<crate::UVec4> for U64Vec4 {
1168     type Output = Self;
1169     #[inline]
shl(self, rhs: crate::UVec4) -> Self::Output1170     fn shl(self, rhs: crate::UVec4) -> Self::Output {
1171         Self {
1172             x: self.x.shl(rhs.x),
1173             y: self.y.shl(rhs.y),
1174             z: self.z.shl(rhs.z),
1175             w: self.w.shl(rhs.w),
1176         }
1177     }
1178 }
1179 
1180 impl Shr<crate::UVec4> for U64Vec4 {
1181     type Output = Self;
1182     #[inline]
shr(self, rhs: crate::UVec4) -> Self::Output1183     fn shr(self, rhs: crate::UVec4) -> Self::Output {
1184         Self {
1185             x: self.x.shr(rhs.x),
1186             y: self.y.shr(rhs.y),
1187             z: self.z.shr(rhs.z),
1188             w: self.w.shr(rhs.w),
1189         }
1190     }
1191 }
1192 
1193 impl Index<usize> for U64Vec4 {
1194     type Output = u64;
1195     #[inline]
index(&self, index: usize) -> &Self::Output1196     fn index(&self, index: usize) -> &Self::Output {
1197         match index {
1198             0 => &self.x,
1199             1 => &self.y,
1200             2 => &self.z,
1201             3 => &self.w,
1202             _ => panic!("index out of bounds"),
1203         }
1204     }
1205 }
1206 
1207 impl IndexMut<usize> for U64Vec4 {
1208     #[inline]
index_mut(&mut self, index: usize) -> &mut Self::Output1209     fn index_mut(&mut self, index: usize) -> &mut Self::Output {
1210         match index {
1211             0 => &mut self.x,
1212             1 => &mut self.y,
1213             2 => &mut self.z,
1214             3 => &mut self.w,
1215             _ => panic!("index out of bounds"),
1216         }
1217     }
1218 }
1219 
1220 #[cfg(not(target_arch = "spirv"))]
1221 impl fmt::Display for U64Vec4 {
fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result1222     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1223         write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
1224     }
1225 }
1226 
1227 #[cfg(not(target_arch = "spirv"))]
1228 impl fmt::Debug for U64Vec4 {
fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result1229     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
1230         fmt.debug_tuple(stringify!(U64Vec4))
1231             .field(&self.x)
1232             .field(&self.y)
1233             .field(&self.z)
1234             .field(&self.w)
1235             .finish()
1236     }
1237 }
1238 
1239 impl From<[u64; 4]> for U64Vec4 {
1240     #[inline]
from(a: [u64; 4]) -> Self1241     fn from(a: [u64; 4]) -> Self {
1242         Self::new(a[0], a[1], a[2], a[3])
1243     }
1244 }
1245 
1246 impl From<U64Vec4> for [u64; 4] {
1247     #[inline]
from(v: U64Vec4) -> Self1248     fn from(v: U64Vec4) -> Self {
1249         [v.x, v.y, v.z, v.w]
1250     }
1251 }
1252 
1253 impl From<(u64, u64, u64, u64)> for U64Vec4 {
1254     #[inline]
from(t: (u64, u64, u64, u64)) -> Self1255     fn from(t: (u64, u64, u64, u64)) -> Self {
1256         Self::new(t.0, t.1, t.2, t.3)
1257     }
1258 }
1259 
1260 impl From<U64Vec4> for (u64, u64, u64, u64) {
1261     #[inline]
from(v: U64Vec4) -> Self1262     fn from(v: U64Vec4) -> Self {
1263         (v.x, v.y, v.z, v.w)
1264     }
1265 }
1266 
1267 impl From<(U64Vec3, u64)> for U64Vec4 {
1268     #[inline]
from((v, w): (U64Vec3, u64)) -> Self1269     fn from((v, w): (U64Vec3, u64)) -> Self {
1270         Self::new(v.x, v.y, v.z, w)
1271     }
1272 }
1273 
1274 impl From<(u64, U64Vec3)> for U64Vec4 {
1275     #[inline]
from((x, v): (u64, U64Vec3)) -> Self1276     fn from((x, v): (u64, U64Vec3)) -> Self {
1277         Self::new(x, v.x, v.y, v.z)
1278     }
1279 }
1280 
1281 impl From<(U64Vec2, u64, u64)> for U64Vec4 {
1282     #[inline]
from((v, z, w): (U64Vec2, u64, u64)) -> Self1283     fn from((v, z, w): (U64Vec2, u64, u64)) -> Self {
1284         Self::new(v.x, v.y, z, w)
1285     }
1286 }
1287 
1288 impl From<(U64Vec2, U64Vec2)> for U64Vec4 {
1289     #[inline]
from((v, u): (U64Vec2, U64Vec2)) -> Self1290     fn from((v, u): (U64Vec2, U64Vec2)) -> Self {
1291         Self::new(v.x, v.y, u.x, u.y)
1292     }
1293 }
1294 
1295 impl From<U16Vec4> for U64Vec4 {
1296     #[inline]
from(v: U16Vec4) -> Self1297     fn from(v: U16Vec4) -> Self {
1298         Self::new(
1299             u64::from(v.x),
1300             u64::from(v.y),
1301             u64::from(v.z),
1302             u64::from(v.w),
1303         )
1304     }
1305 }
1306 
1307 impl From<UVec4> for U64Vec4 {
1308     #[inline]
from(v: UVec4) -> Self1309     fn from(v: UVec4) -> Self {
1310         Self::new(
1311             u64::from(v.x),
1312             u64::from(v.y),
1313             u64::from(v.z),
1314             u64::from(v.w),
1315         )
1316     }
1317 }
1318 
1319 impl TryFrom<I16Vec4> for U64Vec4 {
1320     type Error = core::num::TryFromIntError;
1321 
1322     #[inline]
try_from(v: I16Vec4) -> Result<Self, Self::Error>1323     fn try_from(v: I16Vec4) -> Result<Self, Self::Error> {
1324         Ok(Self::new(
1325             u64::try_from(v.x)?,
1326             u64::try_from(v.y)?,
1327             u64::try_from(v.z)?,
1328             u64::try_from(v.w)?,
1329         ))
1330     }
1331 }
1332 
1333 impl TryFrom<IVec4> for U64Vec4 {
1334     type Error = core::num::TryFromIntError;
1335 
1336     #[inline]
try_from(v: IVec4) -> Result<Self, Self::Error>1337     fn try_from(v: IVec4) -> Result<Self, Self::Error> {
1338         Ok(Self::new(
1339             u64::try_from(v.x)?,
1340             u64::try_from(v.y)?,
1341             u64::try_from(v.z)?,
1342             u64::try_from(v.w)?,
1343         ))
1344     }
1345 }
1346 
1347 impl TryFrom<I64Vec4> for U64Vec4 {
1348     type Error = core::num::TryFromIntError;
1349 
1350     #[inline]
try_from(v: I64Vec4) -> Result<Self, Self::Error>1351     fn try_from(v: I64Vec4) -> Result<Self, Self::Error> {
1352         Ok(Self::new(
1353             u64::try_from(v.x)?,
1354             u64::try_from(v.y)?,
1355             u64::try_from(v.z)?,
1356             u64::try_from(v.w)?,
1357         ))
1358     }
1359 }
1360