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
125 lines
4.3 KiB
LLVM
125 lines
4.3 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu | FileCheck %s --check-prefixes=AARCH
|
|
|
|
define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
|
|
; AARCH-LABEL: muloti_test:
|
|
; AARCH: // %bb.0: // %start
|
|
; AARCH-NEXT: orr x8, x1, x3
|
|
; AARCH-NEXT: cbz x8, .LBB0_2
|
|
; AARCH-NEXT: // %bb.1: // %overflow
|
|
; AARCH-NEXT: mul x9, x3, x0
|
|
; AARCH-NEXT: cmp x1, #0
|
|
; AARCH-NEXT: ccmp x3, #0, #4, ne
|
|
; AARCH-NEXT: umulh x10, x1, x2
|
|
; AARCH-NEXT: umulh x8, x3, x0
|
|
; AARCH-NEXT: madd x9, x1, x2, x9
|
|
; AARCH-NEXT: ccmp xzr, x10, #0, eq
|
|
; AARCH-NEXT: umulh x11, x0, x2
|
|
; AARCH-NEXT: ccmp xzr, x8, #0, eq
|
|
; AARCH-NEXT: mul x0, x0, x2
|
|
; AARCH-NEXT: cset w8, ne
|
|
; AARCH-NEXT: adds x1, x11, x9
|
|
; AARCH-NEXT: csinc w2, w8, wzr, lo
|
|
; AARCH-NEXT: ret
|
|
; AARCH-NEXT: .LBB0_2: // %overflow.no
|
|
; AARCH-NEXT: umulh x1, x0, x2
|
|
; AARCH-NEXT: mul x0, x0, x2
|
|
; AARCH-NEXT: mov w2, wzr
|
|
; AARCH-NEXT: ret
|
|
start:
|
|
%0 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %l, i128 %r) #2
|
|
%1 = extractvalue { i128, i1 } %0, 0
|
|
%2 = extractvalue { i128, i1 } %0, 1
|
|
%3 = zext i1 %2 to i8
|
|
%4 = insertvalue { i128, i8 } undef, i128 %1, 0
|
|
%5 = insertvalue { i128, i8 } %4, i8 %3, 1
|
|
ret { i128, i8 } %5
|
|
}
|
|
|
|
; PR56403
|
|
; We avoid lowering the intrinsic as a libcall because this function has the same name as
|
|
; the libcall we wanted to generate (that would create an infinite loop).
|
|
|
|
define i128 @__muloti4(i128 %0, i128 %1, ptr nocapture nonnull writeonly align 4 %2) #2 {
|
|
; AARCH-LABEL: __muloti4:
|
|
; AARCH: // %bb.0: // %Entry
|
|
; AARCH-NEXT: eor x8, x3, x2, asr #63
|
|
; AARCH-NEXT: eor x9, x1, x0, asr #63
|
|
; AARCH-NEXT: str wzr, [x4]
|
|
; AARCH-NEXT: orr x8, x9, x8
|
|
; AARCH-NEXT: cbz x8, .LBB1_2
|
|
; AARCH-NEXT: // %bb.1: // %overflow
|
|
; AARCH-NEXT: asr x9, x1, #63
|
|
; AARCH-NEXT: umulh x10, x0, x2
|
|
; AARCH-NEXT: asr x13, x3, #63
|
|
; AARCH-NEXT: mul x11, x1, x2
|
|
; AARCH-NEXT: umulh x8, x1, x2
|
|
; AARCH-NEXT: mul x9, x9, x2
|
|
; AARCH-NEXT: adds x10, x11, x10
|
|
; AARCH-NEXT: mul x14, x0, x3
|
|
; AARCH-NEXT: umulh x12, x0, x3
|
|
; AARCH-NEXT: adc x9, x8, x9
|
|
; AARCH-NEXT: mul x13, x0, x13
|
|
; AARCH-NEXT: adds x8, x14, x10
|
|
; AARCH-NEXT: mul x15, x1, x3
|
|
; AARCH-NEXT: smulh x10, x1, x3
|
|
; AARCH-NEXT: adc x11, x12, x13
|
|
; AARCH-NEXT: asr x12, x9, #63
|
|
; AARCH-NEXT: asr x13, x11, #63
|
|
; AARCH-NEXT: adds x9, x9, x11
|
|
; AARCH-NEXT: asr x11, x8, #63
|
|
; AARCH-NEXT: mul x0, x0, x2
|
|
; AARCH-NEXT: adc x12, x12, x13
|
|
; AARCH-NEXT: adds x9, x15, x9
|
|
; AARCH-NEXT: adc x10, x10, x12
|
|
; AARCH-NEXT: cmp x9, x11
|
|
; AARCH-NEXT: ccmp x10, x11, #0, eq
|
|
; AARCH-NEXT: cset w9, ne
|
|
; AARCH-NEXT: tbnz x1, #63, .LBB1_3
|
|
; AARCH-NEXT: b .LBB1_4
|
|
; AARCH-NEXT: .LBB1_2: // %overflow.no
|
|
; AARCH-NEXT: smulh x8, x0, x2
|
|
; AARCH-NEXT: mov w9, wzr
|
|
; AARCH-NEXT: mul x0, x0, x2
|
|
; AARCH-NEXT: tbz x1, #63, .LBB1_4
|
|
; AARCH-NEXT: .LBB1_3: // %overflow.res
|
|
; AARCH-NEXT: eor x10, x3, #0x8000000000000000
|
|
; AARCH-NEXT: orr x10, x2, x10
|
|
; AARCH-NEXT: cbz x10, .LBB1_5
|
|
; AARCH-NEXT: .LBB1_4: // %Else2
|
|
; AARCH-NEXT: cbz w9, .LBB1_6
|
|
; AARCH-NEXT: .LBB1_5: // %Then7
|
|
; AARCH-NEXT: mov w9, #1 // =0x1
|
|
; AARCH-NEXT: str w9, [x4]
|
|
; AARCH-NEXT: .LBB1_6: // %Block9
|
|
; AARCH-NEXT: mov x1, x8
|
|
; AARCH-NEXT: ret
|
|
Entry:
|
|
store i32 0, ptr %2, align 4
|
|
%.fr = freeze i128 %1
|
|
%mul = tail call { i128, i1 } @llvm.smul.with.overflow.i128(i128 %0, i128 %.fr)
|
|
%3 = icmp slt i128 %0, 0
|
|
%4 = icmp eq i128 %.fr, -170141183460469231731687303715884105728
|
|
%5 = and i1 %3, %4
|
|
br i1 %5, label %Then7, label %Else2
|
|
|
|
Else2: ; preds = %Entry
|
|
%mul.ov = extractvalue { i128, i1 } %mul, 1
|
|
br i1 %mul.ov, label %Then7, label %Block9
|
|
|
|
Then7: ; preds = %Else2, %Entry
|
|
store i32 1, ptr %2, align 4
|
|
br label %Block9
|
|
|
|
Block9: ; preds = %Else2, %Then7
|
|
%mul.val = extractvalue { i128, i1 } %mul, 0
|
|
ret i128 %mul.val
|
|
}
|
|
|
|
declare { i128, i1 } @llvm.umul.with.overflow.i128(i128, i128) #1
|
|
declare { i128, i1 } @llvm.smul.with.overflow.i128(i128, i128) #1
|
|
|
|
attributes #0 = { nounwind readnone uwtable }
|
|
attributes #1 = { nounwind readnone speculatable }
|
|
attributes #2 = { nounwind }
|