Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

78 lines
3.0 KiB
LLVM

; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
; OpSelect: condition and object component counts must match.
; CHECK-DAG: %[[#Bool:]] = OpTypeBool
; CHECK-DAG: %[[#I32:]] = OpTypeInt 32 0
; CHECK-DAG: %[[#F32:]] = OpTypeFloat 32
; CHECK-DAG: %[[#I8:]] = OpTypeInt 8 0
; CHECK-DAG: %[[#PtrI8:]] = OpTypePointer Function %[[#I8]]
; CHECK-DAG: %[[#V4I32:]] = OpTypeVector %[[#I32]] 4
; CHECK-DAG: %[[#V4F32:]] = OpTypeVector %[[#F32]] 4
; CHECK-DAG: %[[#V4Bool:]] = OpTypeVector %[[#Bool]] 4
; Scalar result, scalar cond.
; CHECK: OpFunction
; CHECK: %[[#SC:]] = OpFunctionParameter %[[#Bool]]
; CHECK: %[[#SA:]] = OpFunctionParameter %[[#I32]]
; CHECK: %[[#SB:]] = OpFunctionParameter %[[#I32]]
; CHECK: %{{[0-9]+}} = OpSelect %[[#I32]] %[[#SC]] %[[#SA]] %[[#SB]]
define i32 @sel_i32_scond(i1 %c, i32 %a, i32 %b) {
%r = select i1 %c, i32 %a, i32 %b
ret i32 %r
}
; CHECK: OpFunction
; CHECK: %[[#FC:]] = OpFunctionParameter %[[#Bool]]
; CHECK: %[[#FA:]] = OpFunctionParameter %[[#F32]]
; CHECK: %[[#FB:]] = OpFunctionParameter %[[#F32]]
; CHECK: %{{[0-9]+}} = OpSelect %[[#F32]] %[[#FC]] %[[#FA]] %[[#FB]]
define float @sel_f32_scond(i1 %c, float %a, float %b) {
%r = select i1 %c, float %a, float %b
ret float %r
}
; CHECK: OpFunction
; CHECK: %[[#PC:]] = OpFunctionParameter %[[#Bool]]
; CHECK: %[[#PA:]] = OpFunctionParameter %[[#PtrI8]]
; CHECK: %[[#PB:]] = OpFunctionParameter %[[#PtrI8]]
; CHECK: %{{[0-9]+}} = OpSelect %[[#PtrI8]] %[[#PC]] %[[#PA]] %[[#PB]]
define ptr @sel_ptr_scond(i1 %c, ptr %a, ptr %b) {
%r = select i1 %c, ptr %a, ptr %b
ret ptr %r
}
; Vector result, scalar (broadcast) cond.
; CHECK: OpFunction
; CHECK: %[[#VSC:]] = OpFunctionParameter %[[#Bool]]
; CHECK: %[[#VSA:]] = OpFunctionParameter %[[#V4I32]]
; CHECK: %[[#VSB:]] = OpFunctionParameter %[[#V4I32]]
; CHECK: %{{[0-9]+}} = OpSelect %[[#V4I32]] %[[#VSC]] %[[#VSA]] %[[#VSB]]
define <4 x i32> @sel_v4i32_scond(i1 %c, <4 x i32> %a, <4 x i32> %b) {
%r = select i1 %c, <4 x i32> %a, <4 x i32> %b
ret <4 x i32> %r
}
; Vector result, vector cond.
; CHECK: OpFunction
; CHECK: %[[#VVIC:]] = OpFunctionParameter %[[#V4Bool]]
; CHECK: %[[#VVIA:]] = OpFunctionParameter %[[#V4I32]]
; CHECK: %[[#VVIB:]] = OpFunctionParameter %[[#V4I32]]
; CHECK: %{{[0-9]+}} = OpSelect %[[#V4I32]] %[[#VVIC]] %[[#VVIA]] %[[#VVIB]]
define <4 x i32> @sel_v4i32_vcond(<4 x i1> %c, <4 x i32> %a, <4 x i32> %b) {
%r = select <4 x i1> %c, <4 x i32> %a, <4 x i32> %b
ret <4 x i32> %r
}
; CHECK: OpFunction
; CHECK: %[[#VVFC:]] = OpFunctionParameter %[[#V4Bool]]
; CHECK: %[[#VVFA:]] = OpFunctionParameter %[[#V4F32]]
; CHECK: %[[#VVFB:]] = OpFunctionParameter %[[#V4F32]]
; CHECK: %{{[0-9]+}} = OpSelect %[[#V4F32]] %[[#VVFC]] %[[#VVFA]] %[[#VVFB]]
define <4 x float> @sel_v4f32_vcond(<4 x i1> %c, <4 x float> %a, <4 x float> %b) {
%r = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
ret <4 x float> %r
}