GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gccrs

gccrs: Implement basic support for #[repr(simd)]

Adds type-checking support for #[repr(simd)] structs in gccrs.

gccrs now includes basic type-checking for structs annotated with #[repr(simd)]. This change allows the compiler to understand the SIMD representation for these types, although the actual compilation of such structs is still handled as regular structs. The implementation is specific to Rust version 1.49.0, as later versions (1.50.0+) use a different internal representation for #[repr(simd)] structs.

In Details

This commit adds the SIMD variant to ADTType::ReprKind and implements TypeCheckItem::validate_repr_simd to type-check Rust structs annotated with #[repr(simd)]. This is a preliminary step for full SIMD support in gccrs, focusing only on the type-checking aspect for the 1.49.0 ABI. Subsequent compilation and code generation for these structs will be handled separately. The change also renames inline_option to repr_option in TypeCheckBase::parse_repr_options for clarity.

For Context
#[repr(simd)]
A Rust attribute that hints to the compiler that a struct's memory layout should be compatible with SIMD (Single Instruction, Multiple Data) operations. This can enable performance optimizations by allowing data to be processed in parallel.
type-checking
The process by which a compiler verifies that a program's source code adheres to the language's syntax and type rules. It ensures that operations are performed on compatible data types before compilation proceeds.
ADTType::ReprKind
An internal compiler representation for the various memory layout kinds (representations) that an Abstract Data Type (ADT) in Rust can have, such as C, Transparent, Packed, and now Simd.
Filed Under: gccrsrustsimdtype-checking