Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc -mtriple=arm-eabi -mcpu=generic %s -o /dev/null
      2 ; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s
      3 
      4 @x = weak global i16 0          ; <i16*> [#uses=1]
      5 @y = weak global i16 0          ; <i16*> [#uses=0]
      6 
      7 define i32 @f1(i32 %y) {
      8 ; CHECK: f1
      9 ; CHECK: smulbt
     10         %tmp = load i16, i16* @x             ; <i16> [#uses=1]
     11         %tmp1 = add i16 %tmp, 2         ; <i16> [#uses=1]
     12         %tmp2 = sext i16 %tmp1 to i32           ; <i32> [#uses=1]
     13         %tmp3 = ashr i32 %y, 16         ; <i32> [#uses=1]
     14         %tmp4 = mul i32 %tmp2, %tmp3            ; <i32> [#uses=1]
     15         ret i32 %tmp4
     16 }
     17 
     18 define i32 @f2(i32 %x, i32 %y) {
     19 ; CHECK: f2
     20 ; CHECK: smultt
     21         %tmp1 = ashr i32 %x, 16         ; <i32> [#uses=1]
     22         %tmp3 = ashr i32 %y, 16         ; <i32> [#uses=1]
     23         %tmp4 = mul i32 %tmp3, %tmp1            ; <i32> [#uses=1]
     24         ret i32 %tmp4
     25 }
     26 
     27 define i32 @f3(i32 %a, i16 %x, i32 %y) {
     28 ; CHECK: f3
     29 ; CHECK: smlabt
     30         %tmp = sext i16 %x to i32               ; <i32> [#uses=1]
     31         %tmp2 = ashr i32 %y, 16         ; <i32> [#uses=1]
     32         %tmp3 = mul i32 %tmp2, %tmp             ; <i32> [#uses=1]
     33         %tmp5 = add i32 %tmp3, %a               ; <i32> [#uses=1]
     34         ret i32 %tmp5
     35 }
     36 
     37