Files
llvm-project/llvm/test/CodeGen/SPIRV/transcoding/OpVectorExtractDynamic.ll
Arseniy Obolenskiy 69b116d075 [SPIR-V] Fix OpVectorExtractDynamic operand type (#189635)
vID is a register class for integer vector registers only. vfID (float
vector registers) should be also accepted. Aligning the definition with
other instructions of this kind

related to #188703
2026-04-01 14:29:45 +02:00

18 lines
717 B
LLVM

; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; CHECK-SPIRV: OpName %[[#vec:]] "vec"
; CHECK-SPIRV: OpName %[[#index:]] "index"
; CHECK-SPIRV: %[[#float:]] = OpTypeFloat 32
; CHECK-SPIRV: %[[#float2:]] = OpTypeVector %[[#float]] 2
; CHECK-SPIRV: %[[#res:]] = OpVectorExtractDynamic %[[#float]] %[[#vec]] %[[#index]]
define spir_kernel void @test(ptr addrspace(1) nocapture %out, <2 x float> %vec, i32 %index) {
entry:
%res = extractelement <2 x float> %vec, i32 %index
store float %res, ptr addrspace(1) %out, align 4
ret void
}