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

179 lines
3.9 KiB
LLVM

; Test an i32 0/-1 SELECTCCC for every floating-point condition.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
; Test CC in { 0 }
define i32 @f1(float %a, float %b) {
; CHECK-LABEL: f1:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, -268435456
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp oeq float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 1 }
define i32 @f2(float %a, float %b) {
; CHECK-LABEL: f2:
; CHECK: ipm %r2
; CHECK-NEXT: xilf %r2, 268435456
; CHECK-NEXT: afi %r2, -268435456
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp olt float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 0, 1 }
define i32 @f3(float %a, float %b) {
; CHECK-LABEL: f3:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, -536870912
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ole float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 2 }
define i32 @f4(float %a, float %b) {
; CHECK-LABEL: f4:
; CHECK: ipm %r2
; CHECK-NEXT: xilf %r2, 268435456
; CHECK-NEXT: afi %r2, 1342177280
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ogt float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 0, 2 }
define i32 @f5(float %a, float %b) {
; CHECK-LABEL: f5:
; CHECK: ipm %r2
; CHECK-NEXT: xilf %r2, 4294967295
; CHECK-NEXT: sll %r2, 3
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp oge float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 1, 2 }
define i32 @f6(float %a, float %b) {
; CHECK-LABEL: f6:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, 268435456
; CHECK-NEXT: sll %r2, 2
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp one float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 0, 1, 2 }
define i32 @f7(float %a, float %b) {
; CHECK-LABEL: f7:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, -805306368
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ord float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 3 }
define i32 @f8(float %a, float %b) {
; CHECK-LABEL: f8:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, 1342177280
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp uno float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 0, 3 }
define i32 @f9(float %a, float %b) {
; CHECK-LABEL: f9:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, -268435456
; CHECK-NEXT: sll %r2, 2
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ueq float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 1, 3 }
define i32 @f10(float %a, float %b) {
; CHECK-LABEL: f10:
; CHECK: ipm %r2
; CHECK-NEXT: sll %r2, 3
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ult float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 0, 1, 3 }
define i32 @f11(float %a, float %b) {
; CHECK-LABEL: f11:
; CHECK: ipm %r2
; CHECK-NEXT: xilf %r2, 268435456
; CHECK-NEXT: afi %r2, -805306368
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ule float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 2, 3 }
define i32 @f12(float %a, float %b) {
; CHECK-LABEL: f12:
; CHECK: ipm %r2
; CHECK-NEXT: sll %r2, 2
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp ugt float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 0, 2, 3 }
define i32 @f13(float %a, float %b) {
; CHECK-LABEL: f13:
; CHECK: ipm %r2
; CHECK-NEXT: xilf %r2, 268435456
; CHECK-NEXT: afi %r2, 1879048192
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp uge float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}
; Test CC in { 1, 2, 3 }
define i32 @f14(float %a, float %b) {
; CHECK-LABEL: f14:
; CHECK: ipm %r2
; CHECK-NEXT: afi %r2, 1879048192
; CHECK-NEXT: sra %r2, 31
; CHECK: br %r14
%cond = fcmp une float %a, %b
%res = select i1 %cond, i32 -1, i32 0
ret i32 %res
}