Skip to content

Figure out which target features are required for which SIMD size #131800

Open

Description

The context for this is #116558: passing vector types by-value over extern "C" needs certain registers to be present, so if the target feature enabling these registers is missing, then either the ABI needs to change (which can lead to soundness issues if caller and callee disagree on their target features), or LLVM just errors outright.

#127731 moves us towards detecting this situation, but that approach needs data about which target feature is needed to pass which vector size. That will be different for each architecture. So this issue is about gathering all that data.

  • x86 (32bit and 64bit)
    • "sse" => vlen(128)
    • "avx" => vlen(256)
    • "avx512f", "evex512" => vlen(512)
  • arm
    • "neon" => vlen(128)
    • "mve" => ???
  • aarch64:
    • "neon" => vlen(128)
    • "sve" & -Cllvm-args="--aarch64-sve-vector-bits-min={N}" => vlen(N), NOTE: only scalable vectors?
  • hexagon
    • "hvx-length64b" => vlen(512)
    • "hvx-length128b" => vlen(1024)
  • powerpc
    • "altivec" => vlen(128)
    • "mma" => vlen(512), NOTE: not supported by clang
  • mips: "msa" => vlen(128)
  • riscv
    • "zve32x" | "zve32f" => vlen(32),
    • "zve64x" | "zve64f" | "zve64d" => vlen(64),
    • "zvl128b" | "v" => vlen(128)
    • "zvl{N}b" => vlen(N)
    • "zvl" & -Cllvm-args="--riscv-v-vector-bits-min={N}" => vlen(N), NOTE: only scalable vectors?
  • wasm: "simd128" => vlen(128)
  • bpf: none
  • csky: "vdsp1" | "vdsp2" => vlen(128),
  • loongarch: should have an on-stack ABI
  • s390x: "vector" => vlen(128)
  • more?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)A-SIMDArea: SIMD (Single Instruction Multiple Data)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions