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, 51 Franklin Street, Fifth Floor, Boston,
20 ;; MA 02110-1301, USA.
42 (UNSPEC_VMHRADDSHS 72)
90 (UNSPEC_VRSQRTEFP 157)
103 (UNSPEC_PREDICATE 173)
114 (UNSPEC_SET_VSCR 213)
115 (UNSPEC_GET_VRSAVE 214)
116 (UNSPEC_REALIGN_LOAD 215)
117 (UNSPEC_REDUC_PLUS 217)
119 (UNSPEC_VCOND_V4SI 301)
120 (UNSPEC_VCOND_V4SF 302)
121 (UNSPEC_VCOND_V8HI 303)
122 (UNSPEC_VCOND_V16QI 304)
123 (UNSPEC_VCONDU_V4SI 305)
124 (UNSPEC_VCONDU_V8HI 306)
125 (UNSPEC_VCONDU_V16QI 307)
129 [(UNSPECV_SET_VRSAVE 30)
137 (define_mode_macro VI [V4SI V8HI V16QI])
138 ;; Short vec in modes
139 (define_mode_macro VIshort [V8HI V16QI])
141 (define_mode_macro VF [V4SF])
142 ;; Vec modes, pity mode macros are not composable
143 (define_mode_macro V [V4SI V8HI V16QI V4SF])
145 (define_mode_attr VI_char [(V4SI "w") (V8HI "h") (V16QI "b")])
147 ;; Generic LVX load instruction.
148 (define_insn "altivec_lvx_<mode>"
149 [(set (match_operand:V 0 "altivec_register_operand" "=v")
150 (match_operand:V 1 "memory_operand" "Z"))]
153 [(set_attr "type" "vecload")])
155 ;; Generic STVX store instruction.
156 (define_insn "altivec_stvx_<mode>"
157 [(set (match_operand:V 0 "memory_operand" "=Z")
158 (match_operand:V 1 "altivec_register_operand" "v"))]
161 [(set_attr "type" "vecstore")])
163 ;; Vector move instructions.
164 (define_expand "mov<mode>"
165 [(set (match_operand:V 0 "nonimmediate_operand" "")
166 (match_operand:V 1 "any_operand" ""))]
169 rs6000_emit_move (operands[0], operands[1], <MODE>mode);
173 (define_insn "*mov<mode>_internal"
174 [(set (match_operand:V 0 "nonimmediate_operand" "=Z,v,v,o,r,r,v")
175 (match_operand:V 1 "input_operand" "v,Z,v,r,o,r,W"))]
177 && (register_operand (operands[0], <MODE>mode)
178 || register_operand (operands[1], <MODE>mode))"
180 switch (which_alternative)
182 case 0: return "stvx %1,%y0";
183 case 1: return "lvx %0,%y1";
184 case 2: return "vor %0,%1,%1";
188 case 6: return output_vec_const_move (operands);
189 default: gcc_unreachable ();
192 [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")])
195 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
196 (match_operand:V4SI 1 "input_operand" ""))]
197 "TARGET_ALTIVEC && reload_completed
198 && gpr_or_gpr_p (operands[0], operands[1])"
201 rs6000_split_multireg_move (operands[0], operands[1]); DONE;
205 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
206 (match_operand:V8HI 1 "input_operand" ""))]
207 "TARGET_ALTIVEC && reload_completed
208 && gpr_or_gpr_p (operands[0], operands[1])"
210 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
213 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
214 (match_operand:V16QI 1 "input_operand" ""))]
215 "TARGET_ALTIVEC && reload_completed
216 && gpr_or_gpr_p (operands[0], operands[1])"
218 { rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
221 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
222 (match_operand:V4SF 1 "input_operand" ""))]
223 "TARGET_ALTIVEC && reload_completed
224 && gpr_or_gpr_p (operands[0], operands[1])"
227 rs6000_split_multireg_move (operands[0], operands[1]); DONE;
231 [(set (match_operand:VI 0 "altivec_register_operand" "")
232 (match_operand:VI 1 "easy_vector_constant_add_self" ""))]
233 "TARGET_ALTIVEC && reload_completed"
234 [(set (match_dup 0) (match_dup 3))
235 (set (match_dup 0) (plus:VI (match_dup 0)
238 rtx dup = gen_easy_altivec_constant (operands[1]);
241 /* Divide the operand of the resulting VEC_DUPLICATE, and use
242 simplify_rtx to make a CONST_VECTOR. */
243 XEXP (dup, 0) = simplify_const_binary_operation (ASHIFTRT, QImode,
244 XEXP (dup, 0), const1_rtx);
245 const_vec = simplify_rtx (dup);
247 if (GET_MODE (const_vec) == <MODE>mode)
248 operands[3] = const_vec;
250 operands[3] = gen_lowpart (<MODE>mode, const_vec);
253 (define_insn "get_vrsave_internal"
254 [(set (match_operand:SI 0 "register_operand" "=r")
255 (unspec:SI [(reg:SI 109)] UNSPEC_GET_VRSAVE))]
259 return "mfspr %0,256";
261 return "mfvrsave %0";
263 [(set_attr "type" "*")])
265 (define_insn "*set_vrsave_internal"
266 [(match_parallel 0 "vrsave_operation"
268 (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
269 (reg:SI 109)] UNSPECV_SET_VRSAVE))])]
273 return "mtspr 256,%1";
275 return "mtvrsave %1";
277 [(set_attr "type" "*")])
279 (define_insn "*save_world"
280 [(match_parallel 0 "save_world_operation"
281 [(clobber (match_operand:SI 1 "register_operand" "=l"))
282 (use (match_operand:SI 2 "call_operand" "s"))])]
283 "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT"
285 [(set_attr "type" "branch")
286 (set_attr "length" "4")])
288 (define_insn "*restore_world"
289 [(match_parallel 0 "restore_world_operation"
291 (use (match_operand:SI 1 "register_operand" "l"))
292 (use (match_operand:SI 2 "call_operand" "s"))
293 (clobber (match_operand:SI 3 "gpc_reg_operand" "=r"))])]
294 "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT"
297 ;; Simple binary operations.
300 (define_insn "add<mode>3"
301 [(set (match_operand:VI 0 "register_operand" "=v")
302 (plus:VI (match_operand:VI 1 "register_operand" "v")
303 (match_operand:VI 2 "register_operand" "v")))]
305 "vaddu<VI_char>m %0,%1,%2"
306 [(set_attr "type" "vecsimple")])
308 (define_insn "addv4sf3"
309 [(set (match_operand:V4SF 0 "register_operand" "=v")
310 (plus:V4SF (match_operand:V4SF 1 "register_operand" "v")
311 (match_operand:V4SF 2 "register_operand" "v")))]
314 [(set_attr "type" "vecfloat")])
316 (define_insn "altivec_vaddcuw"
317 [(set (match_operand:V4SI 0 "register_operand" "=v")
318 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
319 (match_operand:V4SI 2 "register_operand" "v")]
323 [(set_attr "type" "vecsimple")])
325 (define_insn "altivec_vaddu<VI_char>s"
326 [(set (match_operand:VI 0 "register_operand" "=v")
327 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
328 (match_operand:VI 2 "register_operand" "v")]
330 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
332 "vaddu<VI_char>s %0,%1,%2"
333 [(set_attr "type" "vecsimple")])
335 (define_insn "altivec_vadds<VI_char>s"
336 [(set (match_operand:VI 0 "register_operand" "=v")
337 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
338 (match_operand:VI 2 "register_operand" "v")]
340 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
342 "vadds<VI_char>s %0,%1,%2"
343 [(set_attr "type" "vecsimple")])
346 (define_insn "sub<mode>3"
347 [(set (match_operand:VI 0 "register_operand" "=v")
348 (minus:VI (match_operand:VI 1 "register_operand" "v")
349 (match_operand:VI 2 "register_operand" "v")))]
351 "vsubu<VI_char>m %0,%1,%2"
352 [(set_attr "type" "vecsimple")])
354 (define_insn "subv4sf3"
355 [(set (match_operand:V4SF 0 "register_operand" "=v")
356 (minus:V4SF (match_operand:V4SF 1 "register_operand" "v")
357 (match_operand:V4SF 2 "register_operand" "v")))]
360 [(set_attr "type" "vecfloat")])
362 (define_insn "altivec_vsubcuw"
363 [(set (match_operand:V4SI 0 "register_operand" "=v")
364 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
365 (match_operand:V4SI 2 "register_operand" "v")]
369 [(set_attr "type" "vecsimple")])
371 (define_insn "altivec_vsubu<VI_char>s"
372 [(set (match_operand:VI 0 "register_operand" "=v")
373 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
374 (match_operand:VI 2 "register_operand" "v")]
376 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
378 "vsubu<VI_char>s %0,%1,%2"
379 [(set_attr "type" "vecsimple")])
381 (define_insn "altivec_vsubs<VI_char>s"
382 [(set (match_operand:VI 0 "register_operand" "=v")
383 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
384 (match_operand:VI 2 "register_operand" "v")]
386 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
388 "vsubs<VI_char>s %0,%1,%2"
389 [(set_attr "type" "vecsimple")])
392 (define_insn "altivec_vavgu<VI_char>"
393 [(set (match_operand:VI 0 "register_operand" "=v")
394 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
395 (match_operand:VI 2 "register_operand" "v")]
398 "vavgu<VI_char> %0,%1,%2"
399 [(set_attr "type" "vecsimple")])
401 (define_insn "altivec_vavgs<VI_char>"
402 [(set (match_operand:VI 0 "register_operand" "=v")
403 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
404 (match_operand:VI 2 "register_operand" "v")]
407 "vavgs<VI_char> %0,%1,%2"
408 [(set_attr "type" "vecsimple")])
410 (define_insn "altivec_vcmpbfp"
411 [(set (match_operand:V4SI 0 "register_operand" "=v")
412 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
413 (match_operand:V4SF 2 "register_operand" "v")]
417 [(set_attr "type" "veccmp")])
419 (define_insn "altivec_vcmpequb"
420 [(set (match_operand:V16QI 0 "register_operand" "=v")
421 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
422 (match_operand:V16QI 2 "register_operand" "v")]
426 [(set_attr "type" "vecsimple")])
428 (define_insn "altivec_vcmpequh"
429 [(set (match_operand:V8HI 0 "register_operand" "=v")
430 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
431 (match_operand:V8HI 2 "register_operand" "v")]
435 [(set_attr "type" "vecsimple")])
437 (define_insn "altivec_vcmpequw"
438 [(set (match_operand:V4SI 0 "register_operand" "=v")
439 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
440 (match_operand:V4SI 2 "register_operand" "v")]
444 [(set_attr "type" "vecsimple")])
446 (define_insn "altivec_vcmpeqfp"
447 [(set (match_operand:V4SI 0 "register_operand" "=v")
448 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
449 (match_operand:V4SF 2 "register_operand" "v")]
453 [(set_attr "type" "veccmp")])
455 (define_insn "altivec_vcmpgefp"
456 [(set (match_operand:V4SI 0 "register_operand" "=v")
457 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
458 (match_operand:V4SF 2 "register_operand" "v")]
462 [(set_attr "type" "veccmp")])
464 (define_insn "altivec_vcmpgtub"
465 [(set (match_operand:V16QI 0 "register_operand" "=v")
466 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
467 (match_operand:V16QI 2 "register_operand" "v")]
471 [(set_attr "type" "vecsimple")])
473 (define_insn "altivec_vcmpgtsb"
474 [(set (match_operand:V16QI 0 "register_operand" "=v")
475 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
476 (match_operand:V16QI 2 "register_operand" "v")]
480 [(set_attr "type" "vecsimple")])
482 (define_insn "altivec_vcmpgtuh"
483 [(set (match_operand:V8HI 0 "register_operand" "=v")
484 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
485 (match_operand:V8HI 2 "register_operand" "v")]
489 [(set_attr "type" "vecsimple")])
491 (define_insn "altivec_vcmpgtsh"
492 [(set (match_operand:V8HI 0 "register_operand" "=v")
493 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
494 (match_operand:V8HI 2 "register_operand" "v")]
498 [(set_attr "type" "vecsimple")])
500 (define_insn "altivec_vcmpgtuw"
501 [(set (match_operand:V4SI 0 "register_operand" "=v")
502 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
503 (match_operand:V4SI 2 "register_operand" "v")]
507 [(set_attr "type" "vecsimple")])
509 (define_insn "altivec_vcmpgtsw"
510 [(set (match_operand:V4SI 0 "register_operand" "=v")
511 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
512 (match_operand:V4SI 2 "register_operand" "v")]
516 [(set_attr "type" "vecsimple")])
518 (define_insn "altivec_vcmpgtfp"
519 [(set (match_operand:V4SI 0 "register_operand" "=v")
520 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
521 (match_operand:V4SF 2 "register_operand" "v")]
525 [(set_attr "type" "veccmp")])
527 ;; Fused multiply add
528 (define_insn "altivec_vmaddfp"
529 [(set (match_operand:V4SF 0 "register_operand" "=v")
530 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
531 (match_operand:V4SF 2 "register_operand" "v"))
532 (match_operand:V4SF 3 "register_operand" "v")))]
534 "vmaddfp %0,%1,%2,%3"
535 [(set_attr "type" "vecfloat")])
537 ;; We do multiply as a fused multiply-add with an add of a -0.0 vector.
539 (define_expand "mulv4sf3"
540 [(use (match_operand:V4SF 0 "register_operand" ""))
541 (use (match_operand:V4SF 1 "register_operand" ""))
542 (use (match_operand:V4SF 2 "register_operand" ""))]
543 "TARGET_ALTIVEC && TARGET_FUSED_MADD"
548 /* Generate [-0.0, -0.0, -0.0, -0.0]. */
549 neg0 = gen_reg_rtx (V4SFmode);
550 emit_insn (gen_altivec_vspltisw_v4sf (neg0, constm1_rtx));
551 emit_insn (gen_altivec_vslw_v4sf (neg0, neg0, neg0));
553 /* Use the multiply-add. */
554 emit_insn (gen_altivec_vmaddfp (operands[0], operands[1], operands[2],
559 ;; 32 bit integer multiplication
560 ;; A_high = Operand_0 & 0xFFFF0000 >> 16
561 ;; A_low = Operand_0 & 0xFFFF
562 ;; B_high = Operand_1 & 0xFFFF0000 >> 16
563 ;; B_low = Operand_1 & 0xFFFF
564 ;; result = A_low * B_low + (A_high * B_low + B_high * A_low) << 16
566 ;; (define_insn "mulv4si3"
567 ;; [(set (match_operand:V4SI 0 "register_operand" "=v")
568 ;; (mult:V4SI (match_operand:V4SI 1 "register_operand" "v")
569 ;; (match_operand:V4SI 2 "register_operand" "v")))]
570 (define_expand "mulv4si3"
571 [(use (match_operand:V4SI 0 "register_operand" ""))
572 (use (match_operand:V4SI 1 "register_operand" ""))
573 (use (match_operand:V4SI 2 "register_operand" ""))]
586 zero = gen_reg_rtx (V4SImode);
587 emit_insn (gen_altivec_vspltisw (zero, const0_rtx));
589 sixteen = gen_reg_rtx (V4SImode);
590 emit_insn (gen_altivec_vspltisw (sixteen, gen_rtx_CONST_INT (V4SImode, -16)));
592 swap = gen_reg_rtx (V4SImode);
593 emit_insn (gen_altivec_vrlw (swap, operands[2], sixteen));
595 one = gen_reg_rtx (V8HImode);
596 convert_move (one, operands[1], 0);
598 two = gen_reg_rtx (V8HImode);
599 convert_move (two, operands[2], 0);
601 small_swap = gen_reg_rtx (V8HImode);
602 convert_move (small_swap, swap, 0);
604 low_product = gen_reg_rtx (V4SImode);
605 emit_insn (gen_altivec_vmulouh (low_product, one, two));
607 high_product = gen_reg_rtx (V4SImode);
608 emit_insn (gen_altivec_vmsumuhm (high_product, one, small_swap, zero));
610 emit_insn (gen_altivec_vslw (high_product, high_product, sixteen));
612 emit_insn (gen_addv4si3 (operands[0], high_product, low_product));
618 ;; Fused multiply subtract
619 (define_insn "altivec_vnmsubfp"
620 [(set (match_operand:V4SF 0 "register_operand" "=v")
621 (neg:V4SF (minus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
622 (match_operand:V4SF 2 "register_operand" "v"))
623 (match_operand:V4SF 3 "register_operand" "v"))))]
625 "vnmsubfp %0,%1,%2,%3"
626 [(set_attr "type" "vecfloat")])
628 (define_insn "altivec_vmsumu<VI_char>m"
629 [(set (match_operand:V4SI 0 "register_operand" "=v")
630 (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")
631 (match_operand:VIshort 2 "register_operand" "v")
632 (match_operand:V4SI 3 "register_operand" "v")]
635 "vmsumu<VI_char>m %0,%1,%2,%3"
636 [(set_attr "type" "veccomplex")])
638 (define_insn "altivec_vmsumm<VI_char>m"
639 [(set (match_operand:V4SI 0 "register_operand" "=v")
640 (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")
641 (match_operand:VIshort 2 "register_operand" "v")
642 (match_operand:V4SI 3 "register_operand" "v")]
645 "vmsumm<VI_char>m %0,%1,%2,%3"
646 [(set_attr "type" "veccomplex")])
648 (define_insn "altivec_vmsumshm"
649 [(set (match_operand:V4SI 0 "register_operand" "=v")
650 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
651 (match_operand:V8HI 2 "register_operand" "v")
652 (match_operand:V4SI 3 "register_operand" "v")]
655 "vmsumshm %0,%1,%2,%3"
656 [(set_attr "type" "veccomplex")])
658 (define_insn "altivec_vmsumuhs"
659 [(set (match_operand:V4SI 0 "register_operand" "=v")
660 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
661 (match_operand:V8HI 2 "register_operand" "v")
662 (match_operand:V4SI 3 "register_operand" "v")]
664 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
666 "vmsumuhs %0,%1,%2,%3"
667 [(set_attr "type" "veccomplex")])
669 (define_insn "altivec_vmsumshs"
670 [(set (match_operand:V4SI 0 "register_operand" "=v")
671 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
672 (match_operand:V8HI 2 "register_operand" "v")
673 (match_operand:V4SI 3 "register_operand" "v")]
675 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
677 "vmsumshs %0,%1,%2,%3"
678 [(set_attr "type" "veccomplex")])
682 (define_insn "umax<mode>3"
683 [(set (match_operand:VI 0 "register_operand" "=v")
684 (umax:VI (match_operand:VI 1 "register_operand" "v")
685 (match_operand:VI 2 "register_operand" "v")))]
687 "vmaxu<VI_char> %0,%1,%2"
688 [(set_attr "type" "vecsimple")])
690 (define_insn "smax<mode>3"
691 [(set (match_operand:VI 0 "register_operand" "=v")
692 (smax:VI (match_operand:VI 1 "register_operand" "v")
693 (match_operand:VI 2 "register_operand" "v")))]
695 "vmaxs<VI_char> %0,%1,%2"
696 [(set_attr "type" "vecsimple")])
698 (define_insn "smaxv4sf3"
699 [(set (match_operand:V4SF 0 "register_operand" "=v")
700 (smax:V4SF (match_operand:V4SF 1 "register_operand" "v")
701 (match_operand:V4SF 2 "register_operand" "v")))]
704 [(set_attr "type" "veccmp")])
706 (define_insn "umin<mode>3"
707 [(set (match_operand:VI 0 "register_operand" "=v")
708 (umin:VI (match_operand:VI 1 "register_operand" "v")
709 (match_operand:VI 2 "register_operand" "v")))]
711 "vminu<VI_char> %0,%1,%2"
712 [(set_attr "type" "vecsimple")])
714 (define_insn "smin<mode>3"
715 [(set (match_operand:VI 0 "register_operand" "=v")
716 (smin:VI (match_operand:VI 1 "register_operand" "v")
717 (match_operand:VI 2 "register_operand" "v")))]
719 "vmins<VI_char> %0,%1,%2"
720 [(set_attr "type" "vecsimple")])
722 (define_insn "sminv4sf3"
723 [(set (match_operand:V4SF 0 "register_operand" "=v")
724 (smin:V4SF (match_operand:V4SF 1 "register_operand" "v")
725 (match_operand:V4SF 2 "register_operand" "v")))]
728 [(set_attr "type" "veccmp")])
730 (define_insn "altivec_vmhaddshs"
731 [(set (match_operand:V8HI 0 "register_operand" "=v")
732 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
733 (match_operand:V8HI 2 "register_operand" "v")
734 (match_operand:V8HI 3 "register_operand" "v")]
736 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
738 "vmhaddshs %0,%1,%2,%3"
739 [(set_attr "type" "veccomplex")])
741 (define_insn "altivec_vmhraddshs"
742 [(set (match_operand:V8HI 0 "register_operand" "=v")
743 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
744 (match_operand:V8HI 2 "register_operand" "v")
745 (match_operand:V8HI 3 "register_operand" "v")]
747 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
749 "vmhraddshs %0,%1,%2,%3"
750 [(set_attr "type" "veccomplex")])
752 (define_insn "altivec_vmladduhm"
753 [(set (match_operand:V8HI 0 "register_operand" "=v")
754 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
755 (match_operand:V8HI 2 "register_operand" "v")
756 (match_operand:V8HI 3 "register_operand" "v")]
759 "vmladduhm %0,%1,%2,%3"
760 [(set_attr "type" "veccomplex")])
762 (define_insn "altivec_vmrghb"
763 [(set (match_operand:V16QI 0 "register_operand" "=v")
764 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v")
765 (parallel [(const_int 0)
781 (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v")
782 (parallel [(const_int 8)
801 [(set_attr "type" "vecperm")])
803 (define_insn "altivec_vmrghh"
804 [(set (match_operand:V8HI 0 "register_operand" "=v")
805 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v")
806 (parallel [(const_int 0)
814 (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v")
815 (parallel [(const_int 4)
826 [(set_attr "type" "vecperm")])
828 (define_insn "altivec_vmrghw"
829 [(set (match_operand:V4SI 0 "register_operand" "=v")
830 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v")
831 (parallel [(const_int 0)
835 (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v")
836 (parallel [(const_int 2)
843 [(set_attr "type" "vecperm")])
845 (define_insn "altivec_vmrglb"
846 [(set (match_operand:V16QI 0 "register_operand" "=v")
847 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v")
848 (parallel [(const_int 8)
864 (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v")
865 (parallel [(const_int 0)
884 [(set_attr "type" "vecperm")])
886 (define_insn "altivec_vmrglh"
887 [(set (match_operand:V8HI 0 "register_operand" "=v")
888 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v")
889 (parallel [(const_int 4)
897 (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v")
898 (parallel [(const_int 0)
909 [(set_attr "type" "vecperm")])
911 (define_insn "altivec_vmrglw"
912 [(set (match_operand:V4SI 0 "register_operand" "=v")
913 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v")
914 (parallel [(const_int 2)
918 (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v")
919 (parallel [(const_int 0)
926 [(set_attr "type" "vecperm")])
928 (define_insn "altivec_vmuleub"
929 [(set (match_operand:V8HI 0 "register_operand" "=v")
930 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
931 (match_operand:V16QI 2 "register_operand" "v")]
935 [(set_attr "type" "veccomplex")])
937 (define_insn "altivec_vmulesb"
938 [(set (match_operand:V8HI 0 "register_operand" "=v")
939 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
940 (match_operand:V16QI 2 "register_operand" "v")]
944 [(set_attr "type" "veccomplex")])
946 (define_insn "altivec_vmuleuh"
947 [(set (match_operand:V4SI 0 "register_operand" "=v")
948 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
949 (match_operand:V8HI 2 "register_operand" "v")]
953 [(set_attr "type" "veccomplex")])
955 (define_insn "altivec_vmulesh"
956 [(set (match_operand:V4SI 0 "register_operand" "=v")
957 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
958 (match_operand:V8HI 2 "register_operand" "v")]
962 [(set_attr "type" "veccomplex")])
964 (define_insn "altivec_vmuloub"
965 [(set (match_operand:V8HI 0 "register_operand" "=v")
966 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
967 (match_operand:V16QI 2 "register_operand" "v")]
971 [(set_attr "type" "veccomplex")])
973 (define_insn "altivec_vmulosb"
974 [(set (match_operand:V8HI 0 "register_operand" "=v")
975 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
976 (match_operand:V16QI 2 "register_operand" "v")]
980 [(set_attr "type" "veccomplex")])
982 (define_insn "altivec_vmulouh"
983 [(set (match_operand:V4SI 0 "register_operand" "=v")
984 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
985 (match_operand:V8HI 2 "register_operand" "v")]
989 [(set_attr "type" "veccomplex")])
991 (define_insn "altivec_vmulosh"
992 [(set (match_operand:V4SI 0 "register_operand" "=v")
993 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
994 (match_operand:V8HI 2 "register_operand" "v")]
998 [(set_attr "type" "veccomplex")])
1003 (define_insn "and<mode>3"
1004 [(set (match_operand:VI 0 "register_operand" "=v")
1005 (and:VI (match_operand:VI 1 "register_operand" "v")
1006 (match_operand:VI 2 "register_operand" "v")))]
1009 [(set_attr "type" "vecsimple")])
1011 (define_insn "ior<mode>3"
1012 [(set (match_operand:VI 0 "register_operand" "=v")
1013 (ior:VI (match_operand:VI 1 "register_operand" "v")
1014 (match_operand:VI 2 "register_operand" "v")))]
1017 [(set_attr "type" "vecsimple")])
1019 (define_insn "xor<mode>3"
1020 [(set (match_operand:VI 0 "register_operand" "=v")
1021 (xor:VI (match_operand:VI 1 "register_operand" "v")
1022 (match_operand:VI 2 "register_operand" "v")))]
1025 [(set_attr "type" "vecsimple")])
1027 (define_insn "xorv4sf3"
1028 [(set (match_operand:V4SF 0 "register_operand" "=v")
1029 (xor:V4SF (match_operand:V4SF 1 "register_operand" "v")
1030 (match_operand:V4SF 2 "register_operand" "v")))]
1033 [(set_attr "type" "vecsimple")])
1035 (define_insn "one_cmpl<mode>2"
1036 [(set (match_operand:VI 0 "register_operand" "=v")
1037 (not:VI (match_operand:VI 1 "register_operand" "v")))]
1040 [(set_attr "type" "vecsimple")])
1042 (define_insn "altivec_nor<mode>3"
1043 [(set (match_operand:VI 0 "register_operand" "=v")
1044 (not:VI (ior:VI (match_operand:VI 1 "register_operand" "v")
1045 (match_operand:VI 2 "register_operand" "v"))))]
1048 [(set_attr "type" "vecsimple")])
1050 (define_insn "andc<mode>3"
1051 [(set (match_operand:VI 0 "register_operand" "=v")
1052 (and:VI (not:VI (match_operand:VI 2 "register_operand" "v"))
1053 (match_operand:VI 1 "register_operand" "v")))]
1056 [(set_attr "type" "vecsimple")])
1058 (define_insn "*andc3_v4sf"
1059 [(set (match_operand:V4SF 0 "register_operand" "=v")
1060 (and:V4SF (not:V4SF (match_operand:V4SF 2 "register_operand" "v"))
1061 (match_operand:V4SF 1 "register_operand" "v")))]
1064 [(set_attr "type" "vecsimple")])
1066 (define_insn "altivec_vpkuhum"
1067 [(set (match_operand:V16QI 0 "register_operand" "=v")
1068 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1069 (match_operand:V8HI 2 "register_operand" "v")]
1073 [(set_attr "type" "vecperm")])
1075 (define_insn "altivec_vpkuwum"
1076 [(set (match_operand:V8HI 0 "register_operand" "=v")
1077 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1078 (match_operand:V4SI 2 "register_operand" "v")]
1082 [(set_attr "type" "vecperm")])
1084 (define_insn "altivec_vpkpx"
1085 [(set (match_operand:V8HI 0 "register_operand" "=v")
1086 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1087 (match_operand:V4SI 2 "register_operand" "v")]
1091 [(set_attr "type" "vecperm")])
1093 (define_insn "altivec_vpkshss"
1094 [(set (match_operand:V16QI 0 "register_operand" "=v")
1095 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1096 (match_operand:V8HI 2 "register_operand" "v")]
1098 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1101 [(set_attr "type" "vecperm")])
1103 (define_insn "altivec_vpkswss"
1104 [(set (match_operand:V8HI 0 "register_operand" "=v")
1105 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1106 (match_operand:V4SI 2 "register_operand" "v")]
1108 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1111 [(set_attr "type" "vecperm")])
1113 (define_insn "altivec_vpkuhus"
1114 [(set (match_operand:V16QI 0 "register_operand" "=v")
1115 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1116 (match_operand:V8HI 2 "register_operand" "v")]
1118 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1121 [(set_attr "type" "vecperm")])
1123 (define_insn "altivec_vpkshus"
1124 [(set (match_operand:V16QI 0 "register_operand" "=v")
1125 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
1126 (match_operand:V8HI 2 "register_operand" "v")]
1128 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1131 [(set_attr "type" "vecperm")])
1133 (define_insn "altivec_vpkuwus"
1134 [(set (match_operand:V8HI 0 "register_operand" "=v")
1135 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1136 (match_operand:V4SI 2 "register_operand" "v")]
1138 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1141 [(set_attr "type" "vecperm")])
1143 (define_insn "altivec_vpkswus"
1144 [(set (match_operand:V8HI 0 "register_operand" "=v")
1145 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1146 (match_operand:V4SI 2 "register_operand" "v")]
1148 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1151 [(set_attr "type" "vecperm")])
1153 (define_insn "altivec_vrl<VI_char>"
1154 [(set (match_operand:VI 0 "register_operand" "=v")
1155 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
1156 (match_operand:VI 2 "register_operand" "v")]
1159 "vrl<VI_char> %0,%1,%2"
1160 [(set_attr "type" "vecsimple")])
1162 (define_insn "altivec_vsl<VI_char>"
1163 [(set (match_operand:VI 0 "register_operand" "=v")
1164 (unspec:VI [(match_operand:VI 1 "register_operand" "v")
1165 (match_operand:VI 2 "register_operand" "v")]
1168 "vsl<VI_char> %0,%1,%2"
1169 [(set_attr "type" "vecsimple")])
1171 (define_insn "altivec_vslw_v4sf"
1172 [(set (match_operand:V4SF 0 "register_operand" "=v")
1173 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1174 (match_operand:V4SF 2 "register_operand" "v")]
1178 [(set_attr "type" "vecsimple")])
1180 (define_insn "altivec_vsl"
1181 [(set (match_operand:V4SI 0 "register_operand" "=v")
1182 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1183 (match_operand:V4SI 2 "register_operand" "v")]
1187 [(set_attr "type" "vecperm")])
1189 (define_insn "altivec_vslo"
1190 [(set (match_operand:V4SI 0 "register_operand" "=v")
1191 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1192 (match_operand:V4SI 2 "register_operand" "v")]
1196 [(set_attr "type" "vecperm")])
1198 (define_insn "lshr<mode>3"
1199 [(set (match_operand:VI 0 "register_operand" "=v")
1200 (lshiftrt:VI (match_operand:VI 1 "register_operand" "v")
1201 (match_operand:VI 2 "register_operand" "v") ))]
1203 "vsr<VI_char> %0,%1,%2"
1204 [(set_attr "type" "vecsimple")])
1206 (define_insn "ashr<mode>3"
1207 [(set (match_operand:VI 0 "register_operand" "=v")
1208 (ashiftrt:VI (match_operand:VI 1 "register_operand" "v")
1209 (match_operand:VI 2 "register_operand" "v") ))]
1211 "vsra<VI_char> %0,%1,%2"
1212 [(set_attr "type" "vecsimple")])
1214 (define_insn "altivec_vsr"
1215 [(set (match_operand:V4SI 0 "register_operand" "=v")
1216 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1217 (match_operand:V4SI 2 "register_operand" "v")]
1221 [(set_attr "type" "vecperm")])
1223 (define_insn "altivec_vsro"
1224 [(set (match_operand:V4SI 0 "register_operand" "=v")
1225 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1226 (match_operand:V4SI 2 "register_operand" "v")]
1230 [(set_attr "type" "vecperm")])
1232 (define_insn "altivec_vsum4ubs"
1233 [(set (match_operand:V4SI 0 "register_operand" "=v")
1234 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
1235 (match_operand:V4SI 2 "register_operand" "v")]
1237 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1240 [(set_attr "type" "veccomplex")])
1242 (define_insn "altivec_vsum4s<VI_char>s"
1243 [(set (match_operand:V4SI 0 "register_operand" "=v")
1244 (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")
1245 (match_operand:V4SI 2 "register_operand" "v")]
1247 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1249 "vsum4s<VI_char>s %0,%1,%2"
1250 [(set_attr "type" "veccomplex")])
1252 (define_insn "altivec_vsum2sws"
1253 [(set (match_operand:V4SI 0 "register_operand" "=v")
1254 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1255 (match_operand:V4SI 2 "register_operand" "v")]
1257 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1260 [(set_attr "type" "veccomplex")])
1262 (define_insn "altivec_vsumsws"
1263 [(set (match_operand:V4SI 0 "register_operand" "=v")
1264 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1265 (match_operand:V4SI 2 "register_operand" "v")]
1267 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1270 [(set_attr "type" "veccomplex")])
1272 (define_insn "altivec_vspltb"
1273 [(set (match_operand:V16QI 0 "register_operand" "=v")
1274 (vec_duplicate:V16QI
1275 (vec_select:QI (match_operand:V16QI 1 "register_operand" "v")
1277 [(match_operand:QI 2 "u5bit_cint_operand" "")]))))]
1280 [(set_attr "type" "vecperm")])
1282 (define_insn "altivec_vsplth"
1283 [(set (match_operand:V8HI 0 "register_operand" "=v")
1285 (vec_select:HI (match_operand:V8HI 1 "register_operand" "v")
1287 [(match_operand:QI 2 "u5bit_cint_operand" "")]))))]
1290 [(set_attr "type" "vecperm")])
1292 (define_insn "altivec_vspltw"
1293 [(set (match_operand:V4SI 0 "register_operand" "=v")
1295 (vec_select:SI (match_operand:V4SI 1 "register_operand" "v")
1297 [(match_operand:QI 2 "u5bit_cint_operand" "i")]))))]
1300 [(set_attr "type" "vecperm")])
1302 (define_insn "*altivec_vspltsf"
1303 [(set (match_operand:V4SF 0 "register_operand" "=v")
1305 (vec_select:SF (match_operand:V4SF 1 "register_operand" "v")
1307 [(match_operand:QI 2 "u5bit_cint_operand" "i")]))))]
1310 [(set_attr "type" "vecperm")])
1312 (define_insn "altivec_vspltis<VI_char>"
1313 [(set (match_operand:VI 0 "register_operand" "=v")
1315 (match_operand:QI 1 "s5bit_cint_operand" "i")))]
1317 "vspltis<VI_char> %0,%1"
1318 [(set_attr "type" "vecperm")])
1320 (define_insn "altivec_vspltisw_v4sf"
1321 [(set (match_operand:V4SF 0 "register_operand" "=v")
1323 (float:SF (match_operand:QI 1 "s5bit_cint_operand" "i"))))]
1326 [(set_attr "type" "vecperm")])
1328 (define_insn "ftruncv4sf2"
1329 [(set (match_operand:V4SF 0 "register_operand" "=v")
1330 (fix:V4SF (match_operand:V4SF 1 "register_operand" "v")))]
1333 [(set_attr "type" "vecfloat")])
1335 (define_insn "altivec_vperm_<mode>"
1336 [(set (match_operand:V 0 "register_operand" "=v")
1337 (unspec:V [(match_operand:V 1 "register_operand" "v")
1338 (match_operand:V 2 "register_operand" "v")
1339 (match_operand:V16QI 3 "register_operand" "v")]
1343 [(set_attr "type" "vecperm")])
1345 (define_insn "altivec_vrfip"
1346 [(set (match_operand:V4SF 0 "register_operand" "=v")
1347 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1351 [(set_attr "type" "vecfloat")])
1353 (define_insn "altivec_vrfin"
1354 [(set (match_operand:V4SF 0 "register_operand" "=v")
1355 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1359 [(set_attr "type" "vecfloat")])
1361 (define_insn "altivec_vrfim"
1362 [(set (match_operand:V4SF 0 "register_operand" "=v")
1363 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1367 [(set_attr "type" "vecfloat")])
1369 (define_insn "altivec_vcfux"
1370 [(set (match_operand:V4SF 0 "register_operand" "=v")
1371 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1372 (match_operand:QI 2 "immediate_operand" "i")]
1376 [(set_attr "type" "vecfloat")])
1378 (define_insn "altivec_vcfsx"
1379 [(set (match_operand:V4SF 0 "register_operand" "=v")
1380 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1381 (match_operand:QI 2 "immediate_operand" "i")]
1385 [(set_attr "type" "vecfloat")])
1387 (define_insn "altivec_vctuxs"
1388 [(set (match_operand:V4SI 0 "register_operand" "=v")
1389 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
1390 (match_operand:QI 2 "immediate_operand" "i")]
1392 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1395 [(set_attr "type" "vecfloat")])
1397 (define_insn "altivec_vctsxs"
1398 [(set (match_operand:V4SI 0 "register_operand" "=v")
1399 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
1400 (match_operand:QI 2 "immediate_operand" "i")]
1402 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
1405 [(set_attr "type" "vecfloat")])
1407 (define_insn "altivec_vlogefp"
1408 [(set (match_operand:V4SF 0 "register_operand" "=v")
1409 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1413 [(set_attr "type" "vecfloat")])
1415 (define_insn "altivec_vexptefp"
1416 [(set (match_operand:V4SF 0 "register_operand" "=v")
1417 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1421 [(set_attr "type" "vecfloat")])
1423 (define_insn "altivec_vrsqrtefp"
1424 [(set (match_operand:V4SF 0 "register_operand" "=v")
1425 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1429 [(set_attr "type" "vecfloat")])
1431 (define_insn "altivec_vrefp"
1432 [(set (match_operand:V4SF 0 "register_operand" "=v")
1433 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")]
1437 [(set_attr "type" "vecfloat")])
1439 (define_expand "vcondv4si"
1440 [(set (match_operand:V4SI 0 "register_operand" "=v")
1441 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1442 (match_operand:V4SI 2 "register_operand" "v")
1443 (match_operand:V4SI 3 "comparison_operator" "")
1444 (match_operand:V4SI 4 "register_operand" "v")
1445 (match_operand:V4SI 5 "register_operand" "v")
1446 ] UNSPEC_VCOND_V4SI))]
1450 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1451 operands[3], operands[4], operands[5]))
1458 (define_expand "vconduv4si"
1459 [(set (match_operand:V4SI 0 "register_operand" "=v")
1460 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1461 (match_operand:V4SI 2 "register_operand" "v")
1462 (match_operand:V4SI 3 "comparison_operator" "")
1463 (match_operand:V4SI 4 "register_operand" "v")
1464 (match_operand:V4SI 5 "register_operand" "v")
1465 ] UNSPEC_VCONDU_V4SI))]
1469 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1470 operands[3], operands[4], operands[5]))
1477 (define_expand "vcondv4sf"
1478 [(set (match_operand:V4SF 0 "register_operand" "=v")
1479 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
1480 (match_operand:V4SF 2 "register_operand" "v")
1481 (match_operand:V4SF 3 "comparison_operator" "")
1482 (match_operand:V4SF 4 "register_operand" "v")
1483 (match_operand:V4SF 5 "register_operand" "v")
1484 ] UNSPEC_VCOND_V4SF))]
1488 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1489 operands[3], operands[4], operands[5]))
1496 (define_expand "vcondv8hi"
1497 [(set (match_operand:V4SF 0 "register_operand" "=v")
1498 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1499 (match_operand:V8HI 2 "register_operand" "v")
1500 (match_operand:V8HI 3 "comparison_operator" "")
1501 (match_operand:V8HI 4 "register_operand" "v")
1502 (match_operand:V8HI 5 "register_operand" "v")
1503 ] UNSPEC_VCOND_V8HI))]
1507 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1508 operands[3], operands[4], operands[5]))
1515 (define_expand "vconduv8hi"
1516 [(set (match_operand:V4SF 0 "register_operand" "=v")
1517 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
1518 (match_operand:V8HI 2 "register_operand" "v")
1519 (match_operand:V8HI 3 "comparison_operator" "")
1520 (match_operand:V8HI 4 "register_operand" "v")
1521 (match_operand:V8HI 5 "register_operand" "v")
1522 ] UNSPEC_VCONDU_V8HI))]
1526 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1527 operands[3], operands[4], operands[5]))
1534 (define_expand "vcondv16qi"
1535 [(set (match_operand:V4SF 0 "register_operand" "=v")
1536 (unspec:V16QI [(match_operand:V4SI 1 "register_operand" "v")
1537 (match_operand:V16QI 2 "register_operand" "v")
1538 (match_operand:V16QI 3 "comparison_operator" "")
1539 (match_operand:V16QI 4 "register_operand" "v")
1540 (match_operand:V16QI 5 "register_operand" "v")
1541 ] UNSPEC_VCOND_V16QI))]
1545 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1546 operands[3], operands[4], operands[5]))
1553 (define_expand "vconduv16qi"
1554 [(set (match_operand:V4SF 0 "register_operand" "=v")
1555 (unspec:V16QI [(match_operand:V4SI 1 "register_operand" "v")
1556 (match_operand:V16QI 2 "register_operand" "v")
1557 (match_operand:V16QI 3 "comparison_operator" "")
1558 (match_operand:V16QI 4 "register_operand" "v")
1559 (match_operand:V16QI 5 "register_operand" "v")
1560 ] UNSPEC_VCONDU_V16QI))]
1564 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2],
1565 operands[3], operands[4], operands[5]))
1573 (define_insn "altivec_vsel_v4si"
1574 [(set (match_operand:V4SI 0 "register_operand" "=v")
1575 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
1576 (match_operand:V4SI 2 "register_operand" "v")
1577 (match_operand:V4SI 3 "register_operand" "v")]
1581 [(set_attr "type" "vecperm")])
1583 (define_insn "altivec_vsel_v4sf"
1584 [(set (match_operand:V4SF 0 "register_operand" "=v")
1585 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
1586 (match_operand:V4SF 2 "register_operand" "v")
1587 (match_operand:V4SI 3 "register_operand" "v")]
1591 [(set_attr "type" "vecperm")])
1593 (define_insn "altivec_vsel_v8hi"
1594 [(set (match_operand:V8HI 0 "register_operand" "=v")
1595 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
1596 (match_operand:V8HI 2 "register_operand" "v")
1597 (match_operand:V8HI 3 "register_operand" "v")]
1601 [(set_attr "type" "vecperm")])
1603 (define_insn "altivec_vsel_v16qi"
1604 [(set (match_operand:V16QI 0 "register_operand" "=v")
1605 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
1606 (match_operand:V16QI 2 "register_operand" "v")
1607 (match_operand:V16QI 3 "register_operand" "v")]
1611 [(set_attr "type" "vecperm")])
1613 (define_insn "altivec_vsldoi_<mode>"
1614 [(set (match_operand:V 0 "register_operand" "=v")
1615 (unspec:V [(match_operand:V 1 "register_operand" "v")
1616 (match_operand:V 2 "register_operand" "v")
1617 (match_operand:QI 3 "immediate_operand" "i")]
1620 "vsldoi %0,%1,%2,%3"
1621 [(set_attr "type" "vecperm")])
1623 (define_insn "altivec_vupkhsb"
1624 [(set (match_operand:V8HI 0 "register_operand" "=v")
1625 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")]
1629 [(set_attr "type" "vecperm")])
1631 (define_insn "altivec_vupkhpx"
1632 [(set (match_operand:V4SI 0 "register_operand" "=v")
1633 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")]
1637 [(set_attr "type" "vecperm")])
1639 (define_insn "altivec_vupkhsh"
1640 [(set (match_operand:V4SI 0 "register_operand" "=v")
1641 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")]
1645 [(set_attr "type" "vecperm")])
1647 (define_insn "altivec_vupklsb"
1648 [(set (match_operand:V8HI 0 "register_operand" "=v")
1649 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")]
1653 [(set_attr "type" "vecperm")])
1655 (define_insn "altivec_vupklpx"
1656 [(set (match_operand:V4SI 0 "register_operand" "=v")
1657 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")]
1661 [(set_attr "type" "vecperm")])
1663 (define_insn "altivec_vupklsh"
1664 [(set (match_operand:V4SI 0 "register_operand" "=v")
1665 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")]
1669 [(set_attr "type" "vecperm")])
1671 ;; AltiVec predicates.
1673 (define_expand "cr6_test_for_zero"
1674 [(set (match_operand:SI 0 "register_operand" "=r")
1680 (define_expand "cr6_test_for_zero_reverse"
1681 [(set (match_operand:SI 0 "register_operand" "=r")
1684 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
1688 (define_expand "cr6_test_for_lt"
1689 [(set (match_operand:SI 0 "register_operand" "=r")
1695 (define_expand "cr6_test_for_lt_reverse"
1696 [(set (match_operand:SI 0 "register_operand" "=r")
1699 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
1703 ;; We can get away with generating the opcode on the fly (%3 below)
1704 ;; because all the predicates have the same scheduling parameters.
1706 (define_insn "altivec_predicate_<mode>"
1708 (unspec:CC [(match_operand:V 1 "register_operand" "v")
1709 (match_operand:V 2 "register_operand" "v")
1710 (match_operand 3 "any_operand" "")] UNSPEC_PREDICATE))
1711 (clobber (match_scratch:V 0 "=v"))]
1714 [(set_attr "type" "veccmp")])
1716 (define_insn "altivec_mtvscr"
1719 [(match_operand:V4SI 0 "register_operand" "v")] UNSPECV_MTVSCR))]
1722 [(set_attr "type" "vecsimple")])
1724 (define_insn "altivec_mfvscr"
1725 [(set (match_operand:V8HI 0 "register_operand" "=v")
1726 (unspec_volatile:V8HI [(reg:SI 110)] UNSPECV_MFVSCR))]
1729 [(set_attr "type" "vecsimple")])
1731 (define_insn "altivec_dssall"
1732 [(unspec_volatile [(const_int 0)] UNSPECV_DSSALL)]
1735 [(set_attr "type" "vecsimple")])
1737 (define_insn "altivec_dss"
1738 [(unspec_volatile [(match_operand:QI 0 "immediate_operand" "i")]
1742 [(set_attr "type" "vecsimple")])
1744 (define_insn "altivec_dst"
1745 [(unspec [(match_operand 0 "register_operand" "b")
1746 (match_operand:SI 1 "register_operand" "r")
1747 (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DST)]
1748 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1750 [(set_attr "type" "vecsimple")])
1752 (define_insn "altivec_dstt"
1753 [(unspec [(match_operand 0 "register_operand" "b")
1754 (match_operand:SI 1 "register_operand" "r")
1755 (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DSTT)]
1756 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1758 [(set_attr "type" "vecsimple")])
1760 (define_insn "altivec_dstst"
1761 [(unspec [(match_operand 0 "register_operand" "b")
1762 (match_operand:SI 1 "register_operand" "r")
1763 (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DSTST)]
1764 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1766 [(set_attr "type" "vecsimple")])
1768 (define_insn "altivec_dststt"
1769 [(unspec [(match_operand 0 "register_operand" "b")
1770 (match_operand:SI 1 "register_operand" "r")
1771 (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DSTSTT)]
1772 "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode"
1774 [(set_attr "type" "vecsimple")])
1776 (define_insn "altivec_lvsl"
1777 [(set (match_operand:V16QI 0 "register_operand" "=v")
1778 (unspec:V16QI [(match_operand 1 "memory_operand" "Z")] UNSPEC_LVSL))]
1781 [(set_attr "type" "vecload")])
1783 (define_insn "altivec_lvsr"
1784 [(set (match_operand:V16QI 0 "register_operand" "=v")
1785 (unspec:V16QI [(match_operand 1 "memory_operand" "Z")] UNSPEC_LVSR))]
1788 [(set_attr "type" "vecload")])
1790 (define_expand "build_vector_mask_for_load"
1791 [(set (match_operand:V16QI 0 "register_operand" "")
1792 (unspec:V16QI [(match_operand 1 "memory_operand" "")] UNSPEC_LVSR))]
1799 gcc_assert (GET_CODE (operands[1]) == MEM);
1801 addr = XEXP (operands[1], 0);
1802 temp = gen_reg_rtx (GET_MODE (addr));
1803 emit_insn (gen_rtx_SET (VOIDmode, temp,
1804 gen_rtx_NEG (GET_MODE (addr), addr)));
1805 emit_insn (gen_altivec_lvsr (operands[0],
1806 replace_equiv_address (operands[1], temp)));
1810 ;; Parallel some of the LVE* and STV*'s with unspecs because some have
1811 ;; identical rtl but different instructions-- and gcc gets confused.
1813 (define_insn "altivec_lve<VI_char>x"
1815 [(set (match_operand:VI 0 "register_operand" "=v")
1816 (match_operand:VI 1 "memory_operand" "Z"))
1817 (unspec [(const_int 0)] UNSPEC_LVE)])]
1819 "lve<VI_char>x %0,%y1"
1820 [(set_attr "type" "vecload")])
1822 (define_insn "*altivec_lvesfx"
1824 [(set (match_operand:V4SF 0 "register_operand" "=v")
1825 (match_operand:V4SF 1 "memory_operand" "Z"))
1826 (unspec [(const_int 0)] UNSPEC_LVE)])]
1829 [(set_attr "type" "vecload")])
1831 (define_insn "altivec_lvxl"
1833 [(set (match_operand:V4SI 0 "register_operand" "=v")
1834 (match_operand:V4SI 1 "memory_operand" "Z"))
1835 (unspec [(const_int 0)] UNSPEC_SET_VSCR)])]
1838 [(set_attr "type" "vecload")])
1840 (define_insn "altivec_lvx"
1841 [(set (match_operand:V4SI 0 "register_operand" "=v")
1842 (match_operand:V4SI 1 "memory_operand" "Z"))]
1845 [(set_attr "type" "vecload")])
1847 (define_insn "altivec_stvx"
1849 [(set (match_operand:V4SI 0 "memory_operand" "=Z")
1850 (match_operand:V4SI 1 "register_operand" "v"))
1851 (unspec [(const_int 0)] UNSPEC_STVX)])]
1854 [(set_attr "type" "vecstore")])
1856 (define_insn "altivec_stvxl"
1858 [(set (match_operand:V4SI 0 "memory_operand" "=Z")
1859 (match_operand:V4SI 1 "register_operand" "v"))
1860 (unspec [(const_int 0)] UNSPEC_STVXL)])]
1863 [(set_attr "type" "vecstore")])
1865 (define_insn "altivec_stve<VI_char>x"
1867 [(set (match_operand:VI 0 "memory_operand" "=Z")
1868 (match_operand:VI 1 "register_operand" "v"))
1869 (unspec [(const_int 0)] UNSPEC_STVE)])]
1871 "stve<VI_char>x %1,%y0"
1872 [(set_attr "type" "vecstore")])
1874 (define_insn "*altivec_stvesfx"
1876 [(set (match_operand:V4SF 0 "memory_operand" "=Z")
1877 (match_operand:V4SF 1 "register_operand" "v"))
1878 (unspec [(const_int 0)] UNSPEC_STVE)])]
1881 [(set_attr "type" "vecstore")])
1883 (define_expand "vec_init<mode>"
1884 [(match_operand:V 0 "register_operand" "")
1885 (match_operand 1 "" "")]
1888 rs6000_expand_vector_init (operands[0], operands[1]);
1892 (define_expand "vec_setv4si"
1893 [(match_operand:V4SI 0 "register_operand" "")
1894 (match_operand:SI 1 "register_operand" "")
1895 (match_operand 2 "const_int_operand" "")]
1898 rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2]));
1902 (define_expand "vec_setv8hi"
1903 [(match_operand:V8HI 0 "register_operand" "")
1904 (match_operand:HI 1 "register_operand" "")
1905 (match_operand 2 "const_int_operand" "")]
1908 rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2]));
1912 (define_expand "vec_setv16qi"
1913 [(match_operand:V16QI 0 "register_operand" "")
1914 (match_operand:QI 1 "register_operand" "")
1915 (match_operand 2 "const_int_operand" "")]
1918 rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2]));
1922 (define_expand "vec_setv4sf"
1923 [(match_operand:V4SF 0 "register_operand" "")
1924 (match_operand:SF 1 "register_operand" "")
1925 (match_operand 2 "const_int_operand" "")]
1928 rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2]));
1932 (define_expand "vec_extractv4si"
1933 [(match_operand:SI 0 "register_operand" "")
1934 (match_operand:V4SI 1 "register_operand" "")
1935 (match_operand 2 "const_int_operand" "")]
1938 rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2]));
1942 (define_expand "vec_extractv8hi"
1943 [(match_operand:HI 0 "register_operand" "")
1944 (match_operand:V8HI 1 "register_operand" "")
1945 (match_operand 2 "const_int_operand" "")]
1948 rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2]));
1952 (define_expand "vec_extractv16qi"
1953 [(match_operand:QI 0 "register_operand" "")
1954 (match_operand:V16QI 1 "register_operand" "")
1955 (match_operand 2 "const_int_operand" "")]
1958 rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2]));
1962 (define_expand "vec_extractv4sf"
1963 [(match_operand:SF 0 "register_operand" "")
1964 (match_operand:V4SF 1 "register_operand" "")
1965 (match_operand 2 "const_int_operand" "")]
1968 rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2]));
1973 ;; vspltis? SCRATCH0,0
1974 ;; vsubu?m SCRATCH2,SCRATCH1,%1
1975 ;; vmaxs? %0,%1,SCRATCH2"
1976 (define_expand "abs<mode>2"
1977 [(set (match_dup 2) (vec_duplicate:VI (const_int 0)))
1979 (minus:VI (match_dup 2)
1980 (match_operand:VI 1 "register_operand" "v")))
1981 (set (match_operand:VI 0 "register_operand" "=v")
1982 (smax:VI (match_dup 1) (match_dup 3)))]
1985 operands[2] = gen_reg_rtx (GET_MODE (operands[0]));
1986 operands[3] = gen_reg_rtx (GET_MODE (operands[0]));
1990 ;; vspltisw SCRATCH1,-1
1991 ;; vslw SCRATCH2,SCRATCH1,SCRATCH1
1992 ;; vandc %0,%1,SCRATCH2
1993 (define_expand "absv4sf2"
1995 (vec_duplicate:V4SF (float:SF (const_int -1))))
1997 (unspec:V4SF [(match_dup 2) (match_dup 2)] UNSPEC_VSLW))
1998 (set (match_operand:V4SF 0 "register_operand" "=v")
1999 (and:V4SF (not:V4SF (match_dup 3))
2000 (match_operand:V4SF 1 "register_operand" "v")))]
2003 operands[2] = gen_reg_rtx (V4SFmode);
2004 operands[3] = gen_reg_rtx (V4SFmode);
2008 ;; vspltis? SCRATCH0,0
2009 ;; vsubs?s SCRATCH2,SCRATCH1,%1
2010 ;; vmaxs? %0,%1,SCRATCH2"
2011 (define_expand "altivec_abss_<mode>"
2012 [(set (match_dup 2) (vec_duplicate:VI (const_int 0)))
2013 (parallel [(set (match_dup 3)
2014 (unspec:VI [(match_dup 2)
2015 (match_operand:VI 1 "register_operand" "v")]
2017 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))])
2018 (set (match_operand:VI 0 "register_operand" "=v")
2019 (smax:VI (match_dup 1) (match_dup 3)))]
2022 operands[2] = gen_reg_rtx (GET_MODE (operands[0]));
2023 operands[3] = gen_reg_rtx (GET_MODE (operands[0]));
2026 ;; Vector shift left in bits. Currently supported ony for shift
2027 ;; amounts that can be expressed as byte shifts (divisible by 8).
2028 ;; General shift amounts can be supported using vslo + vsl. We're
2029 ;; not expecting to see these yet (the vectorizer currently
2030 ;; generates only shifts divisible by byte_size).
2031 (define_expand "vec_shl_<mode>"
2032 [(set (match_operand:V 0 "register_operand" "=v")
2033 (unspec:V [(match_operand:V 1 "register_operand" "v")
2034 (match_operand:QI 2 "reg_or_short_operand" "")]
2039 rtx bitshift = operands[2];
2040 rtx byteshift = gen_reg_rtx (QImode);
2041 HOST_WIDE_INT bitshift_val;
2042 HOST_WIDE_INT byteshift_val;
2044 if (! CONSTANT_P (bitshift))
2046 bitshift_val = INTVAL (bitshift);
2047 if (bitshift_val & 0x7)
2049 byteshift_val = bitshift_val >> 3;
2050 byteshift = gen_rtx_CONST_INT (QImode, byteshift_val);
2051 emit_insn (gen_altivec_vsldoi_<mode> (operands[0], operands[1], operands[1],
2056 ;; Vector shift left in bits. Currently supported ony for shift
2057 ;; amounts that can be expressed as byte shifts (divisible by 8).
2058 ;; General shift amounts can be supported using vsro + vsr. We're
2059 ;; not expecting to see these yet (the vectorizer currently
2060 ;; generates only shifts divisible by byte_size).
2061 (define_expand "vec_shr_<mode>"
2062 [(set (match_operand:V 0 "register_operand" "=v")
2063 (unspec:V [(match_operand:V 1 "register_operand" "v")
2064 (match_operand:QI 2 "reg_or_short_operand" "")]
2069 rtx bitshift = operands[2];
2070 rtx byteshift = gen_reg_rtx (QImode);
2071 HOST_WIDE_INT bitshift_val;
2072 HOST_WIDE_INT byteshift_val;
2074 if (! CONSTANT_P (bitshift))
2076 bitshift_val = INTVAL (bitshift);
2077 if (bitshift_val & 0x7)
2079 byteshift_val = 16 - (bitshift_val >> 3);
2080 byteshift = gen_rtx_CONST_INT (QImode, byteshift_val);
2081 emit_insn (gen_altivec_vsldoi_<mode> (operands[0], operands[1], operands[1],
2086 (define_insn "altivec_vsumsws_nomode"
2087 [(set (match_operand 0 "register_operand" "=v")
2088 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
2089 (match_operand:V4SI 2 "register_operand" "v")]
2091 (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
2094 [(set_attr "type" "veccomplex")])
2096 (define_expand "reduc_splus_<mode>"
2097 [(set (match_operand:VIshort 0 "register_operand" "=v")
2098 (unspec:VIshort [(match_operand:VIshort 1 "register_operand" "v")]
2099 UNSPEC_REDUC_PLUS))]
2103 rtx vzero = gen_reg_rtx (V4SImode);
2104 rtx vtmp1 = gen_reg_rtx (V4SImode);
2106 emit_insn (gen_altivec_vspltisw (vzero, const0_rtx));
2107 emit_insn (gen_altivec_vsum4s<VI_char>s (vtmp1, operands[1], vzero));
2108 emit_insn (gen_altivec_vsumsws_nomode (operands[0], vtmp1, vzero));
2112 (define_expand "reduc_uplus_v16qi"
2113 [(set (match_operand:V16QI 0 "register_operand" "=v")
2114 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")]
2115 UNSPEC_REDUC_PLUS))]
2119 rtx vzero = gen_reg_rtx (V4SImode);
2120 rtx vtmp1 = gen_reg_rtx (V4SImode);
2122 emit_insn (gen_altivec_vspltisw (vzero, const0_rtx));
2123 emit_insn (gen_altivec_vsum4ubs (vtmp1, operands[1], vzero));
2124 emit_insn (gen_altivec_vsumsws_nomode (operands[0], vtmp1, vzero));
2128 (define_insn "vec_realign_load_<mode>"
2129 [(set (match_operand:V 0 "register_operand" "=v")
2130 (unspec:V [(match_operand:V 1 "register_operand" "v")
2131 (match_operand:V 2 "register_operand" "v")
2132 (match_operand:V16QI 3 "register_operand" "v")]
2133 UNSPEC_REALIGN_LOAD))]
2136 [(set_attr "type" "vecperm")])
2138 (define_expand "neg<mode>2"
2139 [(use (match_operand:VI 0 "register_operand" ""))
2140 (use (match_operand:VI 1 "register_operand" ""))]
2146 vzero = gen_reg_rtx (GET_MODE (operands[0]));
2147 emit_insn (gen_altivec_vspltis<VI_char> (vzero, const0_rtx));
2148 emit_insn (gen_sub<mode>3 (operands[0], vzero, operands[1]));
2153 (define_expand "negv4sf2"
2154 [(use (match_operand:V4SF 0 "register_operand" ""))
2155 (use (match_operand:V4SF 1 "register_operand" ""))]
2161 /* Generate [-0.0, -0.0, -0.0, -0.0]. */
2162 neg0 = gen_reg_rtx (V4SFmode);
2163 emit_insn (gen_altivec_vspltisw_v4sf (neg0, constm1_rtx));
2164 emit_insn (gen_altivec_vslw_v4sf (neg0, neg0, neg0));
2167 emit_insn (gen_xorv4sf3 (operands[0], neg0, operands[1]));