1 ; RUN: llc < %s -mtriple=arm-apple-ios -mcpu=cortex-a8 | \
2 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-SWDIV
3 ; RUN: llc < %s -mtriple=arm-apple-ios -mcpu=swift | \
4 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-HWDIV
5 ; RUN: llc < %s -mtriple=arm-apple-ios -mcpu=cortex-r4 | \
6 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-SWDIV
7 ; RUN: llc < %s -mtriple=arm-apple-ios -mcpu=cortex-r4f | \
8 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-SWDIV
9 ; RUN: llc < %s -mtriple=arm-apple-ios -mcpu=cortex-r5 | \
10 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-HWDIV
11 ; RUN: llc < %s -mtriple=arm-none-eabi -mcpu=cortex-a8 | \
12 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-EABI
13 ; RUN: llc < %s -mtriple=armv7ve-none-linux-gnu | \
14 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-HWDIV
15 ; RUN: llc < %s -mtriple=thumbv7ve-none-linux-gnu | \
16 ; RUN: FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-HWDIV \
17 ; RUN: -check-prefix=CHECK-THUMB
19 define i32 @f1(i32 %a, i32 %b) {
22 ; CHECK-SWDIV: __divsi3
24 ; CHECK-THUMB: .thumb_func
27 ; CHECK-EABI: __aeabi_idiv
28 %tmp1 = sdiv i32 %a, %b ; <i32> [#uses=1]
32 define i32 @f2(i32 %a, i32 %b) {
35 ; CHECK-SWDIV: __udivsi3
37 ; CHECK-THUMB: .thumb_func
40 ; CHECK-EABI: __aeabi_uidiv
41 %tmp1 = udiv i32 %a, %b ; <i32> [#uses=1]
45 define i32 @f3(i32 %a, i32 %b) {
48 ; CHECK-SWDIV: __modsi3
50 ; CHECK-THUMB: .thumb_func
54 ; EABI MODE = Remainder in R1, quotient in R0
55 ; CHECK-EABI: __aeabi_idivmod
56 ; CHECK-EABI-NEXT: mov r0, r1
57 %tmp1 = srem i32 %a, %b ; <i32> [#uses=1]
61 define i32 @f4(i32 %a, i32 %b) {
64 ; CHECK-SWDIV: __umodsi3
66 ; CHECK-THUMB: .thumb_func
70 ; EABI MODE = Remainder in R1, quotient in R0
71 ; CHECK-EABI: __aeabi_uidivmod
72 ; CHECK-EABI-NEXT: mov r0, r1
73 %tmp1 = urem i32 %a, %b ; <i32> [#uses=1]
78 define i64 @f5(i64 %a, i64 %b) {
81 ; CHECK-SWDIV: __moddi3
83 ; CHECK-HWDIV: __moddi3
85 ; EABI MODE = Remainder in R2-R3, quotient in R0-R1
86 ; CHECK-EABI: __aeabi_ldivmod
87 ; CHECK-EABI-NEXT: mov r0, r2
88 ; CHECK-EABI-NEXT: mov r1, r3
89 %tmp1 = srem i64 %a, %b ; <i64> [#uses=1]
93 define i64 @f6(i64 %a, i64 %b) {
96 ; CHECK-SWDIV: __umoddi3
98 ; CHECK-HWDIV: __umoddi3
100 ; EABI MODE = Remainder in R2-R3, quotient in R0-R1
101 ; CHECK-EABI: __aeabi_uldivmod
102 ; CHECK-EABI-NEXT: mov r0, r2
103 ; CHECK-EABI-NEXT: mov r1, r3
104 %tmp1 = urem i64 %a, %b ; <i64> [#uses=1]