2 ;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 ;; Contributed by Aldy Hernandez (aldy@quesejoda.com)
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 2, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 ;; License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING. If not, write to the
19 ;; Free Software Foundation, 59 Temple Place - Suite 330, Boston,
20 ;; MA 02111-1307, USA.
40 (UNSPEC_VCOND_V4SI 301)
41 (UNSPEC_VCOND_V4SF 302)
42 (UNSPEC_VCOND_V8HI 303)
43 (UNSPEC_VCOND_V16QI 304)
44 (UNSPEC_VCONDU_V4SI 305)
45 (UNSPEC_VCONDU_V8HI 306)
46 (UNSPEC_VCONDU_V16QI 307)
50 (define_mode_macro VI [V4SI V8HI V16QI])
52 (define_mode_macro VIshort [V8HI V16QI])
54 (define_mode_macro VF [V4SF])
55 ;; Vec modes, pity mode macros are not composable
56 (define_mode_macro V [V4SI V8HI V16QI V4SF])
58 (define_mode_attr VI_char [(V4SI "w") (V8HI "h") (V16QI "b")])
60 ;; Generic LVX load instruction.
61 (define_insn "altivec_lvx_<mode>"
62 [(set (match_operand:V 0 "altivec_register_operand" "=v")
63 (match_operand:V 1 "memory_operand" "m"))]
66 [(set_attr "type" "vecload")])
68 ;; Generic STVX store instruction.
69 (define_insn "altivec_stvx_<mode>"
70 [(set (match_operand:V 0 "memory_operand" "=m")
71 (match_operand:V 1 "altivec_register_operand" "v"))]
74 [(set_attr "type" "vecstore")])
76 ;; Vector move instructions.
77 (define_expand "mov<mode>"
78 [(set (match_operand:V 0 "nonimmediate_operand" "")
79 (match_operand:V 1 "any_operand" ""))]
82 rs6000_emit_move (operands[0], operands[1], <MODE>mode);
86 (define_insn "*mov<mode>_internal"
87 [(set (match_operand:V 0 "nonimmediate_operand" "=m,v,v,o,r,r,v")
88 (match_operand:V 1 "input_operand" "v,m,v,r,o,r,W"))]
90 && (register_operand (operands[0], <MODE>mode)
91 || register_operand (operands[1], <MODE>mode))"
93 switch (which_alternative)
95 case 0: return "stvx %1,%y0";
96 case 1: return "lvx %0,%y1";
97 case 2: return "vor %0,%1,%1";
101 case 6: return output_vec_const_move (operands);
105 [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")])
108 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
109 (match_operand:V4SI 1 "input_operand" ""))]
110 "TARGET_ALTIVEC && reload_completed
111 && gpr_or_gpr_p (operands[0], operands[1])"
114 rs6000_split_multireg_move (operands[0], operands[1]); DONE;
118 [(set (match_operand:V4SI 0 "altivec_register_operand" "")
119 (match_operand:V4SI 1 "easy_vector_constant_add_self" ""))]
120 "TARGET_ALTIVEC && reload_completed"
121 [(set (match_dup 0) (match_dup 3))
123 (plus:V4SI (match_dup 0)
126 operands[3] = gen_easy_vector_constant_add_self (operands[1]);
130 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
131 (match_operand:V8HI 1 "input_operand" ""))]
132 "TARGET_ALTIVEC && reload_completed
133 && gpr_or_gpr_p (operands[0], operands[1])"
135 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
138 [(set (match_operand:V8HI 0 "altivec_register_operand" "")
139 (match_operand:V8HI 1 "easy_vector_constant_add_self" ""))]
140 "TARGET_ALTIVEC && reload_completed"
141 [(set (match_dup 0) (match_dup 3))
143 (plus:V8HI (match_dup 0)
146 operands[3] = gen_easy_vector_constant_add_self (operands[1]);
150 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
151 (match_operand:V16QI 1 "input_operand" ""))]
152 "TARGET_ALTIVEC && reload_completed
153 && gpr_or_gpr_p (operands[0], operands[1])"
155 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
158 [(set (match_operand:V16QI 0 "altivec_register_operand" "")
159 (match_operand:V16QI 1 "easy_vector_constant_add_self" ""))]
160 "TARGET_ALTIVEC && reload_completed"
161 [(set (match_dup 0) (match_dup 3))
163 (plus:V16QI (match_dup 0)
166 operands[3] = gen_easy_vector_constant_add_self (operands[1]);
170 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
171 (match_operand:V4SF 1 "input_operand" ""))]
172 "TARGET_ALTIVEC && reload_completed
173 && gpr_or_gpr_p (operands[0], operands[1])"
176 rs6000_split_multireg_move (operands[0], operands[1]); DONE;
179 (define_insn "get_vrsave_internal"
180 [(set (match_operand:SI 0 "register_operand" "=r")
181 (unspec:SI [(reg:SI 109)] 214))]
185 return "mfspr %0,256";
187 return "mfvrsave %0";
189 [(set_attr "type" "*")])
191 (define_insn "*set_vrsave_internal"
192 [(match_parallel 0 "vrsave_operation"
194 (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
195 (reg:SI 109)] 30))])]
199 return "mtspr 256,%1";
201 return "mtvrsave %1";
203 [(set_attr "type" "*")])
205 (define_insn "*save_world"
206 [(match_parallel 0 "save_world_operation"
207 [(clobber (match_operand:SI 1 "register_operand" "=l"))
208 (use (match_operand:SI 2 "call_operand" "s"))])]
209 "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT"
211 [(set_attr "type" "branch")
212 (set_attr "length" "4")])
214 (define_insn "*restore_world"
215 [(match_parallel 0 "restore_world_operation"
217 (use (match_operand:SI 1 "register_operand" "l"))
218 (use (match_operand:SI 2 "call_operand" "s"))
219 (clobber (match_operand:SI 3 "gpc_reg_operand" "=r"))])]
220 "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT"
223 ;; Simple binary operations.
226 (define_insn "add<mode>3"
227 [(set (match_operand:VI 0 "register_operand" "=v")
228 (plus:VI (match_operand:VI 1 "register_operand" "v")
229 (match_operand:VI 2 "register_operand" "v")))]
231 "vaddu<VI_char>m %0,%1,%2"
232 [(set_attr "type" "vecsimple")])
234 (define_insn "addv4sf3"
235 [(set (match_operand:V4SF 0 "register_operand" "=v")
236 (plus:V4SF (match_operand:V4SF 1 "register_operand" "v")
237 (match_operand:V4SF 2 "register_operand" "v")))]
240 [(set_attr "type" "vecfloat")])
242 (define_insn "altivec_vaddcuw"
243 [(set (match_operand:V4SI 0 "register_operand" "=v")
244 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
245 (match_operand:V4SI 2 "register_operand" "v")] 35))]
248 [(set_attr "type" "vecsimple")])
250 (define_insn "altivec_vaddu<VI_char>s"
251 [(set (match_operand:VI 0 "register_operand" "=v")
252 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
253 (match_operand:VI 2 "register_operand" "v")] 36))
254 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
256 "vaddu<VI_char>s %0,%1,%2"
257 [(set_attr "type" "vecsimple")])
259 (define_insn "altivec_vadds<VI_char>s"
260 [(set (match_operand:VI 0 "register_operand" "=v")
261 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
262 (match_operand:VI 2 "register_operand" "v")] 37))
263 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
265 "vadds<VI_char>s %0,%1,%2"
266 [(set_attr "type" "vecsimple")])
269 (define_insn "sub<mode>3"
270 [(set (match_operand:VI 0 "register_operand" "=v")
271 (minus:VI (match_operand:VI 1 "register_operand" "v")
272 (match_operand:VI 2 "register_operand" "v")))]
274 "vsubu<VI_char>m %0,%1,%2"
275 [(set_attr "type" "vecsimple")])
277 (define_insn "subv4sf3"
278 [(set (match_operand:V4SF 0 "register_operand" "=v")
279 (minus:V4SF (match_operand:V4SF 1 "register_operand" "v")
280 (match_operand:V4SF 2 "register_operand" "v")))]
283 [(set_attr "type" "vecfloat")])
285 (define_insn "altivec_vsubcuw"
286 [(set (match_operand:V4SI 0 "register_operand" "=v")
287 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
288 (match_operand:V4SI 2 "register_operand" "v")] 124))]
291 [(set_attr "type" "vecsimple")])
293 (define_insn "altivec_vsubu<VI_char>s"
294 [(set (match_operand:VI 0 "register_operand" "=v")
295 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
296 (match_operand:VI 2 "register_operand" "v")] 125))
297 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
299 "vsubu<VI_char>s %0,%1,%2"
300 [(set_attr "type" "vecsimple")])
302 (define_insn "altivec_vsubs<VI_char>s"
303 [(set (match_operand:VI 0 "register_operand" "=v")
304 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
305 (match_operand:VI 2 "register_operand" "v")] 126))
306 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
308 "vsubs<VI_char>s %0,%1,%2"
309 [(set_attr "type" "vecsimple")])
312 (define_insn "altivec_vavgu<VI_char>"
313 [(set (match_operand:VI 0 "register_operand" "=v")
314 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
315 (match_operand:VI 2 "register_operand" "v")] 44))]
317 "vavgu<VI_char> %0,%1,%2"
318 [(set_attr "type" "vecsimple")])
320 (define_insn "altivec_vavgs<VI_char>"
321 [(set (match_operand:VI 0 "register_operand" "=v")
322 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
323 (match_operand:VI 2 "register_operand" "v")] 45))]
325 "vavgs<VI_char> %0,%1,%2"
326 [(set_attr "type" "vecsimple")])
328 (define_insn "altivec_vcmpbfp"
329 [(set (match_operand:V4SI 0 "register_operand" "=v")
330 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
331 (match_operand:V4SF 2 "register_operand" "v")]
335 [(set_attr "type" "veccmp")])
337 (define_insn "altivec_vcmpequb"
338 [(set (match_operand:V16QI 0 "register_operand" "=v")
339 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
340 (match_operand:V16QI 2 "register_operand" "v")]
344 [(set_attr "type" "vecsimple")])
346 (define_insn "altivec_vcmpequh"
347 [(set (match_operand:V8HI 0 "register_operand" "=v")
348 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
349 (match_operand:V8HI 2 "register_operand" "v")]
353 [(set_attr "type" "vecsimple")])
355 (define_insn "altivec_vcmpequw"
356 [(set (match_operand:V4SI 0 "register_operand" "=v")
357 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
358 (match_operand:V4SI 2 "register_operand" "v")]
362 [(set_attr "type" "vecsimple")])
364 (define_insn "altivec_vcmpeqfp"
365 [(set (match_operand:V4SI 0 "register_operand" "=v")
366 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
367 (match_operand:V4SF 2 "register_operand" "v")]
371 [(set_attr "type" "veccmp")])
373 (define_insn "altivec_vcmpgefp"
374 [(set (match_operand:V4SI 0 "register_operand" "=v")
375 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
376 (match_operand:V4SF 2 "register_operand" "v")]
380 [(set_attr "type" "veccmp")])
382 (define_insn "altivec_vcmpgtub"
383 [(set (match_operand:V16QI 0 "register_operand" "=v")
384 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
385 (match_operand:V16QI 2 "register_operand" "v")]
389 [(set_attr "type" "vecsimple")])
391 (define_insn "altivec_vcmpgtsb"
392 [(set (match_operand:V16QI 0 "register_operand" "=v")
393 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
394 (match_operand:V16QI 2 "register_operand" "v")]
398 [(set_attr "type" "vecsimple")])
400 (define_insn "altivec_vcmpgtuh"
401 [(set (match_operand:V8HI 0 "register_operand" "=v")
402 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
403 (match_operand:V8HI 2 "register_operand" "v")]
407 [(set_attr "type" "vecsimple")])
409 (define_insn "altivec_vcmpgtsh"
410 [(set (match_operand:V8HI 0 "register_operand" "=v")
411 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
412 (match_operand:V8HI 2 "register_operand" "v")]
416 [(set_attr "type" "vecsimple")])
418 (define_insn "altivec_vcmpgtuw"
419 [(set (match_operand:V4SI 0 "register_operand" "=v")
420 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
421 (match_operand:V4SI 2 "register_operand" "v")]
425 [(set_attr "type" "vecsimple")])
427 (define_insn "altivec_vcmpgtsw"
428 [(set (match_operand:V4SI 0 "register_operand" "=v")
429 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
430 (match_operand:V4SI 2 "register_operand" "v")]
434 [(set_attr "type" "vecsimple")])
436 (define_insn "altivec_vcmpgtfp"
437 [(set (match_operand:V4SI 0 "register_operand" "=v")
438 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
439 (match_operand:V4SF 2 "register_operand" "v")]
443 [(set_attr "type" "veccmp")])
445 ;; Fused multiply add
446 (define_insn "altivec_vmaddfp"
447 [(set (match_operand:V4SF 0 "register_operand" "=v")
448 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
449 (match_operand:V4SF 2 "register_operand" "v"))
450 (match_operand:V4SF 3 "register_operand" "v")))]
452 "vmaddfp %0,%1,%2,%3"
453 [(set_attr "type" "vecfloat")])
455 ;; We do multiply as a fused multiply-add with an add of a -0.0 vector.
457 (define_expand "mulv4sf3"
458 [(use (match_operand:V4SF 0 "register_operand" ""))
459 (use (match_operand:V4SF 1 "register_operand" ""))
460 (use (match_operand:V4SF 2 "register_operand" ""))]
461 "TARGET_ALTIVEC && TARGET_FUSED_MADD"
466 /* Generate [-0.0, -0.0, -0.0, -0.0]. */
467 neg0 = gen_reg_rtx (V4SFmode);
468 emit_insn (gen_altivec_vspltisw_v4sf (neg0, constm1_rtx));
469 emit_insn (gen_altivec_vslw_v4sf (neg0, neg0, neg0));
471 /* Use the multiply-add. */
472 emit_insn (gen_altivec_vmaddfp (operands[0], operands[1], operands[2],
477 ;; Fused multiply subtract
478 (define_insn "altivec_vnmsubfp"
479 [(set (match_operand:V4SF 0 "register_operand" "=v")
480 (neg:V4SF (minus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
481 (match_operand:V4SF 2 "register_operand" "v"))
482 (match_operand:V4SF 3 "register_operand" "v"))))]
484 "vnmsubfp %0,%1,%2,%3"
485 [(set_attr "type" "vecfloat")])
487 (define_insn "altivec_vmsumu<VI_char>m"
488 [(set (match_operand:V4SI 0 "register_operand" "=v")
489 (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")
490 (match_operand:VIshort 2 "register_operand" "v")
491 (match_operand:V4SI 3 "register_operand" "v")] 65))]
493 "vmsumu<VI_char>m %0,%1,%2,%3"
494 [(set_attr "type" "veccomplex")])
496 (define_insn "altivec_vmsumm<VI_char>m"
497 [(set (match_operand:V4SI 0 "register_operand" "=v")
498 (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")
499 (match_operand:VIshort 2 "register_operand" "v")
500 (match_operand:V4SI 3 "register_operand" "v")] 66))]
502 "vmsumm<VI_char>m %0,%1,%2,%3"
503 [(set_attr "type" "veccomplex")])
505 (define_insn "altivec_vmsumshm"
506 [(set (match_operand:V4SI 0 "register_operand" "=v")
507 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
508 (match_operand:V8HI 2 "register_operand" "v")
509 (match_operand:V4SI 3 "register_operand" "v")] 68))]
511 "vmsumshm %0,%1,%2,%3"
512 [(set_attr "type" "veccomplex")])
514 (define_insn "altivec_vmsumuhs"
515 [(set (match_operand:V4SI 0 "register_operand" "=v")
516 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
517 (match_operand:V8HI 2 "register_operand" "v")
518 (match_operand:V4SI 3 "register_operand" "v")] 69))
519 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
521 "vmsumuhs %0,%1,%2,%3"
522 [(set_attr "type" "veccomplex")])
524 (define_insn "altivec_vmsumshs"
525 [(set (match_operand:V4SI 0 "register_operand" "=v")
526 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
527 (match_operand:V8HI 2 "register_operand" "v")
528 (match_operand:V4SI 3 "register_operand" "v")] 70))
529 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
531 "vmsumshs %0,%1,%2,%3"
532 [(set_attr "type" "veccomplex")])
536 (define_insn "umax<mode>3"
537 [(set (match_operand:VI 0 "register_operand" "=v")
538 (umax:VI (match_operand:VI 1 "register_operand" "v")
539 (match_operand:VI 2 "register_operand" "v")))]
541 "vmaxu<VI_char> %0,%1,%2"
542 [(set_attr "type" "vecsimple")])
544 (define_insn "smax<mode>3"
545 [(set (match_operand:VI 0 "register_operand" "=v")
546 (smax:VI (match_operand:VI 1 "register_operand" "v")
547 (match_operand:VI 2 "register_operand" "v")))]
549 "vmaxs<VI_char> %0,%1,%2"
550 [(set_attr "type" "vecsimple")])
552 (define_insn "smaxv4sf3"
553 [(set (match_operand:V4SF 0 "register_operand" "=v")
554 (smax:V4SF (match_operand:V4SF 1 "register_operand" "v")
555 (match_operand:V4SF 2 "register_operand" "v")))]
558 [(set_attr "type" "veccmp")])
560 (define_insn "umin<mode>3"
561 [(set (match_operand:VI 0 "register_operand" "=v")
562 (umin:VI (match_operand:VI 1 "register_operand" "v")
563 (match_operand:VI 2 "register_operand" "v")))]
565 "vminu<VI_char> %0,%1,%2"
566 [(set_attr "type" "vecsimple")])
568 (define_insn "smin<mode>3"
569 [(set (match_operand:VI 0 "register_operand" "=v")
570 (smin:VI (match_operand:VI 1 "register_operand" "v")
571 (match_operand:VI 2 "register_operand" "v")))]
573 "vmins<VI_char> %0,%1,%2"
574 [(set_attr "type" "vecsimple")])
576 (define_insn "sminv4sf3"
577 [(set (match_operand:V4SF 0 "register_operand" "=v")
578 (smin:V4SF (match_operand:V4SF 1 "register_operand" "v")
579 (match_operand:V4SF 2 "register_operand" "v")))]
582 [(set_attr "type" "veccmp")])
584 (define_insn "altivec_vmhaddshs"
585 [(set (match_operand:V8HI 0 "register_operand" "=v")
586 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
587 (match_operand:V8HI 2 "register_operand" "v")
588 (match_operand:V8HI 3 "register_operand" "v")] 71))
589 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
591 "vmhaddshs %0,%1,%2,%3"
592 [(set_attr "type" "veccomplex")])
593 (define_insn "altivec_vmhraddshs"
594 [(set (match_operand:V8HI 0 "register_operand" "=v")
595 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
596 (match_operand:V8HI 2 "register_operand" "v")
597 (match_operand:V8HI 3 "register_operand" "v")] 72))
598 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
600 "vmhraddshs %0,%1,%2,%3"
601 [(set_attr "type" "veccomplex")])
602 (define_insn "altivec_vmladduhm"
603 [(set (match_operand:V8HI 0 "register_operand" "=v")
604 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
605 (match_operand:V8HI 2 "register_operand" "v")
606 (match_operand:V8HI 3 "register_operand" "v")] 73))]
608 "vmladduhm %0,%1,%2,%3"
609 [(set_attr "type" "veccomplex")])
611 (define_insn "altivec_vmrghb"
612 [(set (match_operand:V16QI 0 "register_operand" "=v")
613 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v")
614 (parallel [(const_int 8)
630 (match_operand:V16QI 2 "register_operand" "v")
634 [(set_attr "type" "vecperm")])
636 (define_insn "altivec_vmrghh"
637 [(set (match_operand:V8HI 0 "register_operand" "=v")
638 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v")
639 (parallel [(const_int 4)
647 (match_operand:V8HI 2 "register_operand" "v")
651 [(set_attr "type" "vecperm")])
653 (define_insn "altivec_vmrghw"
654 [(set (match_operand:V4SI 0 "register_operand" "=v")
655 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v")
656 (parallel [(const_int 2)
660 (match_operand:V4SI 2 "register_operand" "v")
664 [(set_attr "type" "vecperm")])
666 (define_insn "altivec_vmrglb"
667 [(set (match_operand:V16QI 0 "register_operand" "=v")
668 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v")
669 (parallel [(const_int 0)
685 (match_operand:V16QI 1 "register_operand" "v")
689 [(set_attr "type" "vecperm")])
691 (define_insn "altivec_vmrglh"
692 [(set (match_operand:V8HI 0 "register_operand" "=v")
693 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v")
694 (parallel [(const_int 0)
702 (match_operand:V8HI 1 "register_operand" "v")
706 [(set_attr "type" "vecperm")])
708 (define_insn "altivec_vmrglw"
709 [(set (match_operand:V4SI 0 "register_operand" "=v")
710 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v")
711 (parallel [(const_int 0)
715 (match_operand:V4SI 1 "register_operand" "v")
719 [(set_attr "type" "vecperm")])
721 (define_insn "altivec_vmuleub"
722 [(set (match_operand:V8HI 0 "register_operand" "=v")
723 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
724 (match_operand:V16QI 2 "register_operand" "v")] 83))]
727 [(set_attr "type" "veccomplex")])
729 (define_insn "altivec_vmulesb"
730 [(set (match_operand:V8HI 0 "register_operand" "=v")
731 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
732 (match_operand:V16QI 2 "register_operand" "v")] 84))]
735 [(set_attr "type" "veccomplex")])
737 (define_insn "altivec_vmuleuh"
738 [(set (match_operand:V4SI 0 "register_operand" "=v")
739 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
740 (match_operand:V8HI 2 "register_operand" "v")] 85))]
743 [(set_attr "type" "veccomplex")])
745 (define_insn "altivec_vmulesh"
746 [(set (match_operand:V4SI 0 "register_operand" "=v")
747 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
748 (match_operand:V8HI 2 "register_operand" "v")] 86))]
751 [(set_attr "type" "veccomplex")])
753 (define_insn "altivec_vmuloub"
754 [(set (match_operand:V8HI 0 "register_operand" "=v")
755 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
756 (match_operand:V16QI 2 "register_operand" "v")] 87))]
759 [(set_attr "type" "veccomplex")])
761 (define_insn "altivec_vmulosb"
762 [(set (match_operand:V8HI 0 "register_operand" "=v")
763 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
764 (match_operand:V16QI 2 "register_operand" "v")] 88))]
767 [(set_attr "type" "veccomplex")])
769 (define_insn "altivec_vmulouh"
770 [(set (match_operand:V4SI 0 "register_operand" "=v")
771 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
772 (match_operand:V8HI 2 "register_operand" "v")] 89))]
775 [(set_attr "type" "veccomplex")])
777 (define_insn "altivec_vmulosh"
778 [(set (match_operand:V4SI 0 "register_operand" "=v")
779 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
780 (match_operand:V8HI 2 "register_operand" "v")] 90))]
783 [(set_attr "type" "veccomplex")])
788 (define_insn "and<mode>3"
789 [(set (match_operand:VI 0 "register_operand" "=v")
790 (and:VI (match_operand:VI 1 "register_operand" "v")
791 (match_operand:VI 2 "register_operand" "v")))]
794 [(set_attr "type" "vecsimple")])
796 (define_insn "ior<mode>3"
797 [(set (match_operand:VI 0 "register_operand" "=v")
798 (ior:VI (match_operand:VI 1 "register_operand" "v")
799 (match_operand:VI 2 "register_operand" "v")))]
802 [(set_attr "type" "vecsimple")])
804 (define_insn "xor<mode>3"
805 [(set (match_operand:VI 0 "register_operand" "=v")
806 (xor:VI (match_operand:VI 1 "register_operand" "v")
807 (match_operand:VI 2 "register_operand" "v")))]
810 [(set_attr "type" "vecsimple")])
812 (define_insn "one_cmpl<mode>2"
813 [(set (match_operand:VI 0 "register_operand" "=v")
814 (not:VI (match_operand:VI 1 "register_operand" "v")))]
817 [(set_attr "type" "vecsimple")])
819 (define_insn "altivec_nor<mode>3"
820 [(set (match_operand:VI 0 "register_operand" "=v")
821 (not:VI (ior:VI (match_operand:VI 1 "register_operand" "v")
822 (match_operand:VI 2 "register_operand" "v"))))]
825 [(set_attr "type" "vecsimple")])
827 (define_insn "andc<mode>3"
828 [(set (match_operand:VI 0 "register_operand" "=v")
829 (and:VI (not:VI (match_operand:VI 2 "register_operand" "v"))
830 (match_operand:VI 1 "register_operand" "v")))]
833 [(set_attr "type" "vecsimple")])
835 (define_insn "altivec_vpkuhum"
836 [(set (match_operand:V16QI 0 "register_operand" "=v")
837 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
838 (match_operand:V8HI 2 "register_operand" "v")] 93))]
841 [(set_attr "type" "vecperm")])
843 (define_insn "altivec_vpkuwum"
844 [(set (match_operand:V8HI 0 "register_operand" "=v")
845 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
846 (match_operand:V4SI 2 "register_operand" "v")] 94))]
849 [(set_attr "type" "vecperm")])
851 (define_insn "altivec_vpkpx"
852 [(set (match_operand:V8HI 0 "register_operand" "=v")
853 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
854 (match_operand:V4SI 2 "register_operand" "v")] 95))]
857 [(set_attr "type" "vecperm")])
859 (define_insn "altivec_vpkuhss"
860 [(set (match_operand:V16QI 0 "register_operand" "=v")
861 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
862 (match_operand:V8HI 2 "register_operand" "v")] 96))
863 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
866 [(set_attr "type" "vecperm")])
868 (define_insn "altivec_vpkshss"
869 [(set (match_operand:V16QI 0 "register_operand" "=v")
870 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
871 (match_operand:V8HI 2 "register_operand" "v")] 97))
872 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
875 [(set_attr "type" "vecperm")])
877 (define_insn "altivec_vpkuwss"
878 [(set (match_operand:V8HI 0 "register_operand" "=v")
879 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
880 (match_operand:V4SI 2 "register_operand" "v")] 98))
881 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
884 [(set_attr "type" "vecperm")])
886 (define_insn "altivec_vpkswss"
887 [(set (match_operand:V8HI 0 "register_operand" "=v")
888 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
889 (match_operand:V4SI 2 "register_operand" "v")] 99))
890 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
893 [(set_attr "type" "vecperm")])
895 (define_insn "altivec_vpkuhus"
896 [(set (match_operand:V16QI 0 "register_operand" "=v")
897 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
898 (match_operand:V8HI 2 "register_operand" "v")] 100))
899 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
902 [(set_attr "type" "vecperm")])
904 (define_insn "altivec_vpkshus"
905 [(set (match_operand:V16QI 0 "register_operand" "=v")
906 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
907 (match_operand:V8HI 2 "register_operand" "v")] 101))
908 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
911 [(set_attr "type" "vecperm")])
913 (define_insn "altivec_vpkuwus"
914 [(set (match_operand:V8HI 0 "register_operand" "=v")
915 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
916 (match_operand:V4SI 2 "register_operand" "v")] 102))
917 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
920 [(set_attr "type" "vecperm")])
922 (define_insn "altivec_vpkswus"
923 [(set (match_operand:V8HI 0 "register_operand" "=v")
924 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
925 (match_operand:V4SI 2 "register_operand" "v")] 103))
926 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
929 [(set_attr "type" "vecperm")])
931 (define_insn "altivec_vrl<VI_char>"
932 [(set (match_operand:VI 0 "register_operand" "=v")
933 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
934 (match_operand:VI 2 "register_operand" "v")] 104))]
936 "vrl<VI_char> %0,%1,%2"
937 [(set_attr "type" "vecsimple")])
939 (define_insn "altivec_vsl<VI_char>"
940 [(set (match_operand:VI 0 "register_operand" "=v")
941 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
942 (match_operand:VI 2 "register_operand" "v")] 107))]
944 "vsl<VI_char> %0,%1,%2"
945 [(set_attr "type" "vecsimple")])
947 (define_insn "altivec_vslw_v4sf"
948 [(set (match_operand:V4SF 0 "register_operand" "=v")
949 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
950 (match_operand:V4SF 2 "register_operand" "v")] 109))]
953 [(set_attr "type" "vecsimple")])
955 (define_insn "altivec_vsl"
956 [(set (match_operand:V4SI 0 "register_operand" "=v")
957 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
958 (match_operand:V4SI 2 "register_operand" "v")] 110))]
961 [(set_attr "type" "vecperm")])
963 (define_insn "altivec_vslo"
964 [(set (match_operand:V4SI 0 "register_operand" "=v")
965 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
966 (match_operand:V4SI 2 "register_operand" "v")] 111))]
969 [(set_attr "type" "vecperm")])
971 (define_insn "altivec_vsr<VI_char>"
972 [(set (match_operand:VI 0 "register_operand" "=v")
973 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
974 (match_operand:VI 2 "register_operand" "v")] 112))]
976 "vsr<VI_char> %0,%1,%2"
977 [(set_attr "type" "vecsimple")])
979 (define_insn "altivec_vsra<VI_char>"
980 [(set (match_operand:VI 0 "register_operand" "=v")
981 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
982 (match_operand:VI 2 "register_operand" "v")] 115))]
984 "vsra<VI_char> %0,%1,%2"
985 [(set_attr "type" "vecsimple")])
987 (define_insn "altivec_vsr"
988 [(set (match_operand:V4SI 0 "register_operand" "=v")
989 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
990 (match_operand:V4SI 2 "register_operand" "v")] 118))]
993 [(set_attr "type" "vecperm")])
995 (define_insn "altivec_vsro"
996 [(set (match_operand:V4SI 0 "register_operand" "=v")
997 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
998 (match_operand:V4SI 2 "register_operand" "v")] 119))]
1001 [(set_attr "type" "vecperm")])
1003 (define_insn "altivec_vsum4ubs"
1004 [(set (match_operand:V4SI 0 "register_operand" "=v")
1005 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
1006 (match_operand:V4SI 2 "register_operand" "v")] 131))
1007 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1010 [(set_attr "type" "veccomplex")])
1012 (define_insn "altivec_vsum4s<VI_char>s"
1013 [(set (match_operand:V4SI 0 "register_operand" "=v")
1014 (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")
1015 (match_operand:V4SI 2 "register_operand" "v")] 132))
1016 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1018 "vsum4s<VI_char>s %0,%1,%2"
1019 [(set_attr "type" "veccomplex")])
1021 (define_insn "altivec_vsum2sws"
1022 [(set (match_operand:V4SI 0 "register_operand" "=v")
1023 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1024 (match_operand:V4SI 2 "register_operand" "v")] 134))
1025 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1028 [(set_attr "type" "veccomplex")])
1030 (define_insn "altivec_vsumsws"
1031 [(set (match_operand:V4SI 0 "register_operand" "=v")
1032 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1033 (match_operand:V4SI 2 "register_operand" "v")] 135))
1034 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1037 [(set_attr "type" "veccomplex")])
1039 (define_insn "altivec_vspltb"
1040 [(set (match_operand:V16QI 0 "register_operand" "=v")
1041 (vec_duplicate:V16QI
1042 (vec_select:QI (match_operand:V16QI 1 "register_operand" "v")
1044 [(match_operand:QI 2 "immediate_operand" "i")]))))]
1047 [(set_attr "type" "vecperm")])
1049 (define_insn "altivec_vsplth"
1050 [(set (match_operand:V8HI 0 "register_operand" "=v")
1052 (vec_select:HI (match_operand:V8HI 1 "register_operand" "v")
1054 [(match_operand:QI 2 "immediate_operand" "i")]))))]
1057 [(set_attr "type" "vecperm")])
1059 (define_insn "altivec_vspltw"
1060 [(set (match_operand:V4SI 0 "register_operand" "=v")
1062 (vec_select:SI (match_operand:V4SI 1 "register_operand" "v")
1064 [(match_operand:QI 2 "immediate_operand" "i")]))))]
1067 [(set_attr "type" "vecperm")])
1069 (define_insn "altivec_vspltisb"
1070 [(set (match_operand:V16QI 0 "register_operand" "=v")
1071 (vec_duplicate:V16QI
1072 (match_operand:QI 1 "immediate_operand" "i")))]
1075 [(set_attr "type" "vecperm")])
1077 (define_insn "altivec_vspltish"
1078 [(set (match_operand:V8HI 0 "register_operand" "=v")
1080 (sign_extend:HI (match_operand:QI 1 "immediate_operand" "i"))))]
1083 [(set_attr "type" "vecperm")])
1085 (define_insn "altivec_vspltisw"
1086 [(set (match_operand:V4SI 0 "register_operand" "=v")
1088 (sign_extend:SI (match_operand:QI 1 "immediate_operand" "i"))))]
1091 [(set_attr "type" "vecperm")])
1093 (define_insn "altivec_vspltisw_v4sf"
1094 [(set (match_operand:V4SF 0 "register_operand" "=v")
1096 (float:SF (sign_extend:SI
1097 (match_operand:QI 1 "immediate_operand" "i")))))]
1100 [(set_attr "type" "vecperm")])
1102 (define_insn "ftruncv4sf2"
1103 [(set (match_operand:V4SF 0 "register_operand" "=v")
1104 (fix:V4SF (match_operand:V4SF 1 "register_operand" "v")))]
1107 [(set_attr "type" "vecfloat")])
1109 (define_insn "altivec_vperm_v4sf"
1110 [(set (match_operand:V4SF 0 "register_operand" "=v")
1111 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1112 (match_operand:V4SF 2 "register_operand" "v")
1113 (match_operand:V16QI 3 "register_operand" "v")] 145))]
1116 [(set_attr "type" "vecperm")])
1118 (define_insn "altivec_vperm_<mode>"
1119 [(set (match_operand:VI 0 "register_operand" "=v")
1120 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
1121 (match_operand:VI 2 "register_operand" "v")
1122 (match_operand:V16QI 3 "register_operand" "v")] 144))]
1125 [(set_attr "type" "vecperm")])
1127 (define_insn "altivec_vrfip"
1128 [(set (match_operand:V4SF 0 "register_operand" "=v")
1129 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 148))]
1132 [(set_attr "type" "vecfloat")])
1134 (define_insn "altivec_vrfin"
1135 [(set (match_operand:V4SF 0 "register_operand" "=v")
1136 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 149))]
1139 [(set_attr "type" "vecfloat")])
1141 (define_insn "altivec_vrfim"
1142 [(set (match_operand:V4SF 0 "register_operand" "=v")
1143 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 150))]
1146 [(set_attr "type" "vecfloat")])
1148 (define_insn "altivec_vcfux"
1149 [(set (match_operand:V4SF 0 "register_operand" "=v")
1150 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1151 (match_operand:QI 2 "immediate_operand" "i")] 151))]
1154 [(set_attr "type" "vecfloat")])
1156 (define_insn "altivec_vcfsx"
1157 [(set (match_operand:V4SF 0 "register_operand" "=v")
1158 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1159 (match_operand:QI 2 "immediate_operand" "i")] 152))]
1162 [(set_attr "type" "vecfloat")])
1164 (define_insn "altivec_vctuxs"
1165 [(set (match_operand:V4SI 0 "register_operand" "=v")
1166 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
1167 (match_operand:QI 2 "immediate_operand" "i")] 153))
1168 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1171 [(set_attr "type" "vecfloat")])
1173 (define_insn "altivec_vctsxs"
1174 [(set (match_operand:V4SI 0 "register_operand" "=v")
1175 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
1176 (match_operand:QI 2 "immediate_operand" "i")] 154))
1177 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1180 [(set_attr "type" "vecfloat")])
1182 (define_insn "altivec_vlogefp"
1183 [(set (match_operand:V4SF 0 "register_operand" "=v")
1184 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 155))]
1187 [(set_attr "type" "vecfloat")])
1189 (define_insn "altivec_vexptefp"
1190 [(set (match_operand:V4SF 0 "register_operand" "=v")
1191 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 156))]
1194 [(set_attr "type" "vecfloat")])
1196 (define_insn "altivec_vrsqrtefp"
1197 [(set (match_operand:V4SF 0 "register_operand" "=v")
1198 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 157))]
1201 [(set_attr "type" "vecfloat")])
1203 (define_insn "altivec_vrefp"
1204 [(set (match_operand:V4SF 0 "register_operand" "=v")
1205 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 158))]
1208 [(set_attr "type" "vecfloat")])
1210 (define_expand "vcondv4si"
1211 [(set (match_operand:V4SI 0 "register_operand" "=v")
1212 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1213 (match_operand:V4SI 2 "register_operand" "v")
1214 (match_operand:V4SI 3 "comparison_operator" "")
1215 (match_operand:V4SI 4 "register_operand" "v")
1216 (match_operand:V4SI 5 "register_operand" "v")
1217 ] UNSPEC_VCOND_V4SI))]
1221 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1222 operands[3], operands[4], operands[5]))
1229 (define_expand "vconduv4si"
1230 [(set (match_operand:V4SI 0 "register_operand" "=v")
1231 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1232 (match_operand:V4SI 2 "register_operand" "v")
1233 (match_operand:V4SI 3 "comparison_operator" "")
1234 (match_operand:V4SI 4 "register_operand" "v")
1235 (match_operand:V4SI 5 "register_operand" "v")
1236 ] UNSPEC_VCONDU_V4SI))]
1240 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1241 operands[3], operands[4], operands[5]))
1248 (define_expand "vcondv4sf"
1249 [(set (match_operand:V4SF 0 "register_operand" "=v")
1250 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1251 (match_operand:V4SF 2 "register_operand" "v")
1252 (match_operand:V4SF 3 "comparison_operator" "")
1253 (match_operand:V4SF 4 "register_operand" "v")
1254 (match_operand:V4SF 5 "register_operand" "v")
1255 ] UNSPEC_VCOND_V4SF))]
1259 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1260 operands[3], operands[4], operands[5]))
1267 (define_expand "vcondv8hi"
1268 [(set (match_operand:V4SF 0 "register_operand" "=v")
1269 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1270 (match_operand:V8HI 2 "register_operand" "v")
1271 (match_operand:V8HI 3 "comparison_operator" "")
1272 (match_operand:V8HI 4 "register_operand" "v")
1273 (match_operand:V8HI 5 "register_operand" "v")
1274 ] UNSPEC_VCOND_V8HI))]
1278 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1279 operands[3], operands[4], operands[5]))
1286 (define_expand "vconduv8hi"
1287 [(set (match_operand:V4SF 0 "register_operand" "=v")
1288 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1289 (match_operand:V8HI 2 "register_operand" "v")
1290 (match_operand:V8HI 3 "comparison_operator" "")
1291 (match_operand:V8HI 4 "register_operand" "v")
1292 (match_operand:V8HI 5 "register_operand" "v")
1293 ] UNSPEC_VCONDU_V8HI))]
1297 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1298 operands[3], operands[4], operands[5]))
1305 (define_expand "vcondv16qi"
1306 [(set (match_operand:V4SF 0 "register_operand" "=v")
1307 (unspec:V16QI [(match_operand:V4SI 1 "register_operand" "v")
1308 (match_operand:V16QI 2 "register_operand" "v")
1309 (match_operand:V16QI 3 "comparison_operator" "")
1310 (match_operand:V16QI 4 "register_operand" "v")
1311 (match_operand:V16QI 5 "register_operand" "v")
1312 ] UNSPEC_VCOND_V16QI))]
1316 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1317 operands[3], operands[4], operands[5]))
1324 (define_expand "vconduv16qi"
1325 [(set (match_operand:V4SF 0 "register_operand" "=v")
1326 (unspec:V16QI [(match_operand:V4SI 1 "register_operand" "v")
1327 (match_operand:V16QI 2 "register_operand" "v")
1328 (match_operand:V16QI 3 "comparison_operator" "")
1329 (match_operand:V16QI 4 "register_operand" "v")
1330 (match_operand:V16QI 5 "register_operand" "v")
1331 ] UNSPEC_VCONDU_V16QI))]
1335 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1336 operands[3], operands[4], operands[5]))
1344 (define_insn "altivec_vsel_v4si"
1345 [(set (match_operand:V4SI 0 "register_operand" "=v")
1346 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1347 (match_operand:V4SI 2 "register_operand" "v")
1348 (match_operand:V4SI 3 "register_operand" "v")]
1352 [(set_attr "type" "vecperm")])
1354 (define_insn "altivec_vsel_v4sf"
1355 [(set (match_operand:V4SF 0 "register_operand" "=v")
1356 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1357 (match_operand:V4SF 2 "register_operand" "v")
1358 (match_operand:V4SI 3 "register_operand" "v")]
1362 [(set_attr "type" "vecperm")])
1364 (define_insn "altivec_vsel_v8hi"
1365 [(set (match_operand:V8HI 0 "register_operand" "=v")
1366 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1367 (match_operand:V8HI 2 "register_operand" "v")
1368 (match_operand:V8HI 3 "register_operand" "v")]
1372 [(set_attr "type" "vecperm")])
1374 (define_insn "altivec_vsel_v16qi"
1375 [(set (match_operand:V16QI 0 "register_operand" "=v")
1376 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1377 (match_operand:V16QI 2 "register_operand" "v")
1378 (match_operand:V16QI 3 "register_operand" "v")]
1382 [(set_attr "type" "vecperm")])
1384 (define_insn "altivec_vsldoi_v4si"
1385 [(set (match_operand:V4SI 0 "register_operand" "=v")
1386 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1387 (match_operand:V4SI 2 "register_operand" "v")
1388 (match_operand:QI 3 "immediate_operand" "i")] 163))]
1390 "vsldoi %0,%1,%2,%3"
1391 [(set_attr "type" "vecperm")])
1393 (define_insn "altivec_vsldoi_v4sf"
1394 [(set (match_operand:V4SF 0 "register_operand" "=v")
1395 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1396 (match_operand:V4SF 2 "register_operand" "v")
1397 (match_operand:QI 3 "immediate_operand" "i")] 164))]
1399 "vsldoi %0,%1,%2,%3"
1400 [(set_attr "type" "vecperm")])
1402 (define_insn "altivec_vsldoi_v8hi"
1403 [(set (match_operand:V8HI 0 "register_operand" "=v")
1404 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1405 (match_operand:V8HI 2 "register_operand" "v")
1406 (match_operand:QI 3 "immediate_operand" "i")] 165))]
1408 "vsldoi %0,%1,%2,%3"
1409 [(set_attr "type" "vecperm")])
1411 (define_insn "altivec_vsldoi_v16qi"
1412 [(set (match_operand:V16QI 0 "register_operand" "=v")
1413 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1414 (match_operand:V16QI 2 "register_operand" "v")
1415 (match_operand:QI 3 "immediate_operand" "i")] 166))]
1417 "vsldoi %0,%1,%2,%3"
1418 [(set_attr "type" "vecperm")])
1420 (define_insn "altivec_vupkhsb"
1421 [(set (match_operand:V8HI 0 "register_operand" "=v")
1422 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 167))]
1425 [(set_attr "type" "vecperm")])
1427 (define_insn "altivec_vupkhpx"
1428 [(set (match_operand:V4SI 0 "register_operand" "=v")
1429 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 168))]
1432 [(set_attr "type" "vecperm")])
1434 (define_insn "altivec_vupkhsh"
1435 [(set (match_operand:V4SI 0 "register_operand" "=v")
1436 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 169))]
1439 [(set_attr "type" "vecperm")])
1441 (define_insn "altivec_vupklsb"
1442 [(set (match_operand:V8HI 0 "register_operand" "=v")
1443 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 170))]
1446 [(set_attr "type" "vecperm")])
1448 (define_insn "altivec_vupklpx"
1449 [(set (match_operand:V4SI 0 "register_operand" "=v")
1450 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 171))]
1453 [(set_attr "type" "vecperm")])
1455 (define_insn "altivec_vupklsh"
1456 [(set (match_operand:V4SI 0 "register_operand" "=v")
1457 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 172))]
1460 [(set_attr "type" "vecperm")])
1462 ;; AltiVec predicates.
1464 (define_expand "cr6_test_for_zero"
1465 [(set (match_operand:SI 0 "register_operand" "=r")
1471 (define_expand "cr6_test_for_zero_reverse"
1472 [(set (match_operand:SI 0 "register_operand" "=r")
1475 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
1479 (define_expand "cr6_test_for_lt"
1480 [(set (match_operand:SI 0 "register_operand" "=r")
1486 (define_expand "cr6_test_for_lt_reverse"
1487 [(set (match_operand:SI 0 "register_operand" "=r")
1490 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
1494 ;; We can get away with generating the opcode on the fly (%3 below)
1495 ;; because all the predicates have the same scheduling parameters.
1497 (define_insn "altivec_predicate_v4sf"
1499 (unspec:CC [(match_operand:V4SF 1 "register_operand" "v")
1500 (match_operand:V4SF 2 "register_operand" "v")
1501 (match_operand 3 "any_operand" "")] 174))
1502 (clobber (match_scratch:V4SF 0 "=v"))]
1505 [(set_attr "type" "veccmp")])
1507 (define_insn "altivec_predicate_<mode>"
1509 (unspec:CC [(match_operand:VI 1 "register_operand" "v")
1510 (match_operand:VI 2 "register_operand" "v")
1511 (match_operand 3 "any_operand" "")] 173))
1512 (clobber (match_scratch:VI 0 "=v"))]
1515 [(set_attr "type" "veccmp")])
1517 (define_insn "altivec_mtvscr"
1520 [(match_operand:V4SI 0 "register_operand" "v")] 186))]
1523 [(set_attr "type" "vecsimple")])
1525 (define_insn "altivec_mfvscr"
1526 [(set (match_operand:V8HI 0 "register_operand" "=v")
1527 (unspec_volatile:V8HI [(reg:SI 110)] 187))]
1530 [(set_attr "type" "vecsimple")])
1532 (define_insn "altivec_dssall"
1533 [(unspec_volatile [(const_int 0)] 188)]
1536 [(set_attr "type" "vecsimple")])
1538 (define_insn "altivec_dss"
1539 [(unspec_volatile [(match_operand:QI 0 "immediate_operand" "i")] 189)]
1542 [(set_attr "type" "vecsimple")])
1544 (define_insn "altivec_dst"
1545 [(unspec [(match_operand 0 "register_operand" "b")
1546 (match_operand:SI 1 "register_operand" "r")
1547 (match_operand:QI 2 "immediate_operand" "i")] 190)]
1548 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1550 [(set_attr "type" "vecsimple")])
1552 (define_insn "altivec_dstt"
1553 [(unspec [(match_operand 0 "register_operand" "b")
1554 (match_operand:SI 1 "register_operand" "r")
1555 (match_operand:QI 2 "immediate_operand" "i")] 191)]
1556 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1558 [(set_attr "type" "vecsimple")])
1560 (define_insn "altivec_dstst"
1561 [(unspec [(match_operand 0 "register_operand" "b")
1562 (match_operand:SI 1 "register_operand" "r")
1563 (match_operand:QI 2 "immediate_operand" "i")] 192)]
1564 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1566 [(set_attr "type" "vecsimple")])
1568 (define_insn "altivec_dststt"
1569 [(unspec [(match_operand 0 "register_operand" "b")
1570 (match_operand:SI 1 "register_operand" "r")
1571 (match_operand:QI 2 "immediate_operand" "i")] 193)]
1572 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1574 [(set_attr "type" "vecsimple")])
1576 (define_insn "altivec_lvsl"
1577 [(set (match_operand:V16QI 0 "register_operand" "=v")
1578 (unspec:V16QI [(match_operand 1 "memory_operand" "m")] 194))]
1581 [(set_attr "type" "vecload")])
1583 (define_insn "altivec_lvsr"
1584 [(set (match_operand:V16QI 0 "register_operand" "=v")
1585 (unspec:V16QI [(match_operand 1 "memory_operand" "m")] 195))]
1588 [(set_attr "type" "vecload")])
1590 (define_expand "build_vector_mask_for_load"
1591 [(set (match_operand:V16QI 0 "register_operand" "=v")
1592 (unspec:V16QI [(match_operand 1 "memory_operand" "m")] 195))]
1599 if (GET_CODE (operands[1]) != MEM)
1602 addr = XEXP (operands[1], 0);
1603 temp = gen_reg_rtx (GET_MODE (addr));
1604 emit_insn (gen_rtx_SET (VOIDmode, temp,
1605 gen_rtx_NEG (GET_MODE (addr), addr)));
1606 emit_insn (gen_altivec_lvsr (operands[0],
1607 gen_rtx_MEM (GET_MODE (operands[1]), temp)));
1611 ;; Parallel some of the LVE* and STV*'s with unspecs because some have
1612 ;; identical rtl but different instructions-- and gcc gets confused.
1614 (define_insn "altivec_lve<VI_char>x"
1616 [(set (match_operand:VI 0 "register_operand" "=v")
1617 (match_operand:VI 1 "memory_operand" "m"))
1618 (unspec [(const_int 0)] 196)])]
1620 "lve<VI_char>x %0,%y1"
1621 [(set_attr "type" "vecload")])
1623 (define_insn "altivec_lvxl"
1625 [(set (match_operand:V4SI 0 "register_operand" "=v")
1626 (match_operand:V4SI 1 "memory_operand" "m"))
1627 (unspec [(const_int 0)] 213)])]
1630 [(set_attr "type" "vecload")])
1632 (define_insn "altivec_lvx"
1633 [(set (match_operand:V4SI 0 "register_operand" "=v")
1634 (match_operand:V4SI 1 "memory_operand" "m"))]
1637 [(set_attr "type" "vecload")])
1639 (define_insn "altivec_stvx"
1641 [(set (match_operand:V4SI 0 "memory_operand" "=m")
1642 (match_operand:V4SI 1 "register_operand" "v"))
1643 (unspec [(const_int 0)] 201)])]
1646 [(set_attr "type" "vecstore")])
1648 (define_insn "altivec_stvxl"
1650 [(set (match_operand:V4SI 0 "memory_operand" "=m")
1651 (match_operand:V4SI 1 "register_operand" "v"))
1652 (unspec [(const_int 0)] 202)])]
1655 [(set_attr "type" "vecstore")])
1657 (define_insn "altivec_stve<VI_char>x"
1659 [(set (match_operand:VI 0 "memory_operand" "=m")
1660 (match_operand:VI 1 "register_operand" "v"))
1661 (unspec [(const_int 0)] 203)])]
1663 "stve<VI_char>x %1,%y0"
1664 [(set_attr "type" "vecstore")])
1666 (define_insn "abs<mode>2"
1667 [(set (match_operand:VI 0 "register_operand" "=v")
1668 (abs:VI (match_operand:VI 1 "register_operand" "v")))
1669 (clobber (match_scratch:VI 2 "=&v"))
1670 (clobber (match_scratch:VI 3 "=&v"))]
1672 "vspltisb %2,0\;vsubu<VI_char>m %3,%2,%1\;vmaxs<VI_char> %0,%1,%3"
1673 [(set_attr "type" "vecsimple")
1674 (set_attr "length" "12")])
1676 (define_insn "absv4sf2"
1677 [(set (match_operand:V4SF 0 "register_operand" "=v")
1678 (abs:V4SF (match_operand:V4SF 1 "register_operand" "v")))
1679 (clobber (match_scratch:V4SF 2 "=&v"))
1680 (clobber (match_scratch:V4SF 3 "=&v"))]
1682 "vspltisw %2,-1\;vslw %3,%2,%2\;vandc %0,%1,%3"
1683 [(set_attr "type" "vecsimple")
1684 (set_attr "length" "12")])
1686 (define_insn "altivec_abss_<mode>"
1687 [(set (match_operand:VI 0 "register_operand" "=v")
1688 (unspec:VI [(match_operand:VI 1 "register_operand" "v")] 210))
1689 (clobber (match_scratch:VI 2 "=&v"))
1690 (clobber (match_scratch:VI 3 "=&v"))]
1692 "vspltisb %2,0\;vsubs<VI_char>s %3,%2,%1\;vmaxs<VI_char> %0,%1,%3"
1693 [(set_attr "type" "vecsimple")
1694 (set_attr "length" "12")])
1696 (define_insn "vec_realign_load_v4sf"
1697 [(set (match_operand:V4SF 0 "register_operand" "=v")
1698 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1699 (match_operand:V4SF 2 "register_operand" "v")
1700 (match_operand:V16QI 3 "register_operand" "v")] 216))]
1703 [(set_attr "type" "vecperm")])
1705 (define_insn "vec_realign_load_<mode>"
1706 [(set (match_operand:VI 0 "register_operand" "=v")
1707 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
1708 (match_operand:VI 2 "register_operand" "v")
1709 (match_operand:V16QI 3 "register_operand" "v")] 215))]
1712 [(set_attr "type" "vecperm")])