• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=thumb-apple-darwin -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - \
2; RUN:    | FileCheck %s -check-prefix=CHECK-THUMB
3; RUN: llc -mtriple=thumb-apple-darwin -mcpu=cortex-m3 -mattr=+thumb2 %s -o - \
4; RUN:    | FileCheck %s -check-prefix=CHECK-THUMBV7M
5; RUN: llc -mtriple=thumb-apple-darwin -mcpu=swift %s -o - \
6; RUN:    | FileCheck %s -check-prefix=CHECK-HWDIV
7; RUN: llc -mtriple=thumb-apple-darwin -mcpu=cortex-r4 %s -o - \
8; RUN:    | FileCheck %s -check-prefix=CHECK-HWDIV
9; RUN: llc -mtriple=thumb-apple-darwin -mcpu=cortex-r4f %s -o - \
10; RUN:    | FileCheck %s -check-prefix=CHECK-HWDIV
11; RUN: llc -mtriple=thumb-apple-darwin -mcpu=cortex-r5 %s -o - \
12; RUN:    | FileCheck %s -check-prefix=CHECK-HWDIV
13
14define i32 @f1(i32 %a, i32 %b) {
15entry:
16; CHECK-THUMB: f1
17; CHECK-THUMB: __divsi3
18; CHECK-THUMBV7M: f1
19; CHECK-THUMBV7M: sdiv
20; CHECK-HWDIV: f1
21; CHECK-HWDIV: sdiv
22        %tmp1 = sdiv i32 %a, %b         ; <i32> [#uses=1]
23        ret i32 %tmp1
24}
25
26define i32 @f2(i32 %a, i32 %b) {
27entry:
28; CHECK-THUMB: f2
29; CHECK-THUMB: __udivsi3
30; CHECK-THUMBV7M: f2
31; CHECK-THUMBV7M: udiv
32; CHECK-HWDIV: f2
33; CHECK-HWDIV: udiv
34        %tmp1 = udiv i32 %a, %b         ; <i32> [#uses=1]
35        ret i32 %tmp1
36}
37
38define i32 @f3(i32 %a, i32 %b) {
39entry:
40; CHECK-THUMB: f3
41; CHECK-THUMB: __modsi3
42; CHECK-THUMBV7M: f3
43; CHECK-THUMBV7M: sdiv
44; CHECK-HWDIV: f3
45; CHECK-HWDIV: sdiv
46        %tmp1 = srem i32 %a, %b         ; <i32> [#uses=1]
47        ret i32 %tmp1
48}
49
50define i32 @f4(i32 %a, i32 %b) {
51entry:
52; CHECK-THUMB: f4
53; CHECK-THUMB: __umodsi3
54; CHECK-THUMBV7M: f4
55; CHECK-THUMBV7M: udiv
56; CHECK-HWDIV: f4
57; CHECK-HWDIV: udiv
58        %tmp1 = urem i32 %a, %b         ; <i32> [#uses=1]
59        ret i32 %tmp1
60}
61
62