• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
2
3define i32 @t9(i32 %v) nounwind readnone {
4entry:
5; CHECK-LABEL: t9:
6; CHECK: add r0, r0, r0, lsl #3
7	%0 = mul i32 %v, 9
8	ret i32 %0
9}
10
11define i32 @t7(i32 %v) nounwind readnone {
12entry:
13; CHECK-LABEL: t7:
14; CHECK: rsb r0, r0, r0, lsl #3
15	%0 = mul i32 %v, 7
16	ret i32 %0
17}
18
19define i32 @t5(i32 %v) nounwind readnone {
20entry:
21; CHECK-LABEL: t5:
22; CHECK: add r0, r0, r0, lsl #2
23        %0 = mul i32 %v, 5
24        ret i32 %0
25}
26
27define i32 @t3(i32 %v) nounwind readnone {
28entry:
29; CHECK-LABEL: t3:
30; CHECK: add r0, r0, r0, lsl #1
31        %0 = mul i32 %v, 3
32        ret i32 %0
33}
34
35define i32 @t12288(i32 %v) nounwind readnone {
36entry:
37; CHECK-LABEL: t12288:
38; CHECK: add r0, r0, r0, lsl #1
39; CHECK: lsl{{.*}}#12
40        %0 = mul i32 %v, 12288
41        ret i32 %0
42}
43
44define i32 @tn9(i32 %v) nounwind readnone {
45entry:
46; CHECK-LABEL: tn9:
47; CHECK: add	r0, r0, r0, lsl #3
48; CHECK: rsb	r0, r0, #0
49        %0 = mul i32 %v, -9
50        ret i32 %0
51}
52
53define i32 @tn7(i32 %v) nounwind readnone {
54entry:
55; CHECK-LABEL: tn7:
56; CHECK: sub r0, r0, r0, lsl #3
57	%0 = mul i32 %v, -7
58	ret i32 %0
59}
60
61define i32 @tn5(i32 %v) nounwind readnone {
62entry:
63; CHECK-LABEL: tn5:
64; CHECK: add r0, r0, r0, lsl #2
65; CHECK: rsb r0, r0, #0
66        %0 = mul i32 %v, -5
67        ret i32 %0
68}
69
70define i32 @tn3(i32 %v) nounwind readnone {
71entry:
72; CHECK-LABEL: tn3:
73; CHECK: sub r0, r0, r0, lsl #2
74        %0 = mul i32 %v, -3
75        ret i32 %0
76}
77
78define i32 @tn12288(i32 %v) nounwind readnone {
79entry:
80; CHECK-LABEL: tn12288:
81; CHECK: sub r0, r0, r0, lsl #2
82; CHECK: lsl{{.*}}#12
83        %0 = mul i32 %v, -12288
84        ret i32 %0
85}
86