blob: 95f8c5f086cefb1f9ed6afcf7bcc001cf4761032 [file] [log] [blame]
Jim Grosbach5f5b4112010-05-05 20:47:15 +00001; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=CHECK-ARM
2; RUN: llc < %s -march=arm -mcpu=cortex-m3 \
3; RUN: | FileCheck %s -check-prefix=CHECK-ARMV7M
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner246a1372008-02-17 20:02:20 +00005define i32 @f1(i32 %a, i32 %b) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006entry:
Jim Grosbach5f5b4112010-05-05 20:47:15 +00007; CHECK-ARM: f1
8; CHECK-ARM: __divsi3
9; CHECK-ARMV7M: f1
10; CHECK-ARMV7M: sdiv
Tanya Lattner246a1372008-02-17 20:02:20 +000011 %tmp1 = sdiv i32 %a, %b ; <i32> [#uses=1]
12 ret i32 %tmp1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013}
14
Tanya Lattner246a1372008-02-17 20:02:20 +000015define i32 @f2(i32 %a, i32 %b) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016entry:
Jim Grosbach5f5b4112010-05-05 20:47:15 +000017; CHECK-ARM: f2
18; CHECK-ARM: __udivsi3
19; CHECK-ARMV7M: _f2
20; CHECK-ARMV7M: udiv
Tanya Lattner246a1372008-02-17 20:02:20 +000021 %tmp1 = udiv i32 %a, %b ; <i32> [#uses=1]
22 ret i32 %tmp1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023}
24
Tanya Lattner246a1372008-02-17 20:02:20 +000025define i32 @f3(i32 %a, i32 %b) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026entry:
Jim Grosbach5f5b4112010-05-05 20:47:15 +000027; CHECK-ARM: f3
28; CHECK-ARM: __modsi3
29; CHECK-ARMV7M: _f3
30; CHECK-ARMV7M: sdiv
Tanya Lattner246a1372008-02-17 20:02:20 +000031 %tmp1 = srem i32 %a, %b ; <i32> [#uses=1]
32 ret i32 %tmp1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000033}
34
Tanya Lattner246a1372008-02-17 20:02:20 +000035define i32 @f4(i32 %a, i32 %b) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000036entry:
Jim Grosbach5f5b4112010-05-05 20:47:15 +000037; CHECK-ARM: f4
38; CHECK-ARM: __umodsi3
39; CHECK-ARMV7M: _f4
40; CHECK-ARMV7M: udiv
Tanya Lattner246a1372008-02-17 20:02:20 +000041 %tmp1 = urem i32 %a, %b ; <i32> [#uses=1]
42 ret i32 %tmp1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000043}
Tanya Lattner246a1372008-02-17 20:02:20 +000044