1 ;; ??? This file needs auditing for thumb2
2 ;; Patterns for the Intel Wireless MMX technology architecture.
3 ;; Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
4 ;; Contributed by Red Hat.
6 ;; This file is part of GCC.
8 ;; GCC is free software; you can redistribute it and/or modify it under
9 ;; the terms of the GNU General Public License as published by the Free
10 ;; Software Foundation; either version 3, or (at your option) any later
13 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
14 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 ;; License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>.
23 (define_insn "iwmmxt_iordi3"
24 [(set (match_operand:DI 0 "register_operand" "=y,?&r,?&r")
25 (ior:DI (match_operand:DI 1 "register_operand" "%y,0,r")
26 (match_operand:DI 2 "register_operand" "y,r,r")))]
27 "TARGET_REALLY_IWMMXT"
32 [(set_attr "predicable" "yes")
33 (set_attr "length" "4,8,8")])
35 (define_insn "iwmmxt_xordi3"
36 [(set (match_operand:DI 0 "register_operand" "=y,?&r,?&r")
37 (xor:DI (match_operand:DI 1 "register_operand" "%y,0,r")
38 (match_operand:DI 2 "register_operand" "y,r,r")))]
39 "TARGET_REALLY_IWMMXT"
44 [(set_attr "predicable" "yes")
45 (set_attr "length" "4,8,8")])
47 (define_insn "iwmmxt_anddi3"
48 [(set (match_operand:DI 0 "register_operand" "=y,?&r,?&r")
49 (and:DI (match_operand:DI 1 "register_operand" "%y,0,r")
50 (match_operand:DI 2 "register_operand" "y,r,r")))]
51 "TARGET_REALLY_IWMMXT"
56 [(set_attr "predicable" "yes")
57 (set_attr "length" "4,8,8")])
59 (define_insn "iwmmxt_nanddi3"
60 [(set (match_operand:DI 0 "register_operand" "=y")
61 (and:DI (match_operand:DI 1 "register_operand" "y")
62 (not:DI (match_operand:DI 2 "register_operand" "y"))))]
63 "TARGET_REALLY_IWMMXT"
64 "wandn%?\\t%0, %1, %2"
65 [(set_attr "predicable" "yes")])
67 (define_insn "*iwmmxt_arm_movdi"
68 [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, m,y,y,yr,y,yrUy")
69 (match_operand:DI 1 "di_operand" "rIK,mi,r,y,yr,y,yrUy,y"))]
71 && ( register_operand (operands[0], DImode)
72 || register_operand (operands[1], DImode))"
75 switch (which_alternative)
78 return output_move_double (operands);
82 return \"wmov%?\\t%0,%1\";
84 return \"tmcrr%?\\t%0,%Q1,%R1\";
86 return \"tmrrc%?\\t%Q0,%R0,%1\";
88 return \"wldrd%?\\t%0,%1\";
90 return \"wstrd%?\\t%1,%0\";
93 [(set_attr "length" "8,8,8,4,4,4,4,4")
94 (set_attr "type" "*,load1,store2,*,*,*,*,*")
95 (set_attr "pool_range" "*,1020,*,*,*,*,*,*")
96 (set_attr "neg_pool_range" "*,1012,*,*,*,*,*,*")]
99 (define_insn "*iwmmxt_movsi_insn"
100 [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,rk, m,z,r,?z,Uy,z")
101 (match_operand:SI 1 "general_operand" "rk, I,K,mi,rk,r,z,Uy,z, z"))]
102 "TARGET_REALLY_IWMMXT
103 && ( register_operand (operands[0], SImode)
104 || register_operand (operands[1], SImode))"
106 switch (which_alternative)
108 case 0: return \"mov\\t%0, %1\";
109 case 1: return \"mov\\t%0, %1\";
110 case 2: return \"mvn\\t%0, #%B1\";
111 case 3: return \"ldr\\t%0, %1\";
112 case 4: return \"str\\t%1, %0\";
113 case 5: return \"tmcr\\t%0, %1\";
114 case 6: return \"tmrc\\t%0, %1\";
115 case 7: return arm_output_load_gr (operands);
116 case 8: return \"wstrw\\t%1, %0\";
117 default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\";
119 [(set_attr "type" "*,*,*,load1,store1,*,*,load1,store1,*")
120 (set_attr "length" "*,*,*,*, *,*,*, 16, *,8")
121 (set_attr "pool_range" "*,*,*,4096, *,*,*,1024, *,*")
122 (set_attr "neg_pool_range" "*,*,*,4084, *,*,*, *, 1012,*")
123 ;; Note - the "predicable" attribute is not allowed to have alternatives.
124 ;; Since the wSTRw wCx instruction is not predicable, we cannot support
125 ;; predicating any of the alternatives in this template. Instead,
126 ;; we do the predication ourselves, in cond_iwmmxt_movsi_insn.
127 (set_attr "predicable" "no")
128 ;; Also - we have to pretend that these insns clobber the condition code
129 ;; bits as otherwise arm_final_prescan_insn() will try to conditionalize
131 (set_attr "conds" "clob")]
134 ;; Because iwmmxt_movsi_insn is not predicable, we provide the
135 ;; cond_exec version explicitly, with appropriate constraints.
137 (define_insn "*cond_iwmmxt_movsi_insn"
139 (match_operator 2 "arm_comparison_operator"
140 [(match_operand 3 "cc_register" "")
142 (set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m,z,r")
143 (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,z")))]
144 "TARGET_REALLY_IWMMXT
145 && ( register_operand (operands[0], SImode)
146 || register_operand (operands[1], SImode))"
148 switch (which_alternative)
150 case 0: return \"mov%?\\t%0, %1\";
151 case 1: return \"mvn%?\\t%0, #%B1\";
152 case 2: return \"ldr%?\\t%0, %1\";
153 case 3: return \"str%?\\t%1, %0\";
154 case 4: return \"tmcr%?\\t%0, %1\";
155 default: return \"tmrc%?\\t%0, %1\";
157 [(set_attr "type" "*,*,load1,store1,*,*")
158 (set_attr "pool_range" "*,*,4096, *,*,*")
159 (set_attr "neg_pool_range" "*,*,4084, *,*,*")]
162 (define_insn "mov<mode>_internal"
163 [(set (match_operand:VMMX 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
164 (match_operand:VMMX 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
165 "TARGET_REALLY_IWMMXT"
167 switch (which_alternative)
169 case 0: return \"wmov%?\\t%0, %1\";
170 case 1: return \"wstrd%?\\t%1, %0\";
171 case 2: return \"wldrd%?\\t%0, %1\";
172 case 3: return \"tmrrc%?\\t%Q0, %R0, %1\";
173 case 4: return \"tmcrr%?\\t%0, %Q1, %R1\";
174 case 5: return \"#\";
175 default: return output_move_double (operands);
177 [(set_attr "predicable" "yes")
178 (set_attr "length" "4, 4, 4,4,4,8, 8,8")
179 (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
180 (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
181 (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
183 ;; Vector add/subtract
185 (define_insn "*add<mode>3_iwmmxt"
186 [(set (match_operand:VMMX 0 "register_operand" "=y")
187 (plus:VMMX (match_operand:VMMX 1 "register_operand" "y")
188 (match_operand:VMMX 2 "register_operand" "y")))]
189 "TARGET_REALLY_IWMMXT"
190 "wadd<MMX_char>%?\\t%0, %1, %2"
191 [(set_attr "predicable" "yes")])
193 (define_insn "ssaddv8qi3"
194 [(set (match_operand:V8QI 0 "register_operand" "=y")
195 (ss_plus:V8QI (match_operand:V8QI 1 "register_operand" "y")
196 (match_operand:V8QI 2 "register_operand" "y")))]
197 "TARGET_REALLY_IWMMXT"
198 "waddbss%?\\t%0, %1, %2"
199 [(set_attr "predicable" "yes")])
201 (define_insn "ssaddv4hi3"
202 [(set (match_operand:V4HI 0 "register_operand" "=y")
203 (ss_plus:V4HI (match_operand:V4HI 1 "register_operand" "y")
204 (match_operand:V4HI 2 "register_operand" "y")))]
205 "TARGET_REALLY_IWMMXT"
206 "waddhss%?\\t%0, %1, %2"
207 [(set_attr "predicable" "yes")])
209 (define_insn "ssaddv2si3"
210 [(set (match_operand:V2SI 0 "register_operand" "=y")
211 (ss_plus:V2SI (match_operand:V2SI 1 "register_operand" "y")
212 (match_operand:V2SI 2 "register_operand" "y")))]
213 "TARGET_REALLY_IWMMXT"
214 "waddwss%?\\t%0, %1, %2"
215 [(set_attr "predicable" "yes")])
217 (define_insn "usaddv8qi3"
218 [(set (match_operand:V8QI 0 "register_operand" "=y")
219 (us_plus:V8QI (match_operand:V8QI 1 "register_operand" "y")
220 (match_operand:V8QI 2 "register_operand" "y")))]
221 "TARGET_REALLY_IWMMXT"
222 "waddbus%?\\t%0, %1, %2"
223 [(set_attr "predicable" "yes")])
225 (define_insn "usaddv4hi3"
226 [(set (match_operand:V4HI 0 "register_operand" "=y")
227 (us_plus:V4HI (match_operand:V4HI 1 "register_operand" "y")
228 (match_operand:V4HI 2 "register_operand" "y")))]
229 "TARGET_REALLY_IWMMXT"
230 "waddhus%?\\t%0, %1, %2"
231 [(set_attr "predicable" "yes")])
233 (define_insn "usaddv2si3"
234 [(set (match_operand:V2SI 0 "register_operand" "=y")
235 (us_plus:V2SI (match_operand:V2SI 1 "register_operand" "y")
236 (match_operand:V2SI 2 "register_operand" "y")))]
237 "TARGET_REALLY_IWMMXT"
238 "waddwus%?\\t%0, %1, %2"
239 [(set_attr "predicable" "yes")])
241 (define_insn "*sub<mode>3_iwmmxt"
242 [(set (match_operand:VMMX 0 "register_operand" "=y")
243 (minus:VMMX (match_operand:VMMX 1 "register_operand" "y")
244 (match_operand:VMMX 2 "register_operand" "y")))]
245 "TARGET_REALLY_IWMMXT"
246 "wsub<MMX_char>%?\\t%0, %1, %2"
247 [(set_attr "predicable" "yes")])
249 (define_insn "sssubv8qi3"
250 [(set (match_operand:V8QI 0 "register_operand" "=y")
251 (ss_minus:V8QI (match_operand:V8QI 1 "register_operand" "y")
252 (match_operand:V8QI 2 "register_operand" "y")))]
253 "TARGET_REALLY_IWMMXT"
254 "wsubbss%?\\t%0, %1, %2"
255 [(set_attr "predicable" "yes")])
257 (define_insn "sssubv4hi3"
258 [(set (match_operand:V4HI 0 "register_operand" "=y")
259 (ss_minus:V4HI (match_operand:V4HI 1 "register_operand" "y")
260 (match_operand:V4HI 2 "register_operand" "y")))]
261 "TARGET_REALLY_IWMMXT"
262 "wsubhss%?\\t%0, %1, %2"
263 [(set_attr "predicable" "yes")])
265 (define_insn "sssubv2si3"
266 [(set (match_operand:V2SI 0 "register_operand" "=y")
267 (ss_minus:V2SI (match_operand:V2SI 1 "register_operand" "y")
268 (match_operand:V2SI 2 "register_operand" "y")))]
269 "TARGET_REALLY_IWMMXT"
270 "wsubwss%?\\t%0, %1, %2"
271 [(set_attr "predicable" "yes")])
273 (define_insn "ussubv8qi3"
274 [(set (match_operand:V8QI 0 "register_operand" "=y")
275 (us_minus:V8QI (match_operand:V8QI 1 "register_operand" "y")
276 (match_operand:V8QI 2 "register_operand" "y")))]
277 "TARGET_REALLY_IWMMXT"
278 "wsubbus%?\\t%0, %1, %2"
279 [(set_attr "predicable" "yes")])
281 (define_insn "ussubv4hi3"
282 [(set (match_operand:V4HI 0 "register_operand" "=y")
283 (us_minus:V4HI (match_operand:V4HI 1 "register_operand" "y")
284 (match_operand:V4HI 2 "register_operand" "y")))]
285 "TARGET_REALLY_IWMMXT"
286 "wsubhus%?\\t%0, %1, %2"
287 [(set_attr "predicable" "yes")])
289 (define_insn "ussubv2si3"
290 [(set (match_operand:V2SI 0 "register_operand" "=y")
291 (us_minus:V2SI (match_operand:V2SI 1 "register_operand" "y")
292 (match_operand:V2SI 2 "register_operand" "y")))]
293 "TARGET_REALLY_IWMMXT"
294 "wsubwus%?\\t%0, %1, %2"
295 [(set_attr "predicable" "yes")])
297 (define_insn "*mulv4hi3_iwmmxt"
298 [(set (match_operand:V4HI 0 "register_operand" "=y")
299 (mult:V4HI (match_operand:V4HI 1 "register_operand" "y")
300 (match_operand:V4HI 2 "register_operand" "y")))]
301 "TARGET_REALLY_IWMMXT"
302 "wmulul%?\\t%0, %1, %2"
303 [(set_attr "predicable" "yes")])
305 (define_insn "smulv4hi3_highpart"
306 [(set (match_operand:V4HI 0 "register_operand" "=y")
309 (mult:V4SI (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
310 (sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
312 "TARGET_REALLY_IWMMXT"
313 "wmulsm%?\\t%0, %1, %2"
314 [(set_attr "predicable" "yes")])
316 (define_insn "umulv4hi3_highpart"
317 [(set (match_operand:V4HI 0 "register_operand" "=y")
320 (mult:V4SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
321 (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
323 "TARGET_REALLY_IWMMXT"
324 "wmulum%?\\t%0, %1, %2"
325 [(set_attr "predicable" "yes")])
327 (define_insn "iwmmxt_wmacs"
328 [(set (match_operand:DI 0 "register_operand" "=y")
329 (unspec:DI [(match_operand:DI 1 "register_operand" "0")
330 (match_operand:V4HI 2 "register_operand" "y")
331 (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WMACS))]
332 "TARGET_REALLY_IWMMXT"
333 "wmacs%?\\t%0, %2, %3"
334 [(set_attr "predicable" "yes")])
336 (define_insn "iwmmxt_wmacsz"
337 [(set (match_operand:DI 0 "register_operand" "=y")
338 (unspec:DI [(match_operand:V4HI 1 "register_operand" "y")
339 (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMACSZ))]
340 "TARGET_REALLY_IWMMXT"
341 "wmacsz%?\\t%0, %1, %2"
342 [(set_attr "predicable" "yes")])
344 (define_insn "iwmmxt_wmacu"
345 [(set (match_operand:DI 0 "register_operand" "=y")
346 (unspec:DI [(match_operand:DI 1 "register_operand" "0")
347 (match_operand:V4HI 2 "register_operand" "y")
348 (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WMACU))]
349 "TARGET_REALLY_IWMMXT"
350 "wmacu%?\\t%0, %2, %3"
351 [(set_attr "predicable" "yes")])
353 (define_insn "iwmmxt_wmacuz"
354 [(set (match_operand:DI 0 "register_operand" "=y")
355 (unspec:DI [(match_operand:V4HI 1 "register_operand" "y")
356 (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMACUZ))]
357 "TARGET_REALLY_IWMMXT"
358 "wmacuz%?\\t%0, %1, %2"
359 [(set_attr "predicable" "yes")])
361 ;; Same as xordi3, but don't show input operands so that we don't think
363 (define_insn "iwmmxt_clrdi"
364 [(set (match_operand:DI 0 "register_operand" "=y")
365 (unspec:DI [(const_int 0)] UNSPEC_CLRDI))]
366 "TARGET_REALLY_IWMMXT"
367 "wxor%?\\t%0, %0, %0"
368 [(set_attr "predicable" "yes")])
370 ;; Seems like cse likes to generate these, so we have to support them.
372 (define_insn "*iwmmxt_clrv8qi"
373 [(set (match_operand:V8QI 0 "register_operand" "=y")
374 (const_vector:V8QI [(const_int 0) (const_int 0)
375 (const_int 0) (const_int 0)
376 (const_int 0) (const_int 0)
377 (const_int 0) (const_int 0)]))]
378 "TARGET_REALLY_IWMMXT"
379 "wxor%?\\t%0, %0, %0"
380 [(set_attr "predicable" "yes")])
382 (define_insn "*iwmmxt_clrv4hi"
383 [(set (match_operand:V4HI 0 "register_operand" "=y")
384 (const_vector:V4HI [(const_int 0) (const_int 0)
385 (const_int 0) (const_int 0)]))]
386 "TARGET_REALLY_IWMMXT"
387 "wxor%?\\t%0, %0, %0"
388 [(set_attr "predicable" "yes")])
390 (define_insn "*iwmmxt_clrv2si"
391 [(set (match_operand:V2SI 0 "register_operand" "=y")
392 (const_vector:V2SI [(const_int 0) (const_int 0)]))]
393 "TARGET_REALLY_IWMMXT"
394 "wxor%?\\t%0, %0, %0"
395 [(set_attr "predicable" "yes")])
397 ;; Unsigned averages/sum of absolute differences
399 (define_insn "iwmmxt_uavgrndv8qi3"
400 [(set (match_operand:V8QI 0 "register_operand" "=y")
402 (plus:V8QI (plus:V8QI
403 (match_operand:V8QI 1 "register_operand" "y")
404 (match_operand:V8QI 2 "register_operand" "y"))
405 (const_vector:V8QI [(const_int 1)
414 "TARGET_REALLY_IWMMXT"
415 "wavg2br%?\\t%0, %1, %2"
416 [(set_attr "predicable" "yes")])
418 (define_insn "iwmmxt_uavgrndv4hi3"
419 [(set (match_operand:V4HI 0 "register_operand" "=y")
421 (plus:V4HI (plus:V4HI
422 (match_operand:V4HI 1 "register_operand" "y")
423 (match_operand:V4HI 2 "register_operand" "y"))
424 (const_vector:V4HI [(const_int 1)
429 "TARGET_REALLY_IWMMXT"
430 "wavg2hr%?\\t%0, %1, %2"
431 [(set_attr "predicable" "yes")])
434 (define_insn "iwmmxt_uavgv8qi3"
435 [(set (match_operand:V8QI 0 "register_operand" "=y")
436 (ashiftrt:V8QI (plus:V8QI
437 (match_operand:V8QI 1 "register_operand" "y")
438 (match_operand:V8QI 2 "register_operand" "y"))
440 "TARGET_REALLY_IWMMXT"
441 "wavg2b%?\\t%0, %1, %2"
442 [(set_attr "predicable" "yes")])
444 (define_insn "iwmmxt_uavgv4hi3"
445 [(set (match_operand:V4HI 0 "register_operand" "=y")
446 (ashiftrt:V4HI (plus:V4HI
447 (match_operand:V4HI 1 "register_operand" "y")
448 (match_operand:V4HI 2 "register_operand" "y"))
450 "TARGET_REALLY_IWMMXT"
451 "wavg2h%?\\t%0, %1, %2"
452 [(set_attr "predicable" "yes")])
454 (define_insn "iwmmxt_psadbw"
455 [(set (match_operand:V8QI 0 "register_operand" "=y")
456 (abs:V8QI (minus:V8QI (match_operand:V8QI 1 "register_operand" "y")
457 (match_operand:V8QI 2 "register_operand" "y"))))]
458 "TARGET_REALLY_IWMMXT"
459 "psadbw%?\\t%0, %1, %2"
460 [(set_attr "predicable" "yes")])
463 ;; Insert/extract/shuffle
465 (define_insn "iwmmxt_tinsrb"
466 [(set (match_operand:V8QI 0 "register_operand" "=y")
467 (vec_merge:V8QI (match_operand:V8QI 1 "register_operand" "0")
469 (truncate:QI (match_operand:SI 2 "nonimmediate_operand" "r")))
470 (match_operand:SI 3 "immediate_operand" "i")))]
471 "TARGET_REALLY_IWMMXT"
472 "tinsrb%?\\t%0, %2, %3"
473 [(set_attr "predicable" "yes")])
475 (define_insn "iwmmxt_tinsrh"
476 [(set (match_operand:V4HI 0 "register_operand" "=y")
477 (vec_merge:V4HI (match_operand:V4HI 1 "register_operand" "0")
479 (truncate:HI (match_operand:SI 2 "nonimmediate_operand" "r")))
480 (match_operand:SI 3 "immediate_operand" "i")))]
481 "TARGET_REALLY_IWMMXT"
482 "tinsrh%?\\t%0, %2, %3"
483 [(set_attr "predicable" "yes")])
485 (define_insn "iwmmxt_tinsrw"
486 [(set (match_operand:V2SI 0 "register_operand" "=y")
487 (vec_merge:V2SI (match_operand:V2SI 1 "register_operand" "0")
489 (match_operand:SI 2 "nonimmediate_operand" "r"))
490 (match_operand:SI 3 "immediate_operand" "i")))]
491 "TARGET_REALLY_IWMMXT"
492 "tinsrw%?\\t%0, %2, %3"
493 [(set_attr "predicable" "yes")])
495 (define_insn "iwmmxt_textrmub"
496 [(set (match_operand:SI 0 "register_operand" "=r")
497 (zero_extend:SI (vec_select:QI (match_operand:V8QI 1 "register_operand" "y")
499 [(match_operand:SI 2 "immediate_operand" "i")]))))]
500 "TARGET_REALLY_IWMMXT"
501 "textrmub%?\\t%0, %1, %2"
502 [(set_attr "predicable" "yes")])
504 (define_insn "iwmmxt_textrmsb"
505 [(set (match_operand:SI 0 "register_operand" "=r")
506 (sign_extend:SI (vec_select:QI (match_operand:V8QI 1 "register_operand" "y")
508 [(match_operand:SI 2 "immediate_operand" "i")]))))]
509 "TARGET_REALLY_IWMMXT"
510 "textrmsb%?\\t%0, %1, %2"
511 [(set_attr "predicable" "yes")])
513 (define_insn "iwmmxt_textrmuh"
514 [(set (match_operand:SI 0 "register_operand" "=r")
515 (zero_extend:SI (vec_select:HI (match_operand:V4HI 1 "register_operand" "y")
517 [(match_operand:SI 2 "immediate_operand" "i")]))))]
518 "TARGET_REALLY_IWMMXT"
519 "textrmuh%?\\t%0, %1, %2"
520 [(set_attr "predicable" "yes")])
522 (define_insn "iwmmxt_textrmsh"
523 [(set (match_operand:SI 0 "register_operand" "=r")
524 (sign_extend:SI (vec_select:HI (match_operand:V4HI 1 "register_operand" "y")
526 [(match_operand:SI 2 "immediate_operand" "i")]))))]
527 "TARGET_REALLY_IWMMXT"
528 "textrmsh%?\\t%0, %1, %2"
529 [(set_attr "predicable" "yes")])
531 ;; There are signed/unsigned variants of this instruction, but they are
533 (define_insn "iwmmxt_textrmw"
534 [(set (match_operand:SI 0 "register_operand" "=r")
535 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
536 (parallel [(match_operand:SI 2 "immediate_operand" "i")])))]
537 "TARGET_REALLY_IWMMXT"
538 "textrmsw%?\\t%0, %1, %2"
539 [(set_attr "predicable" "yes")])
541 (define_insn "iwmmxt_wshufh"
542 [(set (match_operand:V4HI 0 "register_operand" "=y")
543 (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
544 (match_operand:SI 2 "immediate_operand" "i")] UNSPEC_WSHUFH))]
545 "TARGET_REALLY_IWMMXT"
546 "wshufh%?\\t%0, %1, %2"
547 [(set_attr "predicable" "yes")])
549 ;; Mask-generating comparisons
551 ;; Note - you cannot use patterns like these here:
553 ;; (set:<vector> (match:<vector>) (<comparator>:<vector> (match:<vector>) (match:<vector>)))
555 ;; Because GCC will assume that the truth value (1 or 0) is installed
556 ;; into the entire destination vector, (with the '1' going into the least
557 ;; significant element of the vector). This is not how these instructions
560 ;; Unfortunately the current patterns are illegal. They are SET insns
561 ;; without a SET in them. They work in most cases for ordinary code
562 ;; generation, but there are circumstances where they can cause gcc to fail.
565 (define_insn "eqv8qi3"
566 [(unspec_volatile [(match_operand:V8QI 0 "register_operand" "=y")
567 (match_operand:V8QI 1 "register_operand" "y")
568 (match_operand:V8QI 2 "register_operand" "y")]
570 "TARGET_REALLY_IWMMXT"
571 "wcmpeqb%?\\t%0, %1, %2"
572 [(set_attr "predicable" "yes")])
574 (define_insn "eqv4hi3"
575 [(unspec_volatile [(match_operand:V4HI 0 "register_operand" "=y")
576 (match_operand:V4HI 1 "register_operand" "y")
577 (match_operand:V4HI 2 "register_operand" "y")]
579 "TARGET_REALLY_IWMMXT"
580 "wcmpeqh%?\\t%0, %1, %2"
581 [(set_attr "predicable" "yes")])
583 (define_insn "eqv2si3"
584 [(unspec_volatile:V2SI [(match_operand:V2SI 0 "register_operand" "=y")
585 (match_operand:V2SI 1 "register_operand" "y")
586 (match_operand:V2SI 2 "register_operand" "y")]
588 "TARGET_REALLY_IWMMXT"
589 "wcmpeqw%?\\t%0, %1, %2"
590 [(set_attr "predicable" "yes")])
592 (define_insn "gtuv8qi3"
593 [(unspec_volatile [(match_operand:V8QI 0 "register_operand" "=y")
594 (match_operand:V8QI 1 "register_operand" "y")
595 (match_operand:V8QI 2 "register_operand" "y")]
597 "TARGET_REALLY_IWMMXT"
598 "wcmpgtub%?\\t%0, %1, %2"
599 [(set_attr "predicable" "yes")])
601 (define_insn "gtuv4hi3"
602 [(unspec_volatile [(match_operand:V4HI 0 "register_operand" "=y")
603 (match_operand:V4HI 1 "register_operand" "y")
604 (match_operand:V4HI 2 "register_operand" "y")]
606 "TARGET_REALLY_IWMMXT"
607 "wcmpgtuh%?\\t%0, %1, %2"
608 [(set_attr "predicable" "yes")])
610 (define_insn "gtuv2si3"
611 [(unspec_volatile [(match_operand:V2SI 0 "register_operand" "=y")
612 (match_operand:V2SI 1 "register_operand" "y")
613 (match_operand:V2SI 2 "register_operand" "y")]
615 "TARGET_REALLY_IWMMXT"
616 "wcmpgtuw%?\\t%0, %1, %2"
617 [(set_attr "predicable" "yes")])
619 (define_insn "gtv8qi3"
620 [(unspec_volatile [(match_operand:V8QI 0 "register_operand" "=y")
621 (match_operand:V8QI 1 "register_operand" "y")
622 (match_operand:V8QI 2 "register_operand" "y")]
624 "TARGET_REALLY_IWMMXT"
625 "wcmpgtsb%?\\t%0, %1, %2"
626 [(set_attr "predicable" "yes")])
628 (define_insn "gtv4hi3"
629 [(unspec_volatile [(match_operand:V4HI 0 "register_operand" "=y")
630 (match_operand:V4HI 1 "register_operand" "y")
631 (match_operand:V4HI 2 "register_operand" "y")]
633 "TARGET_REALLY_IWMMXT"
634 "wcmpgtsh%?\\t%0, %1, %2"
635 [(set_attr "predicable" "yes")])
637 (define_insn "gtv2si3"
638 [(unspec_volatile [(match_operand:V2SI 0 "register_operand" "=y")
639 (match_operand:V2SI 1 "register_operand" "y")
640 (match_operand:V2SI 2 "register_operand" "y")]
642 "TARGET_REALLY_IWMMXT"
643 "wcmpgtsw%?\\t%0, %1, %2"
644 [(set_attr "predicable" "yes")])
648 (define_insn "*smax<mode>3_iwmmxt"
649 [(set (match_operand:VMMX 0 "register_operand" "=y")
650 (smax:VMMX (match_operand:VMMX 1 "register_operand" "y")
651 (match_operand:VMMX 2 "register_operand" "y")))]
652 "TARGET_REALLY_IWMMXT"
653 "wmaxs<MMX_char>%?\\t%0, %1, %2"
654 [(set_attr "predicable" "yes")])
656 (define_insn "*umax<mode>3_iwmmxt"
657 [(set (match_operand:VMMX 0 "register_operand" "=y")
658 (umax:VMMX (match_operand:VMMX 1 "register_operand" "y")
659 (match_operand:VMMX 2 "register_operand" "y")))]
660 "TARGET_REALLY_IWMMXT"
661 "wmaxu<MMX_char>%?\\t%0, %1, %2"
662 [(set_attr "predicable" "yes")])
664 (define_insn "*smin<mode>3_iwmmxt"
665 [(set (match_operand:VMMX 0 "register_operand" "=y")
666 (smin:VMMX (match_operand:VMMX 1 "register_operand" "y")
667 (match_operand:VMMX 2 "register_operand" "y")))]
668 "TARGET_REALLY_IWMMXT"
669 "wmins<MMX_char>%?\\t%0, %1, %2"
670 [(set_attr "predicable" "yes")])
672 (define_insn "*umin<mode>3_iwmmxt"
673 [(set (match_operand:VMMX 0 "register_operand" "=y")
674 (umin:VMMX (match_operand:VMMX 1 "register_operand" "y")
675 (match_operand:VMMX 2 "register_operand" "y")))]
676 "TARGET_REALLY_IWMMXT"
677 "wminu<MMX_char>%?\\t%0, %1, %2"
678 [(set_attr "predicable" "yes")])
680 ;; Pack/unpack insns.
682 (define_insn "iwmmxt_wpackhss"
683 [(set (match_operand:V8QI 0 "register_operand" "=y")
685 (ss_truncate:V4QI (match_operand:V4HI 1 "register_operand" "y"))
686 (ss_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))]
687 "TARGET_REALLY_IWMMXT"
688 "wpackhss%?\\t%0, %1, %2"
689 [(set_attr "predicable" "yes")])
691 (define_insn "iwmmxt_wpackwss"
692 [(set (match_operand:V4HI 0 "register_operand" "=y")
694 (ss_truncate:V2HI (match_operand:V2SI 1 "register_operand" "y"))
695 (ss_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))]
696 "TARGET_REALLY_IWMMXT"
697 "wpackwss%?\\t%0, %1, %2"
698 [(set_attr "predicable" "yes")])
700 (define_insn "iwmmxt_wpackdss"
701 [(set (match_operand:V2SI 0 "register_operand" "=y")
703 (ss_truncate:SI (match_operand:DI 1 "register_operand" "y"))
704 (ss_truncate:SI (match_operand:DI 2 "register_operand" "y"))))]
705 "TARGET_REALLY_IWMMXT"
706 "wpackdss%?\\t%0, %1, %2"
707 [(set_attr "predicable" "yes")])
709 (define_insn "iwmmxt_wpackhus"
710 [(set (match_operand:V8QI 0 "register_operand" "=y")
712 (us_truncate:V4QI (match_operand:V4HI 1 "register_operand" "y"))
713 (us_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))]
714 "TARGET_REALLY_IWMMXT"
715 "wpackhus%?\\t%0, %1, %2"
716 [(set_attr "predicable" "yes")])
718 (define_insn "iwmmxt_wpackwus"
719 [(set (match_operand:V4HI 0 "register_operand" "=y")
721 (us_truncate:V2HI (match_operand:V2SI 1 "register_operand" "y"))
722 (us_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))]
723 "TARGET_REALLY_IWMMXT"
724 "wpackwus%?\\t%0, %1, %2"
725 [(set_attr "predicable" "yes")])
727 (define_insn "iwmmxt_wpackdus"
728 [(set (match_operand:V2SI 0 "register_operand" "=y")
730 (us_truncate:SI (match_operand:DI 1 "register_operand" "y"))
731 (us_truncate:SI (match_operand:DI 2 "register_operand" "y"))))]
732 "TARGET_REALLY_IWMMXT"
733 "wpackdus%?\\t%0, %1, %2"
734 [(set_attr "predicable" "yes")])
737 (define_insn "iwmmxt_wunpckihb"
738 [(set (match_operand:V8QI 0 "register_operand" "=y")
740 (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "y")
741 (parallel [(const_int 4)
749 (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y")
750 (parallel [(const_int 0)
759 "TARGET_REALLY_IWMMXT"
760 "wunpckihb%?\\t%0, %1, %2"
761 [(set_attr "predicable" "yes")])
763 (define_insn "iwmmxt_wunpckihh"
764 [(set (match_operand:V4HI 0 "register_operand" "=y")
766 (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "y")
767 (parallel [(const_int 0)
771 (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
772 (parallel [(const_int 2)
777 "TARGET_REALLY_IWMMXT"
778 "wunpckihh%?\\t%0, %1, %2"
779 [(set_attr "predicable" "yes")])
781 (define_insn "iwmmxt_wunpckihw"
782 [(set (match_operand:V2SI 0 "register_operand" "=y")
784 (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "y")
785 (parallel [(const_int 0)
787 (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y")
788 (parallel [(const_int 1)
791 "TARGET_REALLY_IWMMXT"
792 "wunpckihw%?\\t%0, %1, %2"
793 [(set_attr "predicable" "yes")])
795 (define_insn "iwmmxt_wunpckilb"
796 [(set (match_operand:V8QI 0 "register_operand" "=y")
798 (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "y")
799 (parallel [(const_int 0)
807 (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y")
808 (parallel [(const_int 4)
817 "TARGET_REALLY_IWMMXT"
818 "wunpckilb%?\\t%0, %1, %2"
819 [(set_attr "predicable" "yes")])
821 (define_insn "iwmmxt_wunpckilh"
822 [(set (match_operand:V4HI 0 "register_operand" "=y")
824 (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "y")
825 (parallel [(const_int 2)
829 (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
830 (parallel [(const_int 0)
835 "TARGET_REALLY_IWMMXT"
836 "wunpckilh%?\\t%0, %1, %2"
837 [(set_attr "predicable" "yes")])
839 (define_insn "iwmmxt_wunpckilw"
840 [(set (match_operand:V2SI 0 "register_operand" "=y")
842 (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "y")
843 (parallel [(const_int 1)
845 (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y")
846 (parallel [(const_int 0)
849 "TARGET_REALLY_IWMMXT"
850 "wunpckilw%?\\t%0, %1, %2"
851 [(set_attr "predicable" "yes")])
853 (define_insn "iwmmxt_wunpckehub"
854 [(set (match_operand:V4HI 0 "register_operand" "=y")
856 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
857 (parallel [(const_int 4) (const_int 5)
858 (const_int 6) (const_int 7)]))))]
859 "TARGET_REALLY_IWMMXT"
860 "wunpckehub%?\\t%0, %1"
861 [(set_attr "predicable" "yes")])
863 (define_insn "iwmmxt_wunpckehuh"
864 [(set (match_operand:V2SI 0 "register_operand" "=y")
866 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
867 (parallel [(const_int 2) (const_int 3)]))))]
868 "TARGET_REALLY_IWMMXT"
869 "wunpckehuh%?\\t%0, %1"
870 [(set_attr "predicable" "yes")])
872 (define_insn "iwmmxt_wunpckehuw"
873 [(set (match_operand:DI 0 "register_operand" "=y")
875 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
876 (parallel [(const_int 1)]))))]
877 "TARGET_REALLY_IWMMXT"
878 "wunpckehuw%?\\t%0, %1"
879 [(set_attr "predicable" "yes")])
881 (define_insn "iwmmxt_wunpckehsb"
882 [(set (match_operand:V4HI 0 "register_operand" "=y")
884 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
885 (parallel [(const_int 4) (const_int 5)
886 (const_int 6) (const_int 7)]))))]
887 "TARGET_REALLY_IWMMXT"
888 "wunpckehsb%?\\t%0, %1"
889 [(set_attr "predicable" "yes")])
891 (define_insn "iwmmxt_wunpckehsh"
892 [(set (match_operand:V2SI 0 "register_operand" "=y")
894 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
895 (parallel [(const_int 2) (const_int 3)]))))]
896 "TARGET_REALLY_IWMMXT"
897 "wunpckehsh%?\\t%0, %1"
898 [(set_attr "predicable" "yes")])
900 (define_insn "iwmmxt_wunpckehsw"
901 [(set (match_operand:DI 0 "register_operand" "=y")
903 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
904 (parallel [(const_int 1)]))))]
905 "TARGET_REALLY_IWMMXT"
906 "wunpckehsw%?\\t%0, %1"
907 [(set_attr "predicable" "yes")])
909 (define_insn "iwmmxt_wunpckelub"
910 [(set (match_operand:V4HI 0 "register_operand" "=y")
912 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
913 (parallel [(const_int 0) (const_int 1)
914 (const_int 2) (const_int 3)]))))]
915 "TARGET_REALLY_IWMMXT"
916 "wunpckelub%?\\t%0, %1"
917 [(set_attr "predicable" "yes")])
919 (define_insn "iwmmxt_wunpckeluh"
920 [(set (match_operand:V2SI 0 "register_operand" "=y")
922 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
923 (parallel [(const_int 0) (const_int 1)]))))]
924 "TARGET_REALLY_IWMMXT"
925 "wunpckeluh%?\\t%0, %1"
926 [(set_attr "predicable" "yes")])
928 (define_insn "iwmmxt_wunpckeluw"
929 [(set (match_operand:DI 0 "register_operand" "=y")
931 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
932 (parallel [(const_int 0)]))))]
933 "TARGET_REALLY_IWMMXT"
934 "wunpckeluw%?\\t%0, %1"
935 [(set_attr "predicable" "yes")])
937 (define_insn "iwmmxt_wunpckelsb"
938 [(set (match_operand:V4HI 0 "register_operand" "=y")
940 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
941 (parallel [(const_int 0) (const_int 1)
942 (const_int 2) (const_int 3)]))))]
943 "TARGET_REALLY_IWMMXT"
944 "wunpckelsb%?\\t%0, %1"
945 [(set_attr "predicable" "yes")])
947 (define_insn "iwmmxt_wunpckelsh"
948 [(set (match_operand:V2SI 0 "register_operand" "=y")
950 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
951 (parallel [(const_int 0) (const_int 1)]))))]
952 "TARGET_REALLY_IWMMXT"
953 "wunpckelsh%?\\t%0, %1"
954 [(set_attr "predicable" "yes")])
956 (define_insn "iwmmxt_wunpckelsw"
957 [(set (match_operand:DI 0 "register_operand" "=y")
959 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
960 (parallel [(const_int 0)]))))]
961 "TARGET_REALLY_IWMMXT"
962 "wunpckelsw%?\\t%0, %1"
963 [(set_attr "predicable" "yes")])
967 (define_insn "rorv4hi3"
968 [(set (match_operand:V4HI 0 "register_operand" "=y")
969 (rotatert:V4HI (match_operand:V4HI 1 "register_operand" "y")
970 (match_operand:SI 2 "register_operand" "z")))]
971 "TARGET_REALLY_IWMMXT"
972 "wrorhg%?\\t%0, %1, %2"
973 [(set_attr "predicable" "yes")])
975 (define_insn "rorv2si3"
976 [(set (match_operand:V2SI 0 "register_operand" "=y")
977 (rotatert:V2SI (match_operand:V2SI 1 "register_operand" "y")
978 (match_operand:SI 2 "register_operand" "z")))]
979 "TARGET_REALLY_IWMMXT"
980 "wrorwg%?\\t%0, %1, %2"
981 [(set_attr "predicable" "yes")])
983 (define_insn "rordi3"
984 [(set (match_operand:DI 0 "register_operand" "=y")
985 (rotatert:DI (match_operand:DI 1 "register_operand" "y")
986 (match_operand:SI 2 "register_operand" "z")))]
987 "TARGET_REALLY_IWMMXT"
988 "wrordg%?\\t%0, %1, %2"
989 [(set_attr "predicable" "yes")])
991 (define_insn "ashr<mode>3_iwmmxt"
992 [(set (match_operand:VSHFT 0 "register_operand" "=y")
993 (ashiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y")
994 (match_operand:SI 2 "register_operand" "z")))]
995 "TARGET_REALLY_IWMMXT"
996 "wsra<MMX_char>g%?\\t%0, %1, %2"
997 [(set_attr "predicable" "yes")])
999 (define_insn "lshr<mode>3_iwmmxt"
1000 [(set (match_operand:VSHFT 0 "register_operand" "=y")
1001 (lshiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y")
1002 (match_operand:SI 2 "register_operand" "z")))]
1003 "TARGET_REALLY_IWMMXT"
1004 "wsrl<MMX_char>g%?\\t%0, %1, %2"
1005 [(set_attr "predicable" "yes")])
1007 (define_insn "ashl<mode>3_iwmmxt"
1008 [(set (match_operand:VSHFT 0 "register_operand" "=y")
1009 (ashift:VSHFT (match_operand:VSHFT 1 "register_operand" "y")
1010 (match_operand:SI 2 "register_operand" "z")))]
1011 "TARGET_REALLY_IWMMXT"
1012 "wsll<MMX_char>g%?\\t%0, %1, %2"
1013 [(set_attr "predicable" "yes")])
1015 (define_insn "rorv4hi3_di"
1016 [(set (match_operand:V4HI 0 "register_operand" "=y")
1017 (rotatert:V4HI (match_operand:V4HI 1 "register_operand" "y")
1018 (match_operand:DI 2 "register_operand" "y")))]
1019 "TARGET_REALLY_IWMMXT"
1020 "wrorh%?\\t%0, %1, %2"
1021 [(set_attr "predicable" "yes")])
1023 (define_insn "rorv2si3_di"
1024 [(set (match_operand:V2SI 0 "register_operand" "=y")
1025 (rotatert:V2SI (match_operand:V2SI 1 "register_operand" "y")
1026 (match_operand:DI 2 "register_operand" "y")))]
1027 "TARGET_REALLY_IWMMXT"
1028 "wrorw%?\\t%0, %1, %2"
1029 [(set_attr "predicable" "yes")])
1031 (define_insn "rordi3_di"
1032 [(set (match_operand:DI 0 "register_operand" "=y")
1033 (rotatert:DI (match_operand:DI 1 "register_operand" "y")
1034 (match_operand:DI 2 "register_operand" "y")))]
1035 "TARGET_REALLY_IWMMXT"
1036 "wrord%?\\t%0, %1, %2"
1037 [(set_attr "predicable" "yes")])
1039 (define_insn "ashrv4hi3_di"
1040 [(set (match_operand:V4HI 0 "register_operand" "=y")
1041 (ashiftrt:V4HI (match_operand:V4HI 1 "register_operand" "y")
1042 (match_operand:DI 2 "register_operand" "y")))]
1043 "TARGET_REALLY_IWMMXT"
1044 "wsrah%?\\t%0, %1, %2"
1045 [(set_attr "predicable" "yes")])
1047 (define_insn "ashrv2si3_di"
1048 [(set (match_operand:V2SI 0 "register_operand" "=y")
1049 (ashiftrt:V2SI (match_operand:V2SI 1 "register_operand" "y")
1050 (match_operand:DI 2 "register_operand" "y")))]
1051 "TARGET_REALLY_IWMMXT"
1052 "wsraw%?\\t%0, %1, %2"
1053 [(set_attr "predicable" "yes")])
1055 (define_insn "ashrdi3_di"
1056 [(set (match_operand:DI 0 "register_operand" "=y")
1057 (ashiftrt:DI (match_operand:DI 1 "register_operand" "y")
1058 (match_operand:DI 2 "register_operand" "y")))]
1059 "TARGET_REALLY_IWMMXT"
1060 "wsrad%?\\t%0, %1, %2"
1061 [(set_attr "predicable" "yes")])
1063 (define_insn "lshrv4hi3_di"
1064 [(set (match_operand:V4HI 0 "register_operand" "=y")
1065 (lshiftrt:V4HI (match_operand:V4HI 1 "register_operand" "y")
1066 (match_operand:DI 2 "register_operand" "y")))]
1067 "TARGET_REALLY_IWMMXT"
1068 "wsrlh%?\\t%0, %1, %2"
1069 [(set_attr "predicable" "yes")])
1071 (define_insn "lshrv2si3_di"
1072 [(set (match_operand:V2SI 0 "register_operand" "=y")
1073 (lshiftrt:V2SI (match_operand:V2SI 1 "register_operand" "y")
1074 (match_operand:DI 2 "register_operand" "y")))]
1075 "TARGET_REALLY_IWMMXT"
1076 "wsrlw%?\\t%0, %1, %2"
1077 [(set_attr "predicable" "yes")])
1079 (define_insn "lshrdi3_di"
1080 [(set (match_operand:DI 0 "register_operand" "=y")
1081 (lshiftrt:DI (match_operand:DI 1 "register_operand" "y")
1082 (match_operand:DI 2 "register_operand" "y")))]
1083 "TARGET_REALLY_IWMMXT"
1084 "wsrld%?\\t%0, %1, %2"
1085 [(set_attr "predicable" "yes")])
1087 (define_insn "ashlv4hi3_di"
1088 [(set (match_operand:V4HI 0 "register_operand" "=y")
1089 (ashift:V4HI (match_operand:V4HI 1 "register_operand" "y")
1090 (match_operand:DI 2 "register_operand" "y")))]
1091 "TARGET_REALLY_IWMMXT"
1092 "wsllh%?\\t%0, %1, %2"
1093 [(set_attr "predicable" "yes")])
1095 (define_insn "ashlv2si3_di"
1096 [(set (match_operand:V2SI 0 "register_operand" "=y")
1097 (ashift:V2SI (match_operand:V2SI 1 "register_operand" "y")
1098 (match_operand:DI 2 "register_operand" "y")))]
1099 "TARGET_REALLY_IWMMXT"
1100 "wsllw%?\\t%0, %1, %2"
1101 [(set_attr "predicable" "yes")])
1103 (define_insn "ashldi3_di"
1104 [(set (match_operand:DI 0 "register_operand" "=y")
1105 (ashift:DI (match_operand:DI 1 "register_operand" "y")
1106 (match_operand:DI 2 "register_operand" "y")))]
1107 "TARGET_REALLY_IWMMXT"
1108 "wslld%?\\t%0, %1, %2"
1109 [(set_attr "predicable" "yes")])
1111 (define_insn "iwmmxt_wmadds"
1112 [(set (match_operand:V4HI 0 "register_operand" "=y")
1113 (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1114 (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMADDS))]
1115 "TARGET_REALLY_IWMMXT"
1116 "wmadds%?\\t%0, %1, %2"
1117 [(set_attr "predicable" "yes")])
1119 (define_insn "iwmmxt_wmaddu"
1120 [(set (match_operand:V4HI 0 "register_operand" "=y")
1121 (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1122 (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMADDU))]
1123 "TARGET_REALLY_IWMMXT"
1124 "wmaddu%?\\t%0, %1, %2"
1125 [(set_attr "predicable" "yes")])
1127 (define_insn "iwmmxt_tmia"
1128 [(set (match_operand:DI 0 "register_operand" "=y")
1129 (plus:DI (match_operand:DI 1 "register_operand" "0")
1130 (mult:DI (sign_extend:DI
1131 (match_operand:SI 2 "register_operand" "r"))
1133 (match_operand:SI 3 "register_operand" "r")))))]
1134 "TARGET_REALLY_IWMMXT"
1135 "tmia%?\\t%0, %2, %3"
1136 [(set_attr "predicable" "yes")])
1138 (define_insn "iwmmxt_tmiaph"
1139 [(set (match_operand:DI 0 "register_operand" "=y")
1140 (plus:DI (match_operand:DI 1 "register_operand" "0")
1142 (mult:DI (sign_extend:DI
1143 (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1145 (truncate:HI (match_operand:SI 3 "register_operand" "r"))))
1146 (mult:DI (sign_extend:DI
1147 (truncate:HI (ashiftrt:SI (match_dup 2) (const_int 16))))
1149 (truncate:HI (ashiftrt:SI (match_dup 3) (const_int 16))))))))]
1150 "TARGET_REALLY_IWMMXT"
1151 "tmiaph%?\\t%0, %2, %3"
1152 [(set_attr "predicable" "yes")])
1154 (define_insn "iwmmxt_tmiabb"
1155 [(set (match_operand:DI 0 "register_operand" "=y")
1156 (plus:DI (match_operand:DI 1 "register_operand" "0")
1157 (mult:DI (sign_extend:DI
1158 (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1160 (truncate:HI (match_operand:SI 3 "register_operand" "r"))))))]
1161 "TARGET_REALLY_IWMMXT"
1162 "tmiabb%?\\t%0, %2, %3"
1163 [(set_attr "predicable" "yes")])
1165 (define_insn "iwmmxt_tmiatb"
1166 [(set (match_operand:DI 0 "register_operand" "=y")
1167 (plus:DI (match_operand:DI 1 "register_operand" "0")
1168 (mult:DI (sign_extend:DI
1169 (truncate:HI (ashiftrt:SI
1170 (match_operand:SI 2 "register_operand" "r")
1173 (truncate:HI (match_operand:SI 3 "register_operand" "r"))))))]
1174 "TARGET_REALLY_IWMMXT"
1175 "tmiatb%?\\t%0, %2, %3"
1176 [(set_attr "predicable" "yes")])
1178 (define_insn "iwmmxt_tmiabt"
1179 [(set (match_operand:DI 0 "register_operand" "=y")
1180 (plus:DI (match_operand:DI 1 "register_operand" "0")
1181 (mult:DI (sign_extend:DI
1182 (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1184 (truncate:HI (ashiftrt:SI
1185 (match_operand:SI 3 "register_operand" "r")
1186 (const_int 16)))))))]
1187 "TARGET_REALLY_IWMMXT"
1188 "tmiabt%?\\t%0, %2, %3"
1189 [(set_attr "predicable" "yes")])
1191 (define_insn "iwmmxt_tmiatt"
1192 [(set (match_operand:DI 0 "register_operand" "=y")
1193 (plus:DI (match_operand:DI 1 "register_operand" "0")
1194 (mult:DI (sign_extend:DI
1195 (truncate:HI (ashiftrt:SI
1196 (match_operand:SI 2 "register_operand" "r")
1199 (truncate:HI (ashiftrt:SI
1200 (match_operand:SI 3 "register_operand" "r")
1201 (const_int 16)))))))]
1202 "TARGET_REALLY_IWMMXT"
1203 "tmiatt%?\\t%0, %2, %3"
1204 [(set_attr "predicable" "yes")])
1206 (define_insn "iwmmxt_tbcstqi"
1207 [(set (match_operand:V8QI 0 "register_operand" "=y")
1208 (vec_duplicate:V8QI (match_operand:QI 1 "register_operand" "r")))]
1209 "TARGET_REALLY_IWMMXT"
1211 [(set_attr "predicable" "yes")])
1213 (define_insn "iwmmxt_tbcsthi"
1214 [(set (match_operand:V4HI 0 "register_operand" "=y")
1215 (vec_duplicate:V4HI (match_operand:HI 1 "register_operand" "r")))]
1216 "TARGET_REALLY_IWMMXT"
1218 [(set_attr "predicable" "yes")])
1220 (define_insn "iwmmxt_tbcstsi"
1221 [(set (match_operand:V2SI 0 "register_operand" "=y")
1222 (vec_duplicate:V2SI (match_operand:SI 1 "register_operand" "r")))]
1223 "TARGET_REALLY_IWMMXT"
1225 [(set_attr "predicable" "yes")])
1227 (define_insn "iwmmxt_tmovmskb"
1228 [(set (match_operand:SI 0 "register_operand" "=r")
1229 (unspec:SI [(match_operand:V8QI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1230 "TARGET_REALLY_IWMMXT"
1231 "tmovmskb%?\\t%0, %1"
1232 [(set_attr "predicable" "yes")])
1234 (define_insn "iwmmxt_tmovmskh"
1235 [(set (match_operand:SI 0 "register_operand" "=r")
1236 (unspec:SI [(match_operand:V4HI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1237 "TARGET_REALLY_IWMMXT"
1238 "tmovmskh%?\\t%0, %1"
1239 [(set_attr "predicable" "yes")])
1241 (define_insn "iwmmxt_tmovmskw"
1242 [(set (match_operand:SI 0 "register_operand" "=r")
1243 (unspec:SI [(match_operand:V2SI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1244 "TARGET_REALLY_IWMMXT"
1245 "tmovmskw%?\\t%0, %1"
1246 [(set_attr "predicable" "yes")])
1248 (define_insn "iwmmxt_waccb"
1249 [(set (match_operand:DI 0 "register_operand" "=y")
1250 (unspec:DI [(match_operand:V8QI 1 "register_operand" "y")] UNSPEC_WACC))]
1251 "TARGET_REALLY_IWMMXT"
1253 [(set_attr "predicable" "yes")])
1255 (define_insn "iwmmxt_wacch"
1256 [(set (match_operand:DI 0 "register_operand" "=y")
1257 (unspec:DI [(match_operand:V4HI 1 "register_operand" "y")] UNSPEC_WACC))]
1258 "TARGET_REALLY_IWMMXT"
1260 [(set_attr "predicable" "yes")])
1262 (define_insn "iwmmxt_waccw"
1263 [(set (match_operand:DI 0 "register_operand" "=y")
1264 (unspec:DI [(match_operand:V2SI 1 "register_operand" "y")] UNSPEC_WACC))]
1265 "TARGET_REALLY_IWMMXT"
1267 [(set_attr "predicable" "yes")])
1269 (define_insn "iwmmxt_walign"
1270 [(set (match_operand:V8QI 0 "register_operand" "=y,y")
1271 (subreg:V8QI (ashiftrt:TI
1272 (subreg:TI (vec_concat:V16QI
1273 (match_operand:V8QI 1 "register_operand" "y,y")
1274 (match_operand:V8QI 2 "register_operand" "y,y")) 0)
1276 (match_operand:SI 3 "nonmemory_operand" "i,z")
1277 (const_int 8))) 0))]
1278 "TARGET_REALLY_IWMMXT"
1280 waligni%?\\t%0, %1, %2, %3
1281 walignr%U3%?\\t%0, %1, %2"
1282 [(set_attr "predicable" "yes")])
1284 (define_insn "iwmmxt_tmrc"
1285 [(set (match_operand:SI 0 "register_operand" "=r")
1286 (unspec_volatile:SI [(match_operand:SI 1 "immediate_operand" "i")]
1288 "TARGET_REALLY_IWMMXT"
1290 [(set_attr "predicable" "yes")])
1292 (define_insn "iwmmxt_tmcr"
1293 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")
1294 (match_operand:SI 1 "register_operand" "r")]
1296 "TARGET_REALLY_IWMMXT"
1298 [(set_attr "predicable" "yes")])
1300 (define_insn "iwmmxt_wsadb"
1301 [(set (match_operand:V8QI 0 "register_operand" "=y")
1302 (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y")
1303 (match_operand:V8QI 2 "register_operand" "y")] UNSPEC_WSAD))]
1304 "TARGET_REALLY_IWMMXT"
1305 "wsadb%?\\t%0, %1, %2"
1306 [(set_attr "predicable" "yes")])
1308 (define_insn "iwmmxt_wsadh"
1309 [(set (match_operand:V4HI 0 "register_operand" "=y")
1310 (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1311 (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WSAD))]
1312 "TARGET_REALLY_IWMMXT"
1313 "wsadh%?\\t%0, %1, %2"
1314 [(set_attr "predicable" "yes")])
1316 (define_insn "iwmmxt_wsadbz"
1317 [(set (match_operand:V8QI 0 "register_operand" "=y")
1318 (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y")
1319 (match_operand:V8QI 2 "register_operand" "y")] UNSPEC_WSADZ))]
1320 "TARGET_REALLY_IWMMXT"
1321 "wsadbz%?\\t%0, %1, %2"
1322 [(set_attr "predicable" "yes")])
1324 (define_insn "iwmmxt_wsadhz"
1325 [(set (match_operand:V4HI 0 "register_operand" "=y")
1326 (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1327 (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WSADZ))]
1328 "TARGET_REALLY_IWMMXT"
1329 "wsadhz%?\\t%0, %1, %2"
1330 [(set_attr "predicable" "yes")])