-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
C-feature-requestCategory: a feature request, i.e. not implemented / a PRCategory: a feature request, i.e. not implemented / a PR
Description
I have been playing around with portable_simd on my regular avx512 capable laptop,
and noticed that the alignment constraints of the larger vector types seem to grow beyond the limitations imposed by the hardware (u64x64 require their full size, so 512 byte! alignment).
Is this behavior intended? (E.g. to be directly forward compatible with future even larger vector extensions?)
Since the underlying types leverage repr_simd this might be a issue for the compiler itself, but I wanted to check here first.
macro_rules! debug_simd_align {
(@inner $t:ty, $($N:literal)*) => {
$(
println!("{} {:?}", std::any::type_name::<Simd::<$t, $N>>(), std::alloc::Layout::new::<Simd::<$t, $N>>());
)*
};
($t:ty) => {
debug_simd_align!(@inner $t, 1 2 4 8 16 32 64)
};
}
#[test]
fn test_simd_alignment() {
debug_simd_align!(u8);
debug_simd_align!(u16);
debug_simd_align!(u32);
debug_simd_align!(u64);
debug_simd_align!(usize);
}Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: a feature request, i.e. not implemented / a PRCategory: a feature request, i.e. not implemented / a PR