1 ;; IA-64 machine description for vector operations.
2 ;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
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 3, 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 COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
21 ;; Integer vector operations
23 (define_mode_iterator VEC [V8QI V4HI V2SI V2SF])
24 (define_mode_iterator VECINT [V8QI V4HI V2SI])
25 (define_mode_iterator VECINT12 [V8QI V4HI])
26 (define_mode_iterator VECINT24 [V4HI V2SI])
27 (define_mode_attr vecsize [(V8QI "1") (V4HI "2") (V2SI "4")])
28 (define_mode_attr vecwider [(V8QI "V4HI") (V4HI "V2SI")])
29 (define_mode_attr vecint
30 [(V8QI "V8QI") (V4HI "V4HI") (V2SI "V2SI") (V2SF "V2SI")])
32 (define_expand "mov<mode>"
33 [(set (match_operand:VECINT 0 "general_operand" "")
34 (match_operand:VECINT 1 "general_operand" ""))]
37 rtx op1 = ia64_expand_move (operands[0], operands[1]);
43 (define_insn "*mov<mode>_internal"
44 [(set (match_operand:VECINT 0 "destination_operand"
45 "=r,r,r,r,m ,*f ,*f,Q ,r ,*f")
46 (match_operand:VECINT 1 "move_operand"
47 "rU,W,i,m,rU,U*f,Q ,*f,*f,r "))]
48 "ia64_move_ok (operands[0], operands[1])"
60 [(set_attr "itanium_class" "ialu,ialu,long_i,ld,st,fmisc,fld,stf,frfr,tofr")])
62 (define_insn "one_cmpl<mode>2"
63 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
64 (not:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")))]
67 [(set_attr "itanium_class" "ilog")])
69 (define_insn "and<mode>3"
70 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
72 (match_operand:VECINT 1 "grfr_register_operand" "r,*f")
73 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
78 [(set_attr "itanium_class" "ilog,fmisc")])
80 (define_insn "*andnot<mode>"
81 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
83 (not:VECINT (match_operand:VECINT 1 "grfr_register_operand" "r,*f"))
84 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
89 [(set_attr "itanium_class" "ilog,fmisc")])
91 (define_insn "ior<mode>3"
92 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
94 (match_operand:VECINT 1 "grfr_register_operand" "r,*f")
95 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
100 [(set_attr "itanium_class" "ilog,fmisc")])
102 (define_insn "xor<mode>3"
103 [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f")
105 (match_operand:VECINT 1 "grfr_register_operand" "r,*f")
106 (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))]
111 [(set_attr "itanium_class" "ilog,fmisc")])
113 (define_insn "neg<mode>2"
114 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
115 (neg:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")))]
117 "psub<vecsize> %0 = r0, %1"
118 [(set_attr "itanium_class" "mmalua")])
120 (define_insn "add<mode>3"
121 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
122 (plus:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")
123 (match_operand:VECINT 2 "gr_register_operand" "r")))]
125 "padd<vecsize> %0 = %1, %2"
126 [(set_attr "itanium_class" "mmalua")])
128 (define_insn "*ssadd<mode>3"
129 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
131 (match_operand:VECINT12 1 "gr_register_operand" "r")
132 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
134 "padd<vecsize>.sss %0 = %1, %2"
135 [(set_attr "itanium_class" "mmalua")])
137 (define_insn "*usadd<mode>3"
138 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
140 (match_operand:VECINT12 1 "gr_register_operand" "r")
141 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
143 "padd<vecsize>.uuu %0 = %1, %2"
144 [(set_attr "itanium_class" "mmalua")])
146 (define_insn "sub<mode>3"
147 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
148 (minus:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")
149 (match_operand:VECINT 2 "gr_register_operand" "r")))]
151 "psub<vecsize> %0 = %1, %2"
152 [(set_attr "itanium_class" "mmalua")])
154 (define_insn "*sssub<mode>3"
155 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
157 (match_operand:VECINT12 1 "gr_register_operand" "r")
158 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
160 "psub<vecsize>.sss %0 = %1, %2"
161 [(set_attr "itanium_class" "mmalua")])
163 (define_insn "*ussub<mode>3"
164 [(set (match_operand:VECINT12 0 "gr_register_operand" "=r")
166 (match_operand:VECINT12 1 "gr_register_operand" "r")
167 (match_operand:VECINT12 2 "gr_register_operand" "r")))]
169 "psub<vecsize>.uuu %0 = %1, %2"
170 [(set_attr "itanium_class" "mmalua")])
172 (define_expand "mulv8qi3"
173 [(set (match_operand:V8QI 0 "gr_register_operand" "")
174 (mult:V8QI (match_operand:V8QI 1 "gr_register_operand" "r")
175 (match_operand:V8QI 2 "gr_register_operand" "r")))]
178 rtx l = gen_reg_rtx (V4HImode);
179 rtx h = gen_reg_rtx (V4HImode);
180 emit_insn (gen_vec_widen_umult_lo_v8qi (l, operands[1], operands[2]));
181 emit_insn (gen_vec_widen_umult_hi_v8qi (h, operands[1], operands[2]));
182 if (TARGET_BIG_ENDIAN)
183 emit_insn (gen_vec_pack_trunc_v4hi (operands[0], h, l));
185 emit_insn (gen_vec_pack_trunc_v4hi (operands[0], l, h));
189 (define_expand "vec_widen_umult_lo_v8qi"
190 [(match_operand:V4HI 0 "gr_register_operand" "")
191 (match_operand:V8QI 1 "gr_register_operand" "")
192 (match_operand:V8QI 2 "gr_register_operand" "")]
195 rtx op1 = gen_reg_rtx (V4HImode);
196 rtx op2 = gen_reg_rtx (V4HImode);
197 emit_insn (gen_vec_unpacku_lo_v8qi (op1, operands[1]));
198 emit_insn (gen_vec_unpacku_lo_v8qi (op2, operands[2]));
199 emit_insn (gen_mulv4hi3 (operands[0], op1, op2));
203 (define_expand "vec_widen_umult_hi_v8qi"
204 [(match_operand:V4HI 0 "gr_register_operand" "")
205 (match_operand:V8QI 1 "gr_register_operand" "")
206 (match_operand:V8QI 2 "gr_register_operand" "")]
209 rtx op1 = gen_reg_rtx (V4HImode);
210 rtx op2 = gen_reg_rtx (V4HImode);
211 emit_insn (gen_vec_unpacku_hi_v8qi (op1, operands[1]));
212 emit_insn (gen_vec_unpacku_hi_v8qi (op2, operands[2]));
213 emit_insn (gen_mulv4hi3 (operands[0], op1, op2));
217 (define_expand "vec_widen_smult_lo_v8qi"
218 [(match_operand:V4HI 0 "gr_register_operand" "")
219 (match_operand:V8QI 1 "gr_register_operand" "")
220 (match_operand:V8QI 2 "gr_register_operand" "")]
223 rtx op1 = gen_reg_rtx (V4HImode);
224 rtx op2 = gen_reg_rtx (V4HImode);
225 emit_insn (gen_vec_unpacks_lo_v8qi (op1, operands[1]));
226 emit_insn (gen_vec_unpacks_lo_v8qi (op2, operands[2]));
227 emit_insn (gen_mulv4hi3 (operands[0], op1, op2));
231 (define_expand "vec_widen_smult_hi_v8qi"
232 [(match_operand:V4HI 0 "gr_register_operand" "")
233 (match_operand:V8QI 1 "gr_register_operand" "")
234 (match_operand:V8QI 2 "gr_register_operand" "")]
237 rtx op1 = gen_reg_rtx (V4HImode);
238 rtx op2 = gen_reg_rtx (V4HImode);
239 emit_insn (gen_vec_unpacks_hi_v8qi (op1, operands[1]));
240 emit_insn (gen_vec_unpacks_hi_v8qi (op2, operands[2]));
241 emit_insn (gen_mulv4hi3 (operands[0], op1, op2));
245 (define_insn "mulv4hi3"
246 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
247 (mult:V4HI (match_operand:V4HI 1 "gr_register_operand" "r")
248 (match_operand:V4HI 2 "gr_register_operand" "r")))]
250 "pmpyshr2 %0 = %1, %2, 0"
251 [(set_attr "itanium_class" "mmmul")])
253 (define_insn "pmpyshr2"
254 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
259 (match_operand:V4HI 1 "gr_register_operand" "r"))
261 (match_operand:V4HI 2 "gr_register_operand" "r")))
262 (match_operand:SI 3 "pmpyshr_operand" "n"))))]
264 "pmpyshr2 %0 = %1, %2, %3"
265 [(set_attr "itanium_class" "mmmul")])
267 (define_insn "pmpyshr2_u"
268 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
273 (match_operand:V4HI 1 "gr_register_operand" "r"))
275 (match_operand:V4HI 2 "gr_register_operand" "r")))
276 (match_operand:SI 3 "pmpyshr_operand" "n"))))]
278 "pmpyshr2.u %0 = %1, %2, %3"
279 [(set_attr "itanium_class" "mmmul")])
281 (define_expand "smulv4hi3_highpart"
282 [(match_operand:V4HI 0 "gr_register_operand")
283 (match_operand:V4HI 1 "gr_register_operand")
284 (match_operand:V4HI 2 "gr_register_operand")]
287 emit_insn (gen_pmpyshr2 (operands[0], operands[1],
288 operands[2], GEN_INT (16)));
292 (define_expand "umulv4hi3_highpart"
293 [(match_operand:V4HI 0 "gr_register_operand")
294 (match_operand:V4HI 1 "gr_register_operand")
295 (match_operand:V4HI 2 "gr_register_operand")]
298 emit_insn (gen_pmpyshr2_u (operands[0], operands[1],
299 operands[2], GEN_INT (16)));
303 (define_insn "vec_widen_smult_even_v4hi"
304 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
308 (match_operand:V4HI 1 "gr_register_operand" "r"))
309 (parallel [(const_int 0) (const_int 2)]))
312 (match_operand:V4HI 2 "gr_register_operand" "r"))
313 (parallel [(const_int 0) (const_int 2)]))))]
316 /* Recall that vector elements are numbered in memory order. */
317 if (TARGET_BIG_ENDIAN)
318 return "%,pmpy2.l %0 = %1, %2";
320 return "%,pmpy2.r %0 = %1, %2";
322 [(set_attr "itanium_class" "mmshf")])
324 (define_insn "vec_widen_smult_odd_v4hi"
325 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
329 (match_operand:V4HI 1 "gr_register_operand" "r"))
330 (parallel [(const_int 1) (const_int 3)]))
333 (match_operand:V4HI 2 "gr_register_operand" "r"))
334 (parallel [(const_int 1) (const_int 3)]))))]
337 /* Recall that vector elements are numbered in memory order. */
338 if (TARGET_BIG_ENDIAN)
339 return "%,pmpy2.r %0 = %1, %2";
341 return "%,pmpy2.l %0 = %1, %2";
343 [(set_attr "itanium_class" "mmshf")])
345 (define_expand "vec_widen_smult_lo_v4hi"
346 [(match_operand:V2SI 0 "gr_register_operand" "")
347 (match_operand:V4HI 1 "gr_register_operand" "")
348 (match_operand:V4HI 2 "gr_register_operand" "")]
351 rtx l = gen_reg_rtx (V4HImode);
352 rtx h = gen_reg_rtx (V4HImode);
353 emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
354 emit_insn (gen_pmpyshr2 (h, operands[1], operands[2], GEN_INT (16)));
355 ia64_unpack_assemble (operands[0], l, h, false);
359 (define_expand "vec_widen_smult_hi_v4hi"
360 [(match_operand:V2SI 0 "gr_register_operand" "")
361 (match_operand:V4HI 1 "gr_register_operand" "")
362 (match_operand:V4HI 2 "gr_register_operand" "")]
365 rtx l = gen_reg_rtx (V4HImode);
366 rtx h = gen_reg_rtx (V4HImode);
367 emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
368 emit_insn (gen_pmpyshr2 (h, operands[1], operands[2], GEN_INT (16)));
369 ia64_unpack_assemble (operands[0], l, h, true);
373 (define_expand "vec_widen_umult_lo_v4hi"
374 [(match_operand:V2SI 0 "gr_register_operand" "")
375 (match_operand:V4HI 1 "gr_register_operand" "")
376 (match_operand:V4HI 2 "gr_register_operand" "")]
379 rtx l = gen_reg_rtx (V4HImode);
380 rtx h = gen_reg_rtx (V4HImode);
381 emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
382 emit_insn (gen_pmpyshr2_u (h, operands[1], operands[2], GEN_INT (16)));
383 ia64_unpack_assemble (operands[0], l, h, false);
387 (define_expand "vec_widen_umult_hi_v4hi"
388 [(match_operand:V2SI 0 "gr_register_operand" "")
389 (match_operand:V4HI 1 "gr_register_operand" "")
390 (match_operand:V4HI 2 "gr_register_operand" "")]
393 rtx l = gen_reg_rtx (V4HImode);
394 rtx h = gen_reg_rtx (V4HImode);
395 emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
396 emit_insn (gen_pmpyshr2_u (h, operands[1], operands[2], GEN_INT (16)));
397 ia64_unpack_assemble (operands[0], l, h, true);
401 (define_expand "mulv2si3"
402 [(set (match_operand:V2SI 0 "gr_register_operand" "")
403 (mult:V2SI (match_operand:V2SI 1 "gr_register_operand" "r")
404 (match_operand:V2SI 2 "gr_register_operand" "r")))]
407 rtx t0, t1, t2, t3, t4, t5, t6, t7, x;
408 rtx op1h = gen_lowpart (V4HImode, operands[1]);
409 rtx op2h = gen_lowpart (V4HImode, operands[2]);
411 t0 = gen_reg_rtx (V4HImode);
412 t1 = gen_reg_rtx (V4HImode);
413 t2 = gen_reg_rtx (V4HImode);
414 t3 = gen_reg_rtx (V4HImode);
415 t4 = gen_reg_rtx (V2SImode);
416 t5 = gen_reg_rtx (V2SImode);
417 t6 = gen_reg_rtx (V2SImode);
418 t7 = gen_reg_rtx (V2SImode);
420 /* Consider the HImode components of op1 = DCBA, op2 = ZYXW.
421 Consider .l and .h suffixes below the low and high 16 bits
422 of the full 32-bit product. */
425 x = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (4, const1_rtx, const0_rtx,
426 GEN_INT (3), const2_rtx));
427 x = gen_rtx_VEC_SELECT (V4HImode, op1h, x);
428 emit_insn (gen_rtx_SET (VOIDmode, t0, x));
430 /* T1 = DZ.l, CY.l, BX.l, AW.l. */
431 emit_insn (gen_mulv4hi3 (t1, op1h, op2h));
433 /* T2 = DZ.h, CY.h, BX.h, AW.h. */
434 emit_insn (gen_pmpyshr2_u (t2, op1h, op2h, GEN_INT (16)));
436 /* T3 = CZ.l, DY.l, AX.l, BW.l. */
437 emit_insn (gen_mulv4hi3 (t3, t0, op2h));
439 /* T4 = CY.h, CY.l, AW.h, AW.l = CY, AW. */
440 x = gen_lowpart (V4HImode, t4);
441 if (TARGET_BIG_ENDIAN)
442 x = gen_mix2_odd (x, t2, t1);
444 x = gen_mix2_even (x, t1, t2);
447 /* T5 = CZ.l, 0, AX.l, 0 = CZ << 16, AX << 16. */
448 x = gen_lowpart (V4HImode, t5);
449 if (TARGET_BIG_ENDIAN)
450 x = gen_mix2_even (x, t3, CONST0_RTX (V4HImode));
452 x = gen_mix2_odd (x, CONST0_RTX (V4HImode), t3);
455 /* T6 = DY.l, 0, BW.l, 0 = DY << 16, BW << 16. */
456 x = gen_lowpart (V4HImode, t6);
457 if (TARGET_BIG_ENDIAN)
458 x = gen_mix2_odd (x, t3, CONST0_RTX (V4HImode));
460 x = gen_mix2_even (x, CONST0_RTX (V4HImode), t3);
463 emit_insn (gen_addv2si3 (t7, t4, t5));
464 emit_insn (gen_addv2si3 (operands[0], t6, t7));
468 (define_expand "umax<mode>3"
469 [(set (match_operand:VECINT 0 "gr_register_operand" "")
470 (umax:VECINT (match_operand:VECINT 1 "gr_register_operand" "")
471 (match_operand:VECINT 2 "gr_register_operand" "")))]
474 if (ia64_expand_vecint_minmax (UMAX, <MODE>mode, operands))
478 (define_expand "smax<mode>3"
479 [(set (match_operand:VECINT 0 "gr_register_operand" "")
480 (smax:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
481 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
484 if (ia64_expand_vecint_minmax (SMAX, <MODE>mode, operands))
488 (define_expand "umin<mode>3"
489 [(set (match_operand:VECINT 0 "gr_register_operand" "")
490 (umin:VECINT (match_operand:VECINT 1 "gr_register_operand" "")
491 (match_operand:VECINT 2 "gr_register_operand" "")))]
494 if (ia64_expand_vecint_minmax (UMIN, <MODE>mode, operands))
498 (define_expand "smin<mode>3"
499 [(set (match_operand:VECINT 0 "gr_register_operand" "")
500 (smin:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
501 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
504 if (ia64_expand_vecint_minmax (SMIN, <MODE>mode, operands))
508 (define_insn "*umaxv8qi3"
509 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
510 (umax:V8QI (match_operand:V8QI 1 "gr_register_operand" "r")
511 (match_operand:V8QI 2 "gr_register_operand" "r")))]
513 "pmax1.u %0 = %1, %2"
514 [(set_attr "itanium_class" "mmshf")])
516 (define_insn "*smaxv4hi3"
517 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
518 (smax:V4HI (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
519 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")))]
521 "pmax2 %0 = %r1, %r2"
522 [(set_attr "itanium_class" "mmshf")])
524 (define_insn "*uminv8qi3"
525 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
526 (umin:V8QI (match_operand:V8QI 1 "gr_register_operand" "r")
527 (match_operand:V8QI 2 "gr_register_operand" "r")))]
529 "pmin1.u %0 = %1, %2"
530 [(set_attr "itanium_class" "mmshf")])
532 (define_insn "*sminv4hi3"
533 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
534 (smin:V4HI (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
535 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")))]
537 "pmin2 %0 = %r1, %r2"
538 [(set_attr "itanium_class" "mmshf")])
540 (define_insn "ashl<mode>3"
541 [(set (match_operand:VECINT24 0 "gr_register_operand" "=r")
543 (match_operand:VECINT24 1 "gr_register_operand" "r")
544 (match_operand:DI 2 "gr_reg_or_5bit_operand" "rn")))]
546 "pshl<vecsize> %0 = %1, %2"
547 [(set_attr "itanium_class" "mmshf")])
549 (define_insn "ashr<mode>3"
550 [(set (match_operand:VECINT24 0 "gr_register_operand" "=r")
552 (match_operand:VECINT24 1 "gr_register_operand" "r")
553 (match_operand:DI 2 "gr_reg_or_5bit_operand" "rn")))]
555 "pshr<vecsize> %0 = %1, %2"
556 [(set_attr "itanium_class" "mmshf")])
558 (define_insn "lshr<mode>3"
559 [(set (match_operand:VECINT24 0 "gr_register_operand" "=r")
561 (match_operand:VECINT24 1 "gr_register_operand" "r")
562 (match_operand:DI 2 "gr_reg_or_5bit_operand" "rn")))]
564 "pshr<vecsize>.u %0 = %1, %2"
565 [(set_attr "itanium_class" "mmshf")])
567 (define_expand "vec_shl_<mode>"
568 [(set (match_operand:VECINT 0 "gr_register_operand" "")
569 (ashift:DI (match_operand:VECINT 1 "gr_register_operand" "")
570 (match_operand:DI 2 "gr_reg_or_6bit_operand" "")))]
573 operands[0] = gen_lowpart (DImode, operands[0]);
574 operands[1] = gen_lowpart (DImode, operands[1]);
577 (define_expand "vec_shr_<mode>"
578 [(set (match_operand:VECINT 0 "gr_register_operand" "")
579 (lshiftrt:DI (match_operand:VECINT 1 "gr_register_operand" "")
580 (match_operand:DI 2 "gr_reg_or_6bit_operand" "")))]
583 operands[0] = gen_lowpart (DImode, operands[0]);
584 operands[1] = gen_lowpart (DImode, operands[1]);
587 (define_expand "widen_usumv8qi3"
588 [(match_operand:V4HI 0 "gr_register_operand" "")
589 (match_operand:V8QI 1 "gr_register_operand" "")
590 (match_operand:V4HI 2 "gr_register_operand" "")]
593 ia64_expand_widen_sum (operands, true);
597 (define_expand "widen_usumv4hi3"
598 [(match_operand:V2SI 0 "gr_register_operand" "")
599 (match_operand:V4HI 1 "gr_register_operand" "")
600 (match_operand:V2SI 2 "gr_register_operand" "")]
603 ia64_expand_widen_sum (operands, true);
607 (define_expand "widen_ssumv8qi3"
608 [(match_operand:V4HI 0 "gr_register_operand" "")
609 (match_operand:V8QI 1 "gr_register_operand" "")
610 (match_operand:V4HI 2 "gr_register_operand" "")]
613 ia64_expand_widen_sum (operands, false);
617 (define_expand "widen_ssumv4hi3"
618 [(match_operand:V2SI 0 "gr_register_operand" "")
619 (match_operand:V4HI 1 "gr_register_operand" "")
620 (match_operand:V2SI 2 "gr_register_operand" "")]
623 ia64_expand_widen_sum (operands, false);
627 (define_expand "vcond<mode><mode>"
628 [(set (match_operand:VECINT 0 "gr_register_operand" "")
631 [(match_operand:VECINT 4 "gr_reg_or_0_operand" "")
632 (match_operand:VECINT 5 "gr_reg_or_0_operand" "")])
633 (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
634 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
637 ia64_expand_vecint_cmov (operands);
641 (define_expand "vcondu<mode><mode>"
642 [(set (match_operand:VECINT 0 "gr_register_operand" "")
645 [(match_operand:VECINT 4 "gr_reg_or_0_operand" "")
646 (match_operand:VECINT 5 "gr_reg_or_0_operand" "")])
647 (match_operand:VECINT 1 "gr_reg_or_0_operand" "")
648 (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))]
651 ia64_expand_vecint_cmov (operands);
655 (define_insn "*cmpeq_<mode>"
656 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
657 (eq:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "rU")
658 (match_operand:VECINT 2 "gr_reg_or_0_operand" "rU")))]
660 "pcmp<vecsize>.eq %0 = %r1, %r2"
661 [(set_attr "itanium_class" "mmalua")])
663 (define_insn "*cmpgt_<mode>"
664 [(set (match_operand:VECINT 0 "gr_register_operand" "=r")
665 (gt:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "rU")
666 (match_operand:VECINT 2 "gr_reg_or_0_operand" "rU")))]
668 "pcmp<vecsize>.gt %0 = %r1, %r2"
669 [(set_attr "itanium_class" "mmalua")])
671 (define_insn "vec_pack_ssat_v4hi"
672 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
675 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU"))
677 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))]
680 /* Recall that vector elements are numbered in memory order. */
681 if (TARGET_BIG_ENDIAN)
682 return "%,pack2.sss %0 = %r2, %r1";
684 return "%,pack2.sss %0 = %r1, %r2";
686 [(set_attr "itanium_class" "mmshf")])
688 (define_insn "vec_pack_usat_v4hi"
689 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
692 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU"))
694 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))]
697 /* Recall that vector elements are numbered in memory order. */
698 if (TARGET_BIG_ENDIAN)
699 return "%,pack2.uss %0 = %r2, %r1";
701 return "%,pack2.uss %0 = %r1, %r2";
703 [(set_attr "itanium_class" "mmshf")])
705 (define_insn "vec_pack_ssat_v2si"
706 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
709 (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU"))
711 (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))))]
714 /* Recall that vector elements are numbered in memory order. */
715 if (TARGET_BIG_ENDIAN)
716 return "%,pack4.sss %0 = %r2, %r1";
718 return "%,pack4.sss %0 = %r1, %r2";
720 [(set_attr "itanium_class" "mmshf")])
722 (define_insn "*vec_interleave_lowv8qi"
723 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
726 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
727 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
728 (parallel [(const_int 0) (const_int 8)
729 (const_int 1) (const_int 9)
730 (const_int 2) (const_int 10)
731 (const_int 3) (const_int 11)])))]
734 /* Recall that vector elements are numbered in memory order. */
735 if (TARGET_BIG_ENDIAN)
736 return "%,unpack1.l %0 = %r1, %r2";
738 return "%,unpack1.l %0 = %r2, %r1";
740 [(set_attr "itanium_class" "mmshf")])
742 (define_insn "*vec_interleave_highv8qi"
743 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
746 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
747 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
748 (parallel [(const_int 4) (const_int 12)
749 (const_int 5) (const_int 13)
750 (const_int 6) (const_int 14)
751 (const_int 7) (const_int 15)])))]
754 /* Recall that vector elements are numbered in memory order. */
755 if (TARGET_BIG_ENDIAN)
756 return "%,unpack1.h %0 = %r1, %r2";
758 return "%,unpack1.h %0 = %r2, %r1";
760 [(set_attr "itanium_class" "mmshf")])
762 (define_insn "*mix1_even"
763 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
766 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
767 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
768 (parallel [(const_int 0) (const_int 8)
769 (const_int 2) (const_int 10)
770 (const_int 4) (const_int 12)
771 (const_int 6) (const_int 14)])))]
774 /* Recall that vector elements are numbered in memory order. */
775 if (TARGET_BIG_ENDIAN)
776 return "%,mix1.l %0 = %r1, %r2";
778 return "%,mix1.r %0 = %r2, %r1";
780 [(set_attr "itanium_class" "mmshf")])
782 (define_insn "*mix1_odd"
783 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
786 (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
787 (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
788 (parallel [(const_int 1) (const_int 9)
789 (const_int 3) (const_int 11)
790 (const_int 5) (const_int 13)
791 (const_int 7) (const_int 15)])))]
794 /* Recall that vector elements are numbered in memory order. */
795 if (TARGET_BIG_ENDIAN)
796 return "%,mix1.r %0 = %r1, %r2";
798 return "%,mix1.l %0 = %r2, %r1";
800 [(set_attr "itanium_class" "mmshf")])
802 (define_insn "*mux1_rev"
803 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
805 (match_operand:V8QI 1 "gr_register_operand" "r")
806 (parallel [(const_int 7) (const_int 6)
807 (const_int 5) (const_int 4)
808 (const_int 3) (const_int 2)
809 (const_int 1) (const_int 0)])))]
812 [(set_attr "itanium_class" "mmshf")])
814 (define_insn "*mux1_mix"
815 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
817 (match_operand:V8QI 1 "gr_register_operand" "r")
818 (parallel [(const_int 0) (const_int 4)
819 (const_int 2) (const_int 6)
820 (const_int 1) (const_int 5)
821 (const_int 3) (const_int 7)])))]
824 [(set_attr "itanium_class" "mmshf")])
826 (define_insn "*mux1_shuf"
827 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
829 (match_operand:V8QI 1 "gr_register_operand" "r")
830 (parallel [(const_int 0) (const_int 4)
831 (const_int 1) (const_int 5)
832 (const_int 2) (const_int 6)
833 (const_int 3) (const_int 7)])))]
835 "mux1 %0 = %1, @shuf"
836 [(set_attr "itanium_class" "mmshf")])
838 (define_insn "*mux1_alt"
839 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
841 (match_operand:V8QI 1 "gr_register_operand" "r")
842 (parallel [(const_int 0) (const_int 2)
843 (const_int 4) (const_int 6)
844 (const_int 1) (const_int 3)
845 (const_int 5) (const_int 7)])))]
848 [(set_attr "itanium_class" "mmshf")])
850 (define_insn "*mux1_brcst_v8qi"
851 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
853 (match_operand:V8QI 1 "gr_register_operand" "r")
854 (parallel [(match_operand 2 "mux1_brcst_element" "")
863 "mux1 %0 = %1, @brcst"
864 [(set_attr "itanium_class" "mmshf")])
866 (define_insn "mux1_brcst_qi"
867 [(set (match_operand:V8QI 0 "gr_register_operand" "=r")
869 (match_operand:QI 1 "gr_register_operand" "r")))]
871 "mux1 %0 = %1, @brcst"
872 [(set_attr "itanium_class" "mmshf")])
874 (define_insn "*vec_interleave_lowv4hi"
875 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
878 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
879 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
880 (parallel [(const_int 0) (const_int 4)
881 (const_int 1) (const_int 5)])))]
884 /* Recall that vector elements are numbered in memory order. */
885 if (TARGET_BIG_ENDIAN)
886 return "%,unpack2.l %0 = %r1, %r2";
888 return "%,unpack2.l %0 = %r2, %r1";
890 [(set_attr "itanium_class" "mmshf")])
892 (define_insn "*vec_interleave_highv4hi"
893 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
896 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
897 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
898 (parallel [(const_int 2) (const_int 6)
899 (const_int 3) (const_int 7)])))]
902 /* Recall that vector elements are numbered in memory order. */
903 if (TARGET_BIG_ENDIAN)
904 return "%,unpack2.h %0 = %r1, %r2";
906 return "%,unpack2.h %0 = %r2, %r1";
908 [(set_attr "itanium_class" "mmshf")])
910 (define_insn "mix2_even"
911 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
914 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
915 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
916 (parallel [(const_int 0) (const_int 4)
917 (const_int 2) (const_int 6)])))]
920 /* Recall that vector elements are numbered in memory order. */
921 if (TARGET_BIG_ENDIAN)
922 return "%,mix2.l %0 = %r1, %r2";
924 return "%,mix2.r %0 = %r2, %r1";
926 [(set_attr "itanium_class" "mmshf")])
928 (define_insn "mix2_odd"
929 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
932 (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
933 (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
934 (parallel [(const_int 1) (const_int 5)
935 (const_int 3) (const_int 7)])))]
938 /* Recall that vector elements are numbered in memory order. */
939 if (TARGET_BIG_ENDIAN)
940 return "%,mix2.r %0 = %r1, %r2";
942 return "%,mix2.l %0 = %r2, %r1";
944 [(set_attr "itanium_class" "mmshf")])
947 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
949 (match_operand:V4HI 1 "gr_register_operand" "r")
950 (parallel [(match_operand 2 "const_int_2bit_operand" "")
951 (match_operand 3 "const_int_2bit_operand" "")
952 (match_operand 4 "const_int_2bit_operand" "")
953 (match_operand 5 "const_int_2bit_operand" "")])))]
957 if (TARGET_BIG_ENDIAN)
959 mask |= (3 - INTVAL (operands[2])) << 6;
960 mask |= (3 - INTVAL (operands[3])) << 4;
961 mask |= (3 - INTVAL (operands[4])) << 2;
962 mask |= 3 - INTVAL (operands[5]);
966 mask |= INTVAL (operands[2]);
967 mask |= INTVAL (operands[3]) << 2;
968 mask |= INTVAL (operands[4]) << 4;
969 mask |= INTVAL (operands[5]) << 6;
971 operands[2] = GEN_INT (mask);
972 return "%,mux2 %0 = %1, %2";
974 [(set_attr "itanium_class" "mmshf")])
976 (define_insn "*mux2_brcst_hi"
977 [(set (match_operand:V4HI 0 "gr_register_operand" "=r")
979 (match_operand:HI 1 "gr_register_operand" "r")))]
982 [(set_attr "itanium_class" "mmshf")])
984 (define_insn "*vec_interleave_lowv2si"
985 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
988 (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")
989 (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))
990 (parallel [(const_int 0) (const_int 2)])))]
993 /* Recall that vector elements are numbered in memory order. */
994 if (TARGET_BIG_ENDIAN)
995 return "%,unpack4.l %0 = %r1, %r2";
997 return "%,unpack4.l %0 = %r2, %r1";
999 [(set_attr "itanium_class" "mmshf")])
1001 (define_insn "*vec_interleave_highv2si"
1002 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
1005 (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")
1006 (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))
1007 (parallel [(const_int 1) (const_int 3)])))]
1010 /* Recall that vector elements are numbered in memory order. */
1011 if (TARGET_BIG_ENDIAN)
1012 return "%,unpack4.h %0 = %r1, %r2";
1014 return "%,unpack4.h %0 = %r2, %r1";
1016 [(set_attr "itanium_class" "mmshf")])
1018 (define_expand "vec_initv2si"
1019 [(match_operand:V2SI 0 "gr_register_operand" "")
1020 (match_operand 1 "" "")]
1023 rtx op1 = XVECEXP (operands[1], 0, 0);
1024 rtx op2 = XVECEXP (operands[1], 0, 1);
1027 if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT)
1029 x = gen_rtx_CONST_VECTOR (V2SImode, XVEC (operands[1], 0));
1030 emit_move_insn (operands[0], x);
1034 if (!gr_reg_or_0_operand (op1, SImode))
1035 op1 = force_reg (SImode, op1);
1036 if (!gr_reg_or_0_operand (op2, SImode))
1037 op2 = force_reg (SImode, op2);
1039 x = gen_rtx_VEC_CONCAT (V2SImode, op1, op2);
1040 emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
1044 (define_insn "*vecinit_v2si"
1045 [(set (match_operand:V2SI 0 "gr_register_operand" "=r")
1047 (match_operand:SI 1 "gr_reg_or_0_operand" "rO")
1048 (match_operand:SI 2 "gr_reg_or_0_operand" "rO")))]
1051 /* Recall that vector elements are numbered in memory order. */
1052 if (TARGET_BIG_ENDIAN)
1053 return "%,unpack4.l %0 = %r1, %r2";
1055 return "%,unpack4.l %0 = %r2, %r1";
1057 [(set_attr "itanium_class" "mmshf")])
1059 ;; Missing operations
1068 ;; Floating point vector operations
1070 (define_expand "movv2sf"
1071 [(set (match_operand:V2SF 0 "general_operand" "")
1072 (match_operand:V2SF 1 "general_operand" ""))]
1075 rtx op1 = ia64_expand_move (operands[0], operands[1]);
1081 (define_insn "*movv2sf_internal"
1082 [(set (match_operand:V2SF 0 "destination_operand"
1083 "=f,f,f,Q,*r ,*r,*r,*r,m ,f ,*r")
1084 (match_operand:V2SF 1 "move_operand"
1085 "fU,Y,Q,f,U*r,W ,i ,m ,*r,*r,f "))]
1086 "ia64_move_ok (operands[0], operands[1])"
1088 static const char * const alt[] = {
1090 "%,fpack %0 = %F2, %F1",
1091 "%,ldf8 %0 = %1%P1",
1092 "%,stf8 %0 = %1%P0",
1094 "%,addl %0 = %v1, r0",
1096 "%,ld8%O1 %0 = %1%P1",
1097 "%,st8%Q0 %0 = %r1%P0",
1098 "%,setf.sig %0 = %1",
1099 "%,getf.sig %0 = %1"
1102 if (which_alternative == 1)
1104 operands[2] = XVECEXP (operands[1], 0, TARGET_BIG_ENDIAN ? 0 : 1);
1105 operands[1] = XVECEXP (operands[1], 0, TARGET_BIG_ENDIAN ? 1 : 0);
1108 return alt[which_alternative];
1110 [(set_attr "itanium_class" "fmisc,fmisc,fld,stf,ialu,ialu,long_i,ld,st,tofr,frfr")])
1112 (define_insn "absv2sf2"
1113 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1114 (abs:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")))]
1117 [(set_attr "itanium_class" "fmisc")])
1119 (define_insn "negv2sf2"
1120 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1121 (neg:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")))]
1124 [(set_attr "itanium_class" "fmisc")])
1126 (define_insn "*negabsv2sf2"
1127 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1129 (abs:V2SF (match_operand:V2SF 1 "fr_register_operand" "f"))))]
1132 [(set_attr "itanium_class" "fmisc")])
1134 (define_expand "addv2sf3"
1135 [(set (match_operand:V2SF 0 "fr_register_operand" "")
1136 (fma:V2SF (match_operand:V2SF 1 "fr_register_operand" "")
1138 (match_operand:V2SF 2 "fr_register_operand" "")))]
1141 rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode));
1142 operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v));
1145 (define_expand "subv2sf3"
1146 [(set (match_operand:V2SF 0 "fr_register_operand" "")
1148 (match_operand:V2SF 1 "fr_register_operand" "")
1150 (neg:V2SF (match_operand:V2SF 2 "fr_register_operand" ""))))]
1153 rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode));
1154 operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v));
1157 (define_insn "mulv2sf3"
1158 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1159 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
1160 (match_operand:V2SF 2 "fr_register_operand" "f")))]
1163 [(set_attr "itanium_class" "fmac")])
1165 (define_insn "fmav2sf4"
1166 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1168 (match_operand:V2SF 1 "fr_register_operand" "f")
1169 (match_operand:V2SF 2 "fr_register_operand" "f")
1170 (match_operand:V2SF 3 "fr_register_operand" "f")))]
1172 "fpma %0 = %1, %2, %3"
1173 [(set_attr "itanium_class" "fmac")])
1175 (define_insn "fmsv2sf4"
1176 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1178 (match_operand:V2SF 1 "fr_register_operand" "f")
1179 (match_operand:V2SF 2 "fr_register_operand" "f")
1180 (neg:V2SF (match_operand:V2SF 3 "fr_register_operand" "f"))))]
1182 "fpms %0 = %1, %2, %3"
1183 [(set_attr "itanium_class" "fmac")])
1185 (define_insn "*fpnmpy"
1186 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1188 (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
1189 (match_operand:V2SF 2 "fr_register_operand" "f"))))]
1191 "fpnmpy %0 = %1, %2"
1192 [(set_attr "itanium_class" "fmac")])
1194 (define_insn "fnmav2sf4"
1195 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1197 (neg:V2SF (match_operand:V2SF 1 "fr_register_operand" "f"))
1198 (match_operand:V2SF 2 "fr_register_operand" "f")
1199 (match_operand:V2SF 3 "fr_register_operand" "f")))]
1201 "fpnma %0 = %1, %2, %3"
1202 [(set_attr "itanium_class" "fmac")])
1204 (define_insn "smaxv2sf3"
1205 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1206 (smax:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
1207 (match_operand:V2SF 2 "fr_register_operand" "f")))]
1210 [(set_attr "itanium_class" "fmisc")])
1212 (define_insn "sminv2sf3"
1213 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1214 (smin:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")
1215 (match_operand:V2SF 2 "fr_register_operand" "f")))]
1218 [(set_attr "itanium_class" "fmisc")])
1220 (define_expand "reduc_splus_v2sf"
1221 [(match_operand:V2SF 0 "fr_register_operand" "")
1222 (match_operand:V2SF 1 "fr_register_operand" "")]
1225 rtx tmp = gen_reg_rtx (V2SFmode);
1226 if (TARGET_BIG_ENDIAN)
1227 emit_insn (gen_fswap (tmp, CONST0_RTX (V2SFmode), operands[1]));
1229 emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
1230 emit_insn (gen_addv2sf3 (operands[0], operands[1], tmp));
1234 (define_expand "reduc_smax_v2sf"
1235 [(match_operand:V2SF 0 "fr_register_operand" "")
1236 (match_operand:V2SF 1 "fr_register_operand" "")]
1239 rtx tmp = gen_reg_rtx (V2SFmode);
1240 if (TARGET_BIG_ENDIAN)
1241 emit_insn (gen_fswap (tmp, CONST0_RTX (V2SFmode), operands[1]));
1243 emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
1244 emit_insn (gen_smaxv2sf3 (operands[0], operands[1], tmp));
1248 (define_expand "reduc_smin_v2sf"
1249 [(match_operand:V2SF 0 "fr_register_operand" "")
1250 (match_operand:V2SF 1 "fr_register_operand" "")]
1253 rtx tmp = gen_reg_rtx (V2SFmode);
1254 if (TARGET_BIG_ENDIAN)
1255 emit_insn (gen_fswap (tmp, CONST0_RTX (V2SFmode), operands[1]));
1257 emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
1258 emit_insn (gen_sminv2sf3 (operands[0], operands[1], tmp));
1262 (define_expand "vcondv2sfv2sf"
1263 [(set (match_operand:V2SF 0 "fr_register_operand" "")
1265 (match_operator 3 ""
1266 [(match_operand:V2SF 4 "fr_reg_or_0_operand" "")
1267 (match_operand:V2SF 5 "fr_reg_or_0_operand" "")])
1268 (match_operand:V2SF 1 "fr_reg_or_0_operand" "")
1269 (match_operand:V2SF 2 "fr_reg_or_0_operand" "")))]
1274 cmp = gen_reg_rtx (V2SFmode);
1275 PUT_MODE (operands[3], V2SFmode);
1276 emit_insn (gen_rtx_SET (VOIDmode, cmp, operands[3]));
1278 x = gen_rtx_IF_THEN_ELSE (V2SFmode, cmp, operands[1], operands[2]);
1279 emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
1283 (define_insn "*fpcmp"
1284 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1285 (match_operator:V2SF 3 "comparison_operator"
1286 [(match_operand:V2SF 1 "fr_reg_or_0_operand" "fU")
1287 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")]))]
1289 "fpcmp.%D3 %0 = %F1, %F2"
1290 [(set_attr "itanium_class" "fmisc")])
1292 (define_insn "*fselect"
1293 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1295 (match_operand:V2SF 1 "fr_register_operand" "f")
1296 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")
1297 (match_operand:V2SF 3 "fr_reg_or_0_operand" "fU")))]
1299 "fselect %0 = %F2, %F3, %1"
1300 [(set_attr "itanium_class" "fmisc")])
1302 (define_expand "vec_initv2sf"
1303 [(match_operand:V2SF 0 "fr_register_operand" "")
1304 (match_operand 1 "" "")]
1307 rtx op1 = XVECEXP (operands[1], 0, 0);
1308 rtx op2 = XVECEXP (operands[1], 0, 1);
1311 if (GET_CODE (op1) == CONST_DOUBLE && GET_CODE (op2) == CONST_DOUBLE)
1313 x = gen_rtx_CONST_VECTOR (V2SFmode, XVEC (operands[1], 0));
1314 emit_move_insn (operands[0], x);
1318 if (!fr_reg_or_fp01_operand (op1, SFmode))
1319 op1 = force_reg (SFmode, op1);
1320 if (!fr_reg_or_fp01_operand (op2, SFmode))
1321 op2 = force_reg (SFmode, op2);
1323 emit_insn (gen_fpack (operands[0], op1, op2));
1327 (define_insn "fpack"
1328 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1330 (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
1331 (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
1334 /* Recall that vector elements are numbered in memory order. */
1335 if (TARGET_BIG_ENDIAN)
1336 return "%,fpack %0 = %F1, %F2";
1338 return "%,fpack %0 = %F2, %F1";
1340 [(set_attr "itanium_class" "fmisc")])
1342 (define_insn "fswap"
1343 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1346 (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU")
1347 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
1348 (parallel [(const_int 1) (const_int 2)])))]
1351 /* Recall that vector elements are numbered in memory order. */
1352 if (TARGET_BIG_ENDIAN)
1353 return "%,fswap %0 = %F2, %F1";
1355 return "%,fswap %0 = %F1, %F2";
1357 [(set_attr "itanium_class" "fmisc")])
1359 (define_insn "*vec_interleave_highv2sf"
1360 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1363 (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU")
1364 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
1365 (parallel [(const_int 1) (const_int 3)])))]
1368 /* Recall that vector elements are numbered in memory order. */
1369 if (TARGET_BIG_ENDIAN)
1370 return "%,fmix.l %0 = %F1, %F2";
1372 return "%,fmix.l %0 = %F2, %F1";
1374 [(set_attr "itanium_class" "fmisc")])
1376 (define_insn "*vec_interleave_lowv2sf"
1377 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1380 (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU")
1381 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
1382 (parallel [(const_int 0) (const_int 2)])))]
1385 /* Recall that vector elements are numbered in memory order. */
1386 if (TARGET_BIG_ENDIAN)
1387 return "%,fmix.r %0 = %F1, %F2";
1389 return "%,fmix.r %0 = %F2, %F1";
1391 [(set_attr "itanium_class" "fmisc")])
1393 (define_insn "fmix_lr"
1394 [(set (match_operand:V2SF 0 "fr_register_operand" "=f")
1397 (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU")
1398 (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
1399 (parallel [(const_int 0) (const_int 3)])))]
1402 /* Recall that vector elements are numbered in memory order. */
1403 if (TARGET_BIG_ENDIAN)
1404 return "%,fmix.lr %0 = %F1, %F2";
1406 return "%,fmix.lr %0 = %F2, %F1";
1408 [(set_attr "itanium_class" "fmisc")])
1410 (define_expand "vec_setv2sf"
1411 [(match_operand:V2SF 0 "fr_register_operand" "")
1412 (match_operand:SF 1 "fr_register_operand" "")
1413 (match_operand 2 "const_int_operand" "")]
1416 ia64_expand_vec_setv2sf (operands);
1420 (define_insn_and_split "*vec_extractv2sf_0_le"
1421 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,f,m")
1422 (unspec:SF [(match_operand:V2SF 1 "nonimmediate_operand" "rfm,rm,r")
1425 "!TARGET_BIG_ENDIAN"
1428 [(set (match_dup 0) (match_dup 1))]
1430 if (REG_P (operands[1]) && FR_REGNO_P (REGNO (operands[1])))
1431 operands[0] = gen_rtx_REG (V2SFmode, REGNO (operands[0]));
1432 else if (MEM_P (operands[1]))
1433 operands[1] = adjust_address (operands[1], SFmode, 0);
1435 operands[1] = gen_rtx_REG (SFmode, REGNO (operands[1]));
1438 (define_insn_and_split "*vec_extractv2sf_0_be"
1439 [(set (match_operand:SF 0 "register_operand" "=rf,r")
1440 (unspec:SF [(match_operand:V2SF 1 "nonimmediate_operand" "m,r")
1446 [(set (match_dup 0) (match_dup 1))]
1448 if (MEM_P (operands[1]))
1449 operands[1] = adjust_address (operands[1], SFmode, 0);
1452 emit_insn (gen_lshrdi3 (operands[0], operands[1], GEN_INT (32)));
1457 (define_insn_and_split "*vec_extractv2sf_1_le"
1458 [(set (match_operand:SF 0 "register_operand" "=r")
1459 (unspec:SF [(match_operand:V2SF 1 "register_operand" "r")
1462 "!TARGET_BIG_ENDIAN"
1464 "&& reload_completed"
1467 operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
1468 operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));
1469 emit_insn (gen_lshrdi3 (operands[0], operands[1], GEN_INT (32)));
1473 (define_insn_and_split "*vec_extractv2sf_1_be"
1474 [(set (match_operand:SF 0 "register_operand" "=rf")
1475 (unspec:SF [(match_operand:V2SF 1 "register_operand" "r")
1480 "&& reload_completed"
1481 [(set (match_dup 0) (match_dup 1))]
1483 operands[1] = gen_rtx_REG (SFmode, REGNO (operands[1]));
1486 (define_expand "vec_extractv2sf"
1487 [(set (match_operand:SF 0 "register_operand" "")
1488 (unspec:SF [(match_operand:V2SF 1 "register_operand" "")
1489 (match_operand:DI 2 "const_int_operand" "")]
1494 (define_expand "vec_unpacku_lo_<mode>"
1495 [(match_operand:<vecwider> 0 "register_operand" "")
1496 (match_operand:VECINT12 1 "register_operand" "")]
1499 ia64_expand_unpack (operands, true, false);
1503 (define_expand "vec_unpacku_hi_<mode>"
1504 [(match_operand:<vecwider> 0 "register_operand" "")
1505 (match_operand:VECINT12 1 "register_operand" "")]
1508 ia64_expand_unpack (operands, true, true);
1512 (define_expand "vec_unpacks_lo_<mode>"
1513 [(match_operand:<vecwider> 0 "register_operand" "")
1514 (match_operand:VECINT12 1 "register_operand" "")]
1517 ia64_expand_unpack (operands, false, false);
1521 (define_expand "vec_unpacks_hi_<mode>"
1522 [(match_operand:<vecwider> 0 "register_operand" "")
1523 (match_operand:VECINT12 1 "register_operand" "")]
1526 ia64_expand_unpack (operands, false, true);
1530 (define_expand "vec_pack_trunc_v4hi"
1531 [(match_operand:V8QI 0 "gr_register_operand" "")
1532 (match_operand:V4HI 1 "gr_register_operand" "")
1533 (match_operand:V4HI 2 "gr_register_operand" "")]
1536 rtx op1 = gen_lowpart (V8QImode, operands[1]);
1537 rtx op2 = gen_lowpart (V8QImode, operands[2]);
1538 ia64_expand_vec_perm_even_odd (operands[0], op1, op2, TARGET_BIG_ENDIAN);
1542 (define_expand "vec_pack_trunc_v2si"
1543 [(match_operand:V4HI 0 "gr_register_operand" "")
1544 (match_operand:V2SI 1 "gr_register_operand" "")
1545 (match_operand:V2SI 2 "gr_register_operand" "")]
1548 rtx op1 = gen_lowpart (V4HImode, operands[1]);
1549 rtx op2 = gen_lowpart (V4HImode, operands[2]);
1550 ia64_expand_vec_perm_even_odd (operands[0], op1, op2, TARGET_BIG_ENDIAN);
1554 (define_expand "vec_perm_const<mode>"
1555 [(match_operand:VEC 0 "register_operand" "")
1556 (match_operand:VEC 1 "register_operand" "")
1557 (match_operand:VEC 2 "register_operand" "")
1558 (match_operand:<vecint> 3 "" "")]
1561 if (ia64_expand_vec_perm_const (operands))
1567 ;; Missing operations