Skip to content

SIMD vector type: c_import omits every C vector type (#1872) because With has no vector type to spell it as #1874

Closed

Description

@ehartford

#1872 makes c_import omit C vector types (__attribute__((vector_size)), MSVC <intrin.h>'s _tile1024i, __m128 …): With has no SIMD vector type, and an array spelling would lie about the ABI (vectors are passed in vector registers). Every function or record using one is omitted or opaque, loudly at a use.

That is correct today and wrong forever: SSE/AVX/NEON intrinsics headers, SDL's SIMD helpers and image/audio code all reach these types. A language-level Vector[N, T] (Zig @Vector(N, T), Mojo SIMD[T, N], Rust std::simd — verify in .reference/) with the target's vector ABI in FnAbi/TypeLayout would let c_import present them. Needs a ruling (spelling, which ops, ABI per target) before implementation.

Activity

  1. ehartford commented on Sep 29, 2026

    @ehartford
    ContributorAuthor

    Ruling (Eric, 2026-09-29): implement it properly — a language-level SIMD vector type, in scope. Eric picks the spelling from a list of candidates (brief in progress); the spec wording follows his pick, then c_import maps C vector types onto it.

  2. ehartford commented on Sep 29, 2026

    @ehartford
    ContributorAuthor

    Spec v7.11 landed the blessed words (D78): §4.3d Vector Types, §16.1 C vector types. Implementation next; the compiler is non-compliant until then.

  3. ehartford commented on Sep 30, 2026

    @ehartford
    ContributorAuthor

    Implemented on main: 6719bda (#1927) — Vector[N, T], Mask[N, W], the aliases, lane-wise operators with scalar broadcast, m.select, masks, generic lane counts, 128-bit lanes, and c_import of C vector types, per spec v7.11/v7.14/v7.16 (D78, D80). Stack battery green on 3b9d06a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlanguage-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions