File: udivmodei5.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (70 lines) | stat: -rw-r--r-- 1,500 bytes parent folder | download | duplicates (12)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64

; On i686, this is expanded into a loop. On x86_64, this calls __udivti3.
define i65 @udiv65(i65 %a, i65 %b) nounwind {
; X86-LABEL: udiv65:
; X86-NOT:     call
;
; X64-LABEL: udiv65:
; X64:       # %bb.0:
; X64-NEXT:    pushq %rax
; X64-NEXT:    andl $1, %esi
; X64-NEXT:    andl $1, %ecx
; X64-NEXT:    callq __udivti3@PLT
; X64-NEXT:    popq %rcx
; X64-NEXT:    retq
  %res = udiv i65 %a, %b
  ret i65 %res
}

define i129 @udiv129(i129 %a, i129 %b) nounwind {
; X86-LABEL: udiv129:
; X86-NOT:     call
;
; X64-LABEL: udiv129:
; X64-NOT:     call
  %res = udiv i129 %a, %b
  ret i129 %res
}

define i129 @urem129(i129 %a, i129 %b) nounwind {
; X86-LABEL: urem129:
; X86-NOT:     call
;
; X64-LABEL: urem129:
; X64-NOT:     call
  %res = urem i129 %a, %b
  ret i129 %res
}

define i129 @sdiv129(i129 %a, i129 %b) nounwind {
; X86-LABEL: sdiv129:
; X86-NOT:     call
;
; X64-LABEL: sdiv129:
; X64-NOT:     call
  %res = sdiv i129 %a, %b
  ret i129 %res
}

define i129 @srem129(i129 %a, i129 %b) nounwind {
; X86-LABEL: srem129:
; X86-NOT:     call
;
; X64-LABEL: srem129:
; X64-NOT:     call
  %res = srem i129 %a, %b
  ret i129 %res
}

; Some higher sizes
define i257 @sdiv257(i257 %a, i257 %b) nounwind {
; X86-LABEL: sdiv257:
; X86-NOT:     call
;
; X64-LABEL: sdiv257:
; X64-NOT:     call
  %res = sdiv i257 %a, %b
  ret i257 %res
}