1 ; RUN: llc -O1 -mtriple=armv5te-none-none-eabi %s -o - | FileCheck %s
2 ; RUN: llc -O1 -mtriple=armv6-none-none-eabi %s -o - | FileCheck %s
3 ; RUN: llc -O1 -mtriple=armv7-none-none-eabi %s -o - | FileCheck %s
4 ; RUN: llc -O1 -mtriple=thumbv7-none-none-eabi %s -o - | FileCheck %s
5 ; RUN: llc -O1 -mtriple=thumbv6t2-none-none-eabi %s -o - | FileCheck %s
6 ; RUN: llc -O1 -mtriple=thumbv7em-none-none-eabi %s -o - | FileCheck %s
7 ; RUN: llc -O1 -mtriple=thumbv8m.main-none-none-eabi -mattr=+dsp %s -o - | FileCheck %s
8 define i32 @smulbb(i32 %a, i32 %b) {
10 ; CHECK: smulbb r0, r0, r1
11 %tmp = call i32 @llvm.arm.smulbb(i32 %a, i32 %b)
15 define i32 @smulbt(i32 %a, i32 %b) {
17 ; CHECK: smulbt r0, r0, r1
18 %tmp = call i32 @llvm.arm.smulbt(i32 %a, i32 %b)
22 define i32 @smultb(i32 %a, i32 %b) {
24 ; CHECK: smultb r0, r0, r1
25 %tmp = call i32 @llvm.arm.smultb(i32 %a, i32 %b)
29 define i32 @smultt(i32 %a, i32 %b) {
31 ; CHECK: smultt r0, r0, r1
32 %tmp = call i32 @llvm.arm.smultt(i32 %a, i32 %b)
36 define i32 @smulwb(i32 %a, i32 %b) {
38 ; CHECK: smulwb r0, r0, r1
39 %tmp = call i32 @llvm.arm.smulwb(i32 %a, i32 %b)
43 define i32 @smulwt(i32 %a, i32 %b) {
45 ; CHECK: smulwt r0, r0, r1
46 %tmp = call i32 @llvm.arm.smulwt(i32 %a, i32 %b)
50 define i32 @acc_mults(i32 %a, i32 %b, i32 %acc) {
51 ; CHECK-LABEL: acc_mults
52 ; CHECK: smlabb r2, r0, r1, r2
53 ; CHECK: smlabt r2, r0, r1, r2
54 ; CHECK: smlatb r2, r0, r1, r2
55 ; CHECK: smlatt r2, r0, r1, r2
56 ; CHECK: smlawb r2, r0, r1, r2
57 ; CHECK: smlawt r0, r0, r1, r2
58 %acc1 = call i32 @llvm.arm.smlabb(i32 %a, i32 %b, i32 %acc)
59 %acc2 = call i32 @llvm.arm.smlabt(i32 %a, i32 %b, i32 %acc1)
60 %acc3 = call i32 @llvm.arm.smlatb(i32 %a, i32 %b, i32 %acc2)
61 %acc4 = call i32 @llvm.arm.smlatt(i32 %a, i32 %b, i32 %acc3)
62 %acc5 = call i32 @llvm.arm.smlawb(i32 %a, i32 %b, i32 %acc4)
63 %acc6 = call i32 @llvm.arm.smlawt(i32 %a, i32 %b, i32 %acc5)
67 define i32 @qadd(i32 %a, i32 %b) nounwind {
69 ; CHECK: qadd r0, r0, r1
70 %tmp = call i32 @llvm.arm.qadd(i32 %a, i32 %b)
74 define i32 @qsub(i32 %a, i32 %b) nounwind {
76 ; CHECK: qsub r0, r0, r1
77 %tmp = call i32 @llvm.arm.qsub(i32 %a, i32 %b)
81 define i32 @qdadd(i32 %a, i32 %b) nounwind {
83 ; CHECK: qdadd r0, r0, r1
84 %dbl = call i32 @llvm.arm.qadd(i32 %a, i32 %a)
85 %add = call i32 @llvm.arm.qadd(i32 %dbl, i32 %b)
89 define i32 @qdsub(i32 %a, i32 %b) nounwind {
91 ; CHECK: qdsub r0, r0, r1
92 %dbl = call i32 @llvm.arm.qadd(i32 %b, i32 %b)
93 %add = call i32 @llvm.arm.qsub(i32 %a, i32 %dbl)
97 declare i32 @llvm.arm.smulbb(i32 %a, i32 %b) nounwind readnone
98 declare i32 @llvm.arm.smulbt(i32 %a, i32 %b) nounwind readnone
99 declare i32 @llvm.arm.smultb(i32 %a, i32 %b) nounwind readnone
100 declare i32 @llvm.arm.smultt(i32 %a, i32 %b) nounwind readnone
101 declare i32 @llvm.arm.smulwb(i32 %a, i32 %b) nounwind readnone
102 declare i32 @llvm.arm.smulwt(i32 %a, i32 %b) nounwind readnone
103 declare i32 @llvm.arm.smlabb(i32, i32, i32) nounwind
104 declare i32 @llvm.arm.smlabt(i32, i32, i32) nounwind
105 declare i32 @llvm.arm.smlatb(i32, i32, i32) nounwind
106 declare i32 @llvm.arm.smlatt(i32, i32, i32) nounwind
107 declare i32 @llvm.arm.smlawb(i32, i32, i32) nounwind
108 declare i32 @llvm.arm.smlawt(i32, i32, i32) nounwind
109 declare i32 @llvm.arm.qadd(i32, i32) nounwind
110 declare i32 @llvm.arm.qsub(i32, i32) nounwind