[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev
[oota-llvm.git] / test / CodeGen / Thumb2 / thumb2-smul.ll
1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk,+dsp %s -o - |  FileCheck %s
2
3 @x = weak global i16 0          ; <i16*> [#uses=1]
4 @y = weak global i16 0          ; <i16*> [#uses=0]
5
6 define i32 @f1(i32 %y) {
7 ; CHECK: f1
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]
14         ret i32 %tmp4
15 }
16
17 define i32 @f2(i32 %x, i32 %y) {
18 ; CHECK: f2
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]
23         ret i32 %tmp4
24 }