Debian Codegraph @

llvm/test/CodeGen/PowerPC/uaddo-32.ll

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu | FileCheck %s --check-prefix=LINUXASM
3 ; RUN: llc < %s -mtriple=powerpc-ibm-aix-xcoff | FileCheck %s --check-prefix=AIXASM
4
5 define noundef i32 @add(i32 noundef %a, i32 noundef %b, ptr nocapture noundef writeonly %ovf) {
6 ; LINUXASM-LABEL: add:
7 ; LINUXASM: # %bb.0: # %entry
8 ; LINUXASM-NEXT: li 6, 0
9 ; LINUXASM-NEXT: addc 3, 3, 4
10 ; LINUXASM-NEXT: addze 4, 6
11 ; LINUXASM-NEXT: stw 4, 0(5)
12 ; LINUXASM-NEXT: blr
13
14 ; AIXASM-LABEL: .add:
15 ; AIXASM: # %bb.0: # %entry
16 ; AIXASM-NEXT: addc 3, 3, 4
17 ; AIXASM-NEXT: li 4, 0
18 ; AIXASM-NEXT: addze 4, 4
19 ; AIXASM-NEXT: stw 4, 0(5)
20 ; AIXASM-NEXT: blr
21
22 entry:
23 %0 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %a, i32 %b)
24 %1 = extractvalue { i32, i1 } %0, 1
25 %2 = extractvalue { i32, i1 } %0, 0
26 %3 = zext i1 %1 to i32
27 store i32 %3, ptr %ovf, align 8
28 ret i32 %2
29 }
30
31 declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
32
33 define noundef zeroext i1 @add_overflow(i32 noundef %a, i32 noundef %b, ptr nocapture noundef writeonly %ovf) {
34 ; LINUXASM-LABEL: add_overflow:
35 ; LINUXASM: # %bb.0: # %entry
36 ; LINUXASM-NEXT: li 6, 0
37 ; LINUXASM-NEXT: addc 4, 3, 4
38 ; LINUXASM-NEXT: addze 3, 6
39 ; LINUXASM-NEXT: stw 4, 0(5)
40 ; LINUXASM-NEXT: blr
41
42 ; AIXASM-LABEL: .add_overflow:
43 ; AIXASM: # %bb.0: # %entry
44 ; AIXASM-NEXT: addc 4, 3, 4
45 ; AIXASM-NEXT: li 3, 0
46 ; AIXASM-NEXT: addze 3, 3
47 ; AIXASM-NEXT: stw 4, 0(5)
48 ; AIXASM-NEXT: blr
49
50 entry:
51 %0 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %a, i32 %b)
52 %1 = extractvalue { i32, i1 } %0, 1
53 %2 = extractvalue { i32, i1 } %0, 0
54 store i32 %2, ptr %ovf, align 8
55 ret i1 %1
56 }