• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple thumbv7-windows-itanium -filetype asm -o - %s | FileCheck %s
2; RUN: llc -mtriple thumbv7-windows-msvc -filetype asm -o - %s | FileCheck %s
3
4define arm_aapcs_vfpcc i32 @sdiv32(i32 %divisor, i32 %divident) {
5entry:
6  %div = sdiv i32 %divident, %divisor
7  ret i32 %div
8}
9
10; CHECK-LABEL: sdiv32:
11; CHECK: cbz r0
12; CHECK: b
13; CHECK: udf.w #249
14; CHECK: bl __rt_sdiv
15
16define arm_aapcs_vfpcc i32 @udiv32(i32 %divisor, i32 %divident) {
17entry:
18  %div = udiv i32 %divident, %divisor
19  ret i32 %div
20}
21
22; CHECK-LABEL: udiv32:
23; CHECK: cbz r0
24; CHECK: b
25; CHECK: udf.w #249
26; CHECK: bl __rt_udiv
27
28define arm_aapcs_vfpcc i64 @sdiv64(i64 %divisor, i64 %divident) {
29entry:
30  %div = sdiv i64 %divident, %divisor
31  ret i64 %div
32}
33
34; CHECK-LABEL: sdiv64:
35; CHECK: orr.w r4, r0, r1
36; CHECK-NEXT: cbz r4
37; CHECK: b
38; CHECK: udf.w #249
39; CHECK: bl __rt_sdiv64
40
41define arm_aapcs_vfpcc i64 @udiv64(i64 %divisor, i64 %divident) {
42entry:
43  %div = udiv i64 %divident, %divisor
44  ret i64 %div
45}
46
47; CHECK-LABEL: udiv64:
48; CHECK: orr.w r4, r0, r1
49; CHECK-NEXT: cbz r4
50; CHECK: b
51; CHECK: udf.w #249
52; CHECK: bl __rt_udiv64
53
54