1 ; RUN: llc -march=hexagon < %s | FileCheck %s
5 ; CHECK-LABEL: andb_64:
7 define <64 x i8> @andb_64(<64 x i8> %v0, <64 x i8> %v1) #0 {
8 %p = and <64 x i8> %v0, %v1
12 ; CHECK-LABEL: andb_128:
14 define <128 x i8> @andb_128(<128 x i8> %v0, <128 x i8> %v1) #1 {
15 %p = and <128 x i8> %v0, %v1
19 ; CHECK-LABEL: andh_64:
21 define <32 x i16> @andh_64(<32 x i16> %v0, <32 x i16> %v1) #0 {
22 %p = and <32 x i16> %v0, %v1
26 ; CHECK-LABEL: andh_128:
28 define <64 x i16> @andh_128(<64 x i16> %v0, <64 x i16> %v1) #1 {
29 %p = and <64 x i16> %v0, %v1
33 ; CHECK-LABEL: andw_64:
35 define <16 x i32> @andw_64(<16 x i32> %v0, <16 x i32> %v1) #0 {
36 %p = and <16 x i32> %v0, %v1
40 ; CHECK-LABEL: andw_128:
42 define <32 x i32> @andw_128(<32 x i32> %v0, <32 x i32> %v1) #1 {
43 %p = and <32 x i32> %v0, %v1
49 ; CHECK-LABEL: orb_64:
51 define <64 x i8> @orb_64(<64 x i8> %v0, <64 x i8> %v1) #0 {
52 %p = or <64 x i8> %v0, %v1
56 ; CHECK-LABEL: orb_128:
58 define <128 x i8> @orb_128(<128 x i8> %v0, <128 x i8> %v1) #1 {
59 %p = or <128 x i8> %v0, %v1
63 ; CHECK-LABEL: orh_64:
65 define <32 x i16> @orh_64(<32 x i16> %v0, <32 x i16> %v1) #0 {
66 %p = or <32 x i16> %v0, %v1
70 ; CHECK-LABEL: orh_128:
72 define <64 x i16> @orh_128(<64 x i16> %v0, <64 x i16> %v1) #1 {
73 %p = or <64 x i16> %v0, %v1
77 ; CHECK-LABEL: orw_64:
79 define <16 x i32> @orw_64(<16 x i32> %v0, <16 x i32> %v1) #0 {
80 %p = or <16 x i32> %v0, %v1
84 ; CHECK-LABEL: orw_128:
86 define <32 x i32> @orw_128(<32 x i32> %v0, <32 x i32> %v1) #1 {
87 %p = or <32 x i32> %v0, %v1
93 ; CHECK-LABEL: xorb_64:
95 define <64 x i8> @xorb_64(<64 x i8> %v0, <64 x i8> %v1) #0 {
96 %p = xor <64 x i8> %v0, %v1
100 ; CHECK-LABEL: xorb_128:
102 define <128 x i8> @xorb_128(<128 x i8> %v0, <128 x i8> %v1) #1 {
103 %p = xor <128 x i8> %v0, %v1
107 ; CHECK-LABEL: xorh_64:
109 define <32 x i16> @xorh_64(<32 x i16> %v0, <32 x i16> %v1) #0 {
110 %p = xor <32 x i16> %v0, %v1
114 ; CHECK-LABEL: xorh_128:
116 define <64 x i16> @xorh_128(<64 x i16> %v0, <64 x i16> %v1) #1 {
117 %p = xor <64 x i16> %v0, %v1
121 ; CHECK-LABEL: xorw_64:
123 define <16 x i32> @xorw_64(<16 x i32> %v0, <16 x i32> %v1) #0 {
124 %p = xor <16 x i32> %v0, %v1
128 ; CHECK-LABEL: xorw_128:
130 define <32 x i32> @xorw_128(<32 x i32> %v0, <32 x i32> %v1) #1 {
131 %p = xor <32 x i32> %v0, %v1
137 ; CHECK-LABEL: addb_64:
138 ; CHECK: vadd(v0.b,v1.b)
139 define <64 x i8> @addb_64(<64 x i8> %v0, <64 x i8> %v1) #0 {
140 %p = add <64 x i8> %v0, %v1
144 ; CHECK-LABEL: addb_128:
145 ; CHECK: vadd(v0.b,v1.b)
146 define <128 x i8> @addb_128(<128 x i8> %v0, <128 x i8> %v1) #1 {
147 %p = add <128 x i8> %v0, %v1
151 ; CHECK-LABEL: addh_64:
152 ; CHECK: vadd(v0.h,v1.h)
153 define <32 x i16> @addh_64(<32 x i16> %v0, <32 x i16> %v1) #0 {
154 %p = add <32 x i16> %v0, %v1
158 ; CHECK-LABEL: addh_128:
159 ; CHECK: vadd(v0.h,v1.h)
160 define <64 x i16> @addh_128(<64 x i16> %v0, <64 x i16> %v1) #1 {
161 %p = add <64 x i16> %v0, %v1
165 ; CHECK-LABEL: addw_64:
166 ; CHECK: vadd(v0.w,v1.w)
167 define <16 x i32> @addw_64(<16 x i32> %v0, <16 x i32> %v1) #0 {
168 %p = add <16 x i32> %v0, %v1
172 ; CHECK-LABEL: addw_128:
173 ; CHECK: vadd(v0.w,v1.w)
174 define <32 x i32> @addw_128(<32 x i32> %v0, <32 x i32> %v1) #1 {
175 %p = add <32 x i32> %v0, %v1
181 ; CHECK-LABEL: subb_64:
182 ; CHECK: vsub(v0.b,v1.b)
183 define <64 x i8> @subb_64(<64 x i8> %v0, <64 x i8> %v1) #0 {
184 %p = sub <64 x i8> %v0, %v1
188 ; CHECK-LABEL: subb_128:
189 ; CHECK: vsub(v0.b,v1.b)
190 define <128 x i8> @subb_128(<128 x i8> %v0, <128 x i8> %v1) #1 {
191 %p = sub <128 x i8> %v0, %v1
195 ; CHECK-LABEL: subh_64:
196 ; CHECK: vsub(v0.h,v1.h)
197 define <32 x i16> @subh_64(<32 x i16> %v0, <32 x i16> %v1) #0 {
198 %p = sub <32 x i16> %v0, %v1
202 ; CHECK-LABEL: subh_128:
203 ; CHECK: vsub(v0.h,v1.h)
204 define <64 x i16> @subh_128(<64 x i16> %v0, <64 x i16> %v1) #1 {
205 %p = sub <64 x i16> %v0, %v1
209 ; CHECK-LABEL: subw_64:
210 ; CHECK: vsub(v0.w,v1.w)
211 define <16 x i32> @subw_64(<16 x i32> %v0, <16 x i32> %v1) #0 {
212 %p = sub <16 x i32> %v0, %v1
216 ; CHECK-LABEL: subw_128:
217 ; CHECK: vsub(v0.w,v1.w)
218 define <32 x i32> @subw_128(<32 x i32> %v0, <32 x i32> %v1) #1 {
219 %p = sub <32 x i32> %v0, %v1
225 ; CHECK-LABEL: mpyb_64:
226 ; CHECK: v[[H0:[0-9]+]]:[[L0:[0-9]+]].h = vmpy(v0.b,v1.b)
227 ; CHECK: vshuffe(v[[H0]].b,v[[L0]].b)
228 define <64 x i8> @mpyb_64(<64 x i8> %v0, <64 x i8> %v1) #0 {
229 %p = mul <64 x i8> %v0, %v1
233 ; CHECK-LABEL: mpyb_128:
234 ; CHECK: v[[H0:[0-9]+]]:[[L0:[0-9]+]].h = vmpy(v0.b,v1.b)
235 ; CHECK: vshuffe(v[[H0]].b,v[[L0]].b)
236 define <128 x i8> @mpyb_128(<128 x i8> %v0, <128 x i8> %v1) #1 {
237 %p = mul <128 x i8> %v0, %v1
241 ; CHECK-LABEL: mpyh_64:
242 ; CHECK: vmpyi(v0.h,v1.h)
243 define <32 x i16> @mpyh_64(<32 x i16> %v0, <32 x i16> %v1) #0 {
244 %p = mul <32 x i16> %v0, %v1
248 ; CHECK-LABEL: mpyh_128:
249 ; CHECK: vmpyi(v0.h,v1.h)
250 define <64 x i16> @mpyh_128(<64 x i16> %v0, <64 x i16> %v1) #1 {
251 %p = mul <64 x i16> %v0, %v1
255 ; CHECK-LABEL: mpyw_64:
256 ; CHECK: v[[V0:[0-9]+]].w = vmpyieo(v0.h,v1.h)
257 ; CHECK: v[[V0]].w += vmpyie(v0.w,v1.uh)
258 define <16 x i32> @mpyw_64(<16 x i32> %v0, <16 x i32> %v1) #0 {
259 %p = mul <16 x i32> %v0, %v1
263 ; CHECK-LABEL: mpyw_128:
264 ; CHECK: v[[V0:[0-9]+]].w = vmpyieo(v0.h,v1.h)
265 ; CHECK: v[[V0]].w += vmpyie(v0.w,v1.uh)
266 define <32 x i32> @mpyw_128(<32 x i32> %v0, <32 x i32> %v1) #1 {
267 %p = mul <32 x i32> %v0, %v1
271 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length64b" }
272 attributes #1 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length128b" }