File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
crates/core_simd/src/vector Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ pub trait Vector: sealed::Sealed {
31
31
#[ must_use]
32
32
fn splat ( val : Self :: Scalar ) -> Self ;
33
33
34
+ /// Returns a slice containing the entire SIMD vector.
35
+ fn as_slice ( & self ) -> & [ Self :: Scalar ] ;
36
+
37
+ /// Returns a mutable slice containing the entire SIMD vector.
38
+ fn as_mut_slice ( & mut self ) -> & mut [ Self :: Scalar ] ;
34
39
}
35
40
36
41
macro_rules! impl_vector_for {
@@ -53,7 +58,17 @@ macro_rules! impl_vector_for {
53
58
54
59
#[ inline]
55
60
fn splat( val: Self :: Scalar ) -> Self {
56
- [ val; $lanes] . into( )
61
+ Self :: splat( val)
62
+ }
63
+
64
+ #[ inline]
65
+ fn as_slice( & self ) -> & [ Self :: Scalar ] {
66
+ self . as_slice( )
67
+ }
68
+
69
+ #[ inline]
70
+ fn as_mut_slice( & mut self ) -> & mut [ Self :: Scalar ] {
71
+ self . as_mut_slice( )
57
72
}
58
73
}
59
74
} ;
You can’t perform that action at this time.
0 commit comments