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