Skip to content

LLVM Backend panics when misusing #simd literals #6370

@MrMetube

Description

@MrMetube

Context

    Odin:    dev-2026-02:b942f72cb
    OS:      Windows 11 Professional (version: 25H2), build 26200.7840
    CPU:     12th Gen Intel(R) Core(TM) i5-12600
    RAM:     32540 MiB
    Backend: LLVM 20.1.0

Expected Behavior

Either allow it and upcast/widen the extracted lane or report that the types cannot be compared. Whatever fits with normal behaviour.

Current Behavior

The llvm backend panics.

Failure Information (for bugs)

<odin root>\src\llvm_backend_expr.cpp(3681): Panic: Unknown handled type: #simd[4]u32 -> #simd[4]u32

Steps to Reproduce

odin build this repro code.

package repro

import "core:simd"
import "core:fmt"

main :: proc () {
    V :: #simd [4] u32
    
    // these work
    a := simd.extract(cast(V) 0, 1) == cast(V) 0
    fmt.print(a)
    
    b: V
    c: V
    _ = simd.extract(b, 1) == c
    
    // these all panic
    _ = simd.extract(b, 1) == cast(V) 0
    
    d :: cast(V) 0
    _ = simd.extract(b, 1) == d
    
    e : V : 0
    _ = simd.extract(b, 1) == e
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions