1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefixes=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=X64
5 define i32 @PR40483_add1(i32*, i32) nounwind {
6 ; X86-LABEL: PR40483_add1:
8 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
9 ; X86-NEXT: movl (%ecx), %eax
10 ; X86-NEXT: addl {{[0-9]+}}(%esp), %eax
11 ; X86-NEXT: movl %eax, (%ecx)
12 ; X86-NEXT: jae .LBB0_2
14 ; X86-NEXT: xorl %eax, %eax
18 ; X64-LABEL: PR40483_add1:
20 ; X64-NEXT: xorl %eax, %eax
21 ; X64-NEXT: addl (%rdi), %esi
22 ; X64-NEXT: movl %esi, (%rdi)
23 ; X64-NEXT: cmovael %esi, %eax
25 %3 = load i32, i32* %0, align 8
26 %4 = tail call { i8, i32 } @llvm.x86.addcarry.32(i8 0, i32 %3, i32 %1)
27 %5 = extractvalue { i8, i32 } %4, 1
28 store i32 %5, i32* %0, align 8
29 %6 = extractvalue { i8, i32 } %4, 0
33 %10 = select i1 %7, i32 %9, i32 0
37 define i32 @PR40483_add2(i32*, i32) nounwind {
38 ; X86-LABEL: PR40483_add2:
40 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
41 ; X86-NEXT: movl (%edx), %ecx
42 ; X86-NEXT: xorl %eax, %eax
43 ; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx
44 ; X86-NEXT: movl %ecx, (%edx)
45 ; X86-NEXT: jae .LBB1_2
47 ; X86-NEXT: movl %ecx, %eax
51 ; X64-LABEL: PR40483_add2:
53 ; X64-NEXT: xorl %eax, %eax
54 ; X64-NEXT: addl (%rdi), %esi
55 ; X64-NEXT: movl %esi, (%rdi)
56 ; X64-NEXT: cmovbl %esi, %eax
58 %3 = load i32, i32* %0, align 8
59 %4 = tail call { i8, i32 } @llvm.x86.addcarry.32(i8 0, i32 %3, i32 %1)
60 %5 = extractvalue { i8, i32 } %4, 1
61 store i32 %5, i32* %0, align 8
62 %6 = extractvalue { i8, i32 } %4, 0
66 %10 = select i1 %7, i32 0, i32 %9
70 declare { i8, i32 } @llvm.x86.addcarry.32(i8, i32, i32)