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
114 lines
3.0 KiB
LLVM
114 lines
3.0 KiB
LLVM
; Test the Test Data Class instruction logic operation folding.
|
|
;
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
|
|
|
|
declare i32 @llvm.s390.tdc.f16(half, i64)
|
|
declare i32 @llvm.s390.tdc.f32(float, i64)
|
|
declare i32 @llvm.s390.tdc.f64(double, i64)
|
|
declare i32 @llvm.s390.tdc.f128(fp128, i64)
|
|
|
|
; Check using or i1
|
|
define i32 @f0(half %x) {
|
|
; CHECK-LABEL: f0
|
|
; CHECK: brasl %r14, __extendhfsf2@PLT
|
|
; CHECK: tceb %f0, 7
|
|
; CHECK-NEXT: ipm [[REG1:%r[0-9]+]]
|
|
; CHECK-NEXT: risbg %r2, [[REG1]], 63, 191, 36
|
|
%a = call i32 @llvm.s390.tdc.f16(half %x, i64 3)
|
|
%b = call i32 @llvm.s390.tdc.f16(half %x, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp ne i32 %b, 0
|
|
%res = or i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|
|
|
|
; Check using or i1
|
|
define i32 @f1(float %x) {
|
|
; CHECK-LABEL: f1
|
|
; CHECK: tceb %f0, 7
|
|
; CHECK-NEXT: ipm [[REG1:%r[0-9]+]]
|
|
; CHECK-NEXT: risbg %r2, [[REG1]], 63, 191, 36
|
|
%a = call i32 @llvm.s390.tdc.f32(float %x, i64 3)
|
|
%b = call i32 @llvm.s390.tdc.f32(float %x, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp ne i32 %b, 0
|
|
%res = or i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|
|
|
|
; Check using and i1
|
|
define i32 @f2(double %x) {
|
|
; CHECK-LABEL: f2
|
|
; CHECK: tcdb %f0, 2
|
|
; CHECK-NEXT: ipm [[REG1:%r[0-9]+]]
|
|
; CHECK-NEXT: risbg %r2, [[REG1]], 63, 191, 36
|
|
%a = call i32 @llvm.s390.tdc.f64(double %x, i64 3)
|
|
%b = call i32 @llvm.s390.tdc.f64(double %x, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp ne i32 %b, 0
|
|
%res = and i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|
|
|
|
; Check using xor i1
|
|
define i32 @f3(fp128 %x) {
|
|
; CHECK-LABEL: f3
|
|
; CHECK: tcxb %f0, 5
|
|
; CHECK-NEXT: ipm [[REG1:%r[0-9]+]]
|
|
; CHECK-NEXT: risbg %r2, [[REG1]], 63, 191, 36
|
|
%a = call i32 @llvm.s390.tdc.f128(fp128 %x, i64 3)
|
|
%b = call i32 @llvm.s390.tdc.f128(fp128 %x, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp ne i32 %b, 0
|
|
%res = xor i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|
|
|
|
; Check using xor i1 - negated test
|
|
define i32 @f4(fp128 %x) {
|
|
; CHECK-LABEL: f4
|
|
; CHECK: tcxb %f0, 4090
|
|
; CHECK-NEXT: ipm [[REG1:%r[0-9]+]]
|
|
; CHECK-NEXT: risbg %r2, [[REG1]], 63, 191, 36
|
|
%a = call i32 @llvm.s390.tdc.f128(fp128 %x, i64 3)
|
|
%b = call i32 @llvm.s390.tdc.f128(fp128 %x, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp eq i32 %b, 0
|
|
%res = xor i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|
|
|
|
; Check different first args
|
|
define i32 @f5(float %x, float %y) {
|
|
; CHECK-LABEL: f5
|
|
; CHECK-NOT: tceb {{%f[0-9]+}}, 5
|
|
; CHECK-DAG: tceb %f0, 3
|
|
; CHECK-DAG: tceb %f2, 6
|
|
%a = call i32 @llvm.s390.tdc.f32(float %x, i64 3)
|
|
%b = call i32 @llvm.s390.tdc.f32(float %y, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp ne i32 %b, 0
|
|
%res = xor i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|
|
|
|
; Non-const mask (not supported)
|
|
define i32 @f6(float %x, i64 %y) {
|
|
; CHECK-LABEL: f6
|
|
; CHECK-DAG: tceb %f0, 0(%r2)
|
|
; CHECK-DAG: tceb %f0, 6
|
|
%a = call i32 @llvm.s390.tdc.f32(float %x, i64 %y)
|
|
%b = call i32 @llvm.s390.tdc.f32(float %x, i64 6)
|
|
%a1 = icmp ne i32 %a, 0
|
|
%b1 = icmp ne i32 %b, 0
|
|
%res = xor i1 %a1, %b1
|
|
%xres = zext i1 %res to i32
|
|
ret i32 %xres
|
|
}
|