xref: /llvm-project/llvm/test/CodeGen/X86/udivmodei5.ll (revision 2090e85fee9b2d2a1ca6402b5f44c7d41d1e353f)
1; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
3
4; On i686, this is expanded into a loop. On x86_64, this calls __udivti3.
5define i65 @udiv65(i65 %a, i65 %b) nounwind {
6; X86-LABEL: udiv65:
7; X86-NOT:     call
8;
9; X64-LABEL: udiv65:
10; X64:       # %bb.0:
11; X64-NEXT:    pushq %rax
12; X64-NEXT:    andl $1, %esi
13; X64-NEXT:    andl $1, %ecx
14; X64-NEXT:    callq __udivti3@PLT
15; X64-NEXT:    popq %rcx
16; X64-NEXT:    retq
17  %res = udiv i65 %a, %b
18  ret i65 %res
19}
20
21define i129 @udiv129(i129 %a, i129 %b) nounwind {
22; X86-LABEL: udiv129:
23; X86-NOT:     call
24;
25; X64-LABEL: udiv129:
26; X64-NOT:     call
27  %res = udiv i129 %a, %b
28  ret i129 %res
29}
30
31define i129 @urem129(i129 %a, i129 %b) nounwind {
32; X86-LABEL: urem129:
33; X86-NOT:     call
34;
35; X64-LABEL: urem129:
36; X64-NOT:     call
37  %res = urem i129 %a, %b
38  ret i129 %res
39}
40
41define i129 @sdiv129(i129 %a, i129 %b) nounwind {
42; X86-LABEL: sdiv129:
43; X86-NOT:     call
44;
45; X64-LABEL: sdiv129:
46; X64-NOT:     call
47  %res = sdiv i129 %a, %b
48  ret i129 %res
49}
50
51define i129 @srem129(i129 %a, i129 %b) nounwind {
52; X86-LABEL: srem129:
53; X86-NOT:     call
54;
55; X64-LABEL: srem129:
56; X64-NOT:     call
57  %res = srem i129 %a, %b
58  ret i129 %res
59}
60
61; Some higher sizes
62define i257 @sdiv257(i257 %a, i257 %b) nounwind {
63; X86-LABEL: sdiv257:
64; X86-NOT:     call
65;
66; X64-LABEL: sdiv257:
67; X64-NOT:     call
68  %res = sdiv i257 %a, %b
69  ret i257 %res
70}
71