Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/SPIRV/transcoding/RelationalOperators.ll
T
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

258 lines
9.6 KiB
LLVM

; RUN: llc -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: %[[#bool:]] = OpTypeBool
; CHECK-SPIRV: %[[#bool2:]] = OpTypeVector %[[#bool]] 2
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpUGreaterThan %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testUGreaterThan(uint2 a, uint2 b, global int2 *res) {
;; res[0] = a > b;
;; }
define dso_local spir_kernel void @testUGreaterThan(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp ugt <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpSGreaterThan %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testSGreaterThan(int2 a, int2 b, global int2 *res) {
;; res[0] = a > b;
;; }
define dso_local spir_kernel void @testSGreaterThan(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp sgt <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpUGreaterThanEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testUGreaterThanEqual(uint2 a, uint2 b, global int2 *res) {
;; res[0] = a >= b;
;; }
define dso_local spir_kernel void @testUGreaterThanEqual(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp uge <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpSGreaterThanEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testSGreaterThanEqual(int2 a, int2 b, global int2 *res) {
;; res[0] = a >= b;
;; }
define dso_local spir_kernel void @testSGreaterThanEqual(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp sge <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpULessThan %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testULessThan(uint2 a, uint2 b, global int2 *res) {
;; res[0] = a < b;
;; }
define dso_local spir_kernel void @testULessThan(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp ult <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpSLessThan %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testSLessThan(int2 a, int2 b, global int2 *res) {
;; res[0] = a < b;
;; }
define dso_local spir_kernel void @testSLessThan(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp slt <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpULessThanEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testULessThanEqual(uint2 a, uint2 b, global int2 *res) {
;; res[0] = a <= b;
;; }
define dso_local spir_kernel void @testULessThanEqual(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp ule <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpSLessThanEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testSLessThanEqual(int2 a, int2 b, global int2 *res) {
;; res[0] = a <= b;
;; }
define dso_local spir_kernel void @testSLessThanEqual(<2 x i32> noundef %a, <2 x i32> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = icmp sle <2 x i32> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpFOrdEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testFOrdEqual(float2 a, float2 b, global int2 *res) {
;; res[0] = a == b;
;; }
define dso_local spir_kernel void @testFOrdEqual(<2 x float> noundef %a, <2 x float> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = fcmp oeq <2 x float> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpFUnordNotEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testFUnordNotEqual(float2 a, float2 b, global int2 *res) {
;; res[0] = a != b;
;; }
define dso_local spir_kernel void @testFUnordNotEqual(<2 x float> noundef %a, <2 x float> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = fcmp une <2 x float> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpFOrdGreaterThan %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testFOrdGreaterThan(float2 a, float2 b, global int2 *res) {
;; res[0] = a > b;
;; }
define dso_local spir_kernel void @testFOrdGreaterThan(<2 x float> noundef %a, <2 x float> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = fcmp ogt <2 x float> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpFOrdGreaterThanEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testFOrdGreaterThanEqual(float2 a, float2 b, global int2 *res) {
;; res[0] = a >= b;
;; }
define dso_local spir_kernel void @testFOrdGreaterThanEqual(<2 x float> noundef %a, <2 x float> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = fcmp oge <2 x float> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpFOrdLessThan %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testFOrdLessThan(float2 a, float2 b, global int2 *res) {
;; res[0] = a < b;
;; }
define dso_local spir_kernel void @testFOrdLessThan(<2 x float> noundef %a, <2 x float> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = fcmp olt <2 x float> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}
; CHECK-SPIRV: OpFunction
; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
; CHECK-SPIRV: %[[#]] = OpFOrdLessThanEqual %[[#bool2]] %[[#A]] %[[#B]]
; CHECK-SPIRV: OpFunctionEnd
;; kernel void testFOrdLessThanEqual(float2 a, float2 b, global int2 *res) {
;; res[0] = a <= b;
;; }
define dso_local spir_kernel void @testFOrdLessThanEqual(<2 x float> noundef %a, <2 x float> noundef %b, ptr addrspace(1) nocapture noundef writeonly %res) local_unnamed_addr {
entry:
%cmp = fcmp ole <2 x float> %a, %b
%sext = sext <2 x i1> %cmp to <2 x i32>
store <2 x i32> %sext, ptr addrspace(1) %res, align 8
ret void
}