-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Copy link
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-alignArea: alignment control (`repr(align(N))` and so on)Area: alignment control (`repr(align(N))` and so on)A-reprArea: the `#[repr(stuff)]` attributeArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
See this example playground
#[repr(simd, align(32))]
struct Test([f32; 4]);
fn main() {
println!("{}", core::mem::align_of::<Test>());
}
I expected to see this happen: an alignment of at least 32 to be printed.
Instead, this happened: the alignment is only 16
, the align of the underlying platform 128bit simd vector type.
Meta
Seen on playground nightly with version
(2024-09-14 9b72238eb813e9d06e9e)
Metadata
Metadata
Assignees
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-alignArea: alignment control (`repr(align(N))` and so on)Area: alignment control (`repr(align(N))` and so on)A-reprArea: the `#[repr(stuff)]` attributeArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.