2019-01-08 18:12:36 +08:00
|
|
|
; RUN: llc -mtriple=arm-eabi -mcpu=generic %s -o - | FileCheck %s --check-prefix=DISABLED
|
2014-04-04 00:01:44 +08:00
|
|
|
; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s
|
2016-04-09 00:02:53 +08:00
|
|
|
; RUN: llc -mtriple=thumb--none-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s
|
2016-08-02 20:44:27 +08:00
|
|
|
; RUN: llc -mtriple=thumbv6t2-none-eabi %s -o - | FileCheck %s
|
2019-01-08 18:12:36 +08:00
|
|
|
; RUN: llc -mtriple=thumbv6-none-eabi %s -o - | FileCheck %s -check-prefix=DISABLED
|
2007-01-19 17:20:23 +08:00
|
|
|
|
2016-08-02 20:44:27 +08:00
|
|
|
define i32 @f1(i16 %x, i32 %y) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f1:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smulbt r0, r0, r1|smultb r0, r1, r0}}
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: {{smulbt|smultb}}
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = sext i16 %x to i32
|
|
|
|
%tmp2 = ashr i32 %y, 16
|
|
|
|
%tmp3 = mul i32 %tmp2, %tmp1
|
|
|
|
ret i32 %tmp3
|
2007-01-19 17:20:23 +08:00
|
|
|
}
|
|
|
|
|
2008-02-18 04:02:20 +08:00
|
|
|
define i32 @f2(i32 %x, i32 %y) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f2:
|
2011-04-01 11:36:33 +08:00
|
|
|
; CHECK: smultt
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smultt
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = ashr i32 %x, 16
|
|
|
|
%tmp3 = ashr i32 %y, 16
|
|
|
|
%tmp4 = mul i32 %tmp3, %tmp1
|
2008-02-18 04:02:20 +08:00
|
|
|
ret i32 %tmp4
|
2007-01-19 17:20:23 +08:00
|
|
|
}
|
|
|
|
|
2008-02-18 04:02:20 +08:00
|
|
|
define i32 @f3(i32 %a, i16 %x, i32 %y) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f3:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smlabt r0, r1, r2, r0|smlatb r0, r2, r1, r0}}
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: {{smlabt|smlatb}}
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp = sext i16 %x to i32
|
|
|
|
%tmp2 = ashr i32 %y, 16
|
|
|
|
%tmp3 = mul i32 %tmp2, %tmp
|
|
|
|
%tmp5 = add i32 %tmp3, %a
|
2008-02-18 04:02:20 +08:00
|
|
|
ret i32 %tmp5
|
2007-01-19 17:20:23 +08:00
|
|
|
}
|
2008-02-18 04:02:20 +08:00
|
|
|
|
2016-04-09 00:02:53 +08:00
|
|
|
define i32 @f4(i32 %a, i32 %x, i32 %y) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f4:
|
2016-04-09 00:02:53 +08:00
|
|
|
; CHECK: smlatt
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlatt
|
2016-04-09 00:02:53 +08:00
|
|
|
%tmp1 = ashr i32 %x, 16
|
|
|
|
%tmp3 = ashr i32 %y, 16
|
|
|
|
%tmp4 = mul i32 %tmp3, %tmp1
|
|
|
|
%tmp5 = add i32 %tmp4, %a
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f5(i32 %a, i16 %x, i16 %y) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f5:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK-NOT: sxth
|
2016-04-09 00:02:53 +08:00
|
|
|
; CHECK: smlabb
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlabb
|
2016-04-09 00:02:53 +08:00
|
|
|
%tmp1 = sext i16 %x to i32
|
|
|
|
%tmp3 = sext i16 %y to i32
|
|
|
|
%tmp4 = mul i32 %tmp3, %tmp1
|
|
|
|
%tmp5 = add i32 %tmp4, %a
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
2016-08-02 20:44:27 +08:00
|
|
|
define i32 @f6(i32 %a, i32 %x, i16 %y) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f6:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smlatb r0, r1, r2, r0|smlabt r0, r2, r1, r0}}
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: {{smlatb|smlabt}}
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = sext i16 %y to i32
|
|
|
|
%tmp2 = ashr i32 %x, 16
|
|
|
|
%tmp3 = mul i32 %tmp2, %tmp1
|
|
|
|
%tmp5 = add i32 %tmp3, %a
|
2016-04-09 00:02:53 +08:00
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f7(i32 %a, i32 %b, i32 %c) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f7:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: smlawb r0, r0, r1, r2
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlawb
|
2016-04-09 00:02:53 +08:00
|
|
|
%shl = shl i32 %b, 16
|
|
|
|
%shr = ashr exact i32 %shl, 16
|
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%conv2 = sext i32 %shr to i64
|
|
|
|
%mul = mul nsw i64 %conv2, %conv
|
|
|
|
%shr49 = lshr i64 %mul, 16
|
|
|
|
%conv5 = trunc i64 %shr49 to i32
|
|
|
|
%add = add nsw i32 %conv5, %c
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f8(i32 %a, i16 signext %b, i32 %c) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f8:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smlawb r0, r0, r1, r2
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlawb
|
2016-04-09 00:02:53 +08:00
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%conv1 = sext i16 %b to i64
|
|
|
|
%mul = mul nsw i64 %conv1, %conv
|
|
|
|
%shr5 = lshr i64 %mul, 16
|
|
|
|
%conv2 = trunc i64 %shr5 to i32
|
|
|
|
%add = add nsw i32 %conv2, %c
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f9(i32 %a, i32 %b, i32 %c) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f9:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: smlawt r0, r0, r1, r2
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlawt
|
2016-04-09 00:02:53 +08:00
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%shr = ashr i32 %b, 16
|
|
|
|
%conv1 = sext i32 %shr to i64
|
|
|
|
%mul = mul nsw i64 %conv1, %conv
|
|
|
|
%shr26 = lshr i64 %mul, 16
|
|
|
|
%conv3 = trunc i64 %shr26 to i32
|
|
|
|
%add = add nsw i32 %conv3, %c
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
2016-08-02 20:44:27 +08:00
|
|
|
define i32 @f10(i32 %a, i32 %b) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f10:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: smulwb r0, r0, r1
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smulwb
|
2016-04-09 00:02:53 +08:00
|
|
|
%shl = shl i32 %b, 16
|
|
|
|
%shr = ashr exact i32 %shl, 16
|
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%conv2 = sext i32 %shr to i64
|
|
|
|
%mul = mul nsw i64 %conv2, %conv
|
|
|
|
%shr37 = lshr i64 %mul, 16
|
|
|
|
%conv4 = trunc i64 %shr37 to i32
|
|
|
|
ret i32 %conv4
|
|
|
|
}
|
|
|
|
|
2016-08-02 20:44:27 +08:00
|
|
|
define i32 @f11(i32 %a, i16 signext %b) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f11:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulwb r0, r0, r1
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smulwb
|
2016-04-09 00:02:53 +08:00
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%conv1 = sext i16 %b to i64
|
|
|
|
%mul = mul nsw i64 %conv1, %conv
|
|
|
|
%shr4 = lshr i64 %mul, 16
|
|
|
|
%conv2 = trunc i64 %shr4 to i32
|
|
|
|
ret i32 %conv2
|
|
|
|
}
|
|
|
|
|
2016-08-02 20:44:27 +08:00
|
|
|
define i32 @f12(i32 %a, i32 %b) {
|
2016-04-09 03:49:03 +08:00
|
|
|
; CHECK-LABEL: f12:
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: smulwt r0, r0, r1
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smulwt
|
2016-04-09 00:02:53 +08:00
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%shr = ashr i32 %b, 16
|
|
|
|
%conv1 = sext i32 %shr to i64
|
|
|
|
%mul = mul nsw i64 %conv1, %conv
|
|
|
|
%shr25 = lshr i64 %mul, 16
|
|
|
|
%conv3 = trunc i64 %shr25 to i32
|
|
|
|
ret i32 %conv3
|
|
|
|
}
|
2016-08-02 20:44:27 +08:00
|
|
|
|
|
|
|
define i32 @f13(i32 %x, i16 %y) {
|
|
|
|
; CHECK-LABEL: f13:
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smultb r0, r0, r1|smulbt r0, r1, r0}}
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: {{smultb|smulbt}}
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = sext i16 %y to i32
|
|
|
|
%tmp2 = ashr i32 %x, 16
|
|
|
|
%tmp3 = mul i32 %tmp2, %tmp1
|
|
|
|
ret i32 %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f14(i32 %x, i32 %y) {
|
|
|
|
; CHECK-LABEL: f14:
|
|
|
|
; CHECK-NOT: sxth
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK: {{smultb r0, r1, r0|smulbt r0, r0, r1}}
|
|
|
|
; DISABLED-NOT: {{smultb|smulbt}}
|
|
|
|
%tmp1 = shl i32 %x, 16
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp2 = ashr i32 %tmp1, 16
|
2019-01-08 18:12:36 +08:00
|
|
|
%tmp3 = ashr i32 %y, 16
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp4 = mul i32 %tmp3, %tmp2
|
|
|
|
ret i32 %tmp4
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f15(i32 %x, i32 %y) {
|
|
|
|
; CHECK-LABEL: f15:
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smulbt r0, r0, r1|smultb r0, r1, r0}}
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: {{smulbt|smultb}}
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = shl i32 %x, 16
|
|
|
|
%tmp2 = ashr i32 %tmp1, 16
|
|
|
|
%tmp3 = ashr i32 %y, 16
|
|
|
|
%tmp4 = mul i32 %tmp2, %tmp3
|
|
|
|
ret i32 %tmp4
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f16(i16 %x, i16 %y) {
|
|
|
|
; CHECK-LABEL: f16:
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulbb
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smulbb
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = sext i16 %x to i32
|
|
|
|
%tmp2 = sext i16 %x to i32
|
|
|
|
%tmp3 = mul i32 %tmp1, %tmp2
|
|
|
|
ret i32 %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f17(i32 %x, i32 %y) {
|
|
|
|
; CHECK-LABEL: f17:
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK-NOT: sxth
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: smulbb
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smulbb
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = shl i32 %x, 16
|
|
|
|
%tmp2 = shl i32 %y, 16
|
|
|
|
%tmp3 = ashr i32 %tmp1, 16
|
|
|
|
%tmp4 = ashr i32 %tmp2, 16
|
|
|
|
%tmp5 = mul i32 %tmp3, %tmp4
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f18(i32 %a, i32 %x, i32 %y) {
|
|
|
|
; CHECK-LABEL: f18:
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK-NOT: sxth
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: {{smlabt r0, r1, r2, r0|smlatb r0, r2, r1, r0}}
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: {{smlabt|smlatb}}
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp0 = shl i32 %x, 16
|
|
|
|
%tmp1 = ashr i32 %tmp0, 16
|
|
|
|
%tmp2 = ashr i32 %y, 16
|
|
|
|
%tmp3 = mul i32 %tmp2, %tmp1
|
|
|
|
%tmp5 = add i32 %tmp3, %a
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f19(i32 %a, i32 %x, i32 %y) {
|
|
|
|
; CHECK-LABEL: f19:
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK: {{smlatb r0, r2, r1, r0|smlabt r0, r1, r2, r0}}
|
|
|
|
; DISABLED-NOT: {{smlatb|smlabt}}
|
|
|
|
%tmp0 = shl i32 %x, 16
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = ashr i32 %tmp0, 16
|
2019-01-08 18:12:36 +08:00
|
|
|
%tmp2 = ashr i32 %y, 16
|
|
|
|
%tmp3 = mul i32 %tmp1, %tmp2
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp5 = add i32 %tmp3, %a
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f20(i32 %a, i32 %x, i32 %y) {
|
|
|
|
; CHECK-LABEL: f20:
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK-NOT: sxth
|
2016-08-02 20:44:27 +08:00
|
|
|
; CHECK: smlabb
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlabb
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = shl i32 %x, 16
|
|
|
|
%tmp2 = ashr i32 %tmp1, 16
|
|
|
|
%tmp3 = shl i32 %y, 16
|
|
|
|
%tmp4 = ashr i32 %tmp3, 16
|
|
|
|
%tmp5 = mul i32 %tmp2, %tmp4
|
|
|
|
%tmp6 = add i32 %tmp5, %a
|
|
|
|
ret i32 %tmp6
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f21(i32 %a, i32 %x, i16 %y) {
|
|
|
|
; CHECK-LABEL: f21
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smlabb
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlabb
|
2016-08-02 20:44:27 +08:00
|
|
|
%tmp1 = shl i32 %x, 16
|
|
|
|
%tmp2 = ashr i32 %tmp1, 16
|
|
|
|
%tmp3 = sext i16 %y to i32
|
|
|
|
%tmp4 = mul i32 %tmp2, %tmp3
|
|
|
|
%tmp5 = add i32 %a, %tmp4
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
2017-03-14 17:13:22 +08:00
|
|
|
|
2019-01-08 18:12:36 +08:00
|
|
|
define i32 @f21_b(i32 %a, i32 %x, i16 %y) {
|
|
|
|
; CHECK-LABEL: f21_b
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smlabb
|
|
|
|
; DISABLED-NOT: smlabb
|
|
|
|
%tmp1 = shl i32 %x, 16
|
|
|
|
%tmp2 = ashr i32 %tmp1, 16
|
|
|
|
%tmp3 = sext i16 %y to i32
|
|
|
|
%tmp4 = mul i32 %tmp3, %tmp2
|
|
|
|
%tmp5 = add i32 %a, %tmp4
|
|
|
|
ret i32 %tmp5
|
|
|
|
}
|
|
|
|
|
2017-03-14 17:13:22 +08:00
|
|
|
@global_b = external global i16, align 2
|
|
|
|
|
|
|
|
define i32 @f22(i32 %a) {
|
|
|
|
; CHECK-LABEL: f22:
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK-NOT: sxth
|
2017-03-14 17:13:22 +08:00
|
|
|
; CHECK: smulwb r0, r0, r1
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smulwb
|
2017-03-14 17:13:22 +08:00
|
|
|
%b = load i16, i16* @global_b, align 2
|
|
|
|
%sext = sext i16 %b to i64
|
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%mul = mul nsw i64 %sext, %conv
|
|
|
|
%shr37 = lshr i64 %mul, 16
|
|
|
|
%conv4 = trunc i64 %shr37 to i32
|
|
|
|
ret i32 %conv4
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @f23(i32 %a, i32 %c) {
|
|
|
|
; CHECK-LABEL: f23:
|
2019-01-08 18:12:36 +08:00
|
|
|
; CHECK-NOT: sxth
|
2017-03-14 17:13:22 +08:00
|
|
|
; CHECK: smlawb r0, r0, r2, r1
|
2019-01-08 18:12:36 +08:00
|
|
|
; DISABLED-NOT: smlawb
|
2017-03-14 17:13:22 +08:00
|
|
|
%b = load i16, i16* @global_b, align 2
|
|
|
|
%sext = sext i16 %b to i64
|
|
|
|
%conv = sext i32 %a to i64
|
|
|
|
%mul = mul nsw i64 %sext, %conv
|
|
|
|
%shr49 = lshr i64 %mul, 16
|
|
|
|
%conv5 = trunc i64 %shr49 to i32
|
|
|
|
%add = add nsw i32 %conv5, %c
|
|
|
|
ret i32 %add
|
|
|
|
}
|
2019-01-08 18:12:36 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: f24
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulbb
|
|
|
|
define i32 @f24(i16* %a, i32* %b, i32* %c) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%ld.1 = load i32, i32* %b, align 4
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%shift = shl i32 %ld.1, 16
|
|
|
|
%conv.1 = ashr i32 %shift, 16
|
|
|
|
%mul.0 = mul i32 %conv.0, %conv.1
|
|
|
|
store i32 %ld.1, i32* %c
|
|
|
|
ret i32 %mul.0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f25
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulbb
|
|
|
|
define i32 @f25(i16* %a, i32 %b, i32* %c) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%shift = shl i32 %b, 16
|
|
|
|
%conv.1 = ashr i32 %shift, 16
|
|
|
|
%mul.0 = mul i32 %conv.0, %conv.1
|
|
|
|
store i32 %b, i32* %c
|
|
|
|
ret i32 %mul.0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f25_b
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulbb
|
|
|
|
define i32 @f25_b(i16* %a, i32 %b, i32* %c) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%shift = shl i32 %b, 16
|
|
|
|
%conv.1 = ashr i32 %shift, 16
|
|
|
|
%mul.0 = mul i32 %conv.1, %conv.0
|
|
|
|
store i32 %b, i32* %c
|
|
|
|
ret i32 %mul.0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f26
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smulbt | smultb}}
|
|
|
|
define i32 @f26(i16* %a, i32 %b, i32* %c) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%conv.1 = ashr i32 %b, 16
|
|
|
|
%mul.0 = mul i32 %conv.0, %conv.1
|
|
|
|
store i32 %b, i32* %c
|
|
|
|
ret i32 %mul.0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f26_b
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: {{smulbt | smultb}}
|
|
|
|
define i32 @f26_b(i16* %a, i32 %b, i32* %c) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%conv.1 = ashr i32 %b, 16
|
|
|
|
%mul.0 = mul i32 %conv.1, %conv.0
|
|
|
|
store i32 %b, i32* %c
|
|
|
|
ret i32 %mul.0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f27
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulbb
|
|
|
|
; CHECK: {{smlabt | smlatb}}
|
|
|
|
define i32 @f27(i16* %a, i32* %b) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%ld.1 = load i32, i32* %b, align 4
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%shift = shl i32 %ld.1, 16
|
|
|
|
%conv.1 = ashr i32 %shift, 16
|
|
|
|
%conv.2 = ashr i32 %ld.1, 16
|
|
|
|
%mul.0 = mul i32 %conv.0, %conv.1
|
|
|
|
%mul.1 = mul i32 %conv.0, %conv.2
|
|
|
|
%add = add i32 %mul.0, %mul.1
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: f27_b
|
|
|
|
; CHECK-NOT: sxth
|
|
|
|
; CHECK: smulbb
|
|
|
|
; CHECK: {{smlabt | smlatb}}
|
|
|
|
define i32 @f27_b(i16* %a, i32* %b) {
|
|
|
|
%ld.0 = load i16, i16* %a, align 2
|
|
|
|
%ld.1 = load i32, i32* %b, align 4
|
|
|
|
%conv.0 = sext i16 %ld.0 to i32
|
|
|
|
%shift = shl i32 %ld.1, 16
|
|
|
|
%conv.1 = ashr i32 %shift, 16
|
|
|
|
%conv.2 = ashr i32 %ld.1, 16
|
|
|
|
%mul.0 = mul i32 %conv.0, %conv.1
|
|
|
|
%mul.1 = mul i32 %conv.2, %conv.0
|
|
|
|
%add = add i32 %mul.0, %mul.1
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|