File: umulo-128-legalisation-lowering.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (44 lines) | stat: -rw-r--r-- 1,548 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
; 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 // =0
; AARCH-NEXT:    umulh x8, x1, x2
; AARCH-NEXT:    cset w10, ne
; AARCH-NEXT:    cmp x1, #0 // =0
; AARCH-NEXT:    mul x9, x3, x0
; AARCH-NEXT:    cset w11, ne
; AARCH-NEXT:    cmp xzr, x8
; AARCH-NEXT:    umulh x8, x3, x0
; AARCH-NEXT:    madd x9, x1, x2, x9
; AARCH-NEXT:    and w10, w11, w10
; AARCH-NEXT:    cset w11, ne
; AARCH-NEXT:    cmp xzr, x8
; AARCH-NEXT:    umulh x8, x0, x2
; AARCH-NEXT:    orr w10, w10, w11
; AARCH-NEXT:    cset w11, ne
; AARCH-NEXT:    adds x1, x8, x9
; AARCH-NEXT:    orr w8, w10, w11
; AARCH-NEXT:    cset w9, hs
; AARCH-NEXT:    orr w8, w8, w9
; AARCH-NEXT:    mul x0, x0, x2
; AARCH-NEXT:    mov w2, w8
; 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 }