blob: 6d5472ea05f69d6e16ba934506f3a19218b379ba [file] [log] [blame]
; 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: cmp x3, #0
; AARCH-NEXT: umulh x10, x1, x2
; AARCH-NEXT: cset w8, ne
; AARCH-NEXT: cmp x1, #0
; AARCH-NEXT: cset w9, ne
; AARCH-NEXT: cmp xzr, x10
; AARCH-NEXT: and w8, w9, w8
; AARCH-NEXT: mul x9, x3, x0
; AARCH-NEXT: umulh x10, x3, x0
; AARCH-NEXT: cset w11, ne
; AARCH-NEXT: madd x9, x1, x2, x9
; AARCH-NEXT: orr w8, w8, w11
; AARCH-NEXT: cmp xzr, x10
; AARCH-NEXT: umulh x10, x0, x2
; AARCH-NEXT: cset w11, ne
; AARCH-NEXT: mul x0, x0, x2
; AARCH-NEXT: adds x1, x10, x9
; AARCH-NEXT: orr w8, w8, w11
; AARCH-NEXT: cset w9, hs
; AARCH-NEXT: orr w2, w8, w9
; 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
}
; Function Attrs: nounwind readnone speculatable
declare { i128, i1 } @llvm.umul.with.overflow.i128(i128, i128) #1
attributes #0 = { nounwind readnone uwtable }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { nounwind }