blob: 7a13269615d45b507785500da843c17be2387e7e [file] [log] [blame]
Jim Grosbacha7603982011-07-01 21:12:19 +00001; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk,+t2dsp | FileCheck %s
Evan Cheng5b9fcd12009-07-07 01:17:28 +00002
3@x = weak global i16 0 ; <i16*> [#uses=1]
4@y = weak global i16 0 ; <i16*> [#uses=0]
5
6define i32 @f1(i32 %y) {
Jim Grosbach11872852009-11-17 00:20:26 +00007; CHECK: f1
8; CHECK: smulbt r0, r1, r0
Evan Cheng5b9fcd12009-07-07 01:17:28 +00009 %tmp = load 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]
14 ret i32 %tmp4
15}
16
17define i32 @f2(i32 %x, i32 %y) {
Jim Grosbach11872852009-11-17 00:20:26 +000018; CHECK: f2
19; CHECK: smultt r0, r1, r0
Evan Cheng5b9fcd12009-07-07 01:17:28 +000020 %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]
23 ret i32 %tmp4
24}