2 ;; Copyright (C) 2002, 2003 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.
23 [(UNSPEC_VSPLTISW 141)
28 ;; Generic LVX load instruction.
29 (define_insn "altivec_lvx_4si"
30 [(set (match_operand:V4SI 0 "altivec_register_operand" "=v")
31 (match_operand:V4SI 1 "memory_operand" "m"))]
34 [(set_attr "type" "vecload")])
36 (define_insn "altivec_lvx_8hi"
37 [(set (match_operand:V8HI 0 "altivec_register_operand" "=v")
38 (match_operand:V8HI 1 "memory_operand" "m"))]
41 [(set_attr "type" "vecload")])
43 (define_insn "altivec_lvx_16qi"
44 [(set (match_operand:V16QI 0 "altivec_register_operand" "=v")
45 (match_operand:V16QI 1 "memory_operand" "m"))]
48 [(set_attr "type" "vecload")])
50 (define_insn "altivec_lvx_4sf"
51 [(set (match_operand:V4SF 0 "altivec_register_operand" "=v")
52 (match_operand:V4SF 1 "memory_operand" "m"))]
55 [(set_attr "type" "vecload")])
57 ;; Generic STVX store instruction.
58 (define_insn "altivec_stvx_4si"
59 [(set (match_operand:V4SI 0 "memory_operand" "=m")
60 (match_operand:V4SI 1 "altivec_register_operand" "v"))]
63 [(set_attr "type" "vecstore")])
65 (define_insn "altivec_stvx_8hi"
66 [(set (match_operand:V8HI 0 "memory_operand" "=m")
67 (match_operand:V8HI 1 "altivec_register_operand" "v"))]
70 [(set_attr "type" "vecstore")])
72 (define_insn "altivec_stvx_16qi"
73 [(set (match_operand:V16QI 0 "memory_operand" "=m")
74 (match_operand:V16QI 1 "altivec_register_operand" "v"))]
77 [(set_attr "type" "vecstore")])
79 (define_insn "altivec_stvx_4sf"
80 [(set (match_operand:V4SF 0 "memory_operand" "=m")
81 (match_operand:V4SF 1 "altivec_register_operand" "v"))]
84 [(set_attr "type" "vecstore")])
86 ;; Vector move instructions.
87 (define_expand "movv4si"
88 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
89 (match_operand:V4SI 1 "any_operand" ""))]
91 "{ rs6000_emit_move (operands[0], operands[1], V4SImode); DONE; }")
93 (define_insn "*movv4si_internal"
94 [(set (match_operand:V4SI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v")
95 (match_operand:V4SI 1 "input_operand" "v,m,v,r,o,r,W"))]
99 switch (which_alternative)
101 case 0: return \"stvx %1,%y0\";
102 case 1: return \"lvx %0,%y1\";
103 case 2: return \"vor %0,%1,%1\";
104 case 3: return \"#\";
105 case 4: return \"#\";
106 case 5: return \"#\";
107 case 6: return output_vec_const_move (operands);
111 [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")])
114 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
115 (match_operand:V4SI 1 "input_operand" ""))]
116 "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
117 && altivec_in_gprs_p (operands[0], operands[1])"
118 [(set (match_dup 2) (match_dup 4))
119 (set (match_dup 3) (match_dup 5))]
121 rs6000_split_altivec_in_gprs (operands);
125 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
126 (match_operand:V4SI 1 "input_operand" ""))]
127 "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
128 && altivec_in_gprs_p (operands[0], operands[1])"
129 [(set (match_dup 2) (match_dup 6))
130 (set (match_dup 3) (match_dup 7))
131 (set (match_dup 4) (match_dup 8))
132 (set (match_dup 5) (match_dup 9))]
134 rs6000_split_altivec_in_gprs (operands);
138 [(set (match_operand:V4SI 0 "altivec_register_operand" "")
139 (match_operand:V4SI 1 "easy_vector_constant_add_self" ""))]
140 "TARGET_ALTIVEC && reload_completed"
142 (unspec:V4SI [(match_dup 3)] UNSPEC_VSPLTISW))
144 (plus:V4SI (match_dup 0)
147 { operands[3] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 0)) >> 1); }")
149 (define_expand "movv8hi"
150 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
151 (match_operand:V8HI 1 "any_operand" ""))]
153 "{ rs6000_emit_move (operands[0], operands[1], V8HImode); DONE; }")
155 (define_insn "*movv8hi_internal1"
156 [(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v")
157 (match_operand:V8HI 1 "input_operand" "v,m,v,r,o,r,W"))]
161 switch (which_alternative)
163 case 0: return \"stvx %1,%y0\";
164 case 1: return \"lvx %0,%y1\";
165 case 2: return \"vor %0,%1,%1\";
166 case 3: return \"#\";
167 case 4: return \"#\";
168 case 5: return \"#\";
169 case 6: return output_vec_const_move (operands);
173 [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")])
176 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
177 (match_operand:V8HI 1 "input_operand" ""))]
178 "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
179 && altivec_in_gprs_p (operands[0], operands[1])"
180 [(set (match_dup 2) (match_dup 4))
181 (set (match_dup 3) (match_dup 5))]
183 rs6000_split_altivec_in_gprs (operands);
187 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
188 (match_operand:V8HI 1 "input_operand" ""))]
189 "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
190 && altivec_in_gprs_p (operands[0], operands[1])"
191 [(set (match_dup 2) (match_dup 6))
192 (set (match_dup 3) (match_dup 7))
193 (set (match_dup 4) (match_dup 8))
194 (set (match_dup 5) (match_dup 9))]
196 rs6000_split_altivec_in_gprs (operands);
200 [(set (match_operand:V8HI 0 "altivec_register_operand" "")
201 (match_operand:V8HI 1 "easy_vector_constant_add_self" ""))]
202 "TARGET_ALTIVEC && reload_completed"
204 (unspec:V8HI [(match_dup 3)] UNSPEC_VSPLTISH))
206 (plus:V8HI (match_dup 0)
209 { operands[3] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 0)) >> 1); }")
211 (define_expand "movv16qi"
212 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
213 (match_operand:V16QI 1 "any_operand" ""))]
215 "{ rs6000_emit_move (operands[0], operands[1], V16QImode); DONE; }")
217 (define_insn "*movv16qi_internal1"
218 [(set (match_operand:V16QI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v")
219 (match_operand:V16QI 1 "input_operand" "v,m,v,r,o,r,W"))]
223 switch (which_alternative)
225 case 0: return \"stvx %1,%y0\";
226 case 1: return \"lvx %0,%y1\";
227 case 2: return \"vor %0,%1,%1\";
228 case 3: return \"#\";
229 case 4: return \"#\";
230 case 5: return \"#\";
231 case 6: return output_vec_const_move (operands);
235 [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")])
238 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
239 (match_operand:V16QI 1 "input_operand" ""))]
240 "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
241 && altivec_in_gprs_p (operands[0], operands[1])"
242 [(set (match_dup 2) (match_dup 4))
243 (set (match_dup 3) (match_dup 5))]
245 rs6000_split_altivec_in_gprs (operands);
249 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
250 (match_operand:V16QI 1 "input_operand" ""))]
251 "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
252 && altivec_in_gprs_p (operands[0], operands[1])"
253 [(set (match_dup 2) (match_dup 6))
254 (set (match_dup 3) (match_dup 7))
255 (set (match_dup 4) (match_dup 8))
256 (set (match_dup 5) (match_dup 9))]
258 rs6000_split_altivec_in_gprs (operands);
262 [(set (match_operand:V16QI 0 "altivec_register_operand" "")
263 (match_operand:V16QI 1 "easy_vector_constant_add_self" ""))]
264 "TARGET_ALTIVEC && reload_completed"
266 (unspec:V16QI [(match_dup 3)] UNSPEC_VSPLTISB))
268 (plus:V16QI (match_dup 0)
271 { operands[3] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 0)) >> 1); }")
273 (define_expand "movv4sf"
274 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
275 (match_operand:V4SF 1 "any_operand" ""))]
277 "{ rs6000_emit_move (operands[0], operands[1], V4SFmode); DONE; }")
279 (define_insn "*movv4sf_internal1"
280 [(set (match_operand:V4SF 0 "nonimmediate_operand" "=m,v,v,o,r,r,v")
281 (match_operand:V4SF 1 "input_operand" "v,m,v,r,o,r,W"))]
285 switch (which_alternative)
287 case 0: return \"stvx %1,%y0\";
288 case 1: return \"lvx %0,%y1\";
289 case 2: return \"vor %0,%1,%1\";
290 case 3: return \"#\";
291 case 4: return \"#\";
292 case 5: return \"#\";
293 case 6: return output_vec_const_move (operands);
297 [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")])
300 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
301 (match_operand:V4SF 1 "input_operand" ""))]
302 "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
303 && altivec_in_gprs_p (operands[0], operands[1])"
304 [(set (match_dup 2) (match_dup 4))
305 (set (match_dup 3) (match_dup 5))]
307 rs6000_split_altivec_in_gprs (operands);
311 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
312 (match_operand:V4SF 1 "input_operand" ""))]
313 "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
314 && altivec_in_gprs_p (operands[0], operands[1])"
315 [(set (match_dup 2) (match_dup 6))
316 (set (match_dup 3) (match_dup 7))
317 (set (match_dup 4) (match_dup 8))
318 (set (match_dup 5) (match_dup 9))]
320 rs6000_split_altivec_in_gprs (operands);
323 (define_insn "get_vrsave_internal"
324 [(set (match_operand:SI 0 "register_operand" "=r")
325 (unspec:SI [(reg:SI 109)] 214))]
330 return \"mfspr %0,256\";
332 return \"mfvrsave %0\";
334 [(set_attr "type" "*")])
336 (define_insn "*set_vrsave_internal"
337 [(match_parallel 0 "vrsave_operation"
339 (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
340 (reg:SI 109)] 30))])]
345 return \"mtspr 256,%1\";
347 return \"mtvrsave %1\";
349 [(set_attr "type" "*")])
351 ;; Simple binary operations.
353 (define_insn "addv16qi3"
354 [(set (match_operand:V16QI 0 "register_operand" "=v")
355 (plus:V16QI (match_operand:V16QI 1 "register_operand" "v")
356 (match_operand:V16QI 2 "register_operand" "v")))]
359 [(set_attr "type" "vecsimple")])
361 (define_insn "addv8hi3"
362 [(set (match_operand:V8HI 0 "register_operand" "=v")
363 (plus:V8HI (match_operand:V8HI 1 "register_operand" "v")
364 (match_operand:V8HI 2 "register_operand" "v")))]
367 [(set_attr "type" "vecsimple")])
369 (define_insn "addv4si3"
370 [(set (match_operand:V4SI 0 "register_operand" "=v")
371 (plus:V4SI (match_operand:V4SI 1 "register_operand" "v")
372 (match_operand:V4SI 2 "register_operand" "v")))]
375 [(set_attr "type" "vecsimple")])
377 (define_insn "addv4sf3"
378 [(set (match_operand:V4SF 0 "register_operand" "=v")
379 (plus:V4SF (match_operand:V4SF 1 "register_operand" "v")
380 (match_operand:V4SF 2 "register_operand" "v")))]
383 [(set_attr "type" "vecfloat")])
385 (define_insn "altivec_vaddcuw"
386 [(set (match_operand:V4SI 0 "register_operand" "=v")
387 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
388 (match_operand:V4SI 2 "register_operand" "v")] 35))]
391 [(set_attr "type" "vecsimple")])
393 (define_insn "altivec_vaddubs"
394 [(set (match_operand:V16QI 0 "register_operand" "=v")
395 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
396 (match_operand:V16QI 2 "register_operand" "v")] 36))
397 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
400 [(set_attr "type" "vecsimple")])
402 (define_insn "altivec_vaddsbs"
403 [(set (match_operand:V16QI 0 "register_operand" "=v")
404 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
405 (match_operand:V16QI 2 "register_operand" "v")] 37))
406 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
409 [(set_attr "type" "vecsimple")])
411 (define_insn "altivec_vadduhs"
412 [(set (match_operand:V8HI 0 "register_operand" "=v")
413 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
414 (match_operand:V8HI 2 "register_operand" "v")] 38))
415 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
418 [(set_attr "type" "vecsimple")])
420 (define_insn "altivec_vaddshs"
421 [(set (match_operand:V8HI 0 "register_operand" "=v")
422 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
423 (match_operand:V8HI 2 "register_operand" "v")] 39))
424 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
427 [(set_attr "type" "vecsimple")])
429 (define_insn "altivec_vadduws"
430 [(set (match_operand:V4SI 0 "register_operand" "=v")
431 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
432 (match_operand:V4SI 2 "register_operand" "v")] 40))
433 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
436 [(set_attr "type" "vecsimple")])
438 (define_insn "altivec_vaddsws"
439 [(set (match_operand:V4SI 0 "register_operand" "=v")
440 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
441 (match_operand:V4SI 2 "register_operand" "v")] 41))
442 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
445 [(set_attr "type" "vecsimple")])
447 (define_insn "andv4si3"
448 [(set (match_operand:V4SI 0 "register_operand" "=v")
449 (and:V4SI (match_operand:V4SI 1 "register_operand" "v")
450 (match_operand:V4SI 2 "register_operand" "v")))]
453 [(set_attr "type" "vecsimple")])
455 (define_insn "altivec_vandc"
456 [(set (match_operand:V4SI 0 "register_operand" "=v")
457 (and:V4SI (match_operand:V4SI 1 "register_operand" "v")
458 (not:V4SI (match_operand:V4SI 2 "register_operand" "v"))))]
461 [(set_attr "type" "vecsimple")])
463 (define_insn "altivec_vavgub"
464 [(set (match_operand:V16QI 0 "register_operand" "=v")
465 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
466 (match_operand:V16QI 2 "register_operand" "v")] 44))]
469 [(set_attr "type" "vecsimple")])
471 (define_insn "altivec_vavgsb"
472 [(set (match_operand:V16QI 0 "register_operand" "=v")
473 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
474 (match_operand:V16QI 2 "register_operand" "v")] 45))]
477 [(set_attr "type" "vecsimple")])
479 (define_insn "altivec_vavguh"
480 [(set (match_operand:V8HI 0 "register_operand" "=v")
481 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
482 (match_operand:V8HI 2 "register_operand" "v")] 46))]
485 [(set_attr "type" "vecsimple")])
487 (define_insn "altivec_vavgsh"
488 [(set (match_operand:V8HI 0 "register_operand" "=v")
489 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
490 (match_operand:V8HI 2 "register_operand" "v")] 47))]
493 [(set_attr "type" "vecsimple")])
495 (define_insn "altivec_vavguw"
496 [(set (match_operand:V4SI 0 "register_operand" "=v")
497 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
498 (match_operand:V4SI 2 "register_operand" "v")] 48))]
501 [(set_attr "type" "vecsimple")])
503 (define_insn "altivec_vavgsw"
504 [(set (match_operand:V4SI 0 "register_operand" "=v")
505 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
506 (match_operand:V4SI 2 "register_operand" "v")] 49))]
509 [(set_attr "type" "vecsimple")])
511 (define_insn "altivec_vcmpbfp"
512 [(set (match_operand:V4SI 0 "register_operand" "=v")
513 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
514 (match_operand:V4SF 2 "register_operand" "v")] 50))]
517 [(set_attr "type" "veccmp")])
519 (define_insn "altivec_vcmpequb"
520 [(set (match_operand:V16QI 0 "register_operand" "=v")
521 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
522 (match_operand:V16QI 2 "register_operand" "v")] 51))]
525 [(set_attr "type" "vecsimple")])
527 (define_insn "altivec_vcmpequh"
528 [(set (match_operand:V8HI 0 "register_operand" "=v")
529 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
530 (match_operand:V8HI 2 "register_operand" "v")] 52))]
533 [(set_attr "type" "vecsimple")])
535 (define_insn "altivec_vcmpequw"
536 [(set (match_operand:V4SI 0 "register_operand" "=v")
537 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
538 (match_operand:V4SI 2 "register_operand" "v")] 53))]
541 [(set_attr "type" "vecsimple")])
543 (define_insn "altivec_vcmpeqfp"
544 [(set (match_operand:V4SI 0 "register_operand" "=v")
545 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
546 (match_operand:V4SF 2 "register_operand" "v")] 54))]
549 [(set_attr "type" "veccmp")])
551 (define_insn "altivec_vcmpgefp"
552 [(set (match_operand:V4SI 0 "register_operand" "=v")
553 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
554 (match_operand:V4SF 2 "register_operand" "v")] 55))]
557 [(set_attr "type" "veccmp")])
559 (define_insn "altivec_vcmpgtub"
560 [(set (match_operand:V16QI 0 "register_operand" "=v")
561 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
562 (match_operand:V16QI 2 "register_operand" "v")] 56))]
565 [(set_attr "type" "vecsimple")])
567 (define_insn "altivec_vcmpgtsb"
568 [(set (match_operand:V16QI 0 "register_operand" "=v")
569 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
570 (match_operand:V16QI 2 "register_operand" "v")] 57))]
573 [(set_attr "type" "vecsimple")])
575 (define_insn "altivec_vcmpgtuh"
576 [(set (match_operand:V8HI 0 "register_operand" "=v")
577 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
578 (match_operand:V8HI 2 "register_operand" "v")] 58))]
581 [(set_attr "type" "vecsimple")])
583 (define_insn "altivec_vcmpgtsh"
584 [(set (match_operand:V8HI 0 "register_operand" "=v")
585 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
586 (match_operand:V8HI 2 "register_operand" "v")] 59))]
589 [(set_attr "type" "vecsimple")])
591 (define_insn "altivec_vcmpgtuw"
592 [(set (match_operand:V4SI 0 "register_operand" "=v")
593 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
594 (match_operand:V4SI 2 "register_operand" "v")] 60))]
597 [(set_attr "type" "vecsimple")])
599 (define_insn "altivec_vcmpgtsw"
600 [(set (match_operand:V4SI 0 "register_operand" "=v")
601 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
602 (match_operand:V4SI 2 "register_operand" "v")] 61))]
605 [(set_attr "type" "vecsimple")])
607 (define_insn "altivec_vcmpgtfp"
608 [(set (match_operand:V4SI 0 "register_operand" "=v")
609 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
610 (match_operand:V4SF 2 "register_operand" "v")] 62))]
613 [(set_attr "type" "veccmp")])
615 ;; Fused multiply add
616 (define_insn "altivec_vmaddfp"
617 [(set (match_operand:V4SF 0 "register_operand" "=v")
618 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
619 (match_operand:V4SF 2 "register_operand" "v"))
620 (match_operand:V4SF 3 "register_operand" "v")))]
622 "vmaddfp %0,%1,%2,%3"
623 [(set_attr "type" "vecfloat")])
625 ;; We do multiply as a fused multiply-add with an add of a -0.0 vector.
627 (define_expand "mulv4sf3"
628 [(use (match_operand:V4SF 0 "register_operand" ""))
629 (use (match_operand:V4SF 1 "register_operand" ""))
630 (use (match_operand:V4SF 2 "register_operand" ""))]
631 "TARGET_ALTIVEC && TARGET_FUSED_MADD"
636 /* Generate [-0.0, -0.0, -0.0, -0.0]. */
637 neg0 = gen_reg_rtx (V4SFmode);
638 emit_insn (gen_altivec_vspltisw_v4sf (neg0, GEN_INT (-1)));
639 emit_insn (gen_altivec_vslw_v4sf (neg0, neg0, neg0));
641 /* Use the multiply-add. */
642 emit_insn (gen_altivec_vmaddfp (operands[0], operands[1], operands[2],
647 ;; Fused multiply subtract
648 (define_insn "altivec_vnmsubfp"
649 [(set (match_operand:V4SF 0 "register_operand" "=v")
650 (minus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
651 (match_operand:V4SF 2 "register_operand" "v"))
652 (match_operand:V4SF 3 "register_operand" "v")))]
654 "vnmsubfp %0,%1,%2,%3"
655 [(set_attr "type" "vecfloat")])
658 (define_insn "altivec_vmsumubm"
659 [(set (match_operand:V4SI 0 "register_operand" "=v")
660 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
661 (match_operand:V16QI 2 "register_operand" "v")
662 (match_operand:V4SI 3 "register_operand" "v")] 65))]
664 "vmsumubm %0,%1,%2,%3"
665 [(set_attr "type" "veccomplex")])
667 (define_insn "altivec_vmsummbm"
668 [(set (match_operand:V4SI 0 "register_operand" "=v")
669 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
670 (match_operand:V16QI 2 "register_operand" "v")
671 (match_operand:V4SI 3 "register_operand" "v")] 66))]
673 "vmsumubm %0,%1,%2,%3"
674 [(set_attr "type" "veccomplex")])
676 (define_insn "altivec_vmsumuhm"
677 [(set (match_operand:V4SI 0 "register_operand" "=v")
678 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
679 (match_operand:V8HI 2 "register_operand" "v")
680 (match_operand:V4SI 3 "register_operand" "v")] 67))]
682 "vmsumuhm %0,%1,%2,%3"
683 [(set_attr "type" "veccomplex")])
685 (define_insn "altivec_vmsumshm"
686 [(set (match_operand:V4SI 0 "register_operand" "=v")
687 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
688 (match_operand:V8HI 2 "register_operand" "v")
689 (match_operand:V4SI 3 "register_operand" "v")] 68))]
691 "vmsumshm %0,%1,%2,%3"
692 [(set_attr "type" "veccomplex")])
694 (define_insn "altivec_vmsumuhs"
695 [(set (match_operand:V4SI 0 "register_operand" "=v")
696 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
697 (match_operand:V8HI 2 "register_operand" "v")
698 (match_operand:V4SI 3 "register_operand" "v")] 69))
699 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
701 "vmsumuhs %0,%1,%2,%3"
702 [(set_attr "type" "veccomplex")])
704 (define_insn "altivec_vmsumshs"
705 [(set (match_operand:V4SI 0 "register_operand" "=v")
706 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
707 (match_operand:V8HI 2 "register_operand" "v")
708 (match_operand:V4SI 3 "register_operand" "v")] 70))
709 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
711 "vmsumshs %0,%1,%2,%3"
712 [(set_attr "type" "veccomplex")])
714 (define_insn "umaxv16qi3"
715 [(set (match_operand:V16QI 0 "register_operand" "=v")
716 (umax:V16QI (match_operand:V16QI 1 "register_operand" "v")
717 (match_operand:V16QI 2 "register_operand" "v")))]
720 [(set_attr "type" "vecsimple")])
722 (define_insn "smaxv16qi3"
723 [(set (match_operand:V16QI 0 "register_operand" "=v")
724 (smax:V16QI (match_operand:V16QI 1 "register_operand" "v")
725 (match_operand:V16QI 2 "register_operand" "v")))]
728 [(set_attr "type" "vecsimple")])
730 (define_insn "umaxv8hi3"
731 [(set (match_operand:V8HI 0 "register_operand" "=v")
732 (umax:V8HI (match_operand:V8HI 1 "register_operand" "v")
733 (match_operand:V8HI 2 "register_operand" "v")))]
736 [(set_attr "type" "vecsimple")])
738 (define_insn "smaxv8hi3"
739 [(set (match_operand:V8HI 0 "register_operand" "=v")
740 (smax:V8HI (match_operand:V8HI 1 "register_operand" "v")
741 (match_operand:V8HI 2 "register_operand" "v")))]
744 [(set_attr "type" "vecsimple")])
746 (define_insn "umaxv4si3"
747 [(set (match_operand:V4SI 0 "register_operand" "=v")
748 (umax:V4SI (match_operand:V4SI 1 "register_operand" "v")
749 (match_operand:V4SI 2 "register_operand" "v")))]
752 [(set_attr "type" "vecsimple")])
754 (define_insn "smaxv4si3"
755 [(set (match_operand:V4SI 0 "register_operand" "=v")
756 (smax:V4SI (match_operand:V4SI 1 "register_operand" "v")
757 (match_operand:V4SI 2 "register_operand" "v")))]
760 [(set_attr "type" "vecsimple")])
762 (define_insn "smaxv4sf3"
763 [(set (match_operand:V4SF 0 "register_operand" "=v")
764 (smax:V4SF (match_operand:V4SF 1 "register_operand" "v")
765 (match_operand:V4SF 2 "register_operand" "v")))]
768 [(set_attr "type" "veccmp")])
770 (define_insn "altivec_vmhaddshs"
771 [(set (match_operand:V8HI 0 "register_operand" "=v")
772 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
773 (match_operand:V8HI 2 "register_operand" "v")
774 (match_operand:V8HI 3 "register_operand" "v")] 71))
775 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
777 "vmhaddshs %0,%1,%2,%3"
778 [(set_attr "type" "veccomplex")])
779 (define_insn "altivec_vmhraddshs"
780 [(set (match_operand:V8HI 0 "register_operand" "=v")
781 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
782 (match_operand:V8HI 2 "register_operand" "v")
783 (match_operand:V8HI 3 "register_operand" "v")] 72))
784 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
786 "vmhraddshs %0,%1,%2,%3"
787 [(set_attr "type" "veccomplex")])
788 (define_insn "altivec_vmladduhm"
789 [(set (match_operand:V8HI 0 "register_operand" "=v")
790 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
791 (match_operand:V8HI 2 "register_operand" "v")
792 (match_operand:V8HI 3 "register_operand" "v")] 73))]
794 "vmladduhm %0,%1,%2,%3"
795 [(set_attr "type" "veccomplex")])
797 (define_insn "altivec_vmrghb"
798 [(set (match_operand:V16QI 0 "register_operand" "=v")
799 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v")
800 (parallel [(const_int 8)
816 (match_operand:V16QI 2 "register_operand" "v")
820 [(set_attr "type" "vecperm")])
822 (define_insn "altivec_vmrghh"
823 [(set (match_operand:V8HI 0 "register_operand" "=v")
824 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v")
825 (parallel [(const_int 4)
833 (match_operand:V8HI 2 "register_operand" "v")
837 [(set_attr "type" "vecperm")])
839 (define_insn "altivec_vmrghw"
840 [(set (match_operand:V4SI 0 "register_operand" "=v")
841 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v")
842 (parallel [(const_int 2)
846 (match_operand:V4SI 2 "register_operand" "v")
850 [(set_attr "type" "vecperm")])
852 (define_insn "altivec_vmrglb"
853 [(set (match_operand:V16QI 0 "register_operand" "=v")
854 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v")
855 (parallel [(const_int 0)
871 (match_operand:V16QI 1 "register_operand" "v")
875 [(set_attr "type" "vecperm")])
877 (define_insn "altivec_vmrglh"
878 [(set (match_operand:V8HI 0 "register_operand" "=v")
879 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v")
880 (parallel [(const_int 0)
888 (match_operand:V8HI 1 "register_operand" "v")
892 [(set_attr "type" "vecperm")])
894 (define_insn "altivec_vmrglw"
895 [(set (match_operand:V4SI 0 "register_operand" "=v")
896 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v")
897 (parallel [(const_int 0)
901 (match_operand:V4SI 1 "register_operand" "v")
905 [(set_attr "type" "vecperm")])
907 (define_insn "uminv16qi3"
908 [(set (match_operand:V16QI 0 "register_operand" "=v")
909 (umin:V16QI (match_operand:V16QI 1 "register_operand" "v")
910 (match_operand:V16QI 2 "register_operand" "v")))]
913 [(set_attr "type" "vecsimple")])
915 (define_insn "sminv16qi3"
916 [(set (match_operand:V16QI 0 "register_operand" "=v")
917 (smin:V16QI (match_operand:V16QI 1 "register_operand" "v")
918 (match_operand:V16QI 2 "register_operand" "v")))]
921 [(set_attr "type" "vecsimple")])
923 (define_insn "uminv8hi3"
924 [(set (match_operand:V8HI 0 "register_operand" "=v")
925 (umin:V8HI (match_operand:V8HI 1 "register_operand" "v")
926 (match_operand:V8HI 2 "register_operand" "v")))]
929 [(set_attr "type" "vecsimple")])
931 (define_insn "sminv8hi3"
932 [(set (match_operand:V8HI 0 "register_operand" "=v")
933 (smin:V8HI (match_operand:V8HI 1 "register_operand" "v")
934 (match_operand:V8HI 2 "register_operand" "v")))]
937 [(set_attr "type" "vecsimple")])
939 (define_insn "uminv4si3"
940 [(set (match_operand:V4SI 0 "register_operand" "=v")
941 (umin:V4SI (match_operand:V4SI 1 "register_operand" "v")
942 (match_operand:V4SI 2 "register_operand" "v")))]
945 [(set_attr "type" "vecsimple")])
947 (define_insn "sminv4si3"
948 [(set (match_operand:V4SI 0 "register_operand" "=v")
949 (smin:V4SI (match_operand:V4SI 1 "register_operand" "v")
950 (match_operand:V4SI 2 "register_operand" "v")))]
953 [(set_attr "type" "vecsimple")])
955 (define_insn "sminv4sf3"
956 [(set (match_operand:V4SF 0 "register_operand" "=v")
957 (smin:V4SF (match_operand:V4SF 1 "register_operand" "v")
958 (match_operand:V4SF 2 "register_operand" "v")))]
961 [(set_attr "type" "veccmp")])
963 (define_insn "altivec_vmuleub"
964 [(set (match_operand:V8HI 0 "register_operand" "=v")
965 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
966 (match_operand:V16QI 2 "register_operand" "v")] 83))]
969 [(set_attr "type" "veccomplex")])
971 (define_insn "altivec_vmulesb"
972 [(set (match_operand:V8HI 0 "register_operand" "=v")
973 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
974 (match_operand:V16QI 2 "register_operand" "v")] 84))]
977 [(set_attr "type" "veccomplex")])
979 (define_insn "altivec_vmuleuh"
980 [(set (match_operand:V4SI 0 "register_operand" "=v")
981 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
982 (match_operand:V8HI 2 "register_operand" "v")] 85))]
985 [(set_attr "type" "veccomplex")])
987 (define_insn "altivec_vmulesh"
988 [(set (match_operand:V4SI 0 "register_operand" "=v")
989 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
990 (match_operand:V8HI 2 "register_operand" "v")] 86))]
993 [(set_attr "type" "veccomplex")])
995 (define_insn "altivec_vmuloub"
996 [(set (match_operand:V8HI 0 "register_operand" "=v")
997 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
998 (match_operand:V16QI 2 "register_operand" "v")] 87))]
1001 [(set_attr "type" "veccomplex")])
1003 (define_insn "altivec_vmulosb"
1004 [(set (match_operand:V8HI 0 "register_operand" "=v")
1005 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
1006 (match_operand:V16QI 2 "register_operand" "v")] 88))]
1009 [(set_attr "type" "veccomplex")])
1011 (define_insn "altivec_vmulouh"
1012 [(set (match_operand:V4SI 0 "register_operand" "=v")
1013 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
1014 (match_operand:V8HI 2 "register_operand" "v")] 89))]
1017 [(set_attr "type" "veccomplex")])
1019 (define_insn "altivec_vmulosh"
1020 [(set (match_operand:V4SI 0 "register_operand" "=v")
1021 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
1022 (match_operand:V8HI 2 "register_operand" "v")] 90))]
1025 [(set_attr "type" "veccomplex")])
1027 (define_insn "altivec_vnor"
1028 [(set (match_operand:V4SI 0 "register_operand" "=v")
1029 (not:V4SI (ior:V4SI (match_operand:V4SI 1 "register_operand" "v")
1030 (match_operand:V4SI 2 "register_operand" "v"))))]
1033 [(set_attr "type" "vecsimple")])
1035 (define_insn "iorv4si3"
1036 [(set (match_operand:V4SI 0 "register_operand" "=v")
1037 (ior:V4SI (match_operand:V4SI 1 "register_operand" "v")
1038 (match_operand:V4SI 2 "register_operand" "v")))]
1041 [(set_attr "type" "vecsimple")])
1043 (define_insn "altivec_vpkuhum"
1044 [(set (match_operand:V16QI 0 "register_operand" "=v")
1045 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1046 (match_operand:V8HI 2 "register_operand" "v")] 93))]
1049 [(set_attr "type" "vecperm")])
1051 (define_insn "altivec_vpkuwum"
1052 [(set (match_operand:V8HI 0 "register_operand" "=v")
1053 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1054 (match_operand:V4SI 2 "register_operand" "v")] 94))]
1057 [(set_attr "type" "vecperm")])
1059 (define_insn "altivec_vpkpx"
1060 [(set (match_operand:V8HI 0 "register_operand" "=v")
1061 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1062 (match_operand:V4SI 2 "register_operand" "v")] 95))]
1065 [(set_attr "type" "vecperm")])
1067 (define_insn "altivec_vpkuhss"
1068 [(set (match_operand:V16QI 0 "register_operand" "=v")
1069 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1070 (match_operand:V8HI 2 "register_operand" "v")] 96))
1071 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1074 [(set_attr "type" "vecperm")])
1076 (define_insn "altivec_vpkshss"
1077 [(set (match_operand:V16QI 0 "register_operand" "=v")
1078 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1079 (match_operand:V8HI 2 "register_operand" "v")] 97))
1080 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1083 [(set_attr "type" "vecperm")])
1085 (define_insn "altivec_vpkuwss"
1086 [(set (match_operand:V8HI 0 "register_operand" "=v")
1087 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1088 (match_operand:V4SI 2 "register_operand" "v")] 98))
1089 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1092 [(set_attr "type" "vecperm")])
1094 (define_insn "altivec_vpkswss"
1095 [(set (match_operand:V8HI 0 "register_operand" "=v")
1096 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1097 (match_operand:V4SI 2 "register_operand" "v")] 99))
1098 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1101 [(set_attr "type" "vecperm")])
1103 (define_insn "altivec_vpkuhus"
1104 [(set (match_operand:V16QI 0 "register_operand" "=v")
1105 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1106 (match_operand:V8HI 2 "register_operand" "v")] 100))
1107 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1110 [(set_attr "type" "vecperm")])
1112 (define_insn "altivec_vpkshus"
1113 [(set (match_operand:V16QI 0 "register_operand" "=v")
1114 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1115 (match_operand:V8HI 2 "register_operand" "v")] 101))
1116 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1119 [(set_attr "type" "vecperm")])
1121 (define_insn "altivec_vpkuwus"
1122 [(set (match_operand:V8HI 0 "register_operand" "=v")
1123 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1124 (match_operand:V4SI 2 "register_operand" "v")] 102))
1125 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1128 [(set_attr "type" "vecperm")])
1130 (define_insn "altivec_vpkswus"
1131 [(set (match_operand:V8HI 0 "register_operand" "=v")
1132 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1133 (match_operand:V4SI 2 "register_operand" "v")] 103))
1134 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1137 [(set_attr "type" "vecperm")])
1139 (define_insn "altivec_vrlb"
1140 [(set (match_operand:V16QI 0 "register_operand" "=v")
1141 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1142 (match_operand:V16QI 2 "register_operand" "v")] 104))]
1145 [(set_attr "type" "vecsimple")])
1147 (define_insn "altivec_vrlh"
1148 [(set (match_operand:V8HI 0 "register_operand" "=v")
1149 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1150 (match_operand:V8HI 2 "register_operand" "v")] 105))]
1153 [(set_attr "type" "vecsimple")])
1155 (define_insn "altivec_vrlw"
1156 [(set (match_operand:V4SI 0 "register_operand" "=v")
1157 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1158 (match_operand:V4SI 2 "register_operand" "v")] 106))]
1161 [(set_attr "type" "vecsimple")])
1163 (define_insn "altivec_vslb"
1164 [(set (match_operand:V16QI 0 "register_operand" "=v")
1165 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1166 (match_operand:V16QI 2 "register_operand" "v")] 107))]
1169 [(set_attr "type" "vecsimple")])
1171 (define_insn "altivec_vslh"
1172 [(set (match_operand:V8HI 0 "register_operand" "=v")
1173 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1174 (match_operand:V8HI 2 "register_operand" "v")] 108))]
1177 [(set_attr "type" "vecsimple")])
1179 (define_insn "altivec_vslw"
1180 [(set (match_operand:V4SI 0 "register_operand" "=v")
1181 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1182 (match_operand:V4SI 2 "register_operand" "v")] 109))]
1185 [(set_attr "type" "vecsimple")])
1187 (define_insn "altivec_vslw_v4sf"
1188 [(set (match_operand:V4SF 0 "register_operand" "=v")
1189 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1190 (match_operand:V4SF 2 "register_operand" "v")] 109))]
1193 [(set_attr "type" "vecsimple")])
1195 (define_insn "altivec_vsl"
1196 [(set (match_operand:V4SI 0 "register_operand" "=v")
1197 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1198 (match_operand:V4SI 2 "register_operand" "v")] 110))]
1201 [(set_attr "type" "vecperm")])
1203 (define_insn "altivec_vslo"
1204 [(set (match_operand:V4SI 0 "register_operand" "=v")
1205 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1206 (match_operand:V4SI 2 "register_operand" "v")] 111))]
1209 [(set_attr "type" "vecperm")])
1211 (define_insn "altivec_vsrb"
1212 [(set (match_operand:V16QI 0 "register_operand" "=v")
1213 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1214 (match_operand:V16QI 2 "register_operand" "v")] 112))]
1217 [(set_attr "type" "vecsimple")])
1219 (define_insn "altivec_vsrh"
1220 [(set (match_operand:V8HI 0 "register_operand" "=v")
1221 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1222 (match_operand:V8HI 2 "register_operand" "v")] 113))]
1225 [(set_attr "type" "vecsimple")])
1227 (define_insn "altivec_vsrw"
1228 [(set (match_operand:V4SI 0 "register_operand" "=v")
1229 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1230 (match_operand:V4SI 2 "register_operand" "v")] 114))]
1233 [(set_attr "type" "vecsimple")])
1235 (define_insn "altivec_vsrab"
1236 [(set (match_operand:V16QI 0 "register_operand" "=v")
1237 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1238 (match_operand:V16QI 2 "register_operand" "v")] 115))]
1241 [(set_attr "type" "vecsimple")])
1243 (define_insn "altivec_vsrah"
1244 [(set (match_operand:V8HI 0 "register_operand" "=v")
1245 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1246 (match_operand:V8HI 2 "register_operand" "v")] 116))]
1249 [(set_attr "type" "vecsimple")])
1251 (define_insn "altivec_vsraw"
1252 [(set (match_operand:V4SI 0 "register_operand" "=v")
1253 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1254 (match_operand:V4SI 2 "register_operand" "v")] 117))]
1257 [(set_attr "type" "vecsimple")])
1259 (define_insn "altivec_vsr"
1260 [(set (match_operand:V4SI 0 "register_operand" "=v")
1261 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1262 (match_operand:V4SI 2 "register_operand" "v")] 118))]
1265 [(set_attr "type" "vecperm")])
1267 (define_insn "altivec_vsro"
1268 [(set (match_operand:V4SI 0 "register_operand" "=v")
1269 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1270 (match_operand:V4SI 2 "register_operand" "v")] 119))]
1273 [(set_attr "type" "vecperm")])
1275 (define_insn "subv16qi3"
1276 [(set (match_operand:V16QI 0 "register_operand" "=v")
1277 (minus:V16QI (match_operand:V16QI 1 "register_operand" "v")
1278 (match_operand:V16QI 2 "register_operand" "v")))]
1281 [(set_attr "type" "vecsimple")])
1283 (define_insn "subv8hi3"
1284 [(set (match_operand:V8HI 0 "register_operand" "=v")
1285 (minus:V8HI (match_operand:V8HI 1 "register_operand" "v")
1286 (match_operand:V8HI 2 "register_operand" "v")))]
1289 [(set_attr "type" "vecsimple")])
1291 (define_insn "subv4si3"
1292 [(set (match_operand:V4SI 0 "register_operand" "=v")
1293 (minus:V4SI (match_operand:V4SI 1 "register_operand" "v")
1294 (match_operand:V4SI 2 "register_operand" "v")))]
1297 [(set_attr "type" "vecsimple")])
1299 (define_insn "subv4sf3"
1300 [(set (match_operand:V4SF 0 "register_operand" "=v")
1301 (minus:V4SF (match_operand:V4SF 1 "register_operand" "v")
1302 (match_operand:V4SF 2 "register_operand" "v")))]
1305 [(set_attr "type" "vecfloat")])
1307 (define_insn "altivec_vsubcuw"
1308 [(set (match_operand:V4SI 0 "register_operand" "=v")
1309 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1310 (match_operand:V4SI 2 "register_operand" "v")] 124))]
1313 [(set_attr "type" "vecsimple")])
1315 (define_insn "altivec_vsububs"
1316 [(set (match_operand:V16QI 0 "register_operand" "=v")
1317 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1318 (match_operand:V16QI 2 "register_operand" "v")] 125))
1319 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1322 [(set_attr "type" "vecsimple")])
1324 (define_insn "altivec_vsubsbs"
1325 [(set (match_operand:V16QI 0 "register_operand" "=v")
1326 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1327 (match_operand:V16QI 2 "register_operand" "v")] 126))
1328 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1331 [(set_attr "type" "vecsimple")])
1333 (define_insn "altivec_vsubuhs"
1334 [(set (match_operand:V8HI 0 "register_operand" "=v")
1335 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1336 (match_operand:V8HI 2 "register_operand" "v")] 127))
1337 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1340 [(set_attr "type" "vecsimple")])
1342 (define_insn "altivec_vsubshs"
1343 [(set (match_operand:V8HI 0 "register_operand" "=v")
1344 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1345 (match_operand:V8HI 2 "register_operand" "v")] 128))
1346 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1349 [(set_attr "type" "vecsimple")])
1351 (define_insn "altivec_vsubuws"
1352 [(set (match_operand:V4SI 0 "register_operand" "=v")
1353 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1354 (match_operand:V4SI 2 "register_operand" "v")] 129))
1355 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1358 [(set_attr "type" "vecsimple")])
1360 (define_insn "altivec_vsubsws"
1361 [(set (match_operand:V4SI 0 "register_operand" "=v")
1362 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1363 (match_operand:V4SI 2 "register_operand" "v")] 130))
1364 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1367 [(set_attr "type" "vecsimple")])
1369 (define_insn "altivec_vsum4ubs"
1370 [(set (match_operand:V4SI 0 "register_operand" "=v")
1371 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
1372 (match_operand:V4SI 2 "register_operand" "v")] 131))
1373 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1376 [(set_attr "type" "veccomplex")])
1378 (define_insn "altivec_vsum4sbs"
1379 [(set (match_operand:V4SI 0 "register_operand" "=v")
1380 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
1381 (match_operand:V4SI 2 "register_operand" "v")] 132))
1382 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1385 [(set_attr "type" "veccomplex")])
1387 (define_insn "altivec_vsum4shs"
1388 [(set (match_operand:V4SI 0 "register_operand" "=v")
1389 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
1390 (match_operand:V4SI 2 "register_operand" "v")] 133))
1391 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1394 [(set_attr "type" "veccomplex")])
1396 (define_insn "altivec_vsum2sws"
1397 [(set (match_operand:V4SI 0 "register_operand" "=v")
1398 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1399 (match_operand:V4SI 2 "register_operand" "v")] 134))
1400 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1403 [(set_attr "type" "veccomplex")])
1405 (define_insn "altivec_vsumsws"
1406 [(set (match_operand:V4SI 0 "register_operand" "=v")
1407 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1408 (match_operand:V4SI 2 "register_operand" "v")] 135))
1409 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1412 [(set_attr "type" "veccomplex")])
1415 (define_insn "xorv4si3"
1416 [(set (match_operand:V4SI 0 "register_operand" "=v")
1417 (xor:V4SI (match_operand:V4SI 1 "register_operand" "v")
1418 (match_operand:V4SI 2 "register_operand" "v")))]
1421 [(set_attr "type" "vecsimple")])
1423 (define_insn "xorv8hi3"
1424 [(set (match_operand:V8HI 0 "register_operand" "=v")
1425 (xor:V8HI (match_operand:V8HI 1 "register_operand" "v")
1426 (match_operand:V8HI 2 "register_operand" "v")))]
1429 [(set_attr "type" "vecsimple")])
1431 (define_insn "xorv16qi3"
1432 [(set (match_operand:V16QI 0 "register_operand" "=v")
1433 (xor:V16QI (match_operand:V16QI 1 "register_operand" "v")
1434 (match_operand:V16QI 2 "register_operand" "v")))]
1437 [(set_attr "type" "vecsimple")])
1439 (define_insn "altivec_vspltb"
1440 [(set (match_operand:V16QI 0 "register_operand" "=v")
1441 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1442 (match_operand:QI 2 "immediate_operand" "i")] 136))]
1445 [(set_attr "type" "vecperm")])
1446 ;; End of vector xor's
1448 (define_insn "altivec_vsplth"
1449 [(set (match_operand:V8HI 0 "register_operand" "=v")
1450 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1451 (match_operand:QI 2 "immediate_operand" "i")] 137))]
1454 [(set_attr "type" "vecperm")])
1456 (define_insn "altivec_vspltw"
1457 [(set (match_operand:V4SI 0 "register_operand" "=v")
1458 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1459 (match_operand:QI 2 "immediate_operand" "i")] 138))]
1462 [(set_attr "type" "vecperm")])
1464 (define_insn "altivec_vspltisb"
1465 [(set (match_operand:V16QI 0 "register_operand" "=v")
1466 (unspec:V16QI [(match_operand:QI 1 "immediate_operand" "i")]
1470 [(set_attr "type" "vecperm")])
1472 (define_insn "altivec_vspltish"
1473 [(set (match_operand:V8HI 0 "register_operand" "=v")
1474 (unspec:V8HI [(match_operand:QI 1 "immediate_operand" "i")]
1478 [(set_attr "type" "vecperm")])
1480 (define_insn "altivec_vspltisw"
1481 [(set (match_operand:V4SI 0 "register_operand" "=v")
1482 (unspec:V4SI [(match_operand:QI 1 "immediate_operand" "i")]
1486 [(set_attr "type" "vecperm")])
1488 (define_insn "altivec_vspltisw_v4sf"
1489 [(set (match_operand:V4SF 0 "register_operand" "=v")
1490 (unspec:V4SF [(match_operand:QI 1 "immediate_operand" "i")] 142))]
1493 [(set_attr "type" "vecperm")])
1495 (define_insn "ftruncv4sf2"
1496 [(set (match_operand:V4SF 0 "register_operand" "=v")
1497 (fix:V4SF (match_operand:V4SF 1 "register_operand" "v")))]
1500 [(set_attr "type" "vecfloat")])
1502 (define_insn "altivec_vperm_4si"
1503 [(set (match_operand:V4SI 0 "register_operand" "=v")
1504 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1505 (match_operand:V4SI 2 "register_operand" "v")
1506 (match_operand:V16QI 3 "register_operand" "v")] 144))]
1509 [(set_attr "type" "vecperm")])
1511 (define_insn "altivec_vperm_4sf"
1512 [(set (match_operand:V4SF 0 "register_operand" "=v")
1513 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1514 (match_operand:V4SF 2 "register_operand" "v")
1515 (match_operand:V16QI 3 "register_operand" "v")] 145))]
1518 [(set_attr "type" "vecperm")])
1520 (define_insn "altivec_vperm_8hi"
1521 [(set (match_operand:V8HI 0 "register_operand" "=v")
1522 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1523 (match_operand:V8HI 2 "register_operand" "v")
1524 (match_operand:V16QI 3 "register_operand" "v")] 146))]
1527 [(set_attr "type" "vecperm")])
1529 (define_insn "altivec_vperm_16qi"
1530 [(set (match_operand:V16QI 0 "register_operand" "=v")
1531 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1532 (match_operand:V16QI 2 "register_operand" "v")
1533 (match_operand:V16QI 3 "register_operand" "v")] 147))]
1536 [(set_attr "type" "vecperm")])
1538 (define_insn "altivec_vrfip"
1539 [(set (match_operand:V4SF 0 "register_operand" "=v")
1540 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 148))]
1543 [(set_attr "type" "vecfloat")])
1545 (define_insn "altivec_vrfin"
1546 [(set (match_operand:V4SF 0 "register_operand" "=v")
1547 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 149))]
1550 [(set_attr "type" "vecfloat")])
1552 (define_insn "altivec_vrfim"
1553 [(set (match_operand:V4SF 0 "register_operand" "=v")
1554 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 150))]
1557 [(set_attr "type" "vecfloat")])
1559 (define_insn "altivec_vcfux"
1560 [(set (match_operand:V4SF 0 "register_operand" "=v")
1561 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1562 (match_operand:QI 2 "immediate_operand" "i")] 151))]
1565 [(set_attr "type" "vecfloat")])
1567 (define_insn "altivec_vcfsx"
1568 [(set (match_operand:V4SF 0 "register_operand" "=v")
1569 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1570 (match_operand:QI 2 "immediate_operand" "i")] 152))]
1573 [(set_attr "type" "vecfloat")])
1575 (define_insn "altivec_vctuxs"
1576 [(set (match_operand:V4SI 0 "register_operand" "=v")
1577 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
1578 (match_operand:QI 2 "immediate_operand" "i")] 153))
1579 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1582 [(set_attr "type" "vecfloat")])
1584 (define_insn "altivec_vctsxs"
1585 [(set (match_operand:V4SI 0 "register_operand" "=v")
1586 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
1587 (match_operand:QI 2 "immediate_operand" "i")] 154))
1588 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
1591 [(set_attr "type" "vecfloat")])
1593 (define_insn "altivec_vlogefp"
1594 [(set (match_operand:V4SF 0 "register_operand" "=v")
1595 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 155))]
1598 [(set_attr "type" "vecfloat")])
1600 (define_insn "altivec_vexptefp"
1601 [(set (match_operand:V4SF 0 "register_operand" "=v")
1602 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 156))]
1605 [(set_attr "type" "vecfloat")])
1607 (define_insn "altivec_vrsqrtefp"
1608 [(set (match_operand:V4SF 0 "register_operand" "=v")
1609 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 157))]
1612 [(set_attr "type" "vecfloat")])
1614 (define_insn "altivec_vrefp"
1615 [(set (match_operand:V4SF 0 "register_operand" "=v")
1616 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 158))]
1619 [(set_attr "type" "vecfloat")])
1621 (define_insn "altivec_vsel_4si"
1622 [(set (match_operand:V4SI 0 "register_operand" "=v")
1623 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1624 (match_operand:V4SI 2 "register_operand" "v")
1625 (match_operand:V4SI 3 "register_operand" "v")] 159))]
1628 [(set_attr "type" "vecperm")])
1630 (define_insn "altivec_vsel_4sf"
1631 [(set (match_operand:V4SF 0 "register_operand" "=v")
1632 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1633 (match_operand:V4SF 2 "register_operand" "v")
1634 (match_operand:V4SI 3 "register_operand" "v")] 160))]
1637 [(set_attr "type" "vecperm")])
1639 (define_insn "altivec_vsel_8hi"
1640 [(set (match_operand:V8HI 0 "register_operand" "=v")
1641 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1642 (match_operand:V8HI 2 "register_operand" "v")
1643 (match_operand:V8HI 3 "register_operand" "v")] 161))]
1646 [(set_attr "type" "vecperm")])
1648 (define_insn "altivec_vsel_16qi"
1649 [(set (match_operand:V16QI 0 "register_operand" "=v")
1650 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1651 (match_operand:V16QI 2 "register_operand" "v")
1652 (match_operand:V16QI 3 "register_operand" "v")] 162))]
1655 [(set_attr "type" "vecperm")])
1657 (define_insn "altivec_vsldoi_4si"
1658 [(set (match_operand:V4SI 0 "register_operand" "=v")
1659 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1660 (match_operand:V4SI 2 "register_operand" "v")
1661 (match_operand:QI 3 "immediate_operand" "i")] 163))]
1663 "vsldoi %0,%1,%2,%3"
1664 [(set_attr "type" "vecperm")])
1666 (define_insn "altivec_vsldoi_4sf"
1667 [(set (match_operand:V4SF 0 "register_operand" "=v")
1668 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1669 (match_operand:V4SF 2 "register_operand" "v")
1670 (match_operand:QI 3 "immediate_operand" "i")] 164))]
1672 "vsldoi %0,%1,%2,%3"
1673 [(set_attr "type" "vecperm")])
1675 (define_insn "altivec_vsldoi_8hi"
1676 [(set (match_operand:V8HI 0 "register_operand" "=v")
1677 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1678 (match_operand:V8HI 2 "register_operand" "v")
1679 (match_operand:QI 3 "immediate_operand" "i")] 165))]
1681 "vsldoi %0,%1,%2,%3"
1682 [(set_attr "type" "vecperm")])
1684 (define_insn "altivec_vsldoi_16qi"
1685 [(set (match_operand:V16QI 0 "register_operand" "=v")
1686 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1687 (match_operand:V16QI 2 "register_operand" "v")
1688 (match_operand:QI 3 "immediate_operand" "i")] 166))]
1690 "vsldoi %0,%1,%2,%3"
1691 [(set_attr "type" "vecperm")])
1693 (define_insn "altivec_vupkhsb"
1694 [(set (match_operand:V8HI 0 "register_operand" "=v")
1695 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 167))]
1698 [(set_attr "type" "vecperm")])
1700 (define_insn "altivec_vupkhpx"
1701 [(set (match_operand:V4SI 0 "register_operand" "=v")
1702 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 168))]
1705 [(set_attr "type" "vecperm")])
1707 (define_insn "altivec_vupkhsh"
1708 [(set (match_operand:V4SI 0 "register_operand" "=v")
1709 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 169))]
1712 [(set_attr "type" "vecperm")])
1714 (define_insn "altivec_vupklsb"
1715 [(set (match_operand:V8HI 0 "register_operand" "=v")
1716 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 170))]
1719 [(set_attr "type" "vecperm")])
1721 (define_insn "altivec_vupklpx"
1722 [(set (match_operand:V4SI 0 "register_operand" "=v")
1723 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 171))]
1726 [(set_attr "type" "vecperm")])
1728 (define_insn "altivec_vupklsh"
1729 [(set (match_operand:V4SI 0 "register_operand" "=v")
1730 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 172))]
1733 [(set_attr "type" "vecperm")])
1735 ;; AltiVec predicates.
1737 (define_expand "cr6_test_for_zero"
1738 [(set (match_operand:SI 0 "register_operand" "=r")
1744 (define_expand "cr6_test_for_zero_reverse"
1745 [(set (match_operand:SI 0 "register_operand" "=r")
1748 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
1752 (define_expand "cr6_test_for_lt"
1753 [(set (match_operand:SI 0 "register_operand" "=r")
1759 (define_expand "cr6_test_for_lt_reverse"
1760 [(set (match_operand:SI 0 "register_operand" "=r")
1763 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
1767 ;; We can get away with generating the opcode on the fly (%3 below)
1768 ;; because all the predicates have the same scheduling parameters.
1770 (define_insn "altivec_predicate_v4si"
1772 (unspec:CC [(match_operand:V4SI 1 "register_operand" "v")
1773 (match_operand:V4SI 2 "register_operand" "v")
1774 (match_operand 3 "any_operand" "")] 173))
1775 (clobber (match_scratch:V4SI 0 "=v"))]
1778 [(set_attr "type" "veccmp")])
1780 (define_insn "altivec_predicate_v4sf"
1782 (unspec:CC [(match_operand:V4SF 1 "register_operand" "v")
1783 (match_operand:V4SF 2 "register_operand" "v")
1784 (match_operand 3 "any_operand" "")] 174))
1785 (clobber (match_scratch:V4SF 0 "=v"))]
1788 [(set_attr "type" "veccmp")])
1790 (define_insn "altivec_predicate_v8hi"
1792 (unspec:CC [(match_operand:V8HI 1 "register_operand" "v")
1793 (match_operand:V8HI 2 "register_operand" "v")
1794 (match_operand 3 "any_operand" "")] 175))
1795 (clobber (match_scratch:V8HI 0 "=v"))]
1798 [(set_attr "type" "veccmp")])
1800 (define_insn "altivec_predicate_v16qi"
1802 (unspec:CC [(match_operand:V16QI 1 "register_operand" "v")
1803 (match_operand:V16QI 2 "register_operand" "v")
1804 (match_operand 3 "any_operand" "")] 175))
1805 (clobber (match_scratch:V16QI 0 "=v"))]
1808 [(set_attr "type" "veccmp")])
1810 (define_insn "altivec_mtvscr"
1813 [(match_operand:V4SI 0 "register_operand" "v")] 186))]
1816 [(set_attr "type" "vecsimple")])
1818 (define_insn "altivec_mfvscr"
1819 [(set (match_operand:V8HI 0 "register_operand" "=v")
1820 (unspec_volatile:V8HI [(reg:SI 110)] 187))]
1823 [(set_attr "type" "vecsimple")])
1825 (define_insn "altivec_dssall"
1826 [(unspec [(const_int 0)] 188)]
1829 [(set_attr "type" "vecsimple")])
1831 (define_insn "altivec_dss"
1832 [(unspec [(match_operand:QI 0 "immediate_operand" "i")] 189)]
1835 [(set_attr "type" "vecsimple")])
1837 (define_insn "altivec_dst"
1838 [(unspec [(match_operand:SI 0 "register_operand" "b")
1839 (match_operand:SI 1 "register_operand" "r")
1840 (match_operand:QI 2 "immediate_operand" "i")] 190)]
1843 [(set_attr "type" "vecsimple")])
1845 (define_insn "altivec_dstt"
1846 [(unspec [(match_operand:SI 0 "register_operand" "b")
1847 (match_operand:SI 1 "register_operand" "r")
1848 (match_operand:QI 2 "immediate_operand" "i")] 191)]
1851 [(set_attr "type" "vecsimple")])
1853 (define_insn "altivec_dstst"
1854 [(unspec [(match_operand:SI 0 "register_operand" "b")
1855 (match_operand:SI 1 "register_operand" "r")
1856 (match_operand:QI 2 "immediate_operand" "i")] 192)]
1859 [(set_attr "type" "vecsimple")])
1861 (define_insn "altivec_dststt"
1862 [(unspec [(match_operand:SI 0 "register_operand" "b")
1863 (match_operand:SI 1 "register_operand" "r")
1864 (match_operand:QI 2 "immediate_operand" "i")] 193)]
1867 [(set_attr "type" "vecsimple")])
1869 (define_insn "altivec_lvsl"
1870 [(set (match_operand:V16QI 0 "register_operand" "=v")
1871 (unspec:V16QI [(match_operand:SI 1 "register_operand" "b")
1872 (match_operand:SI 2 "register_operand" "r")] 194))]
1875 [(set_attr "type" "vecload")])
1877 (define_insn "altivec_lvsr"
1878 [(set (match_operand:V16QI 0 "register_operand" "=v")
1879 (unspec:V16QI [(match_operand:SI 1 "register_operand" "b")
1880 (match_operand:SI 2 "register_operand" "r")] 195))]
1883 [(set_attr "type" "vecload")])
1885 ;; Parallel some of the LVE* and STV*'s with unspecs because some have
1886 ;; identical rtl but different instructions-- and gcc gets confused.
1888 (define_insn "altivec_lvebx"
1890 [(set (match_operand:V16QI 0 "register_operand" "=v")
1891 (mem:V16QI (plus:SI (match_operand:SI 1 "register_operand" "b")
1892 (match_operand:SI 2 "register_operand" "r"))))
1893 (unspec [(const_int 0)] 196)])]
1896 [(set_attr "type" "vecload")])
1898 (define_insn "altivec_lvehx"
1900 [(set (match_operand:V8HI 0 "register_operand" "=v")
1902 (and:SI (plus:SI (match_operand:SI 1 "register_operand" "b")
1903 (match_operand:SI 2 "register_operand" "r"))
1905 (unspec [(const_int 0)] 197)])]
1908 [(set_attr "type" "vecload")])
1910 (define_insn "altivec_lvewx"
1912 [(set (match_operand:V4SI 0 "register_operand" "=v")
1914 (and:SI (plus:SI (match_operand:SI 1 "register_operand" "b")
1915 (match_operand:SI 2 "register_operand" "r"))
1917 (unspec [(const_int 0)] 198)])]
1920 [(set_attr "type" "vecload")])
1922 (define_insn "altivec_lvxl"
1924 [(set (match_operand:V4SI 0 "register_operand" "=v")
1925 (mem:V4SI (plus:SI (match_operand:SI 1 "register_operand" "b")
1926 (match_operand:SI 2 "register_operand" "r"))))
1927 (unspec [(const_int 0)] 213)])]
1930 [(set_attr "type" "vecload")])
1932 (define_insn "altivec_lvx"
1933 [(set (match_operand:V4SI 0 "register_operand" "=v")
1934 (mem:V4SI (plus:SI (match_operand:SI 1 "register_operand" "b")
1935 (match_operand:SI 2 "register_operand" "r"))))]
1938 [(set_attr "type" "vecload")])
1940 (define_insn "altivec_stvx"
1943 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
1944 (match_operand:SI 1 "register_operand" "r"))
1946 (match_operand:V4SI 2 "register_operand" "v"))
1947 (unspec [(const_int 0)] 201)])]
1950 [(set_attr "type" "vecstore")])
1952 (define_insn "altivec_stvxl"
1955 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
1956 (match_operand:SI 1 "register_operand" "r"))
1958 (match_operand:V4SI 2 "register_operand" "v"))
1959 (unspec [(const_int 0)] 202)])]
1962 [(set_attr "type" "vecstore")])
1964 (define_insn "altivec_stvebx"
1967 (plus:SI (match_operand:SI 0 "register_operand" "b")
1968 (match_operand:SI 1 "register_operand" "r")))
1969 (match_operand:V16QI 2 "register_operand" "v"))
1970 (unspec [(const_int 0)] 203)])]
1973 [(set_attr "type" "vecstore")])
1975 (define_insn "altivec_stvehx"
1978 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
1979 (match_operand:SI 1 "register_operand" "r"))
1981 (match_operand:V8HI 2 "register_operand" "v"))
1982 (unspec [(const_int 0)] 204)])]
1985 [(set_attr "type" "vecstore")])
1987 (define_insn "altivec_stvewx"
1990 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
1991 (match_operand:SI 1 "register_operand" "r"))
1993 (match_operand:V4SI 2 "register_operand" "v"))
1994 (unspec [(const_int 0)] 205)])]
1997 [(set_attr "type" "vecstore")])
1999 (define_insn "absv16qi2"
2000 [(set (match_operand:V16QI 0 "register_operand" "=v")
2001 (abs:V16QI (match_operand:V16QI 1 "register_operand" "v")))
2002 (clobber (match_scratch:V16QI 2 "=&v"))
2003 (clobber (match_scratch:V16QI 3 "=&v"))]
2005 "vspltisb %2,0\;vsububm %3,%2,%1\;vmaxsb %0,%1,%3"
2006 [(set_attr "type" "vecsimple")
2007 (set_attr "length" "12")])
2009 (define_insn "absv8hi2"
2010 [(set (match_operand:V8HI 0 "register_operand" "=v")
2011 (abs:V8HI (match_operand:V8HI 1 "register_operand" "v")))
2012 (clobber (match_scratch:V8HI 2 "=&v"))
2013 (clobber (match_scratch:V8HI 3 "=&v"))]
2015 "vspltisb %2,0\;vsubuhm %3,%2,%1\;vmaxsh %0,%1,%3"
2016 [(set_attr "type" "vecsimple")
2017 (set_attr "length" "12")])
2019 (define_insn "absv4si2"
2020 [(set (match_operand:V4SI 0 "register_operand" "=v")
2021 (abs:V4SI (match_operand:V4SI 1 "register_operand" "v")))
2022 (clobber (match_scratch:V4SI 2 "=&v"))
2023 (clobber (match_scratch:V4SI 3 "=&v"))]
2025 "vspltisb %2,0\;vsubuwm %3,%2,%1\;vmaxsw %0,%1,%3"
2026 [(set_attr "type" "vecsimple")
2027 (set_attr "length" "12")])
2029 (define_insn "absv4sf2"
2030 [(set (match_operand:V4SF 0 "register_operand" "=v")
2031 (abs:V4SF (match_operand:V4SF 1 "register_operand" "v")))
2032 (clobber (match_scratch:V4SF 2 "=&v"))
2033 (clobber (match_scratch:V4SF 3 "=&v"))]
2035 "vspltisw %2,-1\;vslw %3,%2,%2\;vandc %0,%1,%3"
2036 [(set_attr "type" "vecsimple")
2037 (set_attr "length" "12")])
2039 (define_insn "altivec_abss_v16qi"
2040 [(set (match_operand:V16QI 0 "register_operand" "=v")
2041 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")] 210))
2042 (clobber (match_scratch:V16QI 2 "=&v"))
2043 (clobber (match_scratch:V16QI 3 "=&v"))]
2045 "vspltisb %2,0\;vsubsbs %3,%2,%1\;vmaxsb %0,%1,%3"
2046 [(set_attr "type" "vecsimple")
2047 (set_attr "length" "12")])
2049 (define_insn "altivec_abss_v8hi"
2050 [(set (match_operand:V8HI 0 "register_operand" "=v")
2051 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")] 211))
2052 (clobber (match_scratch:V8HI 2 "=&v"))
2053 (clobber (match_scratch:V8HI 3 "=&v"))]
2055 "vspltisb %2,0\;vsubshs %3,%2,%1\;vmaxsh %0,%1,%3"
2056 [(set_attr "type" "vecsimple")
2057 (set_attr "length" "12")])
2059 (define_insn "altivec_abss_v4si"
2060 [(set (match_operand:V4SI 0 "register_operand" "=v")
2061 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")] 212))
2062 (clobber (match_scratch:V4SI 2 "=&v"))
2063 (clobber (match_scratch:V4SI 3 "=&v"))]
2065 "vspltisb %2,0\;vsubsws %3,%2,%1\;vmaxsw %0,%1,%3"
2066 [(set_attr "type" "vecsimple")
2067 (set_attr "length" "12")])