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
160 lines
4.7 KiB
LLVM
160 lines
4.7 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
|
|
; Test high-part i128->i256 multiplications on z17.
|
|
;
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z17 | FileCheck %s
|
|
|
|
; Multiply high signed.
|
|
define i128 @f1(i128 %a, i128 %b) {
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vl %v0, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r3), 3
|
|
; CHECK-NEXT: vmhq %v0, %v1, %v0
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = sext i128 %a to i256
|
|
%extb = sext i128 %b to i256
|
|
%extres = mul i256 %exta, %extb
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply high unsigned.
|
|
define i128 @f2(i128 %a, i128 %b) {
|
|
; CHECK-LABEL: f2:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vl %v0, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r3), 3
|
|
; CHECK-NEXT: vmlhq %v0, %v1, %v0
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = zext i128 %a to i256
|
|
%extb = zext i128 %b to i256
|
|
%extres = mul i256 %exta, %extb
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply-and-add high signed.
|
|
define i128 @f3(i128 %a, i128 %b, i128 %add) {
|
|
; CHECK-LABEL: f3:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vl %v0, 0(%r5), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v2, 0(%r3), 3
|
|
; CHECK-NEXT: vmahq %v0, %v2, %v1, %v0
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = sext i128 %a to i256
|
|
%extb = sext i128 %b to i256
|
|
%extadd = sext i128 %add to i256
|
|
%extmul = mul i256 %exta, %extb
|
|
%extres = add i256 %extmul, %extadd
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply-and-add high unsigned.
|
|
define i128 @f4(i128 %a, i128 %b, i128 %add) {
|
|
; CHECK-LABEL: f4:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vl %v0, 0(%r5), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v2, 0(%r3), 3
|
|
; CHECK-NEXT: vmalhq %v0, %v2, %v1, %v0
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = zext i128 %a to i256
|
|
%extb = zext i128 %b to i256
|
|
%extadd = zext i128 %add to i256
|
|
%extmul = mul i256 %exta, %extb
|
|
%extres = add i256 %extmul, %extadd
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply-and-add high signed with immediate operand to multiply.
|
|
define i128 @f5(i128 %a, i128 %add) {
|
|
; CHECK-LABEL: f5:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: larl %r1, .LCPI4_0
|
|
; CHECK-NEXT: vl %v0, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r3), 3
|
|
; CHECK-NEXT: vl %v2, 0(%r1), 3
|
|
; CHECK-NEXT: vmahq %v0, %v1, %v2, %v0
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = sext i128 %a to i256
|
|
%extadd = sext i128 %add to i256
|
|
%extmul = mul i256 %exta, 12345
|
|
%extres = add i256 %extmul, %extadd
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply-and-add high unsigned with immediate operand to multiply.
|
|
define i128 @f6(i128 %a, i128 %add) {
|
|
; CHECK-LABEL: f6:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: larl %r1, .LCPI5_0
|
|
; CHECK-NEXT: vl %v0, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r3), 3
|
|
; CHECK-NEXT: vl %v2, 0(%r1), 3
|
|
; CHECK-NEXT: vmalhq %v0, %v1, %v2, %v0
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = zext i128 %a to i256
|
|
%extadd = zext i128 %add to i256
|
|
%extmul = mul i256 %exta, 12345
|
|
%extres = add i256 %extmul, %extadd
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply-and-add high signed with immediate operand to addition.
|
|
define i128 @f7(i128 %a, i128 %b) {
|
|
; CHECK-LABEL: f7:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: larl %r1, .LCPI6_0
|
|
; CHECK-NEXT: vl %v0, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r3), 3
|
|
; CHECK-NEXT: vl %v2, 0(%r1), 3
|
|
; CHECK-NEXT: vmahq %v0, %v1, %v0, %v2
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = sext i128 %a to i256
|
|
%extb = sext i128 %b to i256
|
|
%extmul = mul i256 %exta, %extb
|
|
%extres = add i256 %extmul, 12345
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|
|
; Multiply-and-add high unsigned with immediate operand to addition.
|
|
define i128 @f8(i128 %a, i128 %b) {
|
|
; CHECK-LABEL: f8:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: larl %r1, .LCPI7_0
|
|
; CHECK-NEXT: vl %v0, 0(%r4), 3
|
|
; CHECK-NEXT: vl %v1, 0(%r3), 3
|
|
; CHECK-NEXT: vl %v2, 0(%r1), 3
|
|
; CHECK-NEXT: vmalhq %v0, %v1, %v0, %v2
|
|
; CHECK-NEXT: vst %v0, 0(%r2), 3
|
|
; CHECK-NEXT: br %r14
|
|
%exta = zext i128 %a to i256
|
|
%extb = zext i128 %b to i256
|
|
%extmul = mul i256 %exta, %extb
|
|
%extres = add i256 %extmul, 12345
|
|
%shiftres = lshr i256 %extres, 128
|
|
%res = trunc i256 %shiftres to i128
|
|
ret i128 %res
|
|
}
|
|
|