• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefixes=X64
3; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s --check-prefixes=X86
4
5define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
6; X64-LABEL: muloti_test:
7; X64:       # %bb.0: # %start
8; X64-NEXT:    movq %rdx, %r8
9; X64-NEXT:    movq %rsi, %rax
10; X64-NEXT:    testq %rcx, %rcx
11; X64-NEXT:    setne %dl
12; X64-NEXT:    testq %rsi, %rsi
13; X64-NEXT:    setne %r9b
14; X64-NEXT:    andb %dl, %r9b
15; X64-NEXT:    mulq %r8
16; X64-NEXT:    movq %rax, %rsi
17; X64-NEXT:    seto %r10b
18; X64-NEXT:    movq %rcx, %rax
19; X64-NEXT:    mulq %rdi
20; X64-NEXT:    movq %rax, %rcx
21; X64-NEXT:    seto %r11b
22; X64-NEXT:    orb %r10b, %r11b
23; X64-NEXT:    addq %rsi, %rcx
24; X64-NEXT:    movq %rdi, %rax
25; X64-NEXT:    mulq %r8
26; X64-NEXT:    addq %rcx, %rdx
27; X64-NEXT:    setb %cl
28; X64-NEXT:    orb %r11b, %cl
29; X64-NEXT:    orb %r9b, %cl
30; X64-NEXT:    retq
31;
32; X86-LABEL: muloti_test:
33; X86:       # %bb.0: # %start
34; X86-NEXT:    pushl %ebp
35; X86-NEXT:    .cfi_def_cfa_offset 8
36; X86-NEXT:    pushl %ebx
37; X86-NEXT:    .cfi_def_cfa_offset 12
38; X86-NEXT:    pushl %edi
39; X86-NEXT:    .cfi_def_cfa_offset 16
40; X86-NEXT:    pushl %esi
41; X86-NEXT:    .cfi_def_cfa_offset 20
42; X86-NEXT:    subl $24, %esp
43; X86-NEXT:    .cfi_def_cfa_offset 44
44; X86-NEXT:    .cfi_offset %esi, -20
45; X86-NEXT:    .cfi_offset %edi, -16
46; X86-NEXT:    .cfi_offset %ebx, -12
47; X86-NEXT:    .cfi_offset %ebp, -8
48; X86-NEXT:    movl {{[0-9]+}}(%esp), %edi
49; X86-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
50; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
51; X86-NEXT:    movl {{[0-9]+}}(%esp), %ebx
52; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi
53; X86-NEXT:    mull %ebx
54; X86-NEXT:    movl %eax, %ecx
55; X86-NEXT:    seto {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
56; X86-NEXT:    movl %esi, %eax
57; X86-NEXT:    mull %edi
58; X86-NEXT:    movl %eax, %esi
59; X86-NEXT:    seto {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
60; X86-NEXT:    addl %ecx, %esi
61; X86-NEXT:    movl %edi, %eax
62; X86-NEXT:    mull %ebx
63; X86-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
64; X86-NEXT:    movl %edx, %ecx
65; X86-NEXT:    addl %esi, %ecx
66; X86-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
67; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi
68; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
69; X86-NEXT:    mull %esi
70; X86-NEXT:    movl %esi, %ebx
71; X86-NEXT:    movl %eax, %esi
72; X86-NEXT:    seto {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
73; X86-NEXT:    movl {{[0-9]+}}(%esp), %edi
74; X86-NEXT:    movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
75; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
76; X86-NEXT:    mull %edi
77; X86-NEXT:    movl %eax, %ebp
78; X86-NEXT:    seto {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
79; X86-NEXT:    addl %esi, %ebp
80; X86-NEXT:    movl %edi, %eax
81; X86-NEXT:    mull %ebx
82; X86-NEXT:    movl %ebx, %esi
83; X86-NEXT:    movl %eax, %ebx
84; X86-NEXT:    movl %edx, %edi
85; X86-NEXT:    addl %ebp, %edi
86; X86-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
87; X86-NEXT:    addl {{[-0-9]+}}(%e{{[sb]}}p), %ebx # 4-byte Folded Reload
88; X86-NEXT:    adcl %ecx, %edi
89; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
90; X86-NEXT:    movl %esi, %ecx
91; X86-NEXT:    mull %esi
92; X86-NEXT:    movl %edx, %esi
93; X86-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
94; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
95; X86-NEXT:    mull %ecx
96; X86-NEXT:    movl %edx, %ebp
97; X86-NEXT:    movl %eax, %ecx
98; X86-NEXT:    addl %esi, %ecx
99; X86-NEXT:    adcl $0, %ebp
100; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
101; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
102; X86-NEXT:    mull %edx
103; X86-NEXT:    movl %edx, %esi
104; X86-NEXT:    addl %ecx, %eax
105; X86-NEXT:    movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
106; X86-NEXT:    adcl %ebp, %esi
107; X86-NEXT:    setb %cl
108; X86-NEXT:    movl {{[0-9]+}}(%esp), %ebp
109; X86-NEXT:    movl %ebp, %eax
110; X86-NEXT:    mull {{[0-9]+}}(%esp)
111; X86-NEXT:    addl %esi, %eax
112; X86-NEXT:    movzbl %cl, %ecx
113; X86-NEXT:    adcl %ecx, %edx
114; X86-NEXT:    addl %ebx, %eax
115; X86-NEXT:    adcl %edi, %edx
116; X86-NEXT:    setb {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Spill
117; X86-NEXT:    testl %ebp, %ebp
118; X86-NEXT:    setne %cl
119; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi
120; X86-NEXT:    testl %esi, %esi
121; X86-NEXT:    setne %ch
122; X86-NEXT:    andb %cl, %ch
123; X86-NEXT:    movb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Reload
124; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Folded Reload
125; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Folded Reload
126; X86-NEXT:    orb %ch, %cl
127; X86-NEXT:    movb %cl, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Spill
128; X86-NEXT:    cmpl $0, {{[0-9]+}}(%esp)
129; X86-NEXT:    setne %cl
130; X86-NEXT:    movl {{[0-9]+}}(%esp), %edi
131; X86-NEXT:    testl %edi, %edi
132; X86-NEXT:    setne %bh
133; X86-NEXT:    andb %cl, %bh
134; X86-NEXT:    movb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Reload
135; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Folded Reload
136; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %cl # 1-byte Folded Reload
137; X86-NEXT:    movb %cl, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Spill
138; X86-NEXT:    orl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
139; X86-NEXT:    setne %bl
140; X86-NEXT:    orl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Folded Spill
141; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
142; X86-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
143; X86-NEXT:    movl %esi, (%ecx)
144; X86-NEXT:    movl {{[-0-9]+}}(%e{{[sb]}}p), %esi # 4-byte Reload
145; X86-NEXT:    movl %esi, 4(%ecx)
146; X86-NEXT:    movl %eax, 8(%ecx)
147; X86-NEXT:    movl %edx, 12(%ecx)
148; X86-NEXT:    setne %al
149; X86-NEXT:    andb %bl, %al
150; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %al # 1-byte Folded Reload
151; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %al # 1-byte Folded Reload
152; X86-NEXT:    orb {{[-0-9]+}}(%e{{[sb]}}p), %al # 1-byte Folded Reload
153; X86-NEXT:    orb %bh, %al
154; X86-NEXT:    andb $1, %al
155; X86-NEXT:    movb %al, 16(%ecx)
156; X86-NEXT:    movl %ecx, %eax
157; X86-NEXT:    addl $24, %esp
158; X86-NEXT:    .cfi_def_cfa_offset 20
159; X86-NEXT:    popl %esi
160; X86-NEXT:    .cfi_def_cfa_offset 16
161; X86-NEXT:    popl %edi
162; X86-NEXT:    .cfi_def_cfa_offset 12
163; X86-NEXT:    popl %ebx
164; X86-NEXT:    .cfi_def_cfa_offset 8
165; X86-NEXT:    popl %ebp
166; X86-NEXT:    .cfi_def_cfa_offset 4
167; X86-NEXT:    retl $4
168start:
169  %0 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %l, i128 %r) #2
170  %1 = extractvalue { i128, i1 } %0, 0
171  %2 = extractvalue { i128, i1 } %0, 1
172  %3 = zext i1 %2 to i8
173  %4 = insertvalue { i128, i8 } undef, i128 %1, 0
174  %5 = insertvalue { i128, i8 } %4, i8 %3, 1
175  ret { i128, i8 } %5
176}
177
178; Function Attrs: nounwind readnone speculatable
179declare { i128, i1 } @llvm.umul.with.overflow.i128(i128, i128) #1
180
181attributes #0 = { nounwind readnone uwtable }
182attributes #1 = { nounwind readnone speculatable }
183attributes #2 = { nounwind }
184