1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+dsp %s -o - | FileCheck %s
3 @x = weak global i16 0 ; <i16*> [#uses=1]
4 @y = weak global i16 0 ; <i16*> [#uses=0]
6 define i32 @f1(i32 %y) {
8 ; CHECK: smulbt r0, r1, r0
9 %tmp = load i16, i16* @x ; <i16> [#uses=1]
10 %tmp1 = add i16 %tmp, 2 ; <i16> [#uses=1]
11 %tmp2 = sext i16 %tmp1 to i32 ; <i32> [#uses=1]
12 %tmp3 = ashr i32 %y, 16 ; <i32> [#uses=1]
13 %tmp4 = mul i32 %tmp2, %tmp3 ; <i32> [#uses=1]
17 define i32 @f2(i32 %x, i32 %y) {
19 ; CHECK: smultt r0, r1, r0
20 %tmp1 = ashr i32 %x, 16 ; <i32> [#uses=1]
21 %tmp3 = ashr i32 %y, 16 ; <i32> [#uses=1]
22 %tmp4 = mul i32 %tmp3, %tmp1 ; <i32> [#uses=1]