1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve.fp %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <4 x i32> @vmlau32(<4 x i32> %A, <4 x i32> %B, i32 %X) nounwind {
5 ; CHECK-LABEL: vmlau32:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vmla.u32 q0, q1, r0
10 %0 = insertelement <4 x i32> undef, i32 %X, i32 0
11 %1 = shufflevector <4 x i32> %0, <4 x i32> undef, <4 x i32> zeroinitializer
12 %2 = mul nsw <4 x i32> %B, %1
13 %3 = add nsw <4 x i32> %A, %2
17 define arm_aapcs_vfpcc <4 x i32> @vmlau32b(<4 x i32> %A, <4 x i32> %B, i32 %X) nounwind {
18 ; CHECK-LABEL: vmlau32b:
19 ; CHECK: @ %bb.0: @ %entry
20 ; CHECK-NEXT: vmla.u32 q0, q1, r0
23 %0 = insertelement <4 x i32> undef, i32 %X, i32 0
24 %1 = shufflevector <4 x i32> %0, <4 x i32> undef, <4 x i32> zeroinitializer
25 %2 = mul nsw <4 x i32> %1, %B
26 %3 = add nsw <4 x i32> %2, %A
30 define arm_aapcs_vfpcc <8 x i16> @vmlau16(<8 x i16> %A, <8 x i16> %B, i16 %X) nounwind {
31 ; CHECK-LABEL: vmlau16:
32 ; CHECK: @ %bb.0: @ %entry
33 ; CHECK-NEXT: vmla.u16 q0, q1, r0
36 %0 = insertelement <8 x i16> undef, i16 %X, i32 0
37 %1 = shufflevector <8 x i16> %0, <8 x i16> undef, <8 x i32> zeroinitializer
38 %2 = mul nsw <8 x i16> %B, %1
39 %3 = add nsw <8 x i16> %A, %2
43 define arm_aapcs_vfpcc <8 x i16> @vmlau16b(<8 x i16> %A, <8 x i16> %B, i16 %X) nounwind {
44 ; CHECK-LABEL: vmlau16b:
45 ; CHECK: @ %bb.0: @ %entry
46 ; CHECK-NEXT: vmla.u16 q0, q1, r0
49 %0 = insertelement <8 x i16> undef, i16 %X, i32 0
50 %1 = shufflevector <8 x i16> %0, <8 x i16> undef, <8 x i32> zeroinitializer
51 %2 = mul nsw <8 x i16> %1, %B
52 %3 = add nsw <8 x i16> %2, %A
56 define arm_aapcs_vfpcc <16 x i8> @vmlau8(<16 x i8> %A, <16 x i8> %B, i8 %X) nounwind {
57 ; CHECK-LABEL: vmlau8:
58 ; CHECK: @ %bb.0: @ %entry
59 ; CHECK-NEXT: vmla.u8 q0, q1, r0
62 %0 = insertelement <16 x i8> undef, i8 %X, i32 0
63 %1 = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> zeroinitializer
64 %2 = mul nsw <16 x i8> %B, %1
65 %3 = add nsw <16 x i8> %A, %2
69 define arm_aapcs_vfpcc <16 x i8> @vmlau8b(<16 x i8> %A, <16 x i8> %B, i8 %X) nounwind {
70 ; CHECK-LABEL: vmlau8b:
71 ; CHECK: @ %bb.0: @ %entry
72 ; CHECK-NEXT: vmla.u8 q0, q1, r0
75 %0 = insertelement <16 x i8> undef, i8 %X, i32 0
76 %1 = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> zeroinitializer
77 %2 = mul nsw <16 x i8> %1, %B
78 %3 = add nsw <16 x i8> %2, %A
82 define void @vmla32_in_loop(i32* %s1, i32 %x, i32* %d, i32 %n) {
83 ; CHECK-LABEL: vmla32_in_loop:
84 ; CHECK: @ %bb.0: @ %entry
85 ; CHECK-NEXT: subs r0, #16
86 ; CHECK-NEXT: subs r2, #16
87 ; CHECK-NEXT: .LBB6_1: @ %vector.body
88 ; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
89 ; CHECK-NEXT: vldrw.u32 q0, [r0, #16]!
90 ; CHECK-NEXT: vldrw.u32 q1, [r2, #16]!
91 ; CHECK-NEXT: subs r3, #4
92 ; CHECK-NEXT: vmla.u32 q1, q0, r1
93 ; CHECK-NEXT: vstrw.32 q1, [r2]
94 ; CHECK-NEXT: bne .LBB6_1
95 ; CHECK-NEXT: @ %bb.2: @ %for.cond.cleanup
98 %broadcast.splatinsert8 = insertelement <4 x i32> undef, i32 %x, i32 0
99 %broadcast.splat9 = shufflevector <4 x i32> %broadcast.splatinsert8, <4 x i32> undef, <4 x i32> zeroinitializer
100 br label %vector.body
103 %index = phi i32 [ 0, %entry ], [ %index.next, %vector.body ]
104 %0 = getelementptr inbounds i32, i32* %s1, i32 %index
105 %1 = bitcast i32* %0 to <4 x i32>*
106 %wide.load = load <4 x i32>, <4 x i32>* %1, align 4
107 %2 = mul nsw <4 x i32> %wide.load, %broadcast.splat9
108 %3 = getelementptr inbounds i32, i32* %d, i32 %index
109 %4 = bitcast i32* %3 to <4 x i32>*
110 %wide.load10 = load <4 x i32>, <4 x i32>* %4, align 4
111 %5 = add nsw <4 x i32> %wide.load10, %2
112 %6 = bitcast i32* %3 to <4 x i32>*
113 store <4 x i32> %5, <4 x i32>* %6, align 4
114 %index.next = add i32 %index, 4
115 %7 = icmp eq i32 %index.next, %n
116 br i1 %7, label %for.cond.cleanup, label %vector.body
122 define void @vmla16_in_loop(i16* %s1, i16 %x, i16* %d, i32 %n) {
123 ; CHECK-LABEL: vmla16_in_loop:
124 ; CHECK: @ %bb.0: @ %entry
125 ; CHECK-NEXT: subs r0, #16
126 ; CHECK-NEXT: subs r2, #16
127 ; CHECK-NEXT: .LBB7_1: @ %vector.body
128 ; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
129 ; CHECK-NEXT: vldrh.u16 q0, [r0, #16]!
130 ; CHECK-NEXT: vldrh.u16 q1, [r2, #16]!
131 ; CHECK-NEXT: subs r3, #8
132 ; CHECK-NEXT: vmla.u16 q1, q0, r1
133 ; CHECK-NEXT: vstrh.16 q1, [r2]
134 ; CHECK-NEXT: bne .LBB7_1
135 ; CHECK-NEXT: @ %bb.2: @ %for.cond.cleanup
138 %broadcast.splatinsert11 = insertelement <8 x i16> undef, i16 %x, i32 0
139 %broadcast.splat12 = shufflevector <8 x i16> %broadcast.splatinsert11, <8 x i16> undef, <8 x i32> zeroinitializer
140 br label %vector.body
143 %index = phi i32 [ 0, %entry ], [ %index.next, %vector.body ]
144 %0 = getelementptr inbounds i16, i16* %s1, i32 %index
145 %1 = bitcast i16* %0 to <8 x i16>*
146 %wide.load = load <8 x i16>, <8 x i16>* %1, align 2
147 %2 = mul <8 x i16> %wide.load, %broadcast.splat12
148 %3 = getelementptr inbounds i16, i16* %d, i32 %index
149 %4 = bitcast i16* %3 to <8 x i16>*
150 %wide.load13 = load <8 x i16>, <8 x i16>* %4, align 2
151 %5 = add <8 x i16> %2, %wide.load13
152 %6 = bitcast i16* %3 to <8 x i16>*
153 store <8 x i16> %5, <8 x i16>* %6, align 2
154 %index.next = add i32 %index, 8
155 %7 = icmp eq i32 %index.next, %n
156 br i1 %7, label %for.cond.cleanup, label %vector.body
162 define void @vmla8_in_loop(i8* %s1, i8 %x, i8* %d, i32 %n) {
163 ; CHECK-LABEL: vmla8_in_loop:
164 ; CHECK: @ %bb.0: @ %entry
165 ; CHECK-NEXT: subs r0, #16
166 ; CHECK-NEXT: subs r2, #16
167 ; CHECK-NEXT: .LBB8_1: @ %vector.body
168 ; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
169 ; CHECK-NEXT: vldrh.u16 q0, [r0, #16]!
170 ; CHECK-NEXT: vldrh.u16 q1, [r2, #16]!
171 ; CHECK-NEXT: subs r3, #16
172 ; CHECK-NEXT: vmla.u8 q1, q0, r1
173 ; CHECK-NEXT: vstrh.16 q1, [r2]
174 ; CHECK-NEXT: bne .LBB8_1
175 ; CHECK-NEXT: @ %bb.2: @ %for.cond.cleanup
178 %broadcast.splatinsert11 = insertelement <16 x i8> undef, i8 %x, i32 0
179 %broadcast.splat12 = shufflevector <16 x i8> %broadcast.splatinsert11, <16 x i8> undef, <16 x i32> zeroinitializer
180 br label %vector.body
183 %index = phi i32 [ 0, %entry ], [ %index.next, %vector.body ]
184 %0 = getelementptr inbounds i8, i8* %s1, i32 %index
185 %1 = bitcast i8* %0 to <16 x i8>*
186 %wide.load = load <16 x i8>, <16 x i8>* %1, align 2
187 %2 = mul <16 x i8> %wide.load, %broadcast.splat12
188 %3 = getelementptr inbounds i8, i8* %d, i32 %index
189 %4 = bitcast i8* %3 to <16 x i8>*
190 %wide.load13 = load <16 x i8>, <16 x i8>* %4, align 2
191 %5 = add <16 x i8> %2, %wide.load13
192 %6 = bitcast i8* %3 to <16 x i8>*
193 store <16 x i8> %5, <16 x i8>* %6, align 2
194 %index.next = add i32 %index, 16
195 %7 = icmp eq i32 %index.next, %n
196 br i1 %7, label %for.cond.cleanup, label %vector.body