@@ -45,12 +45,12 @@ That is, two distinct `repr(simd)` vector types that have the same `T` and the
45
45
same ` N ` have the same size and alignment.
46
46
47
47
Vector elements are laid out in source field order, enabling random access to
48
- vector elements by reinterpreting the vector as an array:
48
+ vector elements by reinterpreting the vector as an array or as an homogeneous tuple :
49
49
50
50
``` rust,ignore
51
51
union U {
52
52
vec: Vector<T, N>,
53
- arr: [T; N]
53
+ arr: [T; N],
54
54
}
55
55
56
56
assert_eq!(size_of::<Vector<T, N>>(), size_of::<[T; N]>());
@@ -66,32 +66,6 @@ unsafe {
66
66
```
67
67
68
68
### Unresolved questions
69
-
70
- * ** Blocked** : Should the layout of packed SIMD vectors be the same as that of
71
- homogeneous tuples ? Such that:
72
-
73
- ``` rust,ignore
74
- union U {
75
- vec: Vector<T, N>,
76
- tup: (T_0, ..., T_(N-1)),
77
- }
78
-
79
- assert_eq!(size_of::<Vector<T, N>>(), size_of::<(T_0, ..., T_(N-1))>());
80
- assert!(align_of::<Vector<T, N>>() >= align_of::<(T_0, ..., T_(N-1))>());
81
-
82
- unsafe {
83
- let u = U { vec: Vector(t_0, ..., t_(N - 1)) };
84
-
85
- assert_eq!(u.vec.0, u.tup.0);
86
- // ...
87
- assert_eq!(u.vec.(N - 1), u.tup.(N - 1));
88
- }
89
- ```
90
-
91
- This is blocked on the resolution of issue [ #36 ] about the layout of
92
- homogeneous structs and tuples.
93
-
94
- [ #36 ] : https://github.com/rust-rfcs/unsafe-code-guidelines/issues/36
95
69
96
70
* ` MaybeUninit<T> ` does not have the same ` repr ` as ` T ` , so
97
71
` MaybeUninit<Vector<T, N>> ` are not ` repr(simd) ` , which has performance
0 commit comments