1 ;; IA-64 machine description for vector operations.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 2, or (at your option)
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING. If not, write to
18 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
19 ;; Boston, MA 02111-1307, USA.
22 ;; Integer vector operations
24 (define_mode_macro VECINT [V8QI V4HI V2SI])
25 (define_mode_macro VECINT12 [V8QI V4HI])
26 (define_mode_macro VECINT24 [V4HI V2SI])
27 (define_mode_attr vecsize [(V8QI "1") (V4HI "2") (V2SI "4")])
29 (define_expand "mov<mode>"
30 [(set (match_operand:VECINT 0 "general_operand" "")
31 (match_operand:VECINT 1 "general_operand" ""))]
34 rtx op1 = ia64_expand_move (operands[0], operands[1]);
40 (define_insn "*mov<mode>_internal"
41 [(set (match_operand:VECINT 0 "destination_operand"
42 "=r,r,r,r,m ,*f ,*f,Q ,r ,*f")
43 (match_operand:VECINT 1 "move_operand"
44 "rU,W,i,m,rU,U*f,Q ,*f,*f,r "))]
45 "ia64_move_ok (operands[0], operands[1])"
57 [(set_attr "itanium_class" "ialu,ialu,long_i,ld,st,fmisc,fld,stf,frfr,tofr")])
59 (define_insn "one_cmpl<mode>2"
60 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
61 (not:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")))]
64 [(set_attr "itanium_class" "ilog")])
66 (define_insn "and<mode>3"
67 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
69 (match_operand:VECINT 1 "grfr_register_operand" "r,*f")
70 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
75 [(set_attr "itanium_class" "ilog,fmisc")])
77 (define_insn "*andnot<mode>"
78 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
80 (not:VECINT (match_operand:VECINT 1 "grfr_register_operand" "r,*f"))
81 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
86 [(set_attr "itanium_class" "ilog,fmisc")])
88 (define_insn "ior<mode>3"
89 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
91 (match_operand:VECINT 1 "grfr_register_operand" "r,*f")
92 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
97 [(set_attr "itanium_class" "ilog,fmisc")])
99 (define_insn "xor<mode>3"
100 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
102 (match_operand:VECINT 1 "grfr_register_operand" "r,*f")
103 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
108 [(set_attr "itanium_class" "ilog,fmisc")])
110 (define_insn "neg<mode>2"
111 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
112 (neg:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")))]
114 "psub<vecsize> %0 = r0, %1"
115 [(set_attr "itanium_class" "mmalua")])
117 (define_insn "add<mode>3"
118 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
119 (plus:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")
120 (match_operand:VECINT 2 "gr_register_operand" "r")))]
122 "padd<vecsize> %0 = %1, %2"
123 [(set_attr "itanium_class" "mmalua")])
125 (define_insn "*ssadd<mode>3"
126 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
128 (match_operand:VECINT12 1 "gr_register_operand" "r")
129 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
131 "padd<vecsize>.sss %0 = %1, %2"
132 [(set_attr "itanium_class" "mmalua")])
134 (define_insn "*usadd<mode>3"
135 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
137 (match_operand:VECINT12 1 "gr_register_operand" "r")
138 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
140 "padd<vecsize>.uuu %0 = %1, %2"
141 [(set_attr "itanium_class" "mmalua")])
143 (define_insn "sub<mode>3"
144 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
145 (minus:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")
146 (match_operand:VECINT 2 "gr_register_operand" "r")))]
148 "psub<vecsize> %0 = %1, %2"
149 [(set_attr "itanium_class" "mmalua")])
151 (define_insn "*sssub<mode>3"
152 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
154 (match_operand:VECINT12 1 "gr_register_operand" "r")
155 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
157 "psub<vecsize>.sss %0 = %1, %2"
158 [(set_attr "itanium_class" "mmalua")])
160 (define_insn "*ussub<mode>3"
161 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
163 (match_operand:VECINT12 1 "gr_register_operand" "r")
164 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
166 "psub<vecsize>.uuu %0 = %1, %2"
167 [(set_attr "itanium_class" "mmalua")])
169 (define_expand "mulv8qi3"
170 [(set (match_operand:V8QI 0 "gr_register_operand" "")
171 (mult:V8QI (match_operand:V8QI 1 "gr_register_operand" "r")
172 (match_operand:V8QI 2 "gr_register_operand" "r")))]
175 rtx r1, l1, r2, l2, rm, lm;
177 r1 = gen_reg_rtx (V4HImode);
178 l1 = gen_reg_rtx (V4HImode);
179 r2 = gen_reg_rtx (V4HImode);
180 l2 = gen_reg_rtx (V4HImode);
182 /* Zero-extend the QImode elements into two words of HImode elements
183 by interleaving them with zero bytes. */
184 emit_insn (gen_mix1_r (gen_lowpart (V8QImode, r1),
185 operands[1], CONST0_RTX (V8QImode)));
186 emit_insn (gen_mix1_r (gen_lowpart (V8QImode, r2),
187 operands[2], CONST0_RTX (V8QImode)));
188 emit_insn (gen_mix1_l (gen_lowpart (V8QImode, l1),
189 operands[1], CONST0_RTX (V8QImode)));
190 emit_insn (gen_mix1_l (gen_lowpart (V8QImode, l2),
191 operands[2], CONST0_RTX (V8QImode)));
194 rm = gen_reg_rtx (V4HImode);
195 lm = gen_reg_rtx (V4HImode);
196 emit_insn (gen_mulv4hi3 (rm, r1, r2));
197 emit_insn (gen_mulv4hi3 (lm, l1, l2));
199 /* Zap the high order bytes of the HImode elements by overwriting those
200 in one part with the low order bytes of the other. */
201 emit_insn (gen_mix1_r (operands[0],
202 gen_lowpart (V8QImode, rm),
203 gen_lowpart (V8QImode, lm)));
207 (define_insn "mulv4hi3"
208 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
209 (mult:V4HI (match_operand:V4HI 1 "gr_register_operand" "r")
210 (match_operand:V4HI 2 "gr_register_operand" "r")))]
212 "pmpyshr2 %0 = %1, %2, 0"
213 [(set_attr "itanium_class" "mmmul")])
215 (define_expand "umax<mode>3"
216 [(set (match_operand:VECINT 0 "gr_register_operand" "")
217 (smax:VECINT (match_operand:VECINT 1 "gr_register_operand" "")
218 (match_operand:VECINT 2 "gr_register_operand" "")))]
221 if (ia64_expand_vecint_minmax (UMAX, <MODE>mode, operands))
225 (define_expand "smax<mode>3"
226 [(set (match_operand:VECINT 0 "gr_register_operand" "")
227 (smax:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
228 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
231 if (ia64_expand_vecint_minmax (SMAX, <MODE>mode, operands))
235 (define_expand "umin<mode>3"
236 [(set (match_operand:VECINT 0 "gr_register_operand" "")
237 (umin:VECINT (match_operand:VECINT 1 "gr_register_operand" "")
238 (match_operand:VECINT 2 "gr_register_operand" "")))]
241 if (ia64_expand_vecint_minmax (UMIN, <MODE>mode, operands))
245 (define_expand "smin<mode>3"
246 [(set (match_operand:VECINT 0 "gr_register_operand" "")
247 (smin:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
248 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
251 if (ia64_expand_vecint_minmax (SMIN, <MODE>mode, operands))
255 (define_insn "*umaxv8qi3"
256 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
257 (umax:V8QI (match_operand:V8QI 1 "gr_register_operand" "r")
258 (match_operand:V8QI 2 "gr_register_operand" "r")))]
260 "pmax1.u %0 = %1, %2"
261 [(set_attr "itanium_class" "mmshf")])
263 (define_insn "*smaxv4hi3"
264 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
265 (smax:V4HI (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
266 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")))]
268 "pmax2 %0 = %r1, %r2"
269 [(set_attr "itanium_class" "mmshf")])
271 (define_insn "*uminv8qi3"
272 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
273 (umin:V8QI (match_operand:V8QI 1 "gr_register_operand" "r")
274 (match_operand:V8QI 2 "gr_register_operand" "r")))]
276 "pmin1.u %0 = %1, %2"
277 [(set_attr "itanium_class" "mmshf")])
279 (define_insn "*sminv4hi3"
280 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
281 (smin:V4HI (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
282 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")))]
284 "pmin2 %0 = %r1, %r2"
285 [(set_attr "itanium_class" "mmshf")])
287 (define_insn "ashl<mode>3"
288 [(set (match_operand:VECINT24 0 "gr_register_operand" "=r")
290 (match_operand:VECINT24 1 "gr_register_operand" "r")
291 (match_operand:VECINT24 2 "gr_reg_or_5bit_operand" "rn")))]
293 "pshl<vecsize> %0 = %1, %2"
294 [(set_attr "itanium_class" "mmshf")])
296 (define_insn "ashr<mode>3"
297 [(set (match_operand:VECINT24 0 "gr_register_operand" "=r")
299 (match_operand:VECINT24 1 "gr_register_operand" "r")
300 (match_operand:VECINT24 2 "gr_reg_or_5bit_operand" "rn")))]
302 "pshr<vecsize> %0 = %1, %2"
303 [(set_attr "itanium_class" "mmshf")])
305 (define_insn "lshr<mode>3"
306 [(set (match_operand:VECINT24 0 "gr_register_operand" "=r")
308 (match_operand:VECINT24 1 "gr_register_operand" "r")
309 (match_operand:VECINT24 2 "gr_reg_or_5bit_operand" "rn")))]
311 "pshr<vecsize>.u %0 = %1, %2"
312 [(set_attr "itanium_class" "mmshf")])
314 (define_expand "vcond<mode>"
315 [(set (match_operand:VECINT 0 "gr_register_operand" "")
318 [(match_operand:VECINT 4 "gr_reg_or_0_operand" "")
319 (match_operand:VECINT 5 "gr_reg_or_0_operand" "")])
320 (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
321 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
324 ia64_expand_vecint_cmov (operands);
328 (define_expand "vcondu<mode>"
329 [(set (match_operand:VECINT 0 "gr_register_operand" "")
332 [(match_operand:VECINT 4 "gr_reg_or_0_operand" "")
333 (match_operand:VECINT 5 "gr_reg_or_0_operand" "")])
334 (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
335 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
338 ia64_expand_vecint_cmov (operands);
342 (define_insn "*cmpeq_<mode>"
343 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
344 (eq:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "rU")
345 (match_operand:VECINT 2 "gr_reg_or_0_operand" "rU")))]
347 "pcmp<vecsize>.eq %0 = %r1, %r2"
348 [(set_attr "itanium_class" "mmalua")])
350 (define_insn "*cmpgt_<mode>"
351 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
352 (gt:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "rU")
353 (match_operand:VECINT 2 "gr_reg_or_0_operand" "rU")))]
355 "pcmp<vecsize>.gt %0 = %r1, %r2"
356 [(set_attr "itanium_class" "mmalua")])
358 (define_insn "pack2_sss"
359 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
362 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU"))
364 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))]
366 "pack2.sss %0 = %r1, %r2"
367 [(set_attr "itanium_class" "mmshf")])
369 (define_insn "*pack2_uss"
370 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
373 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU"))
375 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))]
377 "pack2.uss %0 = %r1, %r2"
378 [(set_attr "itanium_class" "mmshf")])
380 (define_insn "pack4_sss"
381 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
384 (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU"))
386 (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))))]
388 "pack4.sss %0 = %r1, %r2"
389 [(set_attr "itanium_class" "mmshf")])
391 (define_insn "unpack1_l"
392 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
395 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
396 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
397 (parallel [(const_int 0)
406 "unpack1.l %0 = %r2, %r1"
407 [(set_attr "itanium_class" "mmshf")])
409 (define_insn "unpack1_h"
410 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
413 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
414 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
415 (parallel [(const_int 4)
424 "unpack1.h %0 = %r2, %r1"
425 [(set_attr "itanium_class" "mmshf")])
427 (define_insn "mix1_r"
428 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
431 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
432 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
433 (parallel [(const_int 0)
442 "mix1.r %0 = %r2, %r1"
443 [(set_attr "itanium_class" "mmshf")])
445 (define_insn "mix1_l"
446 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
449 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
450 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
451 (parallel [(const_int 1)
460 "mix1.l %0 = %r2, %r1"
461 [(set_attr "itanium_class" "mmshf")])
463 (define_insn "*mux1_rev"
464 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
466 (match_operand:V8QI 1 "gr_register_operand" "r")
467 (parallel [(const_int 7)
477 [(set_attr "itanium_class" "mmshf")])
479 (define_insn "*mux1_mix"
480 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
482 (match_operand:V8QI 1 "gr_register_operand" "r")
483 (parallel [(const_int 0)
493 [(set_attr "itanium_class" "mmshf")])
495 (define_insn "*mux1_shuf"
496 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
498 (match_operand:V8QI 1 "gr_register_operand" "r")
499 (parallel [(const_int 0)
508 "mux1 %0 = %1, @shuf"
509 [(set_attr "itanium_class" "mmshf")])
511 (define_insn "*mux1_alt"
512 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
514 (match_operand:V8QI 1 "gr_register_operand" "r")
515 (parallel [(const_int 0)
525 [(set_attr "itanium_class" "mmshf")])
527 (define_insn "*mux1_brcst_v8qi"
528 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
530 (match_operand:V8QI 1 "gr_register_operand" "r")
531 (parallel [(const_int 0)
540 "mux1 %0 = %1, @brcst"
541 [(set_attr "itanium_class" "mmshf")])
543 (define_insn "*mux1_brcst_qi"
544 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
546 (match_operand:QI 1 "gr_register_operand" "r")))]
548 "mux1 %0 = %1, @brcst"
549 [(set_attr "itanium_class" "mmshf")])
551 (define_insn "unpack2_l"
552 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
555 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
556 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
557 (parallel [(const_int 0)
562 "unpack2.l %0 = %r2, %r1"
563 [(set_attr "itanium_class" "mmshf")])
565 (define_insn "unpack2_h"
566 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
569 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
570 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
571 (parallel [(const_int 2)
576 "unpack2.h %0 = %r2, %r1"
577 [(set_attr "itanium_class" "mmshf")])
579 (define_insn "*mix2_r"
580 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
583 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
584 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
585 (parallel [(const_int 0)
590 "mix2.r %0 = %r2, %r1"
591 [(set_attr "itanium_class" "mmshf")])
593 (define_insn "*mix2_l"
594 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
597 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
598 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
599 (parallel [(const_int 1)
604 "mix2.l %0 = %r2, %r1"
605 [(set_attr "itanium_class" "mmshf")])
608 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
610 (match_operand:V4HI 1 "gr_register_operand" "r")
611 (parallel [(match_operand 2 "const_int_2bit_operand" "")
612 (match_operand 3 "const_int_2bit_operand" "")
613 (match_operand 4 "const_int_2bit_operand" "")
614 (match_operand 5 "const_int_2bit_operand" "")])))]
618 mask = INTVAL (operands[2]);
619 mask |= INTVAL (operands[3]) << 2;
620 mask |= INTVAL (operands[4]) << 4;
621 mask |= INTVAL (operands[5]) << 6;
622 operands[2] = GEN_INT (mask);
623 return "%,mux2 %0 = %1, %2";
625 [(set_attr "itanium_class" "mmshf")])
627 (define_insn "*mux2_brcst_hi"
628 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
630 (match_operand:HI 1 "gr_register_operand" "r")))]
633 [(set_attr "itanium_class" "mmshf")])
635 ;; Note that mix4.r performs the exact same operation.
636 (define_insn "*unpack4_l"
637 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
640 (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")
641 (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))
642 (parallel [(const_int 0)
645 "unpack4.l %0 = %r2, %r1"
646 [(set_attr "itanium_class" "mmshf")])
648 ;; Note that mix4.l performs the exact same operation.
649 (define_insn "*unpack4_h"
650 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
653 (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")
654 (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))
655 (parallel [(const_int 1)
658 "unpack4.h %0 = %r2, %r1"
659 [(set_attr "itanium_class" "mmshf")])
661 (define_expand "vec_initv2si"
662 [(match_operand:V2SF 0 "gr_register_operand" "")
663 (match_operand 1 "" "")]
666 rtx op1 = XVECEXP (operands[1], 0, 0);
667 rtx op2 = XVECEXP (operands[1], 0, 1);
670 if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT)
672 x = gen_rtx_CONST_VECTOR (V2SImode, XVEC (operands[1], 0));
673 emit_move_insn (operands[0], x);
677 if (!gr_reg_or_0_operand (op1, SImode))
678 op1 = force_reg (SImode, op1);
679 if (!gr_reg_or_0_operand (op2, SImode))
680 op2 = force_reg (SImode, op2);
682 x = gen_rtx_VEC_CONCAT (V2SImode, op1, op2);
683 emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
687 (define_insn "*vecinit_v2si"
688 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
690 (match_operand:SI 1 "gr_reg_or_0_operand" "rO")
691 (match_operand:SI 2 "gr_reg_or_0_operand" "rO")))]
693 "unpack4.l %0 = %r2, %r1"
694 [(set_attr "itanium_class" "mmshf")])
696 ;; Missing operations
701 ;; pmpyshr, general form
710 ;; Floating point vector operations
712 (define_expand "movv2sf"
713 [(set (match_operand:V2SF 0 "general_operand" "")
714 (match_operand:V2SF 1 "general_operand" ""))]
717 rtx op1 = ia64_expand_move (operands[0], operands[1]);
723 (define_insn "*movv2sf_internal"
724 [(set (match_operand:V2SF 0 "destination_operand"
725 "=f,f,f,Q,*r ,*r,*r,*r,m ,f ,*r")
726 (match_operand:V2SF 1 "move_operand"
727 "fU,Y,Q,f,U*r,W ,i ,m ,*r,*r,f "))]
728 "ia64_move_ok (operands[0], operands[1])"
730 static const char * const alt[] = {
732 "%,fpack %0 = %F2, %F1",
736 "%,addl %0 = %v1, r0",
738 "%,ld8%O1 %0 = %1%P1",
739 "%,st8%Q0 %0 = %r1%P0",
740 "%,setf.sig %0 = %1",
744 if (which_alternative == 1)
746 operands[2] = XVECEXP (operands[1], 0, 1);
747 operands[1] = XVECEXP (operands[1], 0, 0);
750 return alt[which_alternative];
752 [(set_attr "itanium_class" "fmisc,fmisc,fld,stf,ialu,ialu,long_i,ld,st,tofr,frfr")])
754 (define_insn "absv2sf2"
755 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
756 (abs:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")))]
759 [(set_attr "itanium_class" "fmisc")])
761 (define_insn "negv2sf2"
762 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
763 (neg:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")))]
766 [(set_attr "itanium_class" "fmisc")])
768 (define_insn "*negabsv2sf2"
769 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
771 (abs:V2SF (match_operand:V2SF 1 "fr_register_operand" "f"))))]
774 [(set_attr "itanium_class" "fmisc")])
776 (define_expand "addv2sf3"
777 [(set (match_operand:V2SF 0 "fr_register_operand" "")
779 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "")
781 (match_operand:V2SF 2 "fr_register_operand" "")))]
784 rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode));
785 operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v));
788 (define_expand "subv2sf3"
789 [(set (match_operand:V2SF 0 "fr_register_operand" "")
791 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "")
793 (match_operand:V2SF 2 "fr_register_operand" "")))]
796 rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode));
797 operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v));
800 (define_insn "mulv2sf3"
801 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
802 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
803 (match_operand:V2SF 2 "fr_register_operand" "f")))]
806 [(set_attr "itanium_class" "fmac")])
809 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
811 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
812 (match_operand:V2SF 2 "fr_register_operand" "f"))
813 (match_operand:V2SF 3 "fr_register_operand" "f")))]
815 "fpma %0 = %1, %2, %3"
816 [(set_attr "itanium_class" "fmac")])
819 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
821 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
822 (match_operand:V2SF 2 "fr_register_operand" "f"))
823 (match_operand:V2SF 3 "fr_register_operand" "f")))]
825 "fpms %0 = %1, %2, %3"
826 [(set_attr "itanium_class" "fmac")])
828 (define_insn "*fpnmpy"
829 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
831 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
832 (match_operand:V2SF 2 "fr_register_operand" "f"))))]
835 [(set_attr "itanium_class" "fmac")])
837 (define_insn "*fpnma"
838 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
841 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
842 (match_operand:V2SF 2 "fr_register_operand" "f")))
843 (match_operand:V2SF 3 "fr_register_operand" "f")))]
845 "fpnma %0 = %1, %2, %3"
846 [(set_attr "itanium_class" "fmac")])
848 (define_insn "smaxv2sf2"
849 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
850 (smax:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
851 (match_operand:V2SF 2 "fr_register_operand" "f")))]
854 [(set_attr "itanium_class" "fmisc")])
856 (define_insn "sminv2sf2"
857 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
858 (smin:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
859 (match_operand:V2SF 2 "fr_register_operand" "f")))]
862 [(set_attr "itanium_class" "fmisc")])
864 (define_expand "vcondv2sf"
865 [(set (match_operand:V2SF 0 "fr_register_operand" "")
868 [(match_operand:V2SF 4 "fr_reg_or_0_operand" "")
869 (match_operand:V2SF 5 "fr_reg_or_0_operand" "")])
870 (match_operand:V2SF 1 "fr_reg_or_0_operand" "")
871 (match_operand:V2SF 2 "fr_reg_or_0_operand" "")))]
876 PUT_MODE (operands[3], V2SFmode);
877 switch (GET_CODE (operands[3]))
889 x = XEXP (operands[3], 0);
890 XEXP (operands[3], 0) = XEXP (operands[3], 1);
891 XEXP (operands[3], 1) = x;
892 PUT_CODE (operands[3], swap_condition (GET_CODE (operands[3])));
899 cmp = gen_reg_rtx (V2SFmode);
900 emit_insn (gen_rtx_SET (VOIDmode, cmp, operands[3]));
902 x = gen_rtx_IF_THEN_ELSE (V2SFmode, cmp, operands[1], operands[2]);
903 emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
907 (define_insn "*fpcmp"
908 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
910 (match_operand:V2SF 1 "fr_register_operand" "f")
911 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")
912 (match_operand:V2SF 3 "fr_reg_or_0_operand" "fU")))]
914 "fselect %0 = %2, %3, %1"
915 [(set_attr "itanium_class" "fmisc")])
917 (define_expand "vec_initv2sf"
918 [(match_operand:V2SF 0 "fr_register_operand" "")
919 (match_operand 1 "" "")]
922 rtx op1 = XVECEXP (operands[1], 0, 0);
923 rtx op2 = XVECEXP (operands[1], 0, 1);
926 if (GET_CODE (op1) == CONST_DOUBLE && GET_CODE (op2) == CONST_DOUBLE)
928 x = gen_rtx_CONST_VECTOR (V2SFmode, XVEC (operands[1], 0));
929 emit_move_insn (operands[0], x);
933 if (!fr_reg_or_fp01_operand (op1, SFmode))
934 op1 = force_reg (SFmode, op1);
935 if (!fr_reg_or_fp01_operand (op2, SFmode))
936 op2 = force_reg (SFmode, op2);
938 x = gen_rtx_VEC_CONCAT (V2SFmode, op1, op2);
939 emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
943 (define_insn "*fpack"
944 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
946 (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
947 (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
949 "fpack %0 = %F2, %F1"
950 [(set_attr "itanium_class" "fmisc")])
952 ;; Missing operations