Skip to content

Vector sizes are different in x86_64 backend #24179

Closed
@IntegratedQuantum

Description

@IntegratedQuantum

Zig Version

0.15.0-dev.828+3ce8d19f7

Steps to Reproduce and Observed Behavior

pub fn main() !void {
	@compileLog(@sizeOf(@Vector(2, f32)));
}

Observe that this prints different values depending on the backend

$ zig-debug run test.zig
...
Compile Log Output:
@as(comptime_int, 16)
$ zig-debug run test.zig -fllvm
...
Compile Log Output:
@as(comptime_int, 8)

Expected Behavior

The size of vector types, which are usable in extern structs, must be independent of the backend.
Current behavior violates the promise that extern structs have a well-defined in-memory layout.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions