1 ;; IA-64 Machine description template
2 ;; Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3 ;; Contributed by James E. Wilson <wilson@cygnus.com> and
4 ;; David Mosberger <davidm@hpl.hp.com>.
6 ;; This file is part of GNU CC.
8 ;; GNU CC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; GNU CC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU CC; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
23 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
25 ;; ??? register_operand accepts (subreg:DI (mem:SI X)) which forces later
26 ;; reload. This will be fixed once scheduling support is turned on.
28 ;; ??? Optimize for post-increment addressing modes.
30 ;; ??? fselect is not supported, because there is no integer register
33 ;; ??? fp abs/min/max instructions may also work for integer values.
35 ;; ??? Would a predicate_reg_operand predicate be useful? The HP one is buggy,
36 ;; it assumes the operand is a register and takes REGNO of it without checking.
38 ;; ??? Would a branch_reg_operand predicate be useful? The HP one is buggy,
39 ;; it assumes the operand is a register and takes REGNO of it without checking.
41 ;; ??? Go through list of documented named patterns and look for more to
44 ;; ??? Go through instruction manual and look for more instructions that
47 ;; ??? Add function unit scheduling info for Itanium (TM) processor.
49 ;; ??? Need a better way to describe alternate fp status registers.
53 (UNSPEC_LTOFF_DTPMOD 0)
54 (UNSPEC_LTOFF_DTPREL 1)
56 (UNSPEC_LTOFF_TPREL 3)
61 (UNSPEC_GR_RESTORE 11)
63 (UNSPEC_FR_RESTORE 13)
64 (UNSPEC_FR_RECIP_APPROX 14)
65 (UNSPEC_PRED_REL_MUTEX 15)
69 (UNSPEC_CMPXCHG_ACQ 19)
70 (UNSPEC_FETCHADD_ACQ 20)
73 (UNSPEC_BUNDLE_SELECTOR 23)
75 (UNSPEC_PROLOGUE_USE 25)
81 (UNSPECV_INSN_GROUP_BARRIER 2)
84 (UNSPECV_PSAC_ALL 5) ; pred.safe_across_calls
85 (UNSPECV_PSAC_NORMAL 6)
88 ;; ::::::::::::::::::::
92 ;; ::::::::::::::::::::
94 ;; Instruction type. This primarily determines how instructions can be
95 ;; packed in bundles, and secondarily affects scheduling to function units.
97 ;; A alu, can go in I or M syllable of a bundle
102 ;; L long immediate, takes two syllables
105 ;; ??? Should not have any pattern with type unknown. Perhaps add code to
106 ;; check this in md_reorg? Currently use unknown for patterns which emit
107 ;; multiple instructions, patterns which emit 0 instructions, and patterns
108 ;; which emit instruction that can go in any slot (e.g. nop).
110 (define_attr "itanium_class" "unknown,ignore,stop_bit,br,fcmp,fcvtfx,fld,
111 fmac,fmisc,frar_i,frar_m,frbr,frfr,frpr,ialu,icmp,ilog,ishf,ld,
112 chk_s,long_i,mmmul,mmshf,mmshfi,rse_m,scall,sem,stf,st,syst_m0,
113 syst_m,tbit,toar_i,toar_m,tobr,tofr,topr,xmpy,xtd,nop_b,nop_f,
114 nop_i,nop_m,nop_x,lfetch"
115 (const_string "unknown"))
117 ;; chk_s has an I and an M form; use type A for convenience.
118 (define_attr "type" "unknown,A,I,M,F,B,L,X,S"
119 (cond [(eq_attr "itanium_class" "ld,st,fld,stf,sem,nop_m") (const_string "M")
120 (eq_attr "itanium_class" "rse_m,syst_m,syst_m0") (const_string "M")
121 (eq_attr "itanium_class" "frar_m,toar_m,frfr,tofr") (const_string "M")
122 (eq_attr "itanium_class" "lfetch") (const_string "M")
123 (eq_attr "itanium_class" "chk_s,ialu,icmp,ilog") (const_string "A")
124 (eq_attr "itanium_class" "fmisc,fmac,fcmp,xmpy") (const_string "F")
125 (eq_attr "itanium_class" "fcvtfx,nop_f") (const_string "F")
126 (eq_attr "itanium_class" "frar_i,toar_i,frbr,tobr") (const_string "I")
127 (eq_attr "itanium_class" "frpr,topr,ishf,xtd,tbit") (const_string "I")
128 (eq_attr "itanium_class" "mmmul,mmshf,mmshfi,nop_i") (const_string "I")
129 (eq_attr "itanium_class" "br,scall,nop_b") (const_string "B")
130 (eq_attr "itanium_class" "stop_bit") (const_string "S")
131 (eq_attr "itanium_class" "nop_x") (const_string "X")
132 (eq_attr "itanium_class" "long_i") (const_string "L")]
133 (const_string "unknown")))
135 (define_attr "itanium_requires_unit0" "no,yes"
136 (cond [(eq_attr "itanium_class" "syst_m0,sem,frfr,rse_m") (const_string "yes")
137 (eq_attr "itanium_class" "toar_m,frar_m") (const_string "yes")
138 (eq_attr "itanium_class" "frbr,tobr,mmmul") (const_string "yes")
139 (eq_attr "itanium_class" "tbit,ishf,topr,frpr") (const_string "yes")
140 (eq_attr "itanium_class" "toar_i,frar_i") (const_string "yes")
141 (eq_attr "itanium_class" "fmisc,fcmp") (const_string "yes")]
142 (const_string "no")))
144 ;; Predication. True iff this instruction can be predicated.
146 (define_attr "predicable" "no,yes" (const_string "yes"))
149 ;; ::::::::::::::::::::
153 ;; ::::::::::::::::::::
155 ;; We define 6 "dummy" functional units. All the real work to decide which
156 ;; insn uses which unit is done by our MD_SCHED_REORDER hooks. We only
157 ;; have to ensure here that there are enough copies of the dummy unit so
158 ;; that the scheduler doesn't get confused by MD_SCHED_REORDER.
159 ;; Other than the 6 dummies for normal insns, we also add a single dummy unit
162 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "br") 0 0)
163 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "scall") 0 0)
164 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "fcmp") 2 0)
165 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "fcvtfx") 7 0)
166 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "fld") 9 0)
167 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "fmac") 5 0)
168 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "fmisc") 5 0)
170 ;; There is only one insn `mov = ar.bsp' for frar_i:
171 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "frar_i") 13 0)
172 ;; There is only ony insn `mov = ar.unat' for frar_m:
173 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "frar_m") 6 0)
174 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "frbr") 2 0)
175 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "frfr") 2 0)
176 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "frpr") 2 0)
178 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "ialu") 1 0)
179 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "icmp") 1 0)
180 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "ilog") 1 0)
181 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "ishf") 1 0)
182 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "ld") 2 0)
183 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "long_i") 1 0)
184 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "mmmul") 2 0)
185 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "mmshf") 2 0)
186 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "mmshfi") 2 0)
188 ;; Now we have only one insn (flushrs) of such class. We assume that flushrs
189 ;; is the 1st syllable of the bundle after stop bit.
190 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "rse_m") 0 0)
191 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "sem") 11 0)
192 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "stf") 1 0)
193 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "st") 1 0)
194 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "syst_m0") 1 0)
195 ;; Now we use only one insn `mf'. Therfore latency time is set up to 0.
196 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "syst_m") 0 0)
197 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "tbit") 1 0)
199 ;; There is only one insn `mov ar.pfs =' for toar_i therefore we use
200 ;; latency time equal to 0:
201 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "toar_i") 0 0)
202 ;; There are only ony 2 insns `mov ar.ccv =' and `mov ar.unat =' for toar_m:
203 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "toar_m") 5 0)
204 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "tobr") 1 0)
205 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "tofr") 9 0)
206 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "topr") 1 0)
207 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "xmpy") 7 0)
208 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "xtd") 1 0)
210 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "nop_m") 0 0)
211 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "nop_i") 0 0)
212 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "nop_f") 0 0)
213 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "nop_b") 0 0)
214 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "nop_x") 0 0)
216 (define_function_unit "stop_bit" 1 1 (eq_attr "itanium_class" "stop_bit") 0 0)
217 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "ignore") 0 0)
218 (define_function_unit "dummy" 6 1 (eq_attr "itanium_class" "unknown") 0 0)
220 ;; ::::::::::::::::::::
224 ;; ::::::::::::::::::::
226 ;; Set of a single predicate register. This is only used to implement
227 ;; pr-to-pr move and complement.
229 (define_insn "*movcci"
230 [(set (match_operand:CCI 0 "register_operand" "=c,c,c")
231 (match_operand:CCI 1 "nonmemory_operand" "O,n,c"))]
234 cmp.ne %0, p0 = r0, r0
235 cmp.eq %0, p0 = r0, r0
236 (%1) cmp.eq.unc %0, p0 = r0, r0"
237 [(set_attr "itanium_class" "icmp")
238 (set_attr "predicable" "no")])
241 [(set (match_operand:BI 0 "nonimmediate_operand" "=c,c,?c,?*r, c,*r,*r,*m,*r")
242 (match_operand:BI 1 "move_operand" " O,n, c, c,*r, n,*m,*r,*r"))]
245 cmp.ne %0, %I0 = r0, r0
246 cmp.eq %0, %I0 = r0, r0
249 tbit.nz %0, %I0 = %1, 0
254 [(set_attr "itanium_class" "icmp,icmp,unknown,unknown,tbit,ialu,ld,st,ialu")])
257 [(set (match_operand:BI 0 "register_operand" "")
258 (match_operand:BI 1 "register_operand" ""))]
260 && GET_CODE (operands[0]) == REG && GR_REGNO_P (REGNO (operands[0]))
261 && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))"
262 [(cond_exec (ne (match_dup 1) (const_int 0))
263 (set (match_dup 0) (const_int 1)))
264 (cond_exec (eq (match_dup 1) (const_int 0))
265 (set (match_dup 0) (const_int 0)))]
269 [(set (match_operand:BI 0 "register_operand" "")
270 (match_operand:BI 1 "register_operand" ""))]
272 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
273 && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))"
274 [(set (match_dup 2) (match_dup 4))
275 (set (match_dup 3) (match_dup 5))
276 (set (match_dup 0) (unspec:BI [(match_dup 0)] UNSPEC_PRED_REL_MUTEX))]
277 "operands[2] = gen_rtx_REG (CCImode, REGNO (operands[0]));
278 operands[3] = gen_rtx_REG (CCImode, REGNO (operands[0]) + 1);
279 operands[4] = gen_rtx_REG (CCImode, REGNO (operands[1]));
280 operands[5] = gen_rtx_REG (CCImode, REGNO (operands[1]) + 1);")
282 (define_expand "movqi"
283 [(set (match_operand:QI 0 "general_operand" "")
284 (match_operand:QI 1 "general_operand" ""))]
287 rtx op1 = ia64_expand_move (operands[0], operands[1]);
293 (define_insn "*movqi_internal"
294 [(set (match_operand:QI 0 "destination_operand" "=r,r,r, m, r,*f,*f")
295 (match_operand:QI 1 "move_operand" "rO,J,m,rO,*f,rO,*f"))]
296 "ia64_move_ok (operands[0], operands[1])"
305 [(set_attr "itanium_class" "ialu,ialu,ld,st,frfr,tofr,fmisc")])
307 (define_expand "movhi"
308 [(set (match_operand:HI 0 "general_operand" "")
309 (match_operand:HI 1 "general_operand" ""))]
312 rtx op1 = ia64_expand_move (operands[0], operands[1]);
318 (define_insn "*movhi_internal"
319 [(set (match_operand:HI 0 "destination_operand" "=r,r,r, m, r,*f,*f")
320 (match_operand:HI 1 "move_operand" "rO,J,m,rO,*f,rO,*f"))]
321 "ia64_move_ok (operands[0], operands[1])"
330 [(set_attr "itanium_class" "ialu,ialu,ld,st,frfr,tofr,fmisc")])
332 (define_expand "movsi"
333 [(set (match_operand:SI 0 "general_operand" "")
334 (match_operand:SI 1 "general_operand" ""))]
337 rtx op1 = ia64_expand_move (operands[0], operands[1]);
343 ;; This is used during early compilation to delay the decision on
344 ;; how to refer to a variable as long as possible. This is especially
345 ;; important between initial rtl generation and optimization for
346 ;; deferred functions, since we may acquire additional information
347 ;; on the variables used in the meantime.
349 (define_insn_and_split "movsi_symbolic"
350 [(set (match_operand:SI 0 "register_operand" "=r")
351 (match_operand:SI 1 "symbolic_operand" "s"))
352 (clobber (match_scratch:DI 2 "=r"))
356 "!no_new_pseudos || reload_completed"
359 rtx scratch = operands[2];
360 if (!reload_completed)
361 scratch = gen_reg_rtx (Pmode);
362 ia64_expand_load_address (operands[0], operands[1], scratch);
366 (define_insn "*movsi_internal"
367 [(set (match_operand:SI 0 "destination_operand" "=r,r,r,r, m, r,*f,*f, r,*d")
368 (match_operand:SI 1 "move_operand" "rO,J,i,m,rO,*f,rO,*f,*d,rK"))]
369 "ia64_move_ok (operands[0], operands[1])"
381 ;; frar_m, toar_m ??? why not frar_i and toar_i
382 [(set_attr "itanium_class" "ialu,ialu,long_i,ld,st,frfr,tofr,fmisc,frar_m,toar_m")])
384 (define_expand "movdi"
385 [(set (match_operand:DI 0 "general_operand" "")
386 (match_operand:DI 1 "general_operand" ""))]
389 rtx op1 = ia64_expand_move (operands[0], operands[1]);
395 ;; This is used during early compilation to delay the decision on
396 ;; how to refer to a variable as long as possible. This is especially
397 ;; important between initial rtl generation and optimization for
398 ;; deferred functions, since we may acquire additional information
399 ;; on the variables used in the meantime.
401 (define_insn_and_split "movdi_symbolic"
402 [(set (match_operand:DI 0 "register_operand" "=r")
403 (match_operand:DI 1 "symbolic_operand" "s"))
404 (clobber (match_scratch:DI 2 "=r"))
408 "!no_new_pseudos || reload_completed"
411 rtx scratch = operands[2];
412 if (!reload_completed)
413 scratch = gen_reg_rtx (Pmode);
414 ia64_expand_load_address (operands[0], operands[1], scratch);
418 (define_insn "*movdi_internal"
419 [(set (match_operand:DI 0 "destination_operand"
420 "=r,r,r,r, m, r,*f,*f,*f, Q, r,*b, r,*e, r,*d, r,*c")
421 (match_operand:DI 1 "move_operand"
422 "rO,J,i,m,rO,*f,rO,*f, Q,*f,*b,rO,*e,rK,*d,rK,*c,rO"))]
423 "ia64_move_ok (operands[0], operands[1])"
425 static const char * const alt[] = {
427 "%,addl %0 = %1, r0",
429 "%,ld8%O1 %0 = %1%P1",
430 "%,st8%Q0 %0 = %r1%P0",
431 "%,getf.sig %0 = %1",
432 "%,setf.sig %0 = %r1",
446 if (which_alternative == 2 && ! TARGET_NO_PIC
447 && symbolic_operand (operands[1], VOIDmode))
450 return alt[which_alternative];
452 [(set_attr "itanium_class" "ialu,ialu,long_i,ld,st,frfr,tofr,fmisc,fld,stf,frbr,tobr,frar_i,toar_i,frar_m,toar_m,frpr,topr")])
455 [(set (match_operand:DI 0 "register_operand" "")
456 (match_operand:DI 1 "symbolic_operand" ""))]
457 "reload_completed && ! TARGET_NO_PIC"
460 ia64_expand_load_address (operands[0], operands[1], NULL_RTX);
464 (define_expand "load_fptr"
466 (plus:DI (reg:DI 1) (match_operand 1 "function_operand" "")))
467 (set (match_operand:DI 0 "register_operand" "") (match_dup 3))]
470 operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
471 operands[3] = gen_rtx_MEM (DImode, operands[2]);
472 RTX_UNCHANGING_P (operands[3]) = 1;
475 (define_insn "*load_fptr_internal1"
476 [(set (match_operand:DI 0 "register_operand" "=r")
477 (plus:DI (reg:DI 1) (match_operand 1 "function_operand" "s")))]
479 "addl %0 = @ltoff(@fptr(%1)), gp"
480 [(set_attr "itanium_class" "ialu")])
482 (define_insn "load_gprel"
483 [(set (match_operand:DI 0 "register_operand" "=r")
484 (plus:DI (reg:DI 1) (match_operand 1 "sdata_symbolic_operand" "s")))]
486 "addl %0 = @gprel(%1), gp"
487 [(set_attr "itanium_class" "ialu")])
489 (define_insn "gprel64_offset"
490 [(set (match_operand:DI 0 "register_operand" "=r")
491 (minus:DI (match_operand:DI 1 "symbolic_operand" "") (reg:DI 1)))]
493 "movl %0 = @gprel(%1)"
494 [(set_attr "itanium_class" "long_i")])
496 (define_expand "load_gprel64"
498 (minus:DI (match_operand:DI 1 "symbolic_operand" "") (match_dup 3)))
499 (set (match_operand:DI 0 "register_operand" "")
500 (plus:DI (match_dup 3) (match_dup 2)))]
503 operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
504 operands[3] = pic_offset_table_rtx;
507 (define_expand "load_symptr"
508 [(set (match_operand:DI 2 "register_operand" "")
509 (plus:DI (match_dup 4) (match_operand:DI 1 "got_symbolic_operand" "")))
510 (set (match_operand:DI 0 "register_operand" "") (match_dup 3))]
513 operands[3] = gen_rtx_MEM (DImode, operands[2]);
514 operands[4] = pic_offset_table_rtx;
515 RTX_UNCHANGING_P (operands[3]) = 1;
518 (define_insn "*load_symptr_internal1"
519 [(set (match_operand:DI 0 "register_operand" "=r")
520 (plus:DI (reg:DI 1) (match_operand 1 "got_symbolic_operand" "s")))]
522 "addl %0 = @ltoff(%1), gp"
523 [(set_attr "itanium_class" "ialu")])
525 (define_insn "load_ltoff_dtpmod"
526 [(set (match_operand:DI 0 "register_operand" "=r")
528 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
529 UNSPEC_LTOFF_DTPMOD)))]
531 "addl %0 = @ltoff(@dtpmod(%1)), gp"
532 [(set_attr "itanium_class" "ialu")])
534 (define_insn "load_ltoff_dtprel"
535 [(set (match_operand:DI 0 "register_operand" "=r")
537 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
538 UNSPEC_LTOFF_DTPREL)))]
540 "addl %0 = @ltoff(@dtprel(%1)), gp"
541 [(set_attr "itanium_class" "ialu")])
543 (define_expand "load_dtprel"
544 [(set (match_operand:DI 0 "register_operand" "")
545 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
550 (define_insn "*load_dtprel64"
551 [(set (match_operand:DI 0 "register_operand" "=r")
552 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
555 "movl %0 = @dtprel(%1)"
556 [(set_attr "itanium_class" "long_i")])
558 (define_insn "*load_dtprel22"
559 [(set (match_operand:DI 0 "register_operand" "=r")
560 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
563 "addl %0 = @dtprel(%1), r0"
564 [(set_attr "itanium_class" "ialu")])
566 (define_expand "add_dtprel"
567 [(set (match_operand:DI 0 "register_operand" "")
568 (plus:DI (match_operand:DI 1 "register_operand" "")
569 (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")]
574 (define_insn "*add_dtprel14"
575 [(set (match_operand:DI 0 "register_operand" "=r")
576 (plus:DI (match_operand:DI 1 "register_operand" "r")
577 (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")]
580 "adds %0 = @dtprel(%2), %1"
581 [(set_attr "itanium_class" "ialu")])
583 (define_insn "*add_dtprel22"
584 [(set (match_operand:DI 0 "register_operand" "=r")
585 (plus:DI (match_operand:DI 1 "register_operand" "a")
586 (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")]
589 "addl %0 = @dtprel(%2), %1"
590 [(set_attr "itanium_class" "ialu")])
592 (define_insn "load_ltoff_tprel"
593 [(set (match_operand:DI 0 "register_operand" "=r")
595 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
596 UNSPEC_LTOFF_TPREL)))]
598 "addl %0 = @ltoff(@tprel(%1)), gp"
599 [(set_attr "itanium_class" "ialu")])
601 (define_expand "load_tprel"
602 [(set (match_operand:DI 0 "register_operand" "")
603 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
608 (define_insn "*load_tprel64"
609 [(set (match_operand:DI 0 "register_operand" "=r")
610 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
613 "movl %0 = @tprel(%1)"
614 [(set_attr "itanium_class" "long_i")])
616 (define_insn "*load_tprel22"
617 [(set (match_operand:DI 0 "register_operand" "=r")
618 (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")]
621 "addl %0 = @tprel(%1), r0"
622 [(set_attr "itanium_class" "ialu")])
624 (define_expand "add_tprel"
625 [(set (match_operand:DI 0 "register_operand" "")
626 (plus:DI (match_operand:DI 1 "register_operand" "")
627 (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")]
632 (define_insn "*add_tprel14"
633 [(set (match_operand:DI 0 "register_operand" "=r")
634 (plus:DI (match_operand:DI 1 "register_operand" "r")
635 (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")]
638 "adds %0 = @tprel(%2), %1"
639 [(set_attr "itanium_class" "ialu")])
641 (define_insn "*add_tprel22"
642 [(set (match_operand:DI 0 "register_operand" "=r")
643 (plus:DI (match_operand:DI 1 "register_operand" "a")
644 (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")]
647 "addl %0 = @tprel(%2), %1"
648 [(set_attr "itanium_class" "ialu")])
650 ;; With no offsettable memory references, we've got to have a scratch
651 ;; around to play with the second word.
652 (define_expand "movti"
653 [(parallel [(set (match_operand:TI 0 "general_operand" "")
654 (match_operand:TI 1 "general_operand" ""))
655 (clobber (match_scratch:DI 2 ""))])]
658 rtx op1 = ia64_expand_move (operands[0], operands[1]);
664 (define_insn_and_split "*movti_internal"
665 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m")
666 (match_operand:TI 1 "general_operand" "ri,m,r"))
667 (clobber (match_scratch:DI 2 "=X,&r,&r"))]
668 "ia64_move_ok (operands[0], operands[1])"
673 rtx adj1, adj2, in[2], out[2], insn;
676 adj1 = ia64_split_timode (in, operands[1], operands[2]);
677 adj2 = ia64_split_timode (out, operands[0], operands[2]);
680 if (reg_overlap_mentioned_p (out[0], in[1]))
682 if (reg_overlap_mentioned_p (out[1], in[0]))
693 insn = emit_insn (gen_rtx_SET (VOIDmode, out[first], in[first]));
694 if (GET_CODE (out[first]) == MEM
695 && GET_CODE (XEXP (out[first], 0)) == POST_MODIFY)
696 REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_INC,
697 XEXP (XEXP (out[first], 0), 0),
699 insn = emit_insn (gen_rtx_SET (VOIDmode, out[!first], in[!first]));
700 if (GET_CODE (out[!first]) == MEM
701 && GET_CODE (XEXP (out[!first], 0)) == POST_MODIFY)
702 REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_INC,
703 XEXP (XEXP (out[!first], 0), 0),
707 [(set_attr "itanium_class" "unknown")
708 (set_attr "predicable" "no")])
710 ;; ??? SSA creates these. Can't allow memories since we don't have
711 ;; the scratch register. Fortunately combine will know how to add
712 ;; the clobber and scratch.
713 (define_insn_and_split "*movti_internal_reg"
714 [(set (match_operand:TI 0 "register_operand" "=r")
715 (match_operand:TI 1 "nonmemory_operand" "ri"))]
724 ia64_split_timode (in, operands[1], NULL_RTX);
725 ia64_split_timode (out, operands[0], NULL_RTX);
728 if (reg_overlap_mentioned_p (out[0], in[1]))
730 if (reg_overlap_mentioned_p (out[1], in[0]))
735 emit_insn (gen_rtx_SET (VOIDmode, out[first], in[first]));
736 emit_insn (gen_rtx_SET (VOIDmode, out[!first], in[!first]));
739 [(set_attr "itanium_class" "unknown")
740 (set_attr "predicable" "no")])
742 (define_expand "reload_inti"
743 [(parallel [(set (match_operand:TI 0 "register_operand" "=r")
744 (match_operand:TI 1 "" "m"))
745 (clobber (match_operand:TI 2 "register_operand" "=&r"))])]
748 unsigned int s_regno = REGNO (operands[2]);
749 if (s_regno == REGNO (operands[0]))
751 operands[2] = gen_rtx_REG (DImode, s_regno);
754 (define_expand "reload_outti"
755 [(parallel [(set (match_operand:TI 0 "" "=m")
756 (match_operand:TI 1 "register_operand" "r"))
757 (clobber (match_operand:TI 2 "register_operand" "=&r"))])]
760 unsigned int s_regno = REGNO (operands[2]);
761 if (s_regno == REGNO (operands[1]))
763 operands[2] = gen_rtx_REG (DImode, s_regno);
766 ;; Floating Point Moves
768 ;; Note - Patterns for SF mode moves are compulsory, but
769 ;; patterns for DF are optional, as GCC can synthesize them.
771 (define_expand "movsf"
772 [(set (match_operand:SF 0 "general_operand" "")
773 (match_operand:SF 1 "general_operand" ""))]
776 rtx op1 = ia64_expand_move (operands[0], operands[1]);
782 (define_insn "*movsf_internal"
783 [(set (match_operand:SF 0 "destination_operand" "=f,f, Q,*r, f,*r,*r, m")
784 (match_operand:SF 1 "general_operand" "fG,Q,fG,fG,*r,*r, m,*r"))]
785 "ia64_move_ok (operands[0], operands[1])"
795 [(set_attr "itanium_class" "fmisc,fld,stf,frfr,tofr,ialu,ld,st")])
797 (define_expand "movdf"
798 [(set (match_operand:DF 0 "general_operand" "")
799 (match_operand:DF 1 "general_operand" ""))]
802 rtx op1 = ia64_expand_move (operands[0], operands[1]);
808 (define_insn "*movdf_internal"
809 [(set (match_operand:DF 0 "destination_operand" "=f,f, Q,*r, f,*r,*r, m")
810 (match_operand:DF 1 "general_operand" "fG,Q,fG,fG,*r,*r, m,*r"))]
811 "ia64_move_ok (operands[0], operands[1])"
821 [(set_attr "itanium_class" "fmisc,fld,stf,frfr,tofr,ialu,ld,st")])
823 ;; With no offsettable memory references, we've got to have a scratch
824 ;; around to play with the second word if the variable winds up in GRs.
825 (define_expand "movtf"
826 [(set (match_operand:TF 0 "general_operand" "")
827 (match_operand:TF 1 "general_operand" ""))]
828 "INTEL_EXTENDED_IEEE_FORMAT"
830 /* We must support TFmode loads into general registers for stdarg/vararg
831 and unprototyped calls. We split them into DImode loads for convenience.
832 We don't need TFmode stores from general regs, because a stdarg/vararg
833 routine does a block store to memory of unnamed arguments. */
834 if (GET_CODE (operands[0]) == REG
835 && GR_REGNO_P (REGNO (operands[0])))
837 /* We're hoping to transform everything that deals with TFmode
838 quantities and GR registers early in the compiler. */
842 /* Struct to register can just use TImode instead. */
843 if ((GET_CODE (operands[1]) == SUBREG
844 && GET_MODE (SUBREG_REG (operands[1])) == TImode)
845 || (GET_CODE (operands[1]) == REG
846 && GR_REGNO_P (REGNO (operands[1]))))
848 emit_move_insn (gen_rtx_REG (TImode, REGNO (operands[0])),
849 SUBREG_REG (operands[1]));
853 if (GET_CODE (operands[1]) == CONST_DOUBLE)
855 emit_move_insn (gen_rtx_REG (DImode, REGNO (operands[0])),
856 operand_subword (operands[1], 0, 0, TFmode));
857 emit_move_insn (gen_rtx_REG (DImode, REGNO (operands[0]) + 1),
858 operand_subword (operands[1], 1, 0, TFmode));
862 /* If the quantity is in a register not known to be GR, spill it. */
863 if (register_operand (operands[1], TFmode))
864 operands[1] = spill_tfmode_operand (operands[1], 1);
866 if (GET_CODE (operands[1]) == MEM)
870 out[WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (operands[0]));
871 out[!WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (operands[0])+1);
873 emit_move_insn (out[0], adjust_address (operands[1], DImode, 0));
874 emit_move_insn (out[1], adjust_address (operands[1], DImode, 8));
881 if (! reload_in_progress && ! reload_completed)
883 operands[0] = spill_tfmode_operand (operands[0], 0);
884 operands[1] = spill_tfmode_operand (operands[1], 0);
886 if (! ia64_move_ok (operands[0], operands[1]))
887 operands[1] = force_reg (TFmode, operands[1]);
891 ;; ??? There's no easy way to mind volatile acquire/release semantics.
893 (define_insn "*movtf_internal"
894 [(set (match_operand:TF 0 "destination_tfmode_operand" "=f,f, m")
895 (match_operand:TF 1 "general_tfmode_operand" "fG,m,fG"))]
896 "INTEL_EXTENDED_IEEE_FORMAT && ia64_move_ok (operands[0], operands[1])"
901 [(set_attr "itanium_class" "fmisc,fld,stf")])
903 ;; ::::::::::::::::::::
907 ;; ::::::::::::::::::::
909 ;; Signed conversions from a smaller integer to a larger integer
911 (define_insn "extendqidi2"
912 [(set (match_operand:DI 0 "gr_register_operand" "=r")
913 (sign_extend:DI (match_operand:QI 1 "gr_register_operand" "r")))]
916 [(set_attr "itanium_class" "xtd")])
918 (define_insn "extendhidi2"
919 [(set (match_operand:DI 0 "gr_register_operand" "=r")
920 (sign_extend:DI (match_operand:HI 1 "gr_register_operand" "r")))]
923 [(set_attr "itanium_class" "xtd")])
925 (define_insn "extendsidi2"
926 [(set (match_operand:DI 0 "grfr_register_operand" "=r,?f")
927 (sign_extend:DI (match_operand:SI 1 "grfr_register_operand" "r,f")))]
932 [(set_attr "itanium_class" "xtd,fmisc")])
934 ;; Unsigned conversions from a smaller integer to a larger integer
936 (define_insn "zero_extendqidi2"
937 [(set (match_operand:DI 0 "gr_register_operand" "=r,r")
938 (zero_extend:DI (match_operand:QI 1 "gr_nonimmediate_operand" "r,m")))]
943 [(set_attr "itanium_class" "xtd,ld")])
945 (define_insn "zero_extendhidi2"
946 [(set (match_operand:DI 0 "gr_register_operand" "=r,r")
947 (zero_extend:DI (match_operand:HI 1 "gr_nonimmediate_operand" "r,m")))]
952 [(set_attr "itanium_class" "xtd,ld")])
954 (define_insn "zero_extendsidi2"
955 [(set (match_operand:DI 0 "grfr_register_operand" "=r,r,?f")
957 (match_operand:SI 1 "grfr_nonimmediate_operand" "r,m,f")))]
963 [(set_attr "itanium_class" "xtd,ld,fmisc")])
965 ;; Convert between floating point types of different sizes.
967 ;; At first glance, it would appear that emitting fnorm for an extending
968 ;; conversion is unnecessary. However, the stf and getf instructions work
969 ;; correctly only if the input is properly rounded for its type. In
970 ;; particular, we get the wrong result for getf.d/stfd if the input is a
971 ;; denorm single. Since we don't know what the next instruction will be, we
972 ;; have to emit an fnorm.
974 ;; ??? Optimization opportunity here. Get rid of the insn altogether
975 ;; when we can. Should probably use a scheme like has been proposed
976 ;; for ia32 in dealing with operands that match unary operators. This
977 ;; would let combine merge the thing into adjacent insns. See also how the
978 ;; mips port handles SIGN_EXTEND as operands to integer arithmetic insns via
979 ;; se_register_operand.
981 (define_insn "extendsfdf2"
982 [(set (match_operand:DF 0 "fr_register_operand" "=f")
983 (float_extend:DF (match_operand:SF 1 "fr_register_operand" "f")))]
986 [(set_attr "itanium_class" "fmac")])
988 (define_insn "extendsftf2"
989 [(set (match_operand:TF 0 "fr_register_operand" "=f")
990 (float_extend:TF (match_operand:SF 1 "fr_register_operand" "f")))]
991 "INTEL_EXTENDED_IEEE_FORMAT"
993 [(set_attr "itanium_class" "fmac")])
995 (define_insn "extenddftf2"
996 [(set (match_operand:TF 0 "fr_register_operand" "=f")
997 (float_extend:TF (match_operand:DF 1 "fr_register_operand" "f")))]
998 "INTEL_EXTENDED_IEEE_FORMAT"
1000 [(set_attr "itanium_class" "fmac")])
1002 (define_insn "truncdfsf2"
1003 [(set (match_operand:SF 0 "fr_register_operand" "=f")
1004 (float_truncate:SF (match_operand:DF 1 "fr_register_operand" "f")))]
1007 [(set_attr "itanium_class" "fmac")])
1009 (define_insn "trunctfsf2"
1010 [(set (match_operand:SF 0 "fr_register_operand" "=f")
1011 (float_truncate:SF (match_operand:TF 1 "fr_register_operand" "f")))]
1012 "INTEL_EXTENDED_IEEE_FORMAT"
1014 [(set_attr "itanium_class" "fmac")])
1016 (define_insn "trunctfdf2"
1017 [(set (match_operand:DF 0 "fr_register_operand" "=f")
1018 (float_truncate:DF (match_operand:TF 1 "fr_register_operand" "f")))]
1019 "INTEL_EXTENDED_IEEE_FORMAT"
1021 [(set_attr "itanium_class" "fmac")])
1023 ;; Convert between signed integer types and floating point.
1025 (define_insn "floatditf2"
1026 [(set (match_operand:TF 0 "fr_register_operand" "=f")
1027 (float:TF (match_operand:DI 1 "fr_register_operand" "f")))]
1028 "INTEL_EXTENDED_IEEE_FORMAT"
1030 [(set_attr "itanium_class" "fcvtfx")])
1032 ;; ??? Suboptimal. This should be split somehow.
1033 (define_insn "floatdidf2"
1034 [(set (match_operand:DF 0 "register_operand" "=f")
1035 (float:DF (match_operand:DI 1 "register_operand" "f")))]
1036 "!INTEL_EXTENDED_IEEE_FORMAT"
1037 "fcvt.xf %0 = %1\;;;\;fnorm.d %0 = %0"
1038 [(set_attr "itanium_class" "fcvtfx")])
1040 ;; ??? Suboptimal. This should be split somehow.
1041 (define_insn "floatdisf2"
1042 [(set (match_operand:SF 0 "register_operand" "=f")
1043 (float:SF (match_operand:DI 1 "register_operand" "f")))]
1044 "!INTEL_EXTENDED_IEEE_FORMAT"
1045 "fcvt.xf %0 = %1\;;;\;fnorm.s %0 = %0"
1046 [(set_attr "itanium_class" "fcvtfx")])
1048 (define_insn "fix_truncsfdi2"
1049 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1050 (fix:DI (match_operand:SF 1 "fr_register_operand" "f")))]
1052 "fcvt.fx.trunc %0 = %1"
1053 [(set_attr "itanium_class" "fcvtfx")])
1055 (define_insn "fix_truncdfdi2"
1056 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1057 (fix:DI (match_operand:DF 1 "fr_register_operand" "f")))]
1059 "fcvt.fx.trunc %0 = %1"
1060 [(set_attr "itanium_class" "fcvtfx")])
1062 (define_insn "fix_trunctfdi2"
1063 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1064 (fix:DI (match_operand:TF 1 "fr_register_operand" "f")))]
1065 "INTEL_EXTENDED_IEEE_FORMAT"
1066 "fcvt.fx.trunc %0 = %1"
1067 [(set_attr "itanium_class" "fcvtfx")])
1069 (define_insn "fix_trunctfdi2_alts"
1070 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1071 (fix:DI (match_operand:TF 1 "fr_register_operand" "f")))
1072 (use (match_operand:SI 2 "const_int_operand" ""))]
1073 "INTEL_EXTENDED_IEEE_FORMAT"
1074 "fcvt.fx.trunc.s%2 %0 = %1"
1075 [(set_attr "itanium_class" "fcvtfx")])
1077 ;; Convert between unsigned integer types and floating point.
1079 (define_insn "floatunsdisf2"
1080 [(set (match_operand:SF 0 "fr_register_operand" "=f")
1081 (unsigned_float:SF (match_operand:DI 1 "fr_register_operand" "f")))]
1083 "fcvt.xuf.s %0 = %1"
1084 [(set_attr "itanium_class" "fcvtfx")])
1086 (define_insn "floatunsdidf2"
1087 [(set (match_operand:DF 0 "fr_register_operand" "=f")
1088 (unsigned_float:DF (match_operand:DI 1 "fr_register_operand" "f")))]
1090 "fcvt.xuf.d %0 = %1"
1091 [(set_attr "itanium_class" "fcvtfx")])
1093 (define_insn "floatunsditf2"
1094 [(set (match_operand:TF 0 "fr_register_operand" "=f")
1095 (unsigned_float:TF (match_operand:DI 1 "fr_register_operand" "f")))]
1096 "INTEL_EXTENDED_IEEE_FORMAT"
1098 [(set_attr "itanium_class" "fcvtfx")])
1100 (define_insn "fixuns_truncsfdi2"
1101 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1102 (unsigned_fix:DI (match_operand:SF 1 "fr_register_operand" "f")))]
1104 "fcvt.fxu.trunc %0 = %1"
1105 [(set_attr "itanium_class" "fcvtfx")])
1107 (define_insn "fixuns_truncdfdi2"
1108 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1109 (unsigned_fix:DI (match_operand:DF 1 "fr_register_operand" "f")))]
1111 "fcvt.fxu.trunc %0 = %1"
1112 [(set_attr "itanium_class" "fcvtfx")])
1114 (define_insn "fixuns_trunctfdi2"
1115 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1116 (unsigned_fix:DI (match_operand:TF 1 "fr_register_operand" "f")))]
1117 "INTEL_EXTENDED_IEEE_FORMAT"
1118 "fcvt.fxu.trunc %0 = %1"
1119 [(set_attr "itanium_class" "fcvtfx")])
1121 (define_insn "fixuns_trunctfdi2_alts"
1122 [(set (match_operand:DI 0 "fr_register_operand" "=f")
1123 (unsigned_fix:DI (match_operand:TF 1 "fr_register_operand" "f")))
1124 (use (match_operand:SI 2 "const_int_operand" ""))]
1125 "INTEL_EXTENDED_IEEE_FORMAT"
1126 "fcvt.fxu.trunc.s%2 %0 = %1"
1127 [(set_attr "itanium_class" "fcvtfx")])
1129 ;; ::::::::::::::::::::
1131 ;; :: Bit field extraction
1133 ;; ::::::::::::::::::::
1136 [(set (match_operand:DI 0 "gr_register_operand" "=r")
1137 (sign_extract:DI (match_operand:DI 1 "gr_register_operand" "r")
1138 (match_operand:DI 2 "const_int_operand" "n")
1139 (match_operand:DI 3 "const_int_operand" "n")))]
1141 "extr %0 = %1, %3, %2"
1142 [(set_attr "itanium_class" "ishf")])
1144 (define_insn "extzv"
1145 [(set (match_operand:DI 0 "gr_register_operand" "=r")
1146 (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r")
1147 (match_operand:DI 2 "const_int_operand" "n")
1148 (match_operand:DI 3 "const_int_operand" "n")))]
1150 "extr.u %0 = %1, %3, %2"
1151 [(set_attr "itanium_class" "ishf")])
1153 ;; Insert a bit field.
1154 ;; Can have 3 operands, source1 (inserter), source2 (insertee), dest.
1155 ;; Source1 can be 0 or -1.
1156 ;; Source2 can be 0.
1158 ;; ??? Actual dep instruction is more powerful than what these insv
1159 ;; patterns support. Unfortunately, combine is unable to create patterns
1160 ;; where source2 != dest.
1162 (define_expand "insv"
1163 [(set (zero_extract:DI (match_operand:DI 0 "gr_register_operand" "")
1164 (match_operand:DI 1 "const_int_operand" "")
1165 (match_operand:DI 2 "const_int_operand" ""))
1166 (match_operand:DI 3 "nonmemory_operand" ""))]
1169 int width = INTVAL (operands[1]);
1170 int shift = INTVAL (operands[2]);
1172 /* If operand[3] is a constant, and isn't 0 or -1, then load it into a
1174 if (! register_operand (operands[3], DImode)
1175 && operands[3] != const0_rtx && operands[3] != constm1_rtx)
1176 operands[3] = force_reg (DImode, operands[3]);
1178 /* If this is a single dep instruction, we have nothing to do. */
1179 if (! ((register_operand (operands[3], DImode) && width <= 16)
1180 || operands[3] == const0_rtx || operands[3] == constm1_rtx))
1182 /* Check for cases that can be implemented with a mix instruction. */
1183 if (width == 32 && shift == 0)
1185 /* Directly generating the mix4left instruction confuses
1186 optimize_bit_field in function.c. Since this is performing
1187 a useful optimization, we defer generation of the complicated
1188 mix4left RTL to the first splitting phase. */
1189 rtx tmp = gen_reg_rtx (DImode);
1190 emit_insn (gen_shift_mix4left (operands[0], operands[3], tmp));
1193 else if (width == 32 && shift == 32)
1195 emit_insn (gen_mix4right (operands[0], operands[3]));
1199 /* We could handle remaining cases by emitting multiple dep
1202 If we need more than two dep instructions then we lose. A 6
1203 insn sequence mov mask1,mov mask2,shl;;and,and;;or is better than
1204 mov;;dep,shr;;dep,shr;;dep. The former can be executed in 3 cycles,
1205 the latter is 6 cycles on an Itanium (TM) processor, because there is
1206 only one function unit that can execute dep and shr immed.
1208 If we only need two dep instruction, then we still lose.
1209 mov;;dep,shr;;dep is still 4 cycles. Even if we optimize away
1210 the unnecessary mov, this is still undesirable because it will be
1211 hard to optimize, and it creates unnecessary pressure on the I0
1217 /* This code may be useful for other IA-64 processors, so we leave it in
1223 emit_insn (gen_insv (operands[0], GEN_INT (16), GEN_INT (shift),
1227 tmp = gen_reg_rtx (DImode);
1228 emit_insn (gen_lshrdi3 (tmp, operands[3], GEN_INT (16)));
1231 operands[1] = GEN_INT (width);
1232 operands[2] = GEN_INT (shift);
1237 (define_insn "*insv_internal"
1238 [(set (zero_extract:DI (match_operand:DI 0 "gr_register_operand" "+r")
1239 (match_operand:DI 1 "const_int_operand" "n")
1240 (match_operand:DI 2 "const_int_operand" "n"))
1241 (match_operand:DI 3 "nonmemory_operand" "rP"))]
1242 "(gr_register_operand (operands[3], DImode) && INTVAL (operands[1]) <= 16)
1243 || operands[3] == const0_rtx || operands[3] == constm1_rtx"
1244 "dep %0 = %3, %0, %2, %1"
1245 [(set_attr "itanium_class" "ishf")])
1247 ;; Combine doesn't like to create bit-field insertions into zero.
1248 (define_insn "*depz_internal"
1249 [(set (match_operand:DI 0 "gr_register_operand" "=r")
1250 (and:DI (ashift:DI (match_operand:DI 1 "gr_register_operand" "r")
1251 (match_operand:DI 2 "const_int_operand" "n"))
1252 (match_operand:DI 3 "const_int_operand" "n")))]
1253 "CONST_OK_FOR_M (INTVAL (operands[2]))
1254 && ia64_depz_field_mask (operands[3], operands[2]) > 0"
1256 operands[3] = GEN_INT (ia64_depz_field_mask (operands[3], operands[2]));
1257 return "%,dep.z %0 = %1, %2, %3";
1259 [(set_attr "itanium_class" "ishf")])
1261 (define_insn "shift_mix4left"
1262 [(set (zero_extract:DI (match_operand:DI 0 "gr_register_operand" "+r")
1263 (const_int 32) (const_int 0))
1264 (match_operand:DI 1 "gr_register_operand" "r"))
1265 (clobber (match_operand:DI 2 "gr_register_operand" "=r"))]
1268 [(set_attr "itanium_class" "unknown")])
1271 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "")
1272 (const_int 32) (const_int 0))
1273 (match_operand:DI 1 "register_operand" ""))
1274 (clobber (match_operand:DI 2 "register_operand" ""))]
1276 [(set (match_dup 3) (ashift:DI (match_dup 1) (const_int 32)))
1277 (set (zero_extract:DI (match_dup 0) (const_int 32) (const_int 0))
1278 (lshiftrt:DI (match_dup 3) (const_int 32)))]
1279 "operands[3] = operands[2];")
1282 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "")
1283 (const_int 32) (const_int 0))
1284 (match_operand:DI 1 "register_operand" ""))
1285 (clobber (match_operand:DI 2 "register_operand" ""))]
1286 "! reload_completed"
1287 [(set (match_dup 3) (ashift:DI (match_dup 1) (const_int 32)))
1288 (set (zero_extract:DI (match_dup 0) (const_int 32) (const_int 0))
1289 (lshiftrt:DI (match_dup 3) (const_int 32)))]
1290 "operands[3] = operands[2];")
1292 (define_insn "*mix4left"
1293 [(set (zero_extract:DI (match_operand:DI 0 "gr_register_operand" "+r")
1294 (const_int 32) (const_int 0))
1295 (lshiftrt:DI (match_operand:DI 1 "gr_register_operand" "r")
1298 "mix4.l %0 = %0, %r1"
1299 [(set_attr "itanium_class" "mmshf")])
1301 (define_insn "mix4right"
1302 [(set (zero_extract:DI (match_operand:DI 0 "gr_register_operand" "+r")
1303 (const_int 32) (const_int 32))
1304 (match_operand:DI 1 "gr_reg_or_0_operand" "rO"))]
1306 "mix4.r %0 = %r1, %0"
1307 [(set_attr "itanium_class" "mmshf")])
1309 ;; This is used by the rotrsi3 pattern.
1311 (define_insn "*mix4right_3op"
1312 [(set (match_operand:DI 0 "gr_register_operand" "=r")
1313 (ior:DI (zero_extend:DI (match_operand:SI 1 "gr_register_operand" "r"))
1314 (ashift:DI (zero_extend:DI
1315 (match_operand:SI 2 "gr_register_operand" "r"))
1318 "mix4.r %0 = %2, %1"
1319 [(set_attr "itanium_class" "mmshf")])
1322 ;; ::::::::::::::::::::
1324 ;; :: 1 bit Integer arithmetic
1326 ;; ::::::::::::::::::::
1328 (define_insn_and_split "andbi3"
1329 [(set (match_operand:BI 0 "register_operand" "=c,c,r")
1330 (and:BI (match_operand:BI 1 "register_operand" "%0,0,r")
1331 (match_operand:BI 2 "register_operand" "c,r,r")))]
1335 tbit.nz.and.orcm %0, %I0 = %2, 0
1338 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
1339 && GET_CODE (operands[2]) == REG && PR_REGNO_P (REGNO (operands[2]))"
1340 [(cond_exec (eq (match_dup 2) (const_int 0))
1341 (set (match_dup 0) (and:BI (ne:BI (const_int 0) (const_int 0))
1344 [(set_attr "itanium_class" "unknown,tbit,ilog")])
1346 (define_insn_and_split "*andcmbi3"
1347 [(set (match_operand:BI 0 "register_operand" "=c,c,r")
1348 (and:BI (not:BI (match_operand:BI 1 "register_operand" "c,r,r"))
1349 (match_operand:BI 2 "register_operand" "0,0,r")))]
1353 tbit.z.and.orcm %0, %I0 = %1, 0
1356 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
1357 && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))"
1358 [(cond_exec (ne (match_dup 1) (const_int 0))
1359 (set (match_dup 0) (and:BI (ne:BI (const_int 0) (const_int 0))
1362 [(set_attr "itanium_class" "unknown,tbit,ilog")])
1364 (define_insn_and_split "iorbi3"
1365 [(set (match_operand:BI 0 "register_operand" "=c,c,r")
1366 (ior:BI (match_operand:BI 1 "register_operand" "%0,0,r")
1367 (match_operand:BI 2 "register_operand" "c,r,r")))]
1371 tbit.nz.or.andcm %0, %I0 = %2, 0
1374 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
1375 && GET_CODE (operands[2]) == REG && PR_REGNO_P (REGNO (operands[2]))"
1376 [(cond_exec (ne (match_dup 2) (const_int 0))
1377 (set (match_dup 0) (ior:BI (eq:BI (const_int 0) (const_int 0))
1380 [(set_attr "itanium_class" "unknown,tbit,ilog")])
1382 (define_insn_and_split "*iorcmbi3"
1383 [(set (match_operand:BI 0 "register_operand" "=c,c")
1384 (ior:BI (not:BI (match_operand:BI 1 "register_operand" "c,r"))
1385 (match_operand:BI 2 "register_operand" "0,0")))]
1389 tbit.z.or.andcm %0, %I0 = %1, 0"
1391 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
1392 && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))"
1393 [(cond_exec (eq (match_dup 1) (const_int 0))
1394 (set (match_dup 0) (ior:BI (eq:BI (const_int 0) (const_int 0))
1397 [(set_attr "itanium_class" "unknown,tbit")])
1399 (define_insn "one_cmplbi2"
1400 [(set (match_operand:BI 0 "register_operand" "=c,r,c,&c")
1401 (not:BI (match_operand:BI 1 "register_operand" "r,r,0,c")))
1402 (clobber (match_scratch:BI 2 "=X,X,c,X"))]
1405 tbit.z %0, %I0 = %1, 0
1409 [(set_attr "itanium_class" "tbit,ilog,unknown,unknown")])
1412 [(set (match_operand:BI 0 "register_operand" "")
1413 (not:BI (match_operand:BI 1 "register_operand" "")))
1414 (clobber (match_scratch:BI 2 ""))]
1416 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
1417 && rtx_equal_p (operands[0], operands[1])"
1418 [(set (match_dup 4) (match_dup 3))
1419 (set (match_dup 0) (const_int 1))
1420 (cond_exec (ne (match_dup 2) (const_int 0))
1421 (set (match_dup 0) (const_int 0)))
1422 (set (match_dup 0) (unspec:BI [(match_dup 0)] UNSPEC_PRED_REL_MUTEX))]
1423 "operands[3] = gen_rtx_REG (CCImode, REGNO (operands[1]));
1424 operands[4] = gen_rtx_REG (CCImode, REGNO (operands[2]));")
1427 [(set (match_operand:BI 0 "register_operand" "")
1428 (not:BI (match_operand:BI 1 "register_operand" "")))
1429 (clobber (match_scratch:BI 2 ""))]
1431 && GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
1432 && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))
1433 && ! rtx_equal_p (operands[0], operands[1])"
1434 [(cond_exec (ne (match_dup 1) (const_int 0))
1435 (set (match_dup 0) (const_int 0)))
1436 (cond_exec (eq (match_dup 1) (const_int 0))
1437 (set (match_dup 0) (const_int 1)))
1438 (set (match_dup 0) (unspec:BI [(match_dup 0)] UNSPEC_PRED_REL_MUTEX))]
1441 (define_insn "*cmpsi_and_0"
1442 [(set (match_operand:BI 0 "register_operand" "=c")
1443 (and:BI (match_operator:BI 4 "predicate_operator"
1444 [(match_operand:SI 2 "gr_reg_or_0_operand" "rO")
1445 (match_operand:SI 3 "gr_reg_or_8bit_operand" "rK")])
1446 (match_operand:BI 1 "register_operand" "0")))]
1448 "cmp4.%C4.and.orcm %0, %I0 = %3, %r2"
1449 [(set_attr "itanium_class" "icmp")])
1451 (define_insn "*cmpsi_and_1"
1452 [(set (match_operand:BI 0 "register_operand" "=c")
1453 (and:BI (match_operator:BI 3 "signed_inequality_operator"
1454 [(match_operand:SI 2 "gr_register_operand" "r")
1456 (match_operand:BI 1 "register_operand" "0")))]
1458 "cmp4.%C3.and.orcm %0, %I0 = r0, %2"
1459 [(set_attr "itanium_class" "icmp")])
1461 (define_insn "*cmpsi_andnot_0"
1462 [(set (match_operand:BI 0 "register_operand" "=c")
1463 (and:BI (not:BI (match_operator:BI 4 "predicate_operator"
1464 [(match_operand:SI 2 "gr_reg_or_0_operand" "rO")
1465 (match_operand:SI 3 "gr_reg_or_8bit_operand" "rK")]))
1466 (match_operand:BI 1 "register_operand" "0")))]
1468 "cmp4.%C4.or.andcm %I0, %0 = %3, %r2"
1469 [(set_attr "itanium_class" "icmp")])
1471 (define_insn "*cmpsi_andnot_1"
1472 [(set (match_operand:BI 0 "register_operand" "=c")
1473 (and:BI (not:BI (match_operator:BI 3 "signed_inequality_operator"
1474 [(match_operand:SI 2 "gr_register_operand" "r")
1476 (match_operand:BI 1 "register_operand" "0")))]
1478 "cmp4.%C3.or.andcm %I0, %0 = r0, %2"
1479 [(set_attr "itanium_class" "icmp")])
1481 (define_insn "*cmpdi_and_0"
1482 [(set (match_operand:BI 0 "register_operand" "=c")
1483 (and:BI (match_operator:BI 4 "predicate_operator"
1484 [(match_operand:DI 2 "gr_register_operand" "r")
1485 (match_operand:DI 3 "gr_reg_or_8bit_operand" "rK")])
1486 (match_operand:BI 1 "register_operand" "0")))]
1488 "cmp.%C4.and.orcm %0, %I0 = %3, %2"
1489 [(set_attr "itanium_class" "icmp")])
1491 (define_insn "*cmpdi_and_1"
1492 [(set (match_operand:BI 0 "register_operand" "=c")
1493 (and:BI (match_operator:BI 3 "signed_inequality_operator"
1494 [(match_operand:DI 2 "gr_register_operand" "r")
1496 (match_operand:BI 1 "register_operand" "0")))]
1498 "cmp.%C3.and.orcm %0, %I0 = r0, %2"
1499 [(set_attr "itanium_class" "icmp")])
1501 (define_insn "*cmpdi_andnot_0"
1502 [(set (match_operand:BI 0 "register_operand" "=c")
1503 (and:BI (not:BI (match_operator:BI 4 "predicate_operator"
1504 [(match_operand:DI 2 "gr_register_operand" "r")
1505 (match_operand:DI 3 "gr_reg_or_8bit_operand" "rK")]))
1506 (match_operand:BI 1 "register_operand" "0")))]
1508 "cmp.%C4.or.andcm %I0, %0 = %3, %2"
1509 [(set_attr "itanium_class" "icmp")])
1511 (define_insn "*cmpdi_andnot_1"
1512 [(set (match_operand:BI 0 "register_operand" "=c")
1513 (and:BI (not:BI (match_operator:BI 3 "signed_inequality_operator"
1514 [(match_operand:DI 2 "gr_register_operand" "r")
1516 (match_operand:BI 1 "register_operand" "0")))]
1518 "cmp.%C3.or.andcm %I0, %0 = r0, %2"
1519 [(set_attr "itanium_class" "icmp")])
1521 (define_insn "*tbit_and_0"
1522 [(set (match_operand:BI 0 "register_operand" "=c")
1523 (and:BI (ne:BI (and:DI (match_operand:DI 1 "gr_register_operand" "r")
1526 (match_operand:BI 2 "register_operand" "0")))]
1528 "tbit.nz.and.orcm %0, %I0 = %1, 0"
1529 [(set_attr "itanium_class" "tbit")])
1531 (define_insn "*tbit_and_1"
1532 [(set (match_operand:BI 0 "register_operand" "=c")
1533 (and:BI (eq:BI (and:DI (match_operand:DI 1 "gr_register_operand" "r")
1536 (match_operand:BI 2 "register_operand" "0")))]
1538 "tbit.z.and.orcm %0, %I0 = %1, 0"
1539 [(set_attr "itanium_class" "tbit")])
1541 (define_insn "*tbit_and_2"
1542 [(set (match_operand:BI 0 "register_operand" "=c")
1543 (and:BI (ne:BI (zero_extract:DI
1544 (match_operand:DI 1 "gr_register_operand" "r")
1546 (match_operand:DI 2 "const_int_operand" "n"))
1548 (match_operand:BI 3 "register_operand" "0")))]
1550 "tbit.nz.and.orcm %0, %I0 = %1, %2"
1551 [(set_attr "itanium_class" "tbit")])
1553 (define_insn "*tbit_and_3"
1554 [(set (match_operand:BI 0 "register_operand" "=c")
1555 (and:BI (eq:BI (zero_extract:DI
1556 (match_operand:DI 1 "gr_register_operand" "r")
1558 (match_operand:DI 2 "const_int_operand" "n"))
1560 (match_operand:BI 3 "register_operand" "0")))]
1562 "tbit.z.and.orcm %0, %I0 = %1, %2"
1563 [(set_attr "itanium_class" "tbit")])
1565 (define_insn "*cmpsi_or_0"
1566 [(set (match_operand:BI 0 "register_operand" "=c")
1567 (ior:BI (match_operator:BI 4 "predicate_operator"
1568 [(match_operand:SI 2 "gr_reg_or_0_operand" "rO")
1569 (match_operand:SI 3 "gr_reg_or_8bit_operand" "rK")])
1570 (match_operand:BI 1 "register_operand" "0")))]
1572 "cmp4.%C4.or.andcm %0, %I0 = %3, %r2"
1573 [(set_attr "itanium_class" "icmp")])
1575 (define_insn "*cmpsi_or_1"
1576 [(set (match_operand:BI 0 "register_operand" "=c")
1577 (ior:BI (match_operator:BI 3 "signed_inequality_operator"
1578 [(match_operand:SI 2 "gr_register_operand" "r")
1580 (match_operand:BI 1 "register_operand" "0")))]
1582 "cmp4.%C3.or.andcm %0, %I0 = r0, %2"
1583 [(set_attr "itanium_class" "icmp")])
1585 (define_insn "*cmpsi_orcm_0"
1586 [(set (match_operand:BI 0 "register_operand" "=c")
1587 (ior:BI (not:BI (match_operator:BI 4 "predicate_operator"
1588 [(match_operand:SI 2 "gr_reg_or_0_operand" "rO")
1589 (match_operand:SI 3 "gr_reg_or_8bit_operand" "rK")]))
1590 (match_operand:BI 1 "register_operand" "0")))]
1592 "cmp4.%C4.and.orcm %I0, %0 = %3, %r2"
1593 [(set_attr "itanium_class" "icmp")])
1595 (define_insn "*cmpsi_orcm_1"
1596 [(set (match_operand:BI 0 "register_operand" "=c")
1597 (ior:BI (not:BI (match_operator:BI 3 "signed_inequality_operator"
1598 [(match_operand:SI 2 "gr_register_operand" "r")
1600 (match_operand:BI 1 "register_operand" "0")))]
1602 "cmp4.%C3.and.orcm %I0, %0 = r0, %2"
1603 [(set_attr "itanium_class" "icmp")])
1605 (define_insn "*cmpdi_or_0"
1606 [(set (match_operand:BI 0 "register_operand" "=c")
1607 (ior:BI (match_operator:BI 4 "predicate_operator"
1608 [(match_operand:DI 2 "gr_register_operand" "r")
1609 (match_operand:DI 3 "gr_reg_or_8bit_operand" "rK")])
1610 (match_operand:BI 1 "register_operand" "0")))]
1612 "cmp.%C4.or.andcm %0, %I0 = %3, %2"
1613 [(set_attr "itanium_class" "icmp")])
1615 (define_insn "*cmpdi_or_1"
1616 [(set (match_operand:BI 0 "register_operand" "=c")
1617 (ior:BI (match_operator:BI 3 "signed_inequality_operator"
1618 [(match_operand:DI 2 "gr_register_operand" "r")
1620 (match_operand:BI 1 "register_operand" "0")))]
1622 "cmp.%C3.or.andcm %0, %I0 = r0, %2"
1623 [(set_attr "itanium_class" "icmp")])
1625 (define_insn "*cmpdi_orcm_0"
1626 [(set (match_operand:BI 0 "register_operand" "=c")
1627 (ior:BI (not:BI (match_operator:BI 4 "predicate_operator"
1628 [(match_operand:DI 2 "gr_register_operand" "r")
1629 (match_operand:DI 3 "gr_reg_or_8bit_operand" "rK")]))
1630 (match_operand:BI 1 "register_operand" "0")))]
1632 "cmp.%C4.and.orcm %I0, %0 = %3, %2"
1633 [(set_attr "itanium_class" "icmp")])
1635 (define_insn "*cmpdi_orcm_1"
1636 [(set (match_operand:BI 0 "register_operand" "=c")
1637 (ior:BI (not:BI (match_operator:BI 3 "signed_inequality_operator"
1638 [(match_operand:DI 2 "gr_register_operand" "r")
1640 (match_operand:BI 1 "register_operand" "0")))]
1642 "cmp.%C3.and.orcm %I0, %0 = r0, %2"
1643 [(set_attr "itanium_class" "icmp")])
1645 (define_insn "*tbit_or_0"
1646 [(set (match_operand:BI 0 "register_operand" "=c")
1647 (ior:BI (ne:BI (and:DI (match_operand:DI 1 "gr_register_operand" "r")
1650 (match_operand:BI 2 "register_operand" "0")))]
1652 "tbit.nz.or.andcm %0, %I0 = %1, 0"
1653 [(set_attr "itanium_class" "tbit")])
1655 (define_insn "*tbit_or_1"
1656 [(set (match_operand:BI 0 "register_operand" "=c")
1657 (ior:BI (eq:BI (and:DI (match_operand:DI 1 "gr_register_operand" "r")
1660 (match_operand:BI 2 "register_operand" "0")))]
1662 "tbit.z.or.andcm %0, %I0 = %1, 0"
1663 [(set_attr "itanium_class" "tbit")])
1665 (define_insn "*tbit_or_2"
1666 [(set (match_operand:BI 0 "register_operand" "=c")
1667 (ior:BI (ne:BI (zero_extract:DI
1668 (match_operand:DI 1 "gr_register_operand" "r")
1670 (match_operand:DI 2 "const_int_operand" "n"))
1672 (match_operand:BI 3 "register_operand" "0")))]
1674 "tbit.nz.or.andcm %0, %I0 = %1, %2"
1675 [(set_attr "itanium_class" "tbit")])
1677 (define_insn "*tbit_or_3"
1678 [(set (match_operand:BI 0 "register_operand" "=c")
1679 (ior:BI (eq:BI (zero_extract:DI
1680 (match_operand:DI 1 "gr_register_operand" "r")
1682 (match_operand:DI 2 "const_int_operand" "n"))
1684 (match_operand:BI 3 "register_operand" "0")))]
1686 "tbit.z.or.andcm %0, %I0 = %1, %2"
1687 [(set_attr "itanium_class" "tbit")])
1689 ;; Transform test of and/or of setcc into parallel comparisons.
1692 [(set (match_operand:BI 0 "register_operand" "")
1693 (ne:BI (and:DI (ne:DI (match_operand:BI 2 "register_operand" "")
1695 (match_operand:DI 3 "register_operand" ""))
1699 (and:BI (ne:BI (and:DI (match_dup 3) (const_int 1)) (const_int 0))
1704 [(set (match_operand:BI 0 "register_operand" "")
1705 (eq:BI (and:DI (ne:DI (match_operand:BI 2 "register_operand" "")
1707 (match_operand:DI 3 "register_operand" ""))
1711 (and:BI (ne:BI (and:DI (match_dup 3) (const_int 1)) (const_int 0))
1713 (parallel [(set (match_dup 0) (not:BI (match_dup 0)))
1714 (clobber (scratch))])]
1718 [(set (match_operand:BI 0 "register_operand" "")
1719 (ne:BI (ior:DI (ne:DI (match_operand:BI 2 "register_operand" "")
1721 (match_operand:DI 3 "register_operand" ""))
1725 (ior:BI (ne:BI (match_dup 3) (const_int 0))
1730 [(set (match_operand:BI 0 "register_operand" "")
1731 (eq:BI (ior:DI (ne:DI (match_operand:BI 2 "register_operand" "")
1733 (match_operand:DI 3 "register_operand" ""))
1737 (ior:BI (ne:BI (match_dup 3) (const_int 0))
1739 (parallel [(set (match_dup 0) (not:BI (match_dup 0)))
1740 (clobber (scratch))])]
1743 ;; ??? Incredibly hackish. Either need four proper patterns with all
1744 ;; the alternatives, or rely on sched1 to split the insn and hope that
1745 ;; nothing bad happens to the comparisons in the meantime.
1747 ;; Alternately, adjust combine to allow 2->2 and 3->3 splits, assuming
1748 ;; that we're doing height reduction.
1750 ;(define_insn_and_split ""
1751 ; [(set (match_operand:BI 0 "register_operand" "=c")
1752 ; (and:BI (and:BI (match_operator:BI 1 "comparison_operator"
1753 ; [(match_operand 2 "" "")
1754 ; (match_operand 3 "" "")])
1755 ; (match_operator:BI 4 "comparison_operator"
1756 ; [(match_operand 5 "" "")
1757 ; (match_operand 6 "" "")]))
1759 ; "flag_schedule_insns"
1762 ; [(set (match_dup 0) (and:BI (match_dup 1) (match_dup 0)))
1763 ; (set (match_dup 0) (and:BI (match_dup 4) (match_dup 0)))]
1766 ;(define_insn_and_split ""
1767 ; [(set (match_operand:BI 0 "register_operand" "=c")
1768 ; (ior:BI (ior:BI (match_operator:BI 1 "comparison_operator"
1769 ; [(match_operand 2 "" "")
1770 ; (match_operand 3 "" "")])
1771 ; (match_operator:BI 4 "comparison_operator"
1772 ; [(match_operand 5 "" "")
1773 ; (match_operand 6 "" "")]))
1775 ; "flag_schedule_insns"
1778 ; [(set (match_dup 0) (ior:BI (match_dup 1) (match_dup 0)))
1779 ; (set (match_dup 0) (ior:BI (match_dup 4) (match_dup 0)))]
1783 ; [(set (match_operand:BI 0 "register_operand" "")
1784 ; (and:BI (and:BI (match_operator:BI 1 "comparison_operator"
1785 ; [(match_operand 2 "" "")
1786 ; (match_operand 3 "" "")])
1787 ; (match_operand:BI 7 "register_operand" ""))
1788 ; (and:BI (match_operator:BI 4 "comparison_operator"
1789 ; [(match_operand 5 "" "")
1790 ; (match_operand 6 "" "")])
1791 ; (match_operand:BI 8 "register_operand" ""))))]
1793 ; [(set (match_dup 0) (and:BI (match_dup 7) (match_dup 8)))
1794 ; (set (match_dup 0) (and:BI (and:BI (match_dup 1) (match_dup 4))
1799 ; [(set (match_operand:BI 0 "register_operand" "")
1800 ; (ior:BI (ior:BI (match_operator:BI 1 "comparison_operator"
1801 ; [(match_operand 2 "" "")
1802 ; (match_operand 3 "" "")])
1803 ; (match_operand:BI 7 "register_operand" ""))
1804 ; (ior:BI (match_operator:BI 4 "comparison_operator"
1805 ; [(match_operand 5 "" "")
1806 ; (match_operand 6 "" "")])
1807 ; (match_operand:BI 8 "register_operand" ""))))]
1809 ; [(set (match_dup 0) (ior:BI (match_dup 7) (match_dup 8)))
1810 ; (set (match_dup 0) (ior:BI (ior:BI (match_dup 1) (match_dup 4))
1814 ;; Try harder to avoid predicate copies by duplicating compares.
1815 ;; Note that we'll have already split the predicate copy, which
1816 ;; is kind of a pain, but oh well.
1819 [(set (match_operand:BI 0 "register_operand" "")
1820 (match_operand:BI 1 "comparison_operator" ""))
1821 (set (match_operand:CCI 2 "register_operand" "")
1822 (match_operand:CCI 3 "register_operand" ""))
1823 (set (match_operand:CCI 4 "register_operand" "")
1824 (match_operand:CCI 5 "register_operand" ""))
1825 (set (match_operand:BI 6 "register_operand" "")
1826 (unspec:BI [(match_dup 6)] UNSPEC_PRED_REL_MUTEX))]
1827 "REGNO (operands[3]) == REGNO (operands[0])
1828 && REGNO (operands[4]) == REGNO (operands[0]) + 1
1829 && REGNO (operands[4]) == REGNO (operands[2]) + 1
1830 && REGNO (operands[6]) == REGNO (operands[2])"
1831 [(set (match_dup 0) (match_dup 1))
1832 (set (match_dup 6) (match_dup 7))]
1833 "operands[7] = copy_rtx (operands[1]);")
1835 ;; ::::::::::::::::::::
1837 ;; :: 16 bit Integer arithmetic
1839 ;; ::::::::::::::::::::
1841 (define_insn "mulhi3"
1842 [(set (match_operand:HI 0 "gr_register_operand" "=r")
1843 (mult:HI (match_operand:HI 1 "gr_register_operand" "r")
1844 (match_operand:HI 2 "gr_register_operand" "r")))]
1846 "pmpy2.r %0 = %1, %2"
1847 [(set_attr "itanium_class" "mmmul")])
1850 ;; ::::::::::::::::::::
1852 ;; :: 32 bit Integer arithmetic
1854 ;; ::::::::::::::::::::
1856 (define_insn "addsi3"
1857 [(set (match_operand:SI 0 "gr_register_operand" "=r,r,r")
1858 (plus:SI (match_operand:SI 1 "gr_register_operand" "%r,r,a")
1859 (match_operand:SI 2 "gr_reg_or_22bit_operand" "r,I,J")))]
1865 [(set_attr "itanium_class" "ialu")])
1867 (define_insn "*addsi3_plus1"
1868 [(set (match_operand:SI 0 "gr_register_operand" "=r")
1869 (plus:SI (plus:SI (match_operand:SI 1 "gr_register_operand" "r")
1870 (match_operand:SI 2 "gr_register_operand" "r"))
1873 "add %0 = %1, %2, 1"
1874 [(set_attr "itanium_class" "ialu")])
1876 (define_insn "*addsi3_plus1_alt"
1877 [(set (match_operand:SI 0 "gr_register_operand" "=r")
1878 (plus:SI (mult:SI (match_operand:SI 1 "gr_register_operand" "r")
1882 "add %0 = %1, %1, 1"
1883 [(set_attr "itanium_class" "ialu")])
1885 (define_insn "*addsi3_shladd"
1886 [(set (match_operand:SI 0 "gr_register_operand" "=r")
1887 (plus:SI (mult:SI (match_operand:SI 1 "gr_register_operand" "r")
1888 (match_operand:SI 2 "shladd_operand" "n"))
1889 (match_operand:SI 3 "gr_register_operand" "r")))]
1891 "shladd %0 = %1, %S2, %3"
1892 [(set_attr "itanium_class" "ialu")])
1894 (define_insn "subsi3"
1895 [(set (match_operand:SI 0 "gr_register_operand" "=r")
1896 (minus:SI (match_operand:SI 1 "gr_reg_or_8bit_operand" "rK")
1897 (match_operand:SI 2 "gr_register_operand" "r")))]
1900 [(set_attr "itanium_class" "ialu")])
1902 (define_insn "*subsi3_minus1"
1903 [(set (match_operand:SI 0 "gr_register_operand" "=r")
1904 (plus:SI (not:SI (match_operand:SI 1 "gr_register_operand" "r"))
1905 (match_operand:SI 2 "gr_register_operand" "r")))]
1907 "sub %0 = %2, %1, 1"
1908 [(set_attr "itanium_class" "ialu")])
1910 ;; ??? Could add maddsi3 patterns patterned after the madddi3 patterns.
1912 (define_insn "mulsi3"
1913 [(set (match_operand:SI 0 "fr_register_operand" "=f")
1914 (mult:SI (match_operand:SI 1 "grfr_register_operand" "f")
1915 (match_operand:SI 2 "grfr_register_operand" "f")))]
1917 "xmpy.l %0 = %1, %2"
1918 [(set_attr "itanium_class" "xmpy")])
1920 (define_insn "maddsi4"
1921 [(set (match_operand:SI 0 "fr_register_operand" "=f")
1922 (plus:SI (mult:SI (match_operand:SI 1 "grfr_register_operand" "f")
1923 (match_operand:SI 2 "grfr_register_operand" "f"))
1924 (match_operand:SI 3 "grfr_register_operand" "f")))]
1926 "xma.l %0 = %1, %2, %3"
1927 [(set_attr "itanium_class" "xmpy")])
1929 (define_insn "negsi2"
1930 [(set (match_operand:SI 0 "gr_register_operand" "=r")
1931 (neg:SI (match_operand:SI 1 "gr_register_operand" "r")))]
1934 [(set_attr "itanium_class" "ialu")])
1936 (define_expand "abssi2"
1938 (ge:BI (match_operand:SI 1 "gr_register_operand" "") (const_int 0)))
1939 (set (match_operand:SI 0 "gr_register_operand" "")
1940 (if_then_else:SI (eq (match_dup 2) (const_int 0))
1941 (neg:SI (match_dup 1))
1944 { operands[2] = gen_reg_rtx (BImode); })
1946 (define_expand "sminsi3"
1948 (ge:BI (match_operand:SI 1 "gr_register_operand" "")
1949 (match_operand:SI 2 "gr_register_operand" "")))
1950 (set (match_operand:SI 0 "gr_register_operand" "")
1951 (if_then_else:SI (ne (match_dup 3) (const_int 0))
1952 (match_dup 2) (match_dup 1)))]
1954 { operands[3] = gen_reg_rtx (BImode); })
1956 (define_expand "smaxsi3"
1958 (ge:BI (match_operand:SI 1 "gr_register_operand" "")
1959 (match_operand:SI 2 "gr_register_operand" "")))
1960 (set (match_operand:SI 0 "gr_register_operand" "")
1961 (if_then_else:SI (ne (match_dup 3) (const_int 0))
1962 (match_dup 1) (match_dup 2)))]
1964 { operands[3] = gen_reg_rtx (BImode); })
1966 (define_expand "uminsi3"
1968 (geu:BI (match_operand:SI 1 "gr_register_operand" "")
1969 (match_operand:SI 2 "gr_register_operand" "")))
1970 (set (match_operand:SI 0 "gr_register_operand" "")
1971 (if_then_else:SI (ne (match_dup 3) (const_int 0))
1972 (match_dup 2) (match_dup 1)))]
1974 { operands[3] = gen_reg_rtx (BImode); })
1976 (define_expand "umaxsi3"
1978 (geu:BI (match_operand:SI 1 "gr_register_operand" "")
1979 (match_operand:SI 2 "gr_register_operand" "")))
1980 (set (match_operand:SI 0 "gr_register_operand" "")
1981 (if_then_else:SI (ne (match_dup 3) (const_int 0))
1982 (match_dup 1) (match_dup 2)))]
1984 { operands[3] = gen_reg_rtx (BImode); })
1986 (define_expand "divsi3"
1987 [(set (match_operand:SI 0 "register_operand" "")
1988 (div:SI (match_operand:SI 1 "general_operand" "")
1989 (match_operand:SI 2 "general_operand" "")))]
1990 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
1992 rtx op1_tf, op2_tf, op0_tf, op0_di, twon34;
1993 REAL_VALUE_TYPE twon34_r;
1995 op0_tf = gen_reg_rtx (TFmode);
1996 op0_di = gen_reg_rtx (DImode);
1998 if (CONSTANT_P (operands[1]))
1999 operands[1] = force_reg (SImode, operands[1]);
2000 op1_tf = gen_reg_rtx (TFmode);
2001 expand_float (op1_tf, operands[1], 0);
2003 if (CONSTANT_P (operands[2]))
2004 operands[2] = force_reg (SImode, operands[2]);
2005 op2_tf = gen_reg_rtx (TFmode);
2006 expand_float (op2_tf, operands[2], 0);
2009 real_2expN (&twon34_r, -34);
2010 twon34 = CONST_DOUBLE_FROM_REAL_VALUE (twon34_r, TFmode);
2011 twon34 = force_reg (TFmode, twon34);
2013 emit_insn (gen_divsi3_internal (op0_tf, op1_tf, op2_tf, twon34));
2015 emit_insn (gen_fix_trunctfdi2_alts (op0_di, op0_tf, const1_rtx));
2016 emit_move_insn (operands[0], gen_lowpart (SImode, op0_di));
2020 (define_expand "modsi3"
2021 [(set (match_operand:SI 0 "register_operand" "")
2022 (mod:SI (match_operand:SI 1 "general_operand" "")
2023 (match_operand:SI 2 "general_operand" "")))]
2024 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2026 rtx op2_neg, op1_di, div;
2028 div = gen_reg_rtx (SImode);
2029 emit_insn (gen_divsi3 (div, operands[1], operands[2]));
2031 op2_neg = expand_unop (SImode, neg_optab, operands[2], NULL_RTX, 0);
2033 /* This is a trick to get us to reuse the value that we're sure to
2034 have already copied to the FP regs. */
2035 op1_di = gen_reg_rtx (DImode);
2036 convert_move (op1_di, operands[1], 0);
2038 emit_insn (gen_maddsi4 (operands[0], div, op2_neg,
2039 gen_lowpart (SImode, op1_di)));
2043 (define_expand "udivsi3"
2044 [(set (match_operand:SI 0 "register_operand" "")
2045 (udiv:SI (match_operand:SI 1 "general_operand" "")
2046 (match_operand:SI 2 "general_operand" "")))]
2047 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2049 rtx op1_tf, op2_tf, op0_tf, op0_di, twon34;
2050 REAL_VALUE_TYPE twon34_r;
2052 op0_tf = gen_reg_rtx (TFmode);
2053 op0_di = gen_reg_rtx (DImode);
2055 if (CONSTANT_P (operands[1]))
2056 operands[1] = force_reg (SImode, operands[1]);
2057 op1_tf = gen_reg_rtx (TFmode);
2058 expand_float (op1_tf, operands[1], 1);
2060 if (CONSTANT_P (operands[2]))
2061 operands[2] = force_reg (SImode, operands[2]);
2062 op2_tf = gen_reg_rtx (TFmode);
2063 expand_float (op2_tf, operands[2], 1);
2066 real_2expN (&twon34_r, -34);
2067 twon34 = CONST_DOUBLE_FROM_REAL_VALUE (twon34_r, TFmode);
2068 twon34 = force_reg (TFmode, twon34);
2070 emit_insn (gen_divsi3_internal (op0_tf, op1_tf, op2_tf, twon34));
2072 emit_insn (gen_fixuns_trunctfdi2_alts (op0_di, op0_tf, const1_rtx));
2073 emit_move_insn (operands[0], gen_lowpart (SImode, op0_di));
2077 (define_expand "umodsi3"
2078 [(set (match_operand:SI 0 "register_operand" "")
2079 (umod:SI (match_operand:SI 1 "general_operand" "")
2080 (match_operand:SI 2 "general_operand" "")))]
2081 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2083 rtx op2_neg, op1_di, div;
2085 div = gen_reg_rtx (SImode);
2086 emit_insn (gen_udivsi3 (div, operands[1], operands[2]));
2088 op2_neg = expand_unop (SImode, neg_optab, operands[2], NULL_RTX, 0);
2090 /* This is a trick to get us to reuse the value that we're sure to
2091 have already copied to the FP regs. */
2092 op1_di = gen_reg_rtx (DImode);
2093 convert_move (op1_di, operands[1], 1);
2095 emit_insn (gen_maddsi4 (operands[0], div, op2_neg,
2096 gen_lowpart (SImode, op1_di)));
2100 (define_insn_and_split "divsi3_internal"
2101 [(set (match_operand:TF 0 "fr_register_operand" "=&f")
2102 (float:TF (div:SI (match_operand:TF 1 "fr_register_operand" "f")
2103 (match_operand:TF 2 "fr_register_operand" "f"))))
2104 (clobber (match_scratch:TF 4 "=&f"))
2105 (clobber (match_scratch:TF 5 "=&f"))
2106 (clobber (match_scratch:BI 6 "=c"))
2107 (use (match_operand:TF 3 "fr_register_operand" "f"))]
2108 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2110 "&& reload_completed"
2111 [(parallel [(set (match_dup 0) (div:TF (const_int 1) (match_dup 2)))
2112 (set (match_dup 6) (unspec:BI [(match_dup 1) (match_dup 2)]
2113 UNSPEC_FR_RECIP_APPROX))
2114 (use (const_int 1))])
2115 (cond_exec (ne (match_dup 6) (const_int 0))
2116 (parallel [(set (match_dup 4) (mult:TF (match_dup 1) (match_dup 0)))
2117 (use (const_int 1))]))
2118 (cond_exec (ne (match_dup 6) (const_int 0))
2119 (parallel [(set (match_dup 5)
2120 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
2122 (use (const_int 1))]))
2123 (cond_exec (ne (match_dup 6) (const_int 0))
2124 (parallel [(set (match_dup 4)
2125 (plus:TF (mult:TF (match_dup 5) (match_dup 4))
2127 (use (const_int 1))]))
2128 (cond_exec (ne (match_dup 6) (const_int 0))
2129 (parallel [(set (match_dup 5)
2130 (plus:TF (mult:TF (match_dup 5) (match_dup 5))
2132 (use (const_int 1))]))
2133 (cond_exec (ne (match_dup 6) (const_int 0))
2134 (parallel [(set (match_dup 0)
2135 (plus:TF (mult:TF (match_dup 5) (match_dup 4))
2137 (use (const_int 1))]))
2139 "operands[7] = CONST1_RTX (TFmode);"
2140 [(set_attr "predicable" "no")])
2142 ;; ::::::::::::::::::::
2144 ;; :: 64 bit Integer arithmetic
2146 ;; ::::::::::::::::::::
2148 (define_insn "adddi3"
2149 [(set (match_operand:DI 0 "gr_register_operand" "=r,r,r")
2150 (plus:DI (match_operand:DI 1 "gr_register_operand" "%r,r,a")
2151 (match_operand:DI 2 "gr_reg_or_22bit_operand" "r,I,J")))]
2157 [(set_attr "itanium_class" "ialu")])
2159 (define_insn "*adddi3_plus1"
2160 [(set (match_operand:DI 0 "gr_register_operand" "=r")
2161 (plus:DI (plus:DI (match_operand:DI 1 "gr_register_operand" "r")
2162 (match_operand:DI 2 "gr_register_operand" "r"))
2165 "add %0 = %1, %2, 1"
2166 [(set_attr "itanium_class" "ialu")])
2168 ;; This has some of the same problems as shladd. We let the shladd
2169 ;; eliminator hack handle it, which results in the 1 being forced into
2170 ;; a register, but not more ugliness here.
2171 (define_insn "*adddi3_plus1_alt"
2172 [(set (match_operand:DI 0 "gr_register_operand" "=r")
2173 (plus:DI (mult:DI (match_operand:DI 1 "gr_register_operand" "r")
2177 "add %0 = %1, %1, 1"
2178 [(set_attr "itanium_class" "ialu")])
2180 (define_insn "subdi3"
2181 [(set (match_operand:DI 0 "gr_register_operand" "=r")
2182 (minus:DI (match_operand:DI 1 "gr_reg_or_8bit_operand" "rK")
2183 (match_operand:DI 2 "gr_register_operand" "r")))]
2186 [(set_attr "itanium_class" "ialu")])
2188 (define_insn "*subdi3_minus1"
2189 [(set (match_operand:DI 0 "gr_register_operand" "=r")
2190 (plus:DI (not:DI (match_operand:DI 1 "gr_register_operand" "r"))
2191 (match_operand:DI 2 "gr_register_operand" "r")))]
2193 "sub %0 = %2, %1, 1"
2194 [(set_attr "itanium_class" "ialu")])
2196 ;; ??? Use grfr instead of fr because of virtual register elimination
2197 ;; and silly test cases multiplying by the frame pointer.
2198 (define_insn "muldi3"
2199 [(set (match_operand:DI 0 "fr_register_operand" "=f")
2200 (mult:DI (match_operand:DI 1 "grfr_register_operand" "f")
2201 (match_operand:DI 2 "grfr_register_operand" "f")))]
2203 "xmpy.l %0 = %1, %2"
2204 [(set_attr "itanium_class" "xmpy")])
2206 ;; ??? If operand 3 is an eliminable reg, then register elimination causes the
2207 ;; same problem that we have with shladd below. Unfortunately, this case is
2208 ;; much harder to fix because the multiply puts the result in an FP register,
2209 ;; but the add needs inputs from a general register. We add a spurious clobber
2210 ;; here so that it will be present just in case register elimination gives us
2211 ;; the funny result.
2213 ;; ??? Maybe validate_changes should try adding match_scratch clobbers?
2215 ;; ??? Maybe we should change how adds are canonicalized.
2217 (define_insn "madddi4"
2218 [(set (match_operand:DI 0 "fr_register_operand" "=f")
2219 (plus:DI (mult:DI (match_operand:DI 1 "grfr_register_operand" "f")
2220 (match_operand:DI 2 "grfr_register_operand" "f"))
2221 (match_operand:DI 3 "grfr_register_operand" "f")))
2222 (clobber (match_scratch:DI 4 "=X"))]
2224 "xma.l %0 = %1, %2, %3"
2225 [(set_attr "itanium_class" "xmpy")])
2227 ;; This can be created by register elimination if operand3 of shladd is an
2228 ;; eliminable register or has reg_equiv_constant set.
2230 ;; We have to use nonmemory_operand for operand 4, to ensure that the
2231 ;; validate_changes call inside eliminate_regs will always succeed. If it
2232 ;; doesn't succeed, then this remain a madddi4 pattern, and will be reloaded
2235 (define_insn "*madddi4_elim"
2236 [(set (match_operand:DI 0 "register_operand" "=&r")
2237 (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "f")
2238 (match_operand:DI 2 "register_operand" "f"))
2239 (match_operand:DI 3 "register_operand" "f"))
2240 (match_operand:DI 4 "nonmemory_operand" "rI")))
2241 (clobber (match_scratch:DI 5 "=f"))]
2242 "reload_in_progress"
2244 [(set_attr "itanium_class" "unknown")])
2247 [(set (match_operand:DI 0 "register_operand" "")
2248 (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "")
2249 (match_operand:DI 2 "register_operand" ""))
2250 (match_operand:DI 3 "register_operand" ""))
2251 (match_operand:DI 4 "gr_reg_or_14bit_operand" "")))
2252 (clobber (match_scratch:DI 5 ""))]
2254 [(parallel [(set (match_dup 5) (plus:DI (mult:DI (match_dup 1) (match_dup 2))
2256 (clobber (match_dup 0))])
2257 (set (match_dup 0) (match_dup 5))
2258 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
2261 ;; ??? There are highpart multiply and add instructions, but we have no way
2262 ;; to generate them.
2264 (define_insn "smuldi3_highpart"
2265 [(set (match_operand:DI 0 "fr_register_operand" "=f")
2268 (mult:TI (sign_extend:TI
2269 (match_operand:DI 1 "fr_register_operand" "f"))
2271 (match_operand:DI 2 "fr_register_operand" "f")))
2274 "xmpy.h %0 = %1, %2"
2275 [(set_attr "itanium_class" "xmpy")])
2277 (define_insn "umuldi3_highpart"
2278 [(set (match_operand:DI 0 "fr_register_operand" "=f")
2281 (mult:TI (zero_extend:TI
2282 (match_operand:DI 1 "fr_register_operand" "f"))
2284 (match_operand:DI 2 "fr_register_operand" "f")))
2287 "xmpy.hu %0 = %1, %2"
2288 [(set_attr "itanium_class" "xmpy")])
2290 (define_insn "negdi2"
2291 [(set (match_operand:DI 0 "gr_register_operand" "=r")
2292 (neg:DI (match_operand:DI 1 "gr_register_operand" "r")))]
2295 [(set_attr "itanium_class" "ialu")])
2297 (define_expand "absdi2"
2299 (ge:BI (match_operand:DI 1 "gr_register_operand" "") (const_int 0)))
2300 (set (match_operand:DI 0 "gr_register_operand" "")
2301 (if_then_else:DI (eq (match_dup 2) (const_int 0))
2302 (neg:DI (match_dup 1))
2305 { operands[2] = gen_reg_rtx (BImode); })
2307 (define_expand "smindi3"
2309 (ge:BI (match_operand:DI 1 "gr_register_operand" "")
2310 (match_operand:DI 2 "gr_register_operand" "")))
2311 (set (match_operand:DI 0 "gr_register_operand" "")
2312 (if_then_else:DI (ne (match_dup 3) (const_int 0))
2313 (match_dup 2) (match_dup 1)))]
2315 { operands[3] = gen_reg_rtx (BImode); })
2317 (define_expand "smaxdi3"
2319 (ge:BI (match_operand:DI 1 "gr_register_operand" "")
2320 (match_operand:DI 2 "gr_register_operand" "")))
2321 (set (match_operand:DI 0 "gr_register_operand" "")
2322 (if_then_else:DI (ne (match_dup 3) (const_int 0))
2323 (match_dup 1) (match_dup 2)))]
2325 { operands[3] = gen_reg_rtx (BImode); })
2327 (define_expand "umindi3"
2329 (geu:BI (match_operand:DI 1 "gr_register_operand" "")
2330 (match_operand:DI 2 "gr_register_operand" "")))
2331 (set (match_operand:DI 0 "gr_register_operand" "")
2332 (if_then_else:DI (ne (match_dup 3) (const_int 0))
2333 (match_dup 2) (match_dup 1)))]
2335 { operands[3] = gen_reg_rtx (BImode); })
2337 (define_expand "umaxdi3"
2339 (geu:BI (match_operand:DI 1 "gr_register_operand" "")
2340 (match_operand:DI 2 "gr_register_operand" "")))
2341 (set (match_operand:DI 0 "gr_register_operand" "")
2342 (if_then_else:DI (ne (match_dup 3) (const_int 0))
2343 (match_dup 1) (match_dup 2)))]
2345 { operands[3] = gen_reg_rtx (BImode); })
2347 (define_expand "ffsdi2"
2349 (eq:BI (match_operand:DI 1 "gr_register_operand" "") (const_int 0)))
2350 (set (match_dup 2) (plus:DI (match_dup 1) (const_int -1)))
2351 (set (match_dup 5) (const_int 0))
2352 (set (match_dup 3) (xor:DI (match_dup 1) (match_dup 2)))
2353 (set (match_dup 4) (unspec:DI [(match_dup 3)] UNSPEC_POPCNT))
2354 (set (match_operand:DI 0 "gr_register_operand" "")
2355 (if_then_else:DI (ne (match_dup 6) (const_int 0))
2356 (match_dup 5) (match_dup 4)))]
2359 operands[2] = gen_reg_rtx (DImode);
2360 operands[3] = gen_reg_rtx (DImode);
2361 operands[4] = gen_reg_rtx (DImode);
2362 operands[5] = gen_reg_rtx (DImode);
2363 operands[6] = gen_reg_rtx (BImode);
2366 (define_insn "*popcnt"
2367 [(set (match_operand:DI 0 "gr_register_operand" "=r")
2368 (unspec:DI [(match_operand:DI 1 "gr_register_operand" "r")]
2372 [(set_attr "itanium_class" "mmmul")])
2374 (define_expand "divdi3"
2375 [(set (match_operand:DI 0 "register_operand" "")
2376 (div:DI (match_operand:DI 1 "general_operand" "")
2377 (match_operand:DI 2 "general_operand" "")))]
2378 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2380 rtx op1_tf, op2_tf, op0_tf;
2382 op0_tf = gen_reg_rtx (TFmode);
2384 if (CONSTANT_P (operands[1]))
2385 operands[1] = force_reg (DImode, operands[1]);
2386 op1_tf = gen_reg_rtx (TFmode);
2387 expand_float (op1_tf, operands[1], 0);
2389 if (CONSTANT_P (operands[2]))
2390 operands[2] = force_reg (DImode, operands[2]);
2391 op2_tf = gen_reg_rtx (TFmode);
2392 expand_float (op2_tf, operands[2], 0);
2394 if (TARGET_INLINE_DIV_LAT)
2395 emit_insn (gen_divdi3_internal_lat (op0_tf, op1_tf, op2_tf));
2397 emit_insn (gen_divdi3_internal_thr (op0_tf, op1_tf, op2_tf));
2399 emit_insn (gen_fix_trunctfdi2_alts (operands[0], op0_tf, const1_rtx));
2403 (define_expand "moddi3"
2404 [(set (match_operand:DI 0 "register_operand" "")
2405 (mod:SI (match_operand:DI 1 "general_operand" "")
2406 (match_operand:DI 2 "general_operand" "")))]
2407 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2411 div = gen_reg_rtx (DImode);
2412 emit_insn (gen_divdi3 (div, operands[1], operands[2]));
2414 op2_neg = expand_unop (DImode, neg_optab, operands[2], NULL_RTX, 0);
2416 emit_insn (gen_madddi4 (operands[0], div, op2_neg, operands[1]));
2420 (define_expand "udivdi3"
2421 [(set (match_operand:DI 0 "register_operand" "")
2422 (udiv:DI (match_operand:DI 1 "general_operand" "")
2423 (match_operand:DI 2 "general_operand" "")))]
2424 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2426 rtx op1_tf, op2_tf, op0_tf;
2428 op0_tf = gen_reg_rtx (TFmode);
2430 if (CONSTANT_P (operands[1]))
2431 operands[1] = force_reg (DImode, operands[1]);
2432 op1_tf = gen_reg_rtx (TFmode);
2433 expand_float (op1_tf, operands[1], 1);
2435 if (CONSTANT_P (operands[2]))
2436 operands[2] = force_reg (DImode, operands[2]);
2437 op2_tf = gen_reg_rtx (TFmode);
2438 expand_float (op2_tf, operands[2], 1);
2440 if (TARGET_INLINE_DIV_LAT)
2441 emit_insn (gen_divdi3_internal_lat (op0_tf, op1_tf, op2_tf));
2443 emit_insn (gen_divdi3_internal_thr (op0_tf, op1_tf, op2_tf));
2445 emit_insn (gen_fixuns_trunctfdi2_alts (operands[0], op0_tf, const1_rtx));
2449 (define_expand "umoddi3"
2450 [(set (match_operand:DI 0 "register_operand" "")
2451 (umod:DI (match_operand:DI 1 "general_operand" "")
2452 (match_operand:DI 2 "general_operand" "")))]
2453 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2457 div = gen_reg_rtx (DImode);
2458 emit_insn (gen_udivdi3 (div, operands[1], operands[2]));
2460 op2_neg = expand_unop (DImode, neg_optab, operands[2], NULL_RTX, 0);
2462 emit_insn (gen_madddi4 (operands[0], div, op2_neg, operands[1]));
2466 (define_insn_and_split "divdi3_internal_lat"
2467 [(set (match_operand:TF 0 "fr_register_operand" "=&f")
2468 (float:TF (div:SI (match_operand:TF 1 "fr_register_operand" "f")
2469 (match_operand:TF 2 "fr_register_operand" "f"))))
2470 (clobber (match_scratch:TF 3 "=&f"))
2471 (clobber (match_scratch:TF 4 "=&f"))
2472 (clobber (match_scratch:TF 5 "=&f"))
2473 (clobber (match_scratch:BI 6 "=c"))]
2474 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_LAT"
2476 "&& reload_completed"
2477 [(parallel [(set (match_dup 0) (div:TF (const_int 1) (match_dup 2)))
2478 (set (match_dup 6) (unspec:BI [(match_dup 1) (match_dup 2)]
2479 UNSPEC_FR_RECIP_APPROX))
2480 (use (const_int 1))])
2481 (cond_exec (ne (match_dup 6) (const_int 0))
2482 (parallel [(set (match_dup 3)
2483 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
2485 (use (const_int 1))]))
2486 (cond_exec (ne (match_dup 6) (const_int 0))
2487 (parallel [(set (match_dup 4) (mult:TF (match_dup 1) (match_dup 0)))
2488 (use (const_int 1))]))
2489 (cond_exec (ne (match_dup 6) (const_int 0))
2490 (parallel [(set (match_dup 5) (mult:TF (match_dup 3) (match_dup 3)))
2491 (use (const_int 1))]))
2492 (cond_exec (ne (match_dup 6) (const_int 0))
2493 (parallel [(set (match_dup 4)
2494 (plus:TF (mult:TF (match_dup 3) (match_dup 4))
2496 (use (const_int 1))]))
2497 (cond_exec (ne (match_dup 6) (const_int 0))
2498 (parallel [(set (match_dup 0)
2499 (plus:TF (mult:TF (match_dup 3) (match_dup 0))
2501 (use (const_int 1))]))
2502 (cond_exec (ne (match_dup 6) (const_int 0))
2503 (parallel [(set (match_dup 3)
2504 (plus:TF (mult:TF (match_dup 5) (match_dup 4))
2506 (use (const_int 1))]))
2507 (cond_exec (ne (match_dup 6) (const_int 0))
2508 (parallel [(set (match_dup 0)
2509 (plus:TF (mult:TF (match_dup 5) (match_dup 0))
2511 (use (const_int 1))]))
2512 (cond_exec (ne (match_dup 6) (const_int 0))
2513 (parallel [(set (match_dup 4)
2514 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 3)))
2516 (use (const_int 1))]))
2517 (cond_exec (ne (match_dup 6) (const_int 0))
2518 (parallel [(set (match_dup 0)
2519 (plus:TF (mult:TF (match_dup 4) (match_dup 0))
2521 (use (const_int 1))]))
2523 "operands[7] = CONST1_RTX (TFmode);"
2524 [(set_attr "predicable" "no")])
2526 (define_insn_and_split "divdi3_internal_thr"
2527 [(set (match_operand:TF 0 "fr_register_operand" "=&f")
2528 (float:TF (div:SI (match_operand:TF 1 "fr_register_operand" "f")
2529 (match_operand:TF 2 "fr_register_operand" "f"))))
2530 (clobber (match_scratch:TF 3 "=&f"))
2531 (clobber (match_scratch:TF 4 "=f"))
2532 (clobber (match_scratch:BI 5 "=c"))]
2533 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_THR"
2535 "&& reload_completed"
2536 [(parallel [(set (match_dup 0) (div:TF (const_int 1) (match_dup 2)))
2537 (set (match_dup 5) (unspec:BI [(match_dup 1) (match_dup 2)]
2538 UNSPEC_FR_RECIP_APPROX))
2539 (use (const_int 1))])
2540 (cond_exec (ne (match_dup 5) (const_int 0))
2541 (parallel [(set (match_dup 3)
2542 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
2544 (use (const_int 1))]))
2545 (cond_exec (ne (match_dup 5) (const_int 0))
2546 (parallel [(set (match_dup 0)
2547 (plus:TF (mult:TF (match_dup 3) (match_dup 0))
2549 (use (const_int 1))]))
2550 (cond_exec (ne (match_dup 5) (const_int 0))
2551 (parallel [(set (match_dup 3) (mult:TF (match_dup 3) (match_dup 3)))
2552 (use (const_int 1))]))
2553 (cond_exec (ne (match_dup 5) (const_int 0))
2554 (parallel [(set (match_dup 0)
2555 (plus:TF (mult:TF (match_dup 3) (match_dup 0))
2557 (use (const_int 1))]))
2558 (cond_exec (ne (match_dup 5) (const_int 0))
2559 (parallel [(set (match_dup 3) (mult:TF (match_dup 0) (match_dup 1)))
2560 (use (const_int 1))]))
2561 (cond_exec (ne (match_dup 5) (const_int 0))
2562 (parallel [(set (match_dup 4)
2563 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 3)))
2565 (use (const_int 1))]))
2566 (cond_exec (ne (match_dup 5) (const_int 0))
2567 (parallel [(set (match_dup 0)
2568 (plus:TF (mult:TF (match_dup 4) (match_dup 0))
2570 (use (const_int 1))]))
2572 "operands[6] = CONST1_RTX (TFmode);"
2573 [(set_attr "predicable" "no")])
2575 ;; ::::::::::::::::::::
2577 ;; :: 32 bit floating point arithmetic
2579 ;; ::::::::::::::::::::
2581 (define_insn "addsf3"
2582 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2583 (plus:SF (match_operand:SF 1 "fr_register_operand" "%f")
2584 (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
2586 "fadd.s %0 = %1, %F2"
2587 [(set_attr "itanium_class" "fmac")])
2589 (define_insn "subsf3"
2590 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2591 (minus:SF (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
2592 (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
2594 "fsub.s %0 = %F1, %F2"
2595 [(set_attr "itanium_class" "fmac")])
2597 (define_insn "mulsf3"
2598 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2599 (mult:SF (match_operand:SF 1 "fr_register_operand" "%f")
2600 (match_operand:SF 2 "fr_register_operand" "f")))]
2602 "fmpy.s %0 = %1, %2"
2603 [(set_attr "itanium_class" "fmac")])
2605 (define_insn "abssf2"
2606 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2607 (abs:SF (match_operand:SF 1 "fr_register_operand" "f")))]
2610 [(set_attr "itanium_class" "fmisc")])
2612 (define_insn "negsf2"
2613 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2614 (neg:SF (match_operand:SF 1 "fr_register_operand" "f")))]
2617 [(set_attr "itanium_class" "fmisc")])
2619 (define_insn "*nabssf2"
2620 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2621 (neg:SF (abs:SF (match_operand:SF 1 "fr_register_operand" "f"))))]
2624 [(set_attr "itanium_class" "fmisc")])
2626 (define_insn "minsf3"
2627 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2628 (smin:SF (match_operand:SF 1 "fr_register_operand" "f")
2629 (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
2632 [(set_attr "itanium_class" "fmisc")])
2634 (define_insn "maxsf3"
2635 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2636 (smax:SF (match_operand:SF 1 "fr_register_operand" "f")
2637 (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
2640 [(set_attr "itanium_class" "fmisc")])
2642 (define_insn "*maddsf4"
2643 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2644 (plus:SF (mult:SF (match_operand:SF 1 "fr_register_operand" "f")
2645 (match_operand:SF 2 "fr_register_operand" "f"))
2646 (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")))]
2648 "fma.s %0 = %1, %2, %F3"
2649 [(set_attr "itanium_class" "fmac")])
2651 (define_insn "*msubsf4"
2652 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2653 (minus:SF (mult:SF (match_operand:SF 1 "fr_register_operand" "f")
2654 (match_operand:SF 2 "fr_register_operand" "f"))
2655 (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")))]
2657 "fms.s %0 = %1, %2, %F3"
2658 [(set_attr "itanium_class" "fmac")])
2660 (define_insn "*nmulsf3"
2661 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2662 (neg:SF (mult:SF (match_operand:SF 1 "fr_register_operand" "f")
2663 (match_operand:SF 2 "fr_register_operand" "f"))))]
2665 "fnmpy.s %0 = %1, %2"
2666 [(set_attr "itanium_class" "fmac")])
2668 ;; ??? Is it possible to canonicalize this as (minus (reg) (mult))?
2670 (define_insn "*nmaddsf4"
2671 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2672 (plus:SF (neg:SF (mult:SF
2673 (match_operand:SF 1 "fr_register_operand" "f")
2674 (match_operand:SF 2 "fr_register_operand" "f")))
2675 (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")))]
2677 "fnma.s %0 = %1, %2, %F3"
2678 [(set_attr "itanium_class" "fmac")])
2680 (define_expand "divsf3"
2681 [(set (match_operand:SF 0 "fr_register_operand" "")
2682 (div:SF (match_operand:SF 1 "fr_register_operand" "")
2683 (match_operand:SF 2 "fr_register_operand" "")))]
2684 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2687 if (TARGET_INLINE_DIV_LAT)
2688 insn = gen_divsf3_internal_lat (operands[0], operands[1], operands[2]);
2690 insn = gen_divsf3_internal_thr (operands[0], operands[1], operands[2]);
2695 (define_insn_and_split "divsf3_internal_lat"
2696 [(set (match_operand:SF 0 "fr_register_operand" "=&f")
2697 (div:SF (match_operand:SF 1 "fr_register_operand" "f")
2698 (match_operand:SF 2 "fr_register_operand" "f")))
2699 (clobber (match_scratch:TF 3 "=&f"))
2700 (clobber (match_scratch:TF 4 "=f"))
2701 (clobber (match_scratch:BI 5 "=c"))]
2702 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_LAT"
2704 "&& reload_completed"
2705 [(parallel [(set (match_dup 6) (div:TF (const_int 1) (match_dup 8)))
2706 (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)]
2707 UNSPEC_FR_RECIP_APPROX))
2708 (use (const_int 1))])
2709 (cond_exec (ne (match_dup 5) (const_int 0))
2710 (parallel [(set (match_dup 3) (mult:TF (match_dup 7) (match_dup 6)))
2711 (use (const_int 1))]))
2712 (cond_exec (ne (match_dup 5) (const_int 0))
2713 (parallel [(set (match_dup 4)
2714 (plus:TF (neg:TF (mult:TF (match_dup 8) (match_dup 6)))
2716 (use (const_int 1))]))
2717 (cond_exec (ne (match_dup 5) (const_int 0))
2718 (parallel [(set (match_dup 3)
2719 (plus:TF (mult:TF (match_dup 4) (match_dup 3))
2721 (use (const_int 1))]))
2722 (cond_exec (ne (match_dup 5) (const_int 0))
2723 (parallel [(set (match_dup 4) (mult:TF (match_dup 4) (match_dup 4)))
2724 (use (const_int 1))]))
2725 (cond_exec (ne (match_dup 5) (const_int 0))
2726 (parallel [(set (match_dup 3)
2727 (plus:TF (mult:TF (match_dup 4) (match_dup 3))
2729 (use (const_int 1))]))
2730 (cond_exec (ne (match_dup 5) (const_int 0))
2731 (parallel [(set (match_dup 4) (mult:TF (match_dup 4) (match_dup 4)))
2732 (use (const_int 1))]))
2733 (cond_exec (ne (match_dup 5) (const_int 0))
2734 (parallel [(set (match_dup 9)
2736 (plus:TF (mult:TF (match_dup 4) (match_dup 3))
2738 (use (const_int 1))]))
2739 (cond_exec (ne (match_dup 5) (const_int 0))
2741 (float_truncate:SF (match_dup 6))))
2744 operands[6] = gen_rtx_REG (TFmode, REGNO (operands[0]));
2745 operands[7] = gen_rtx_REG (TFmode, REGNO (operands[1]));
2746 operands[8] = gen_rtx_REG (TFmode, REGNO (operands[2]));
2747 operands[9] = gen_rtx_REG (DFmode, REGNO (operands[0]));
2748 operands[10] = CONST1_RTX (TFmode);
2750 [(set_attr "predicable" "no")])
2752 (define_insn_and_split "divsf3_internal_thr"
2753 [(set (match_operand:SF 0 "fr_register_operand" "=&f")
2754 (div:SF (match_operand:SF 1 "fr_register_operand" "f")
2755 (match_operand:SF 2 "fr_register_operand" "f")))
2756 (clobber (match_scratch:TF 3 "=&f"))
2757 (clobber (match_scratch:TF 4 "=f"))
2758 (clobber (match_scratch:BI 5 "=c"))]
2759 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_THR"
2761 "&& reload_completed"
2762 [(parallel [(set (match_dup 6) (div:TF (const_int 1) (match_dup 8)))
2763 (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)]
2764 UNSPEC_FR_RECIP_APPROX))
2765 (use (const_int 1))])
2766 (cond_exec (ne (match_dup 5) (const_int 0))
2767 (parallel [(set (match_dup 3)
2768 (plus:TF (neg:TF (mult:TF (match_dup 8) (match_dup 6)))
2770 (use (const_int 1))]))
2771 (cond_exec (ne (match_dup 5) (const_int 0))
2772 (parallel [(set (match_dup 3)
2773 (plus:TF (mult:TF (match_dup 3) (match_dup 3))
2775 (use (const_int 1))]))
2776 (cond_exec (ne (match_dup 5) (const_int 0))
2777 (parallel [(set (match_dup 6)
2778 (plus:TF (mult:TF (match_dup 3) (match_dup 6))
2780 (use (const_int 1))]))
2781 (cond_exec (ne (match_dup 5) (const_int 0))
2782 (parallel [(set (match_dup 9)
2784 (mult:TF (match_dup 7) (match_dup 6))))
2785 (use (const_int 1))]))
2786 (cond_exec (ne (match_dup 5) (const_int 0))
2787 (parallel [(set (match_dup 4)
2788 (plus:TF (neg:TF (mult:TF (match_dup 8) (match_dup 3)))
2790 (use (const_int 1))]))
2791 (cond_exec (ne (match_dup 5) (const_int 0))
2794 (plus:TF (mult:TF (match_dup 4) (match_dup 6))
2798 operands[6] = gen_rtx_REG (TFmode, REGNO (operands[0]));
2799 operands[7] = gen_rtx_REG (TFmode, REGNO (operands[1]));
2800 operands[8] = gen_rtx_REG (TFmode, REGNO (operands[2]));
2801 operands[9] = gen_rtx_REG (SFmode, REGNO (operands[3]));
2802 operands[10] = CONST1_RTX (TFmode);
2804 [(set_attr "predicable" "no")])
2806 ;; ::::::::::::::::::::
2808 ;; :: 64 bit floating point arithmetic
2810 ;; ::::::::::::::::::::
2812 (define_insn "adddf3"
2813 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2814 (plus:DF (match_operand:DF 1 "fr_register_operand" "%f")
2815 (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))]
2817 "fadd.d %0 = %1, %F2"
2818 [(set_attr "itanium_class" "fmac")])
2820 (define_insn "*adddf3_trunc"
2821 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2823 (plus:DF (match_operand:DF 1 "fr_register_operand" "%f")
2824 (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))))]
2826 "fadd.s %0 = %1, %F2"
2827 [(set_attr "itanium_class" "fmac")])
2829 (define_insn "subdf3"
2830 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2831 (minus:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
2832 (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))]
2834 "fsub.d %0 = %F1, %F2"
2835 [(set_attr "itanium_class" "fmac")])
2837 (define_insn "*subdf3_trunc"
2838 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2840 (minus:DF (match_operand:DF 1 "fr_reg_or_fp01_operand" "fG")
2841 (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG"))))]
2843 "fsub.s %0 = %F1, %F2"
2844 [(set_attr "itanium_class" "fmac")])
2846 (define_insn "muldf3"
2847 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2848 (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2849 (match_operand:DF 2 "fr_register_operand" "f")))]
2851 "fmpy.d %0 = %1, %2"
2852 [(set_attr "itanium_class" "fmac")])
2854 (define_insn "*muldf3_trunc"
2855 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2857 (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2858 (match_operand:DF 2 "fr_register_operand" "f"))))]
2860 "fmpy.s %0 = %1, %2"
2861 [(set_attr "itanium_class" "fmac")])
2863 (define_insn "absdf2"
2864 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2865 (abs:DF (match_operand:DF 1 "fr_register_operand" "f")))]
2868 [(set_attr "itanium_class" "fmisc")])
2870 (define_insn "negdf2"
2871 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2872 (neg:DF (match_operand:DF 1 "fr_register_operand" "f")))]
2875 [(set_attr "itanium_class" "fmisc")])
2877 (define_insn "*nabsdf2"
2878 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2879 (neg:DF (abs:DF (match_operand:DF 1 "fr_register_operand" "f"))))]
2882 [(set_attr "itanium_class" "fmisc")])
2884 (define_insn "mindf3"
2885 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2886 (smin:DF (match_operand:DF 1 "fr_register_operand" "f")
2887 (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))]
2890 [(set_attr "itanium_class" "fmisc")])
2892 (define_insn "maxdf3"
2893 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2894 (smax:DF (match_operand:DF 1 "fr_register_operand" "f")
2895 (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))]
2898 [(set_attr "itanium_class" "fmisc")])
2900 (define_insn "*madddf4"
2901 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2902 (plus:DF (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2903 (match_operand:DF 2 "fr_register_operand" "f"))
2904 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))]
2906 "fma.d %0 = %1, %2, %F3"
2907 [(set_attr "itanium_class" "fmac")])
2909 (define_insn "*madddf4_trunc"
2910 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2912 (plus:DF (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2913 (match_operand:DF 2 "fr_register_operand" "f"))
2914 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))))]
2916 "fma.s %0 = %1, %2, %F3"
2917 [(set_attr "itanium_class" "fmac")])
2919 (define_insn "*msubdf4"
2920 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2921 (minus:DF (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2922 (match_operand:DF 2 "fr_register_operand" "f"))
2923 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))]
2925 "fms.d %0 = %1, %2, %F3"
2926 [(set_attr "itanium_class" "fmac")])
2928 (define_insn "*msubdf4_trunc"
2929 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2931 (minus:DF (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2932 (match_operand:DF 2 "fr_register_operand" "f"))
2933 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))))]
2935 "fms.s %0 = %1, %2, %F3"
2936 [(set_attr "itanium_class" "fmac")])
2938 (define_insn "*nmuldf3"
2939 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2940 (neg:DF (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2941 (match_operand:DF 2 "fr_register_operand" "f"))))]
2943 "fnmpy.d %0 = %1, %2"
2944 [(set_attr "itanium_class" "fmac")])
2946 (define_insn "*nmuldf3_trunc"
2947 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2949 (neg:DF (mult:DF (match_operand:DF 1 "fr_register_operand" "f")
2950 (match_operand:DF 2 "fr_register_operand" "f")))))]
2952 "fnmpy.s %0 = %1, %2"
2953 [(set_attr "itanium_class" "fmac")])
2955 ;; ??? Is it possible to canonicalize this as (minus (reg) (mult))?
2957 (define_insn "*nmadddf4"
2958 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2959 (plus:DF (neg:DF (mult:DF
2960 (match_operand:DF 1 "fr_register_operand" "f")
2961 (match_operand:DF 2 "fr_register_operand" "f")))
2962 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))]
2964 "fnma.d %0 = %1, %2, %F3"
2965 [(set_attr "itanium_class" "fmac")])
2967 (define_insn "*nmadddf4_alts"
2968 [(set (match_operand:DF 0 "fr_register_operand" "=f")
2969 (plus:DF (neg:DF (mult:DF
2970 (match_operand:DF 1 "fr_register_operand" "f")
2971 (match_operand:DF 2 "fr_register_operand" "f")))
2972 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))
2973 (use (match_operand:SI 4 "const_int_operand" ""))]
2975 "fnma.d.s%4 %0 = %1, %2, %F3"
2976 [(set_attr "itanium_class" "fmac")])
2978 (define_insn "*nmadddf4_trunc"
2979 [(set (match_operand:SF 0 "fr_register_operand" "=f")
2981 (plus:DF (neg:DF (mult:DF
2982 (match_operand:DF 1 "fr_register_operand" "f")
2983 (match_operand:DF 2 "fr_register_operand" "f")))
2984 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))))]
2986 "fnma.s %0 = %1, %2, %F3"
2987 [(set_attr "itanium_class" "fmac")])
2989 (define_expand "divdf3"
2990 [(set (match_operand:DF 0 "fr_register_operand" "")
2991 (div:DF (match_operand:DF 1 "fr_register_operand" "")
2992 (match_operand:DF 2 "fr_register_operand" "")))]
2993 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
2996 if (TARGET_INLINE_DIV_LAT)
2997 insn = gen_divdf3_internal_lat (operands[0], operands[1], operands[2]);
2999 insn = gen_divdf3_internal_thr (operands[0], operands[1], operands[2]);
3004 (define_insn_and_split "divdf3_internal_lat"
3005 [(set (match_operand:DF 0 "fr_register_operand" "=&f")
3006 (div:DF (match_operand:DF 1 "fr_register_operand" "f")
3007 (match_operand:DF 2 "fr_register_operand" "f")))
3008 (clobber (match_scratch:TF 3 "=&f"))
3009 (clobber (match_scratch:TF 4 "=&f"))
3010 (clobber (match_scratch:TF 5 "=&f"))
3011 (clobber (match_scratch:BI 6 "=c"))]
3012 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_LAT"
3014 "&& reload_completed"
3015 [(parallel [(set (match_dup 7) (div:TF (const_int 1) (match_dup 9)))
3016 (set (match_dup 6) (unspec:BI [(match_dup 8) (match_dup 9)]
3017 UNSPEC_FR_RECIP_APPROX))
3018 (use (const_int 1))])
3019 (cond_exec (ne (match_dup 6) (const_int 0))
3020 (parallel [(set (match_dup 3) (mult:TF (match_dup 8) (match_dup 7)))
3021 (use (const_int 1))]))
3022 (cond_exec (ne (match_dup 6) (const_int 0))
3023 (parallel [(set (match_dup 4)
3024 (plus:TF (neg:TF (mult:TF (match_dup 9) (match_dup 7)))
3026 (use (const_int 1))]))
3027 (cond_exec (ne (match_dup 6) (const_int 0))
3028 (parallel [(set (match_dup 3)
3029 (plus:TF (mult:TF (match_dup 4) (match_dup 3))
3031 (use (const_int 1))]))
3032 (cond_exec (ne (match_dup 6) (const_int 0))
3033 (parallel [(set (match_dup 5) (mult:TF (match_dup 4) (match_dup 4)))
3034 (use (const_int 1))]))
3035 (cond_exec (ne (match_dup 6) (const_int 0))
3036 (parallel [(set (match_dup 7)
3037 (plus:TF (mult:TF (match_dup 4) (match_dup 7))
3039 (use (const_int 1))]))
3040 (cond_exec (ne (match_dup 6) (const_int 0))
3041 (parallel [(set (match_dup 3)
3042 (plus:TF (mult:TF (match_dup 5) (match_dup 3))
3044 (use (const_int 1))]))
3045 (cond_exec (ne (match_dup 6) (const_int 0))
3046 (parallel [(set (match_dup 4) (mult:TF (match_dup 5) (match_dup 5)))
3047 (use (const_int 1))]))
3048 (cond_exec (ne (match_dup 6) (const_int 0))
3049 (parallel [(set (match_dup 7)
3050 (plus:TF (mult:TF (match_dup 5) (match_dup 7))
3052 (use (const_int 1))]))
3053 (cond_exec (ne (match_dup 6) (const_int 0))
3054 (parallel [(set (match_dup 10)
3056 (plus:TF (mult:TF (match_dup 4) (match_dup 3))
3058 (use (const_int 1))]))
3059 (cond_exec (ne (match_dup 6) (const_int 0))
3060 (parallel [(set (match_dup 7)
3061 (plus:TF (mult:TF (match_dup 4) (match_dup 7))
3063 (use (const_int 1))]))
3064 (cond_exec (ne (match_dup 6) (const_int 0))
3065 (parallel [(set (match_dup 11)
3067 (plus:TF (neg:TF (mult:TF (match_dup 9) (match_dup 3)))
3069 (use (const_int 1))]))
3070 (cond_exec (ne (match_dup 6) (const_int 0))
3072 (float_truncate:DF (plus:TF (mult:TF (match_dup 5) (match_dup 7))
3076 operands[7] = gen_rtx_REG (TFmode, REGNO (operands[0]));
3077 operands[8] = gen_rtx_REG (TFmode, REGNO (operands[1]));
3078 operands[9] = gen_rtx_REG (TFmode, REGNO (operands[2]));
3079 operands[10] = gen_rtx_REG (DFmode, REGNO (operands[3]));
3080 operands[11] = gen_rtx_REG (DFmode, REGNO (operands[5]));
3081 operands[12] = CONST1_RTX (TFmode);
3083 [(set_attr "predicable" "no")])
3085 (define_insn_and_split "divdf3_internal_thr"
3086 [(set (match_operand:DF 0 "fr_register_operand" "=&f")
3087 (div:DF (match_operand:DF 1 "fr_register_operand" "f")
3088 (match_operand:DF 2 "fr_register_operand" "f")))
3089 (clobber (match_scratch:TF 3 "=&f"))
3090 (clobber (match_scratch:DF 4 "=f"))
3091 (clobber (match_scratch:BI 5 "=c"))]
3092 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_THR"
3094 "&& reload_completed"
3095 [(parallel [(set (match_dup 6) (div:TF (const_int 1) (match_dup 8)))
3096 (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)]
3097 UNSPEC_FR_RECIP_APPROX))
3098 (use (const_int 1))])
3099 (cond_exec (ne (match_dup 5) (const_int 0))
3100 (parallel [(set (match_dup 3)
3101 (plus:TF (neg:TF (mult:TF (match_dup 8) (match_dup 6)))
3103 (use (const_int 1))]))
3104 (cond_exec (ne (match_dup 5) (const_int 0))
3105 (parallel [(set (match_dup 6)
3106 (plus:TF (mult:TF (match_dup 3) (match_dup 6))
3108 (use (const_int 1))]))
3109 (cond_exec (ne (match_dup 5) (const_int 0))
3110 (parallel [(set (match_dup 3)
3111 (mult:TF (match_dup 3) (match_dup 3)))
3112 (use (const_int 1))]))
3113 (cond_exec (ne (match_dup 5) (const_int 0))
3114 (parallel [(set (match_dup 6)
3115 (plus:TF (mult:TF (match_dup 3) (match_dup 6))
3117 (use (const_int 1))]))
3118 (cond_exec (ne (match_dup 5) (const_int 0))
3119 (parallel [(set (match_dup 3)
3120 (mult:TF (match_dup 3) (match_dup 3)))
3121 (use (const_int 1))]))
3122 (cond_exec (ne (match_dup 5) (const_int 0))
3123 (parallel [(set (match_dup 6)
3124 (plus:TF (mult:TF (match_dup 3) (match_dup 6))
3126 (use (const_int 1))]))
3127 (cond_exec (ne (match_dup 5) (const_int 0))
3128 (parallel [(set (match_dup 9)
3130 (mult:TF (match_dup 7) (match_dup 3))))
3131 (use (const_int 1))]))
3132 (cond_exec (ne (match_dup 5) (const_int 0))
3133 (parallel [(set (match_dup 4)
3134 (plus:DF (neg:DF (mult:DF (match_dup 2) (match_dup 9)))
3136 (use (const_int 1))]))
3137 (cond_exec (ne (match_dup 5) (const_int 0))
3139 (plus:DF (mult:DF (match_dup 4) (match_dup 0))
3143 operands[6] = gen_rtx_REG (TFmode, REGNO (operands[0]));
3144 operands[7] = gen_rtx_REG (TFmode, REGNO (operands[1]));
3145 operands[8] = gen_rtx_REG (TFmode, REGNO (operands[2]));
3146 operands[9] = gen_rtx_REG (DFmode, REGNO (operands[3]));
3147 operands[10] = CONST1_RTX (TFmode);
3149 [(set_attr "predicable" "no")])
3151 ;; ::::::::::::::::::::
3153 ;; :: 80 bit floating point arithmetic
3155 ;; ::::::::::::::::::::
3157 (define_insn "addtf3"
3158 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3159 (plus:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3160 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))]
3161 "INTEL_EXTENDED_IEEE_FORMAT"
3162 "fadd %0 = %F1, %F2"
3163 [(set_attr "itanium_class" "fmac")])
3165 (define_insn "*addtf3_truncsf"
3166 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3168 (plus:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3169 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3170 "INTEL_EXTENDED_IEEE_FORMAT"
3171 "fadd.s %0 = %F1, %F2"
3172 [(set_attr "itanium_class" "fmac")])
3174 (define_insn "*addtf3_truncdf"
3175 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3177 (plus:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3178 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3179 "INTEL_EXTENDED_IEEE_FORMAT"
3180 "fadd.d %0 = %F1, %F2"
3181 [(set_attr "itanium_class" "fmac")])
3183 (define_insn "subtf3"
3184 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3185 (minus:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3186 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))]
3187 "INTEL_EXTENDED_IEEE_FORMAT"
3188 "fsub %0 = %F1, %F2"
3189 [(set_attr "itanium_class" "fmac")])
3191 (define_insn "*subtf3_truncsf"
3192 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3194 (minus:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3195 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3196 "INTEL_EXTENDED_IEEE_FORMAT"
3197 "fsub.s %0 = %F1, %F2"
3198 [(set_attr "itanium_class" "fmac")])
3200 (define_insn "*subtf3_truncdf"
3201 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3203 (minus:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3204 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3205 "INTEL_EXTENDED_IEEE_FORMAT"
3206 "fsub.d %0 = %F1, %F2"
3207 [(set_attr "itanium_class" "fmac")])
3209 (define_insn "multf3"
3210 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3211 (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3212 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))]
3213 "INTEL_EXTENDED_IEEE_FORMAT"
3214 "fmpy %0 = %F1, %F2"
3215 [(set_attr "itanium_class" "fmac")])
3217 (define_insn "*multf3_truncsf"
3218 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3220 (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3221 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3222 "INTEL_EXTENDED_IEEE_FORMAT"
3223 "fmpy.s %0 = %F1, %F2"
3224 [(set_attr "itanium_class" "fmac")])
3226 (define_insn "*multf3_truncdf"
3227 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3229 (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3230 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3231 "INTEL_EXTENDED_IEEE_FORMAT"
3232 "fmpy.d %0 = %F1, %F2"
3233 [(set_attr "itanium_class" "fmac")])
3235 (define_insn "*multf3_alts"
3236 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3237 (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3238 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))
3239 (use (match_operand:SI 3 "const_int_operand" ""))]
3240 "INTEL_EXTENDED_IEEE_FORMAT"
3241 "fmpy.s%3 %0 = %F1, %F2"
3242 [(set_attr "itanium_class" "fmac")])
3244 (define_insn "*multf3_truncsf_alts"
3245 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3247 (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3248 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))
3249 (use (match_operand:SI 3 "const_int_operand" ""))]
3250 "INTEL_EXTENDED_IEEE_FORMAT"
3251 "fmpy.s.s%3 %0 = %F1, %F2"
3252 [(set_attr "itanium_class" "fmac")])
3254 (define_insn "*multf3_truncdf_alts"
3255 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3257 (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3258 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))
3259 (use (match_operand:SI 3 "const_int_operand" ""))]
3260 "INTEL_EXTENDED_IEEE_FORMAT"
3261 "fmpy.d.s%3 %0 = %F1, %F2"
3262 [(set_attr "itanium_class" "fmac")])
3264 (define_insn "abstf2"
3265 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3266 (abs:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")))]
3267 "INTEL_EXTENDED_IEEE_FORMAT"
3269 [(set_attr "itanium_class" "fmisc")])
3271 (define_insn "negtf2"
3272 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3273 (neg:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")))]
3274 "INTEL_EXTENDED_IEEE_FORMAT"
3276 [(set_attr "itanium_class" "fmisc")])
3278 (define_insn "*nabstf2"
3279 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3280 (neg:TF (abs:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG"))))]
3281 "INTEL_EXTENDED_IEEE_FORMAT"
3283 [(set_attr "itanium_class" "fmisc")])
3285 (define_insn "mintf3"
3286 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3287 (smin:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3288 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))]
3289 "INTEL_EXTENDED_IEEE_FORMAT"
3290 "fmin %0 = %F1, %F2"
3291 [(set_attr "itanium_class" "fmisc")])
3293 (define_insn "maxtf3"
3294 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3295 (smax:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3296 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))]
3297 "INTEL_EXTENDED_IEEE_FORMAT"
3298 "fmax %0 = %F1, %F2"
3299 [(set_attr "itanium_class" "fmisc")])
3301 (define_insn "*maddtf4"
3302 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3303 (plus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3304 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3305 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG")))]
3306 "INTEL_EXTENDED_IEEE_FORMAT"
3307 "fma %0 = %F1, %F2, %F3"
3308 [(set_attr "itanium_class" "fmac")])
3310 (define_insn "*maddtf4_truncsf"
3311 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3313 (plus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3314 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3315 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))]
3316 "INTEL_EXTENDED_IEEE_FORMAT"
3317 "fma.s %0 = %F1, %F2, %F3"
3318 [(set_attr "itanium_class" "fmac")])
3320 (define_insn "*maddtf4_truncdf"
3321 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3323 (plus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3324 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3325 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))]
3326 "INTEL_EXTENDED_IEEE_FORMAT"
3327 "fma.d %0 = %F1, %F2, %F3"
3328 [(set_attr "itanium_class" "fmac")])
3330 (define_insn "*maddtf4_alts"
3331 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3332 (plus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3333 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3334 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG")))
3335 (use (match_operand:SI 4 "const_int_operand" ""))]
3336 "INTEL_EXTENDED_IEEE_FORMAT"
3337 "fma.s%4 %0 = %F1, %F2, %F3"
3338 [(set_attr "itanium_class" "fmac")])
3340 (define_insn "*maddtf4_alts_truncdf"
3341 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3343 (plus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3344 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3345 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))
3346 (use (match_operand:SI 4 "const_int_operand" ""))]
3347 "INTEL_EXTENDED_IEEE_FORMAT"
3348 "fma.d.s%4 %0 = %F1, %F2, %F3"
3349 [(set_attr "itanium_class" "fmac")])
3351 (define_insn "*msubtf4"
3352 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3353 (minus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3354 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3355 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG")))]
3356 "INTEL_EXTENDED_IEEE_FORMAT"
3357 "fms %0 = %F1, %F2, %F3"
3358 [(set_attr "itanium_class" "fmac")])
3360 (define_insn "*msubtf4_truncsf"
3361 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3363 (minus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3364 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3365 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))]
3366 "INTEL_EXTENDED_IEEE_FORMAT"
3367 "fms.s %0 = %F1, %F2, %F3"
3368 [(set_attr "itanium_class" "fmac")])
3370 (define_insn "*msubtf4_truncdf"
3371 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3373 (minus:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3374 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))
3375 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))]
3376 "INTEL_EXTENDED_IEEE_FORMAT"
3377 "fms.d %0 = %F1, %F2, %F3"
3378 [(set_attr "itanium_class" "fmac")])
3380 (define_insn "*nmultf3"
3381 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3382 (neg:TF (mult:TF (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3383 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG"))))]
3384 "INTEL_EXTENDED_IEEE_FORMAT"
3385 "fnmpy %0 = %F1, %F2"
3386 [(set_attr "itanium_class" "fmac")])
3388 (define_insn "*nmultf3_truncsf"
3389 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3392 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3393 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))))]
3394 "INTEL_EXTENDED_IEEE_FORMAT"
3395 "fnmpy.s %0 = %F1, %F2"
3396 [(set_attr "itanium_class" "fmac")])
3398 (define_insn "*nmultf3_truncdf"
3399 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3402 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3403 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))))]
3404 "INTEL_EXTENDED_IEEE_FORMAT"
3405 "fnmpy.d %0 = %F1, %F2"
3406 [(set_attr "itanium_class" "fmac")])
3408 ;; ??? Is it possible to canonicalize this as (minus (reg) (mult))?
3410 (define_insn "*nmaddtf4"
3411 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3412 (plus:TF (neg:TF (mult:TF
3413 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3414 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))
3415 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG")))]
3416 "INTEL_EXTENDED_IEEE_FORMAT"
3417 "fnma %0 = %F1, %F2, %F3"
3418 [(set_attr "itanium_class" "fmac")])
3420 (define_insn "*nmaddtf4_truncsf"
3421 [(set (match_operand:SF 0 "fr_register_operand" "=f")
3423 (plus:TF (neg:TF (mult:TF
3424 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3425 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))
3426 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))]
3427 "INTEL_EXTENDED_IEEE_FORMAT"
3428 "fnma.s %0 = %F1, %F2, %F3"
3429 [(set_attr "itanium_class" "fmac")])
3431 (define_insn "*nmaddtf4_truncdf"
3432 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3434 (plus:TF (neg:TF (mult:TF
3435 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3436 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))
3437 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))]
3438 "INTEL_EXTENDED_IEEE_FORMAT"
3439 "fnma.d %0 = %F1, %F2, %F3"
3440 [(set_attr "itanium_class" "fmac")])
3442 (define_insn "*nmaddtf4_alts"
3443 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3444 (plus:TF (neg:TF (mult:TF
3445 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3446 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))
3447 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG")))
3448 (use (match_operand:SI 4 "const_int_operand" ""))]
3449 "INTEL_EXTENDED_IEEE_FORMAT"
3450 "fnma.s%4 %0 = %F1, %F2, %F3"
3451 [(set_attr "itanium_class" "fmac")])
3453 (define_insn "*nmaddtf4_truncdf_alts"
3454 [(set (match_operand:DF 0 "fr_register_operand" "=f")
3458 (match_operand:TF 1 "tfreg_or_fp01_operand" "fG")
3459 (match_operand:TF 2 "tfreg_or_fp01_operand" "fG")))
3460 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG"))))
3461 (use (match_operand:SI 4 "const_int_operand" ""))]
3462 "INTEL_EXTENDED_IEEE_FORMAT"
3463 "fnma.d.s%4 %0 = %F1, %F2, %F3"
3464 [(set_attr "itanium_class" "fmac")])
3466 (define_expand "divtf3"
3467 [(set (match_operand:TF 0 "fr_register_operand" "")
3468 (div:TF (match_operand:TF 1 "fr_register_operand" "")
3469 (match_operand:TF 2 "fr_register_operand" "")))]
3470 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV"
3473 if (TARGET_INLINE_DIV_LAT)
3474 insn = gen_divtf3_internal_lat (operands[0], operands[1], operands[2]);
3476 insn = gen_divtf3_internal_thr (operands[0], operands[1], operands[2]);
3481 (define_insn_and_split "divtf3_internal_lat"
3482 [(set (match_operand:TF 0 "fr_register_operand" "=&f")
3483 (div:TF (match_operand:TF 1 "fr_register_operand" "f")
3484 (match_operand:TF 2 "fr_register_operand" "f")))
3485 (clobber (match_scratch:TF 3 "=&f"))
3486 (clobber (match_scratch:TF 4 "=&f"))
3487 (clobber (match_scratch:TF 5 "=&f"))
3488 (clobber (match_scratch:TF 6 "=&f"))
3489 (clobber (match_scratch:BI 7 "=c"))]
3490 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_LAT"
3492 "&& reload_completed"
3493 [(parallel [(set (match_dup 0) (div:TF (const_int 1) (match_dup 2)))
3494 (set (match_dup 7) (unspec:BI [(match_dup 1) (match_dup 2)]
3495 UNSPEC_FR_RECIP_APPROX))
3496 (use (const_int 1))])
3497 (cond_exec (ne (match_dup 7) (const_int 0))
3498 (parallel [(set (match_dup 3)
3499 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
3501 (use (const_int 1))]))
3502 (cond_exec (ne (match_dup 7) (const_int 0))
3503 (parallel [(set (match_dup 4) (mult:TF (match_dup 1) (match_dup 0)))
3504 (use (const_int 1))]))
3505 (cond_exec (ne (match_dup 7) (const_int 0))
3506 (parallel [(set (match_dup 5) (mult:TF (match_dup 3) (match_dup 3)))
3507 (use (const_int 1))]))
3508 (cond_exec (ne (match_dup 7) (const_int 0))
3509 (parallel [(set (match_dup 6)
3510 (plus:TF (mult:TF (match_dup 3) (match_dup 3))
3512 (use (const_int 1))]))
3513 (cond_exec (ne (match_dup 7) (const_int 0))
3514 (parallel [(set (match_dup 3)
3515 (plus:TF (mult:TF (match_dup 5) (match_dup 5))
3517 (use (const_int 1))]))
3518 (cond_exec (ne (match_dup 7) (const_int 0))
3519 (parallel [(set (match_dup 5)
3520 (plus:TF (mult:TF (match_dup 6) (match_dup 0))
3522 (use (const_int 1))]))
3523 (cond_exec (ne (match_dup 7) (const_int 0))
3524 (parallel [(set (match_dup 0)
3525 (plus:TF (mult:TF (match_dup 5) (match_dup 3))
3527 (use (const_int 1))]))
3528 (cond_exec (ne (match_dup 7) (const_int 0))
3529 (parallel [(set (match_dup 4)
3530 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 4)))
3532 (use (const_int 1))]))
3533 (cond_exec (ne (match_dup 7) (const_int 0))
3534 (parallel [(set (match_dup 3)
3535 (plus:TF (mult:TF (match_dup 3) (match_dup 0))
3537 (use (const_int 1))]))
3538 (cond_exec (ne (match_dup 7) (const_int 0))
3539 (parallel [(set (match_dup 5)
3540 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
3542 (use (const_int 1))]))
3543 (cond_exec (ne (match_dup 7) (const_int 0))
3544 (parallel [(set (match_dup 0)
3545 (plus:TF (mult:TF (match_dup 4) (match_dup 0))
3547 (use (const_int 1))]))
3548 (cond_exec (ne (match_dup 7) (const_int 0))
3549 (parallel [(set (match_dup 4)
3550 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 3)))
3552 (use (const_int 1))]))
3553 (cond_exec (ne (match_dup 7) (const_int 0))
3555 (plus:TF (mult:TF (match_dup 4) (match_dup 0))
3558 "operands[8] = CONST1_RTX (TFmode);"
3559 [(set_attr "predicable" "no")])
3561 (define_insn_and_split "divtf3_internal_thr"
3562 [(set (match_operand:TF 0 "fr_register_operand" "=&f")
3563 (div:TF (match_operand:TF 1 "fr_register_operand" "f")
3564 (match_operand:TF 2 "fr_register_operand" "f")))
3565 (clobber (match_scratch:TF 3 "=&f"))
3566 (clobber (match_scratch:TF 4 "=&f"))
3567 (clobber (match_scratch:BI 5 "=c"))]
3568 "INTEL_EXTENDED_IEEE_FORMAT && TARGET_INLINE_DIV_THR"
3570 "&& reload_completed"
3571 [(parallel [(set (match_dup 0) (div:TF (const_int 1) (match_dup 2)))
3572 (set (match_dup 5) (unspec:BI [(match_dup 1) (match_dup 2)]
3573 UNSPEC_FR_RECIP_APPROX))
3574 (use (const_int 1))])
3575 (cond_exec (ne (match_dup 5) (const_int 0))
3576 (parallel [(set (match_dup 3)
3577 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
3579 (use (const_int 1))]))
3580 (cond_exec (ne (match_dup 5) (const_int 0))
3581 (parallel [(set (match_dup 4)
3582 (plus:TF (mult:TF (match_dup 3) (match_dup 0))
3584 (use (const_int 1))]))
3585 (cond_exec (ne (match_dup 5) (const_int 0))
3586 (parallel [(set (match_dup 3) (mult:TF (match_dup 3) (match_dup 3)))
3587 (use (const_int 1))]))
3588 (cond_exec (ne (match_dup 5) (const_int 0))
3589 (parallel [(set (match_dup 3)
3590 (plus:TF (mult:TF (match_dup 3) (match_dup 4))
3592 (use (const_int 1))]))
3593 (cond_exec (ne (match_dup 5) (const_int 0))
3594 (parallel [(set (match_dup 4) (mult:TF (match_dup 1) (match_dup 0)))
3595 (use (const_int 1))]))
3596 (cond_exec (ne (match_dup 5) (const_int 0))
3597 (parallel [(set (match_dup 0)
3598 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 3)))
3600 (use (const_int 1))]))
3601 (cond_exec (ne (match_dup 5) (const_int 0))
3602 (parallel [(set (match_dup 0)
3603 (plus:TF (mult:TF (match_dup 0) (match_dup 3))
3605 (use (const_int 1))]))
3606 (cond_exec (ne (match_dup 5) (const_int 0))
3607 (parallel [(set (match_dup 3)
3608 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 4)))
3610 (use (const_int 1))]))
3611 (cond_exec (ne (match_dup 5) (const_int 0))
3612 (parallel [(set (match_dup 3)
3613 (plus:TF (mult:TF (match_dup 3) (match_dup 0))
3615 (use (const_int 1))]))
3616 (cond_exec (ne (match_dup 5) (const_int 0))
3617 (parallel [(set (match_dup 4)
3618 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 0)))
3620 (use (const_int 1))]))
3621 (cond_exec (ne (match_dup 5) (const_int 0))
3622 (parallel [(set (match_dup 0)
3623 (plus:TF (mult:TF (match_dup 4) (match_dup 0))
3625 (use (const_int 1))]))
3626 (cond_exec (ne (match_dup 5) (const_int 0))
3627 (parallel [(set (match_dup 4)
3628 (plus:TF (neg:TF (mult:TF (match_dup 2) (match_dup 3)))
3630 (use (const_int 1))]))
3631 (cond_exec (ne (match_dup 5) (const_int 0))
3633 (plus:TF (mult:TF (match_dup 4) (match_dup 0))
3636 "operands[6] = CONST1_RTX (TFmode);"
3637 [(set_attr "predicable" "no")])
3639 ;; ??? frcpa works like cmp.foo.unc.
3641 (define_insn "*recip_approx"
3642 [(set (match_operand:TF 0 "fr_register_operand" "=f")
3643 (div:TF (const_int 1)
3644 (match_operand:TF 3 "fr_register_operand" "f")))
3645 (set (match_operand:BI 1 "register_operand" "=c")
3646 (unspec:BI [(match_operand:TF 2 "fr_register_operand" "f")
3647 (match_dup 3)] UNSPEC_FR_RECIP_APPROX))
3648 (use (match_operand:SI 4 "const_int_operand" ""))]
3649 "INTEL_EXTENDED_IEEE_FORMAT"
3650 "frcpa.s%4 %0, %1 = %2, %3"
3651 [(set_attr "itanium_class" "fmisc")
3652 (set_attr "predicable" "no")])
3654 ;; ::::::::::::::::::::
3656 ;; :: 32 bit Integer Shifts and Rotates
3658 ;; ::::::::::::::::::::
3660 (define_expand "ashlsi3"
3661 [(set (match_operand:SI 0 "gr_register_operand" "")
3662 (ashift:SI (match_operand:SI 1 "gr_register_operand" "")
3663 (match_operand:SI 2 "gr_reg_or_5bit_operand" "")))]
3666 if (GET_CODE (operands[2]) != CONST_INT)
3668 /* Why oh why didn't Intel arrange for SHIFT_COUNT_TRUNCATED? Now
3669 we've got to get rid of stray bits outside the SImode register. */
3670 rtx subshift = gen_reg_rtx (DImode);
3671 emit_insn (gen_zero_extendsidi2 (subshift, operands[2]));
3672 operands[2] = subshift;
3676 (define_insn "*ashlsi3_internal"
3677 [(set (match_operand:SI 0 "gr_register_operand" "=r,r,r")
3678 (ashift:SI (match_operand:SI 1 "gr_register_operand" "r,r,r")
3679 (match_operand:DI 2 "gr_reg_or_5bit_operand" "R,n,r")))]
3682 shladd %0 = %1, %2, r0
3683 dep.z %0 = %1, %2, %E2
3685 [(set_attr "itanium_class" "ialu,ishf,mmshf")])
3687 (define_expand "ashrsi3"
3688 [(set (match_operand:SI 0 "gr_register_operand" "")
3689 (ashiftrt:SI (match_operand:SI 1 "gr_register_operand" "")
3690 (match_operand:SI 2 "gr_reg_or_5bit_operand" "")))]
3693 rtx subtarget = gen_reg_rtx (DImode);
3694 if (GET_CODE (operands[2]) == CONST_INT)
3695 emit_insn (gen_extv (subtarget, gen_lowpart (DImode, operands[1]),
3696 GEN_INT (32 - INTVAL (operands[2])), operands[2]));
3699 rtx subshift = gen_reg_rtx (DImode);
3700 emit_insn (gen_extendsidi2 (subtarget, operands[1]));
3701 emit_insn (gen_zero_extendsidi2 (subshift, operands[2]));
3702 emit_insn (gen_ashrdi3 (subtarget, subtarget, subshift));
3704 emit_move_insn (gen_lowpart (DImode, operands[0]), subtarget);
3708 (define_expand "lshrsi3"
3709 [(set (match_operand:SI 0 "gr_register_operand" "")
3710 (lshiftrt:SI (match_operand:SI 1 "gr_register_operand" "")
3711 (match_operand:SI 2 "gr_reg_or_5bit_operand" "")))]
3714 rtx subtarget = gen_reg_rtx (DImode);
3715 if (GET_CODE (operands[2]) == CONST_INT)
3716 emit_insn (gen_extzv (subtarget, gen_lowpart (DImode, operands[1]),
3717 GEN_INT (32 - INTVAL (operands[2])), operands[2]));
3720 rtx subshift = gen_reg_rtx (DImode);
3721 emit_insn (gen_zero_extendsidi2 (subtarget, operands[1]));
3722 emit_insn (gen_zero_extendsidi2 (subshift, operands[2]));
3723 emit_insn (gen_lshrdi3 (subtarget, subtarget, subshift));
3725 emit_move_insn (gen_lowpart (DImode, operands[0]), subtarget);
3729 ;; Use mix4.r/shr to implement rotrsi3. We only get 32 bits of valid result
3730 ;; here, instead of 64 like the patterns above. Keep the pattern together
3731 ;; until after combine; otherwise it won't get matched often.
3733 (define_expand "rotrsi3"
3734 [(set (match_operand:SI 0 "gr_register_operand" "")
3735 (rotatert:SI (match_operand:SI 1 "gr_register_operand" "")
3736 (match_operand:SI 2 "gr_reg_or_5bit_operand" "")))]
3739 if (GET_MODE (operands[2]) != VOIDmode)
3741 rtx tmp = gen_reg_rtx (DImode);
3742 emit_insn (gen_zero_extendsidi2 (tmp, operands[2]));
3747 (define_insn_and_split "*rotrsi3_internal"
3748 [(set (match_operand:SI 0 "gr_register_operand" "=&r")
3749 (rotatert:SI (match_operand:SI 1 "gr_register_operand" "r")
3750 (match_operand:DI 2 "gr_reg_or_5bit_operand" "rM")))]
3755 (ior:DI (zero_extend:DI (match_dup 1))
3756 (ashift:DI (zero_extend:DI (match_dup 1)) (const_int 32))))
3758 (lshiftrt:DI (match_dup 3) (match_dup 2)))]
3759 "operands[3] = gen_rtx_REG (DImode, REGNO (operands[0]));")
3761 (define_expand "rotlsi3"
3762 [(set (match_operand:SI 0 "gr_register_operand" "")
3763 (rotate:SI (match_operand:SI 1 "gr_register_operand" "")
3764 (match_operand:SI 2 "gr_reg_or_5bit_operand" "")))]
3767 if (! shift_32bit_count_operand (operands[2], SImode))
3769 rtx tmp = gen_reg_rtx (SImode);
3770 emit_insn (gen_subsi3 (tmp, GEN_INT (32), operands[2]));
3771 emit_insn (gen_rotrsi3 (operands[0], operands[1], tmp));
3776 (define_insn_and_split "*rotlsi3_internal"
3777 [(set (match_operand:SI 0 "gr_register_operand" "=r")
3778 (rotate:SI (match_operand:SI 1 "gr_register_operand" "r")
3779 (match_operand:SI 2 "shift_32bit_count_operand" "n")))]
3784 (ior:DI (zero_extend:DI (match_dup 1))
3785 (ashift:DI (zero_extend:DI (match_dup 1)) (const_int 32))))
3787 (lshiftrt:DI (match_dup 3) (match_dup 2)))]
3789 operands[3] = gen_rtx_REG (DImode, REGNO (operands[0]));
3790 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
3793 ;; ::::::::::::::::::::
3795 ;; :: 64 bit Integer Shifts and Rotates
3797 ;; ::::::::::::::::::::
3799 (define_insn "ashldi3"
3800 [(set (match_operand:DI 0 "gr_register_operand" "=r,r,r")
3801 (ashift:DI (match_operand:DI 1 "gr_register_operand" "r,r,r")
3802 (match_operand:DI 2 "gr_reg_or_6bit_operand" "R,r,rM")))]
3805 shladd %0 = %1, %2, r0
3808 [(set_attr "itanium_class" "ialu,mmshf,mmshfi")])
3810 ;; ??? Maybe combine this with the multiply and add instruction?
3812 (define_insn "*shladd"
3813 [(set (match_operand:DI 0 "gr_register_operand" "=r")
3814 (plus:DI (mult:DI (match_operand:DI 1 "gr_register_operand" "r")
3815 (match_operand:DI 2 "shladd_operand" "n"))
3816 (match_operand:DI 3 "gr_register_operand" "r")))]
3818 "shladd %0 = %1, %S2, %3"
3819 [(set_attr "itanium_class" "ialu")])
3821 ;; This can be created by register elimination if operand3 of shladd is an
3822 ;; eliminable register or has reg_equiv_constant set.
3824 ;; We have to use nonmemory_operand for operand 4, to ensure that the
3825 ;; validate_changes call inside eliminate_regs will always succeed. If it
3826 ;; doesn't succeed, then this remain a shladd pattern, and will be reloaded
3829 (define_insn_and_split "*shladd_elim"
3830 [(set (match_operand:DI 0 "gr_register_operand" "=&r")
3831 (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "gr_register_operand" "r")
3832 (match_operand:DI 2 "shladd_operand" "n"))
3833 (match_operand:DI 3 "nonmemory_operand" "r"))
3834 (match_operand:DI 4 "nonmemory_operand" "rI")))]
3835 "reload_in_progress"
3838 [(set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (match_dup 2))
3840 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
3842 [(set_attr "itanium_class" "unknown")])
3844 (define_insn "ashrdi3"
3845 [(set (match_operand:DI 0 "gr_register_operand" "=r,r")
3846 (ashiftrt:DI (match_operand:DI 1 "gr_register_operand" "r,r")
3847 (match_operand:DI 2 "gr_reg_or_6bit_operand" "r,rM")))]
3852 [(set_attr "itanium_class" "mmshf,mmshfi")])
3854 (define_insn "lshrdi3"
3855 [(set (match_operand:DI 0 "gr_register_operand" "=r,r")
3856 (lshiftrt:DI (match_operand:DI 1 "gr_register_operand" "r,r")
3857 (match_operand:DI 2 "gr_reg_or_6bit_operand" "r,rM")))]
3862 [(set_attr "itanium_class" "mmshf,mmshfi")])
3864 ;; Using a predicate that accepts only constants doesn't work, because optabs
3865 ;; will load the operand into a register and call the pattern if the predicate
3866 ;; did not accept it on the first try. So we use nonmemory_operand and then
3867 ;; verify that we have an appropriate constant in the expander.
3869 (define_expand "rotrdi3"
3870 [(set (match_operand:DI 0 "gr_register_operand" "")
3871 (rotatert:DI (match_operand:DI 1 "gr_register_operand" "")
3872 (match_operand:DI 2 "nonmemory_operand" "")))]
3875 if (! shift_count_operand (operands[2], DImode))
3879 (define_insn "*rotrdi3_internal"
3880 [(set (match_operand:DI 0 "gr_register_operand" "=r")
3881 (rotatert:DI (match_operand:DI 1 "gr_register_operand" "r")
3882 (match_operand:DI 2 "shift_count_operand" "M")))]
3884 "shrp %0 = %1, %1, %2"
3885 [(set_attr "itanium_class" "ishf")])
3887 (define_expand "rotldi3"
3888 [(set (match_operand:DI 0 "gr_register_operand" "")
3889 (rotate:DI (match_operand:DI 1 "gr_register_operand" "")
3890 (match_operand:DI 2 "nonmemory_operand" "")))]
3893 if (! shift_count_operand (operands[2], DImode))
3897 (define_insn "*rotldi3_internal"
3898 [(set (match_operand:DI 0 "gr_register_operand" "=r")
3899 (rotate:DI (match_operand:DI 1 "gr_register_operand" "r")
3900 (match_operand:DI 2 "shift_count_operand" "M")))]
3902 "shrp %0 = %1, %1, %e2"
3903 [(set_attr "itanium_class" "ishf")])
3905 ;; ::::::::::::::::::::
3907 ;; :: 32 bit Integer Logical operations
3909 ;; ::::::::::::::::::::
3911 ;; We don't seem to need any other 32-bit logical operations, because gcc
3912 ;; generates zero-extend;zero-extend;DImode-op, which combine optimizes to
3913 ;; DImode-op;zero-extend, and then we can optimize away the zero-extend.
3914 ;; This doesn't work for unary logical operations, because we don't call
3915 ;; apply_distributive_law for them.
3917 ;; ??? Likewise, this doesn't work for andnot, which isn't handled by
3918 ;; apply_distributive_law. We get inefficient code for
3919 ;; int sub4 (int i, int j) { return i & ~j; }
3920 ;; We could convert (and (not (sign_extend A)) (sign_extend B)) to
3921 ;; (zero_extend (and (not A) B)) in combine.
3922 ;; Or maybe fix this by adding andsi3/iorsi3/xorsi3 patterns like the
3923 ;; one_cmplsi2 pattern.
3925 (define_insn "one_cmplsi2"
3926 [(set (match_operand:SI 0 "gr_register_operand" "=r")
3927 (not:SI (match_operand:SI 1 "gr_register_operand" "r")))]
3930 [(set_attr "itanium_class" "ilog")])
3932 ;; ::::::::::::::::::::
3934 ;; :: 64 bit Integer Logical operations
3936 ;; ::::::::::::::::::::
3938 (define_insn "anddi3"
3939 [(set (match_operand:DI 0 "grfr_register_operand" "=r,*f")
3940 (and:DI (match_operand:DI 1 "grfr_register_operand" "%r,*f")
3941 (match_operand:DI 2 "grfr_reg_or_8bit_operand" "rK,*f")))]
3946 [(set_attr "itanium_class" "ilog,fmisc")])
3948 (define_insn "*andnot"
3949 [(set (match_operand:DI 0 "grfr_register_operand" "=r,*f")
3950 (and:DI (not:DI (match_operand:DI 1 "grfr_register_operand" "r,*f"))
3951 (match_operand:DI 2 "grfr_reg_or_8bit_operand" "rK,*f")))]
3956 [(set_attr "itanium_class" "ilog,fmisc")])
3958 (define_insn "iordi3"
3959 [(set (match_operand:DI 0 "grfr_register_operand" "=r,*f")
3960 (ior:DI (match_operand:DI 1 "grfr_register_operand" "%r,*f")
3961 (match_operand:DI 2 "grfr_reg_or_8bit_operand" "rK,*f")))]
3966 [(set_attr "itanium_class" "ilog,fmisc")])
3968 (define_insn "xordi3"
3969 [(set (match_operand:DI 0 "grfr_register_operand" "=r,*f")
3970 (xor:DI (match_operand:DI 1 "grfr_register_operand" "%r,*f")
3971 (match_operand:DI 2 "grfr_reg_or_8bit_operand" "rK,*f")))]
3976 [(set_attr "itanium_class" "ilog,fmisc")])
3978 (define_insn "one_cmpldi2"
3979 [(set (match_operand:DI 0 "gr_register_operand" "=r")
3980 (not:DI (match_operand:DI 1 "gr_register_operand" "r")))]
3983 [(set_attr "itanium_class" "ilog")])
3985 ;; ::::::::::::::::::::
3989 ;; ::::::::::::::::::::
3991 (define_expand "cmpbi"
3993 (compare (match_operand:BI 0 "register_operand" "")
3994 (match_operand:BI 1 "const_int_operand" "")))]
3997 ia64_compare_op0 = operands[0];
3998 ia64_compare_op1 = operands[1];
4002 (define_expand "cmpsi"
4004 (compare (match_operand:SI 0 "gr_register_operand" "")
4005 (match_operand:SI 1 "gr_reg_or_8bit_and_adjusted_operand" "")))]
4008 ia64_compare_op0 = operands[0];
4009 ia64_compare_op1 = operands[1];
4013 (define_expand "cmpdi"
4015 (compare (match_operand:DI 0 "gr_register_operand" "")
4016 (match_operand:DI 1 "gr_reg_or_8bit_and_adjusted_operand" "")))]
4019 ia64_compare_op0 = operands[0];
4020 ia64_compare_op1 = operands[1];
4024 (define_expand "cmpsf"
4026 (compare (match_operand:SF 0 "fr_reg_or_fp01_operand" "")
4027 (match_operand:SF 1 "fr_reg_or_fp01_operand" "")))]
4030 ia64_compare_op0 = operands[0];
4031 ia64_compare_op1 = operands[1];
4035 (define_expand "cmpdf"
4037 (compare (match_operand:DF 0 "fr_reg_or_fp01_operand" "")
4038 (match_operand:DF 1 "fr_reg_or_fp01_operand" "")))]
4041 ia64_compare_op0 = operands[0];
4042 ia64_compare_op1 = operands[1];
4046 (define_expand "cmptf"
4048 (compare (match_operand:TF 0 "tfreg_or_fp01_operand" "")
4049 (match_operand:TF 1 "tfreg_or_fp01_operand" "")))]
4050 "INTEL_EXTENDED_IEEE_FORMAT"
4052 ia64_compare_op0 = operands[0];
4053 ia64_compare_op1 = operands[1];
4057 (define_insn "*cmpsi_normal"
4058 [(set (match_operand:BI 0 "register_operand" "=c")
4059 (match_operator:BI 1 "normal_comparison_operator"
4060 [(match_operand:SI 2 "gr_register_operand" "r")
4061 (match_operand:SI 3 "gr_reg_or_8bit_operand" "rK")]))]
4063 "cmp4.%C1 %0, %I0 = %3, %2"
4064 [(set_attr "itanium_class" "icmp")])
4066 ;; We use %r3 because it is possible for us to match a 0, and two of the
4067 ;; unsigned comparisons don't accept immediate operands of zero.
4069 (define_insn "*cmpsi_adjusted"
4070 [(set (match_operand:BI 0 "register_operand" "=c")
4071 (match_operator:BI 1 "adjusted_comparison_operator"
4072 [(match_operand:SI 2 "gr_register_operand" "r")
4073 (match_operand:SI 3 "gr_reg_or_8bit_adjusted_operand" "rL")]))]
4075 "cmp4.%C1 %0, %I0 = %r3, %2"
4076 [(set_attr "itanium_class" "icmp")])
4078 (define_insn "*cmpdi_normal"
4079 [(set (match_operand:BI 0 "register_operand" "=c")
4080 (match_operator:BI 1 "normal_comparison_operator"
4081 [(match_operand:DI 2 "gr_reg_or_0_operand" "rO")
4082 (match_operand:DI 3 "gr_reg_or_8bit_operand" "rK")]))]
4084 "cmp.%C1 %0, %I0 = %3, %r2"
4085 [(set_attr "itanium_class" "icmp")])
4087 ;; We use %r3 because it is possible for us to match a 0, and two of the
4088 ;; unsigned comparisons don't accept immediate operands of zero.
4090 (define_insn "*cmpdi_adjusted"
4091 [(set (match_operand:BI 0 "register_operand" "=c")
4092 (match_operator:BI 1 "adjusted_comparison_operator"
4093 [(match_operand:DI 2 "gr_register_operand" "r")
4094 (match_operand:DI 3 "gr_reg_or_8bit_adjusted_operand" "rL")]))]
4096 "cmp.%C1 %0, %I0 = %r3, %2"
4097 [(set_attr "itanium_class" "icmp")])
4099 (define_insn "*cmpsf_internal"
4100 [(set (match_operand:BI 0 "register_operand" "=c")
4101 (match_operator:BI 1 "comparison_operator"
4102 [(match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")
4103 (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")]))]
4105 "fcmp.%D1 %0, %I0 = %F2, %F3"
4106 [(set_attr "itanium_class" "fcmp")])
4108 (define_insn "*cmpdf_internal"
4109 [(set (match_operand:BI 0 "register_operand" "=c")
4110 (match_operator:BI 1 "comparison_operator"
4111 [(match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")
4112 (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")]))]
4114 "fcmp.%D1 %0, %I0 = %F2, %F3"
4115 [(set_attr "itanium_class" "fcmp")])
4117 (define_insn "*cmptf_internal"
4118 [(set (match_operand:BI 0 "register_operand" "=c")
4119 (match_operator:BI 1 "comparison_operator"
4120 [(match_operand:TF 2 "tfreg_or_fp01_operand" "fG")
4121 (match_operand:TF 3 "tfreg_or_fp01_operand" "fG")]))]
4122 "INTEL_EXTENDED_IEEE_FORMAT"
4123 "fcmp.%D1 %0, %I0 = %F2, %F3"
4124 [(set_attr "itanium_class" "fcmp")])
4126 ;; ??? Can this pattern be generated?
4128 (define_insn "*bit_zero"
4129 [(set (match_operand:BI 0 "register_operand" "=c")
4130 (eq:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r")
4132 (match_operand:DI 2 "immediate_operand" "n"))
4135 "tbit.z %0, %I0 = %1, %2"
4136 [(set_attr "itanium_class" "tbit")])
4138 (define_insn "*bit_one"
4139 [(set (match_operand:BI 0 "register_operand" "=c")
4140 (ne:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r")
4142 (match_operand:DI 2 "immediate_operand" "n"))
4145 "tbit.nz %0, %I0 = %1, %2"
4146 [(set_attr "itanium_class" "tbit")])
4148 ;; ::::::::::::::::::::
4152 ;; ::::::::::::::::::::
4154 (define_expand "beq"
4156 (if_then_else (match_dup 1)
4157 (label_ref (match_operand 0 "" ""))
4160 "operands[1] = ia64_expand_compare (EQ, VOIDmode);")
4162 (define_expand "bne"
4164 (if_then_else (match_dup 1)
4165 (label_ref (match_operand 0 "" ""))
4168 "operands[1] = ia64_expand_compare (NE, VOIDmode);")
4170 (define_expand "blt"
4172 (if_then_else (match_dup 1)
4173 (label_ref (match_operand 0 "" ""))
4176 "operands[1] = ia64_expand_compare (LT, VOIDmode);")
4178 (define_expand "ble"
4180 (if_then_else (match_dup 1)
4181 (label_ref (match_operand 0 "" ""))
4184 "operands[1] = ia64_expand_compare (LE, VOIDmode);")
4186 (define_expand "bgt"
4188 (if_then_else (match_dup 1)
4189 (label_ref (match_operand 0 "" ""))
4192 "operands[1] = ia64_expand_compare (GT, VOIDmode);")
4194 (define_expand "bge"
4196 (if_then_else (match_dup 1)
4197 (label_ref (match_operand 0 "" ""))
4200 "operands[1] = ia64_expand_compare (GE, VOIDmode);")
4202 (define_expand "bltu"
4204 (if_then_else (match_dup 1)
4205 (label_ref (match_operand 0 "" ""))
4208 "operands[1] = ia64_expand_compare (LTU, VOIDmode);")
4210 (define_expand "bleu"
4212 (if_then_else (match_dup 1)
4213 (label_ref (match_operand 0 "" ""))
4216 "operands[1] = ia64_expand_compare (LEU, VOIDmode);")
4218 (define_expand "bgtu"
4220 (if_then_else (match_dup 1)
4221 (label_ref (match_operand 0 "" ""))
4224 "operands[1] = ia64_expand_compare (GTU, VOIDmode);")
4226 (define_expand "bgeu"
4228 (if_then_else (match_dup 1)
4229 (label_ref (match_operand 0 "" ""))
4232 "operands[1] = ia64_expand_compare (GEU, VOIDmode);")
4234 (define_expand "bunordered"
4236 (if_then_else (match_dup 1)
4237 (label_ref (match_operand 0 "" ""))
4240 "operands[1] = ia64_expand_compare (UNORDERED, VOIDmode);")
4242 (define_expand "bordered"
4244 (if_then_else (match_dup 1)
4245 (label_ref (match_operand 0 "" ""))
4248 "operands[1] = ia64_expand_compare (ORDERED, VOIDmode);")
4250 (define_insn "*br_true"
4252 (if_then_else (match_operator 0 "predicate_operator"
4253 [(match_operand:BI 1 "register_operand" "c")
4255 (label_ref (match_operand 2 "" ""))
4258 "(%J0) br.cond%+ %l2"
4259 [(set_attr "itanium_class" "br")
4260 (set_attr "predicable" "no")])
4262 (define_insn "*br_false"
4264 (if_then_else (match_operator 0 "predicate_operator"
4265 [(match_operand:BI 1 "register_operand" "c")
4268 (label_ref (match_operand 2 "" ""))))]
4270 "(%j0) br.cond%+ %l2"
4271 [(set_attr "itanium_class" "br")
4272 (set_attr "predicable" "no")])
4274 ;; ::::::::::::::::::::
4276 ;; :: Counted loop operations
4278 ;; ::::::::::::::::::::
4280 (define_expand "doloop_end"
4281 [(use (match_operand 0 "" "")) ; loop pseudo
4282 (use (match_operand 1 "" "")) ; iterations; zero if unknown
4283 (use (match_operand 2 "" "")) ; max iterations
4284 (use (match_operand 3 "" "")) ; loop level
4285 (use (match_operand 4 "" ""))] ; label
4288 /* Only use cloop on innermost loops. */
4289 if (INTVAL (operands[3]) > 1)
4291 emit_jump_insn (gen_doloop_end_internal (gen_rtx_REG (DImode, AR_LC_REGNUM),
4296 (define_insn "doloop_end_internal"
4297 [(set (pc) (if_then_else (ne (match_operand:DI 0 "ar_lc_reg_operand" "")
4299 (label_ref (match_operand 1 "" ""))
4301 (set (match_dup 0) (if_then_else:DI (ne (match_dup 0) (const_int 0))
4302 (plus:DI (match_dup 0) (const_int -1))
4305 "br.cloop.sptk.few %l1"
4306 [(set_attr "itanium_class" "br")
4307 (set_attr "predicable" "no")])
4309 ;; ::::::::::::::::::::
4311 ;; :: Set flag operations
4313 ;; ::::::::::::::::::::
4315 (define_expand "seq"
4316 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4318 "operands[1] = ia64_expand_compare (EQ, DImode);")
4320 (define_expand "sne"
4321 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4323 "operands[1] = ia64_expand_compare (NE, DImode);")
4325 (define_expand "slt"
4326 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4328 "operands[1] = ia64_expand_compare (LT, DImode);")
4330 (define_expand "sle"
4331 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4333 "operands[1] = ia64_expand_compare (LE, DImode);")
4335 (define_expand "sgt"
4336 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4338 "operands[1] = ia64_expand_compare (GT, DImode);")
4340 (define_expand "sge"
4341 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4343 "operands[1] = ia64_expand_compare (GE, DImode);")
4345 (define_expand "sltu"
4346 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4348 "operands[1] = ia64_expand_compare (LTU, DImode);")
4350 (define_expand "sleu"
4351 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4353 "operands[1] = ia64_expand_compare (LEU, DImode);")
4355 (define_expand "sgtu"
4356 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4358 "operands[1] = ia64_expand_compare (GTU, DImode);")
4360 (define_expand "sgeu"
4361 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4363 "operands[1] = ia64_expand_compare (GEU, DImode);")
4365 (define_expand "sunordered"
4366 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4368 "operands[1] = ia64_expand_compare (UNORDERED, DImode);")
4370 (define_expand "sordered"
4371 [(set (match_operand:DI 0 "gr_register_operand" "") (match_dup 1))]
4373 "operands[1] = ia64_expand_compare (ORDERED, DImode);")
4375 ;; Don't allow memory as destination here, because cmov/cmov/st is more
4376 ;; efficient than mov/mov/cst/cst.
4378 (define_insn_and_split "*sne_internal"
4379 [(set (match_operand:DI 0 "gr_register_operand" "=r")
4380 (ne:DI (match_operand:BI 1 "register_operand" "c")
4385 [(cond_exec (ne (match_dup 1) (const_int 0))
4386 (set (match_dup 0) (const_int 1)))
4387 (cond_exec (eq (match_dup 1) (const_int 0))
4388 (set (match_dup 0) (const_int 0)))]
4390 [(set_attr "itanium_class" "unknown")])
4392 (define_insn_and_split "*seq_internal"
4393 [(set (match_operand:DI 0 "gr_register_operand" "=r")
4394 (eq:DI (match_operand:BI 1 "register_operand" "c")
4399 [(cond_exec (ne (match_dup 1) (const_int 0))
4400 (set (match_dup 0) (const_int 0)))
4401 (cond_exec (eq (match_dup 1) (const_int 0))
4402 (set (match_dup 0) (const_int 1)))]
4404 [(set_attr "itanium_class" "unknown")])
4406 ;; ::::::::::::::::::::
4408 ;; :: Conditional move instructions.
4410 ;; ::::::::::::::::::::
4412 ;; ??? Add movXXcc patterns?
4415 ;; DImode if_then_else patterns.
4418 (define_insn "*cmovdi_internal"
4419 [(set (match_operand:DI 0 "destination_operand"
4420 "= r, r, r, r, r, r, r, r, r, r, m, Q, *f,*b,*d*e")
4422 (match_operator 4 "predicate_operator"
4423 [(match_operand:BI 1 "register_operand"
4424 "c,c,c,c,c,c,c,c,c,c,c,c,c,c,c")
4426 (match_operand:DI 2 "move_operand"
4427 "rim, *f, *b,*d*e,rim,rim, rim,*f,*b,*d*e,rO,*f,rOQ,rO, rK")
4428 (match_operand:DI 3 "move_operand"
4429 "rim,rim,rim, rim, *f, *b,*d*e,*f,*b,*d*e,rO,*f,rOQ,rO, rK")))]
4430 "ia64_move_ok (operands[0], operands[2])
4431 && ia64_move_ok (operands[0], operands[3])"
4433 [(set_attr "predicable" "no")])
4436 [(set (match_operand 0 "destination_operand" "")
4438 (match_operator 4 "predicate_operator"
4439 [(match_operand:BI 1 "register_operand" "")
4441 (match_operand 2 "move_operand" "")
4442 (match_operand 3 "move_operand" "")))]
4447 int emitted_something;
4449 emitted_something = 0;
4450 if (! rtx_equal_p (operands[0], operands[2]))
4452 tmp = gen_rtx_SET (VOIDmode, operands[0], operands[2]);
4453 tmp = gen_rtx_COND_EXEC (VOIDmode, operands[4], tmp);
4455 emitted_something = 1;
4457 if (! rtx_equal_p (operands[0], operands[3]))
4459 tmp = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
4460 VOIDmode, operands[1], const0_rtx);
4461 tmp = gen_rtx_COND_EXEC (VOIDmode, tmp,
4462 gen_rtx_SET (VOIDmode, operands[0],
4465 emitted_something = 1;
4467 if (! emitted_something)
4468 emit_note (NULL, NOTE_INSN_DELETED);
4472 ;; Absolute value pattern.
4474 (define_insn "*absdi2_internal"
4475 [(set (match_operand:DI 0 "gr_register_operand" "=r,r")
4477 (match_operator 4 "predicate_operator"
4478 [(match_operand:BI 1 "register_operand" "c,c")
4480 (neg:DI (match_operand:DI 2 "gr_reg_or_22bit_operand" "rI,rI"))
4481 (match_operand:DI 3 "gr_reg_or_22bit_operand" "0,rI")))]
4484 [(set_attr "itanium_class" "ialu,unknown")
4485 (set_attr "predicable" "no")])
4488 [(set (match_operand:DI 0 "register_operand" "")
4490 (match_operator 4 "predicate_operator"
4491 [(match_operand:BI 1 "register_operand" "c,c")
4493 (neg:DI (match_operand:DI 2 "gr_reg_or_22bit_operand" ""))
4494 (match_operand:DI 3 "gr_reg_or_22bit_operand" "")))]
4495 "reload_completed && rtx_equal_p (operands[0], operands[3])"
4499 (neg:DI (match_dup 2))))]
4503 [(set (match_operand:DI 0 "register_operand" "")
4505 (match_operator 4 "predicate_operator"
4506 [(match_operand:BI 1 "register_operand" "c,c")
4508 (neg:DI (match_operand:DI 2 "gr_reg_or_22bit_operand" ""))
4509 (match_operand:DI 3 "gr_reg_or_22bit_operand" "")))]
4513 (set (match_dup 0) (neg:DI (match_dup 2))))
4516 (set (match_dup 0) (match_dup 3)))]
4518 operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
4519 VOIDmode, operands[1], const0_rtx);
4523 ;; SImode if_then_else patterns.
4526 (define_insn "*cmovsi_internal"
4527 [(set (match_operand:SI 0 "destination_operand" "=r,m,*f,r,m,*f,r,m,*f")
4529 (match_operator 4 "predicate_operator"
4530 [(match_operand:BI 1 "register_operand" "c,c,c,c,c,c,c,c,c")
4532 (match_operand:SI 2 "move_operand"
4533 "0,0,0,rim*f,rO,rO,rim*f,rO,rO")
4534 (match_operand:SI 3 "move_operand"
4535 "rim*f,rO,rO,0,0,0,rim*f,rO,rO")))]
4536 "ia64_move_ok (operands[0], operands[2])
4537 && ia64_move_ok (operands[0], operands[3])"
4539 [(set_attr "predicable" "no")])
4541 (define_insn "*abssi2_internal"
4542 [(set (match_operand:SI 0 "gr_register_operand" "=r,r")
4544 (match_operator 4 "predicate_operator"
4545 [(match_operand:BI 1 "register_operand" "c,c")
4547 (neg:SI (match_operand:SI 3 "gr_reg_or_22bit_operand" "rI,rI"))
4548 (match_operand:SI 2 "gr_reg_or_22bit_operand" "0,rI")))]
4551 [(set_attr "itanium_class" "ialu,unknown")
4552 (set_attr "predicable" "no")])
4555 [(set (match_operand:SI 0 "register_operand" "")
4557 (match_operator 4 "predicate_operator"
4558 [(match_operand:BI 1 "register_operand" "c,c")
4560 (neg:SI (match_operand:SI 2 "gr_reg_or_22bit_operand" ""))
4561 (match_operand:SI 3 "gr_reg_or_22bit_operand" "")))]
4562 "reload_completed && rtx_equal_p (operands[0], operands[3])"
4566 (neg:SI (match_dup 2))))]
4570 [(set (match_operand:SI 0 "register_operand" "")
4572 (match_operator 4 "predicate_operator"
4573 [(match_operand:BI 1 "register_operand" "c,c")
4575 (neg:SI (match_operand:SI 2 "gr_reg_or_22bit_operand" ""))
4576 (match_operand:SI 3 "gr_reg_or_22bit_operand" "")))]
4580 (set (match_dup 0) (neg:SI (match_dup 2))))
4583 (set (match_dup 0) (match_dup 3)))]
4585 operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
4586 VOIDmode, operands[1], const0_rtx);
4589 (define_insn_and_split "*cond_opsi2_internal"
4590 [(set (match_operand:SI 0 "gr_register_operand" "=r")
4591 (match_operator:SI 5 "condop_operator"
4593 (match_operator 6 "predicate_operator"
4594 [(match_operand:BI 1 "register_operand" "c")
4596 (match_operand:SI 2 "gr_register_operand" "r")
4597 (match_operand:SI 3 "gr_register_operand" "r"))
4598 (match_operand:SI 4 "gr_register_operand" "r")]))]
4604 (set (match_dup 0) (match_op_dup:SI 5 [(match_dup 2) (match_dup 4)])))
4607 (set (match_dup 0) (match_op_dup:SI 5 [(match_dup 3) (match_dup 4)])))]
4609 operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[6]) == NE ? EQ : NE,
4610 VOIDmode, operands[1], const0_rtx);
4612 [(set_attr "itanium_class" "ialu")
4613 (set_attr "predicable" "no")])
4616 (define_insn_and_split "*cond_opsi2_internal_b"
4617 [(set (match_operand:SI 0 "gr_register_operand" "=r")
4618 (match_operator:SI 5 "condop_operator"
4619 [(match_operand:SI 4 "gr_register_operand" "r")
4621 (match_operator 6 "predicate_operator"
4622 [(match_operand:BI 1 "register_operand" "c")
4624 (match_operand:SI 2 "gr_register_operand" "r")
4625 (match_operand:SI 3 "gr_register_operand" "r"))]))]
4631 (set (match_dup 0) (match_op_dup:SI 5 [(match_dup 4) (match_dup 2)])))
4634 (set (match_dup 0) (match_op_dup:SI 5 [(match_dup 4) (match_dup 3)])))]
4636 operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[6]) == NE ? EQ : NE,
4637 VOIDmode, operands[1], const0_rtx);
4639 [(set_attr "itanium_class" "ialu")
4640 (set_attr "predicable" "no")])
4643 ;; ::::::::::::::::::::
4645 ;; :: Call and branch instructions
4647 ;; ::::::::::::::::::::
4649 ;; Subroutine call instruction returning no value. Operand 0 is the function
4650 ;; to call; operand 1 is the number of bytes of arguments pushed (in mode
4651 ;; `SImode', except it is normally a `const_int'); operand 2 is the number of
4652 ;; registers used as operands.
4654 ;; On most machines, operand 2 is not actually stored into the RTL pattern. It
4655 ;; is supplied for the sake of some RISC machines which need to put this
4656 ;; information into the assembler code; they can put it in the RTL instead of
4659 (define_expand "call"
4660 [(use (match_operand:DI 0 "" ""))
4661 (use (match_operand 1 "" ""))
4662 (use (match_operand 2 "" ""))
4663 (use (match_operand 3 "" ""))]
4666 ia64_expand_call (NULL_RTX, operands[0], operands[2], 0);
4670 (define_expand "sibcall"
4671 [(use (match_operand:DI 0 "" ""))
4672 (use (match_operand 1 "" ""))
4673 (use (match_operand 2 "" ""))
4674 (use (match_operand 3 "" ""))]
4677 ia64_expand_call (NULL_RTX, operands[0], operands[2], 1);
4681 ;; Subroutine call instruction returning a value. Operand 0 is the hard
4682 ;; register in which the value is returned. There are three more operands,
4683 ;; the same as the three operands of the `call' instruction (but with numbers
4684 ;; increased by one).
4686 ;; Subroutines that return `BLKmode' objects use the `call' insn.
4688 (define_expand "call_value"
4689 [(use (match_operand 0 "" ""))
4690 (use (match_operand:DI 1 "" ""))
4691 (use (match_operand 2 "" ""))
4692 (use (match_operand 3 "" ""))
4693 (use (match_operand 4 "" ""))]
4696 ia64_expand_call (operands[0], operands[1], operands[3], 0);
4700 (define_expand "sibcall_value"
4701 [(use (match_operand 0 "" ""))
4702 (use (match_operand:DI 1 "" ""))
4703 (use (match_operand 2 "" ""))
4704 (use (match_operand 3 "" ""))
4705 (use (match_operand 4 "" ""))]
4708 ia64_expand_call (operands[0], operands[1], operands[3], 1);
4712 ;; Call subroutine returning any type.
4714 (define_expand "untyped_call"
4715 [(parallel [(call (match_operand 0 "" "")
4717 (match_operand 1 "" "")
4718 (match_operand 2 "" "")])]
4723 emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx));
4725 for (i = 0; i < XVECLEN (operands[2], 0); i++)
4727 rtx set = XVECEXP (operands[2], 0, i);
4728 emit_move_insn (SET_DEST (set), SET_SRC (set));
4731 /* The optimizer does not know that the call sets the function value
4732 registers we stored in the result block. We avoid problems by
4733 claiming that all hard registers are used and clobbered at this
4735 emit_insn (gen_blockage ());
4740 (define_insn "call_nopic"
4741 [(call (mem:DI (match_operand:DI 0 "call_operand" "b,i"))
4742 (match_operand 1 "" ""))
4743 (clobber (match_operand:DI 2 "register_operand" "=b,b"))]
4745 "br.call%+.many %2 = %0"
4746 [(set_attr "itanium_class" "br,scall")])
4748 (define_insn "call_value_nopic"
4749 [(set (match_operand 0 "" "")
4750 (call (mem:DI (match_operand:DI 1 "call_operand" "b,i"))
4751 (match_operand 2 "" "")))
4752 (clobber (match_operand:DI 3 "register_operand" "=b,b"))]
4754 "br.call%+.many %3 = %1"
4755 [(set_attr "itanium_class" "br,scall")])
4757 (define_insn "sibcall_nopic"
4758 [(call (mem:DI (match_operand:DI 0 "call_operand" "b,i"))
4759 (match_operand 1 "" ""))
4760 (use (match_operand:DI 2 "register_operand" "=b,b"))
4761 (use (match_operand:DI 3 "ar_pfs_reg_operand" ""))]
4764 [(set_attr "itanium_class" "br,scall")])
4766 (define_insn "call_pic"
4767 [(call (mem (match_operand 0 "call_operand" "b,i"))
4768 (match_operand 1 "" ""))
4769 (use (unspec [(reg:DI 1)] UNSPEC_PIC_CALL))
4770 (clobber (match_operand:DI 2 "register_operand" "=b,b"))]
4772 "br.call%+.many %2 = %0"
4773 [(set_attr "itanium_class" "br,scall")])
4775 (define_insn "call_value_pic"
4776 [(set (match_operand 0 "" "")
4777 (call (mem:DI (match_operand:DI 1 "call_operand" "b,i"))
4778 (match_operand 2 "" "")))
4779 (use (unspec [(reg:DI 1)] UNSPEC_PIC_CALL))
4780 (clobber (match_operand:DI 3 "register_operand" "=b,b"))]
4782 "br.call%+.many %3 = %1"
4783 [(set_attr "itanium_class" "br,scall")])
4785 (define_insn "sibcall_pic"
4786 [(call (mem:DI (match_operand:DI 0 "call_operand" "bi"))
4787 (match_operand 1 "" ""))
4788 (use (unspec [(reg:DI 1)] UNSPEC_PIC_CALL))
4789 (use (match_operand:DI 2 "register_operand" "=b"))
4790 (use (match_operand:DI 3 "ar_pfs_reg_operand" ""))]
4793 [(set_attr "itanium_class" "br")])
4795 (define_insn "return_internal"
4797 (use (match_operand:DI 0 "register_operand" "b"))]
4799 "br.ret.sptk.many %0"
4800 [(set_attr "itanium_class" "br")])
4802 (define_insn "return"
4804 "ia64_direct_return ()"
4805 "br.ret.sptk.many rp"
4806 [(set_attr "itanium_class" "br")])
4808 (define_insn "*return_true"
4810 (if_then_else (match_operator 0 "predicate_operator"
4811 [(match_operand:BI 1 "register_operand" "c")
4815 "ia64_direct_return ()"
4816 "(%J0) br.ret%+.many rp"
4817 [(set_attr "itanium_class" "br")
4818 (set_attr "predicable" "no")])
4820 (define_insn "*return_false"
4822 (if_then_else (match_operator 0 "predicate_operator"
4823 [(match_operand:BI 1 "register_operand" "c")
4827 "ia64_direct_return ()"
4828 "(%j0) br.ret%+.many rp"
4829 [(set_attr "itanium_class" "br")
4830 (set_attr "predicable" "no")])
4833 [(set (pc) (label_ref (match_operand 0 "" "")))]
4836 [(set_attr "itanium_class" "br")])
4838 (define_insn "indirect_jump"
4839 [(set (pc) (match_operand:DI 0 "register_operand" "b"))]
4842 [(set_attr "itanium_class" "br")])
4844 (define_expand "tablejump"
4845 [(parallel [(set (pc) (match_operand:DI 0 "memory_operand" ""))
4846 (use (label_ref (match_operand 1 "" "")))])]
4849 rtx op0 = operands[0];
4852 /* ??? Bother -- do_tablejump is "helpful" and pulls the table
4853 element into a register without bothering to see whether that
4854 is necessary given the operand predicate. Check for MEM just
4855 in case someone fixes this. */
4856 if (GET_CODE (op0) == MEM)
4857 addr = XEXP (op0, 0);
4860 /* Otherwise, cheat and guess that the previous insn in the
4861 stream was the memory load. Grab the address from that.
4862 Note we have to momentarily pop out of the sequence started
4863 by the insn-emit wrapper in order to grab the last insn. */
4867 last = get_last_insn ();
4869 set = single_set (last);
4871 if (! rtx_equal_p (SET_DEST (set), op0)
4872 || GET_CODE (SET_SRC (set)) != MEM)
4874 addr = XEXP (SET_SRC (set), 0);
4875 if (rtx_equal_p (addr, op0))
4879 /* Jump table elements are stored pc-relative. That is, a displacement
4880 from the entry to the label. Thus to convert to an absolute address
4881 we add the address of the memory from which the value is loaded. */
4882 operands[0] = expand_simple_binop (DImode, PLUS, op0, addr,
4883 NULL_RTX, 1, OPTAB_DIRECT);
4886 (define_insn "*tablejump_internal"
4887 [(set (pc) (match_operand:DI 0 "register_operand" "b"))
4888 (use (label_ref (match_operand 1 "" "")))]
4891 [(set_attr "itanium_class" "br")])
4894 ;; ::::::::::::::::::::
4896 ;; :: Prologue and Epilogue instructions
4898 ;; ::::::::::::::::::::
4900 (define_expand "prologue"
4904 ia64_expand_prologue ();
4908 (define_expand "epilogue"
4912 ia64_expand_epilogue (0);
4916 (define_expand "sibcall_epilogue"
4920 ia64_expand_epilogue (1);
4924 ;; This prevents the scheduler from moving the SP decrement past FP-relative
4925 ;; stack accesses. This is the same as adddi3 plus the extra set.
4927 (define_insn "prologue_allocate_stack"
4928 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
4929 (plus:DI (match_operand:DI 1 "register_operand" "%r,r,a")
4930 (match_operand:DI 2 "gr_reg_or_22bit_operand" "r,I,J")))
4931 (set (match_operand:DI 3 "register_operand" "+r,r,r")
4938 [(set_attr "itanium_class" "ialu")])
4940 ;; This prevents the scheduler from moving the SP restore past FP-relative
4941 ;; stack accesses. This is similar to movdi plus the extra set.
4943 (define_insn "epilogue_deallocate_stack"
4944 [(set (match_operand:DI 0 "register_operand" "=r")
4945 (match_operand:DI 1 "register_operand" "+r"))
4946 (set (match_dup 1) (match_dup 1))]
4949 [(set_attr "itanium_class" "ialu")])
4951 ;; As USE insns aren't meaningful after reload, this is used instead
4952 ;; to prevent deleting instructions setting registers for EH handling
4953 (define_insn "prologue_use"
4954 [(unspec:DI [(match_operand:DI 0 "register_operand" "")]
4955 UNSPEC_PROLOGUE_USE)]
4958 [(set_attr "itanium_class" "ignore")
4959 (set_attr "predicable" "no")])
4961 ;; Allocate a new register frame.
4963 (define_insn "alloc"
4964 [(set (match_operand:DI 0 "register_operand" "=r")
4965 (unspec_volatile:DI [(const_int 0)] UNSPECV_ALLOC))
4966 (use (match_operand:DI 1 "const_int_operand" "i"))
4967 (use (match_operand:DI 2 "const_int_operand" "i"))
4968 (use (match_operand:DI 3 "const_int_operand" "i"))
4969 (use (match_operand:DI 4 "const_int_operand" "i"))]
4971 "alloc %0 = ar.pfs, %1, %2, %3, %4"
4972 [(set_attr "itanium_class" "syst_m0")
4973 (set_attr "predicable" "no")])
4976 (define_expand "gr_spill"
4977 [(parallel [(set (match_operand:DI 0 "memory_operand" "=m")
4978 (unspec:DI [(match_operand:DI 1 "register_operand" "r")
4979 (match_operand:DI 2 "const_int_operand" "")]
4981 (clobber (match_dup 3))])]
4983 "operands[3] = gen_rtx_REG (DImode, AR_UNAT_REGNUM);")
4985 (define_insn "gr_spill_internal"
4986 [(set (match_operand:DI 0 "memory_operand" "=m")
4987 (unspec:DI [(match_operand:DI 1 "register_operand" "r")
4988 (match_operand:DI 2 "const_int_operand" "")]
4990 (clobber (match_operand:DI 3 "register_operand" ""))]
4993 /* Note that we use a C output pattern here to avoid the predicate
4994 being automatically added before the .mem.offset directive. */
4995 return ".mem.offset %2, 0\;%,st8.spill %0 = %1%P0";
4997 [(set_attr "itanium_class" "st")])
5000 (define_expand "gr_restore"
5001 [(parallel [(set (match_operand:DI 0 "register_operand" "=r")
5002 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
5003 (match_operand:DI 2 "const_int_operand" "")]
5005 (use (match_dup 3))])]
5007 "operands[3] = gen_rtx_REG (DImode, AR_UNAT_REGNUM);")
5009 (define_insn "gr_restore_internal"
5010 [(set (match_operand:DI 0 "register_operand" "=r")
5011 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
5012 (match_operand:DI 2 "const_int_operand" "")]
5014 (use (match_operand:DI 3 "register_operand" ""))]
5016 { return ".mem.offset %2, 0\;%,ld8.fill %0 = %1%P1"; }
5017 [(set_attr "itanium_class" "ld")])
5019 (define_insn "fr_spill"
5020 [(set (match_operand:TF 0 "memory_operand" "=m")
5021 (unspec:TF [(match_operand:TF 1 "register_operand" "f")]
5024 "stf.spill %0 = %1%P0"
5025 [(set_attr "itanium_class" "stf")])
5027 (define_insn "fr_restore"
5028 [(set (match_operand:TF 0 "register_operand" "=f")
5029 (unspec:TF [(match_operand:TF 1 "memory_operand" "m")]
5030 UNSPEC_FR_RESTORE))]
5032 "ldf.fill %0 = %1%P1"
5033 [(set_attr "itanium_class" "fld")])
5035 ;; ??? The explicit stop is not ideal. It would be better if
5036 ;; rtx_needs_barrier took care of this, but this is something that can be
5037 ;; fixed later. This avoids an RSE DV.
5039 (define_insn "bsp_value"
5040 [(set (match_operand:DI 0 "register_operand" "=r")
5041 (unspec:DI [(const_int 0)] UNSPEC_BSP_VALUE))]
5043 ";;\;mov %0 = ar.bsp"
5044 [(set_attr "itanium_class" "frar_i")])
5046 (define_insn "set_bsp"
5047 [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")]
5065 [(set_attr "itanium_class" "unknown")
5066 (set_attr "predicable" "no")])
5068 ;; ??? The explicit stops are not ideal. It would be better if
5069 ;; rtx_needs_barrier took care of this, but this is something that can be
5070 ;; fixed later. This avoids an RSE DV.
5072 (define_insn "flushrs"
5073 [(unspec [(const_int 0)] UNSPEC_FLUSHRS)]
5076 [(set_attr "itanium_class" "rse_m")])
5078 ;; ::::::::::::::::::::
5080 ;; :: Miscellaneous instructions
5082 ;; ::::::::::::::::::::
5084 ;; ??? Emiting a NOP instruction isn't very useful. This should probably
5085 ;; be emitting ";;" to force a break in the instruction packing.
5087 ;; No operation, needed in case the user uses -g but not -O.
5092 [(set_attr "itanium_class" "unknown")])
5094 (define_insn "nop_m"
5098 [(set_attr "itanium_class" "nop_m")])
5100 (define_insn "nop_i"
5104 [(set_attr "itanium_class" "nop_i")])
5106 (define_insn "nop_f"
5110 [(set_attr "itanium_class" "nop_f")])
5112 (define_insn "nop_b"
5116 [(set_attr "itanium_class" "nop_b")])
5118 (define_insn "nop_x"
5122 [(set_attr "itanium_class" "nop_x")])
5124 (define_insn "bundle_selector"
5125 [(unspec [(match_operand 0 "const_int_operand" "")] UNSPEC_BUNDLE_SELECTOR)]
5127 { return get_bundle_name (INTVAL (operands[0])); }
5128 [(set_attr "itanium_class" "ignore")
5129 (set_attr "predicable" "no")])
5131 ;; Pseudo instruction that prevents the scheduler from moving code above this
5133 (define_insn "blockage"
5134 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
5137 [(set_attr "itanium_class" "ignore")
5138 (set_attr "predicable" "no")])
5140 (define_insn "insn_group_barrier"
5141 [(unspec_volatile [(match_operand 0 "const_int_operand" "")]
5142 UNSPECV_INSN_GROUP_BARRIER)]
5145 [(set_attr "itanium_class" "stop_bit")
5146 (set_attr "predicable" "no")])
5148 (define_expand "trap"
5149 [(trap_if (const_int 1) (const_int 0))]
5153 ;; ??? We don't have a match-any slot type. Setting the type to unknown
5154 ;; produces worse code that setting the slot type to A.
5156 (define_insn "*trap"
5157 [(trap_if (const_int 1) (match_operand 0 "const_int_operand" ""))]
5160 [(set_attr "itanium_class" "chk_s")])
5162 (define_expand "conditional_trap"
5163 [(trap_if (match_operand 0 "" "") (match_operand 1 "" ""))]
5166 operands[0] = ia64_expand_compare (GET_CODE (operands[0]), VOIDmode);
5169 (define_insn "*conditional_trap"
5170 [(trap_if (match_operator 0 "predicate_operator"
5171 [(match_operand:BI 1 "register_operand" "c")
5173 (match_operand 2 "const_int_operand" ""))]
5176 [(set_attr "itanium_class" "chk_s")
5177 (set_attr "predicable" "no")])
5179 (define_insn "break_f"
5180 [(unspec_volatile [(const_int 0)] UNSPECV_BREAK)]
5183 [(set_attr "itanium_class" "nop_f")])
5185 (define_insn "prefetch"
5186 [(prefetch (match_operand:DI 0 "address_operand" "p")
5187 (match_operand:DI 1 "const_int_operand" "n")
5188 (match_operand:DI 2 "const_int_operand" "n"))]
5191 static const char * const alt[2][4] = {
5199 "lfetch.excl.nta [%0]",
5200 "lfetch.excl.nt1 [%0]",
5201 "lfetch.excl.nt2 [%0]",
5205 int i = (INTVAL (operands[1]));
5206 int j = (INTVAL (operands[2]));
5208 if (i != 0 && i != 1)
5214 [(set_attr "itanium_class" "lfetch")])
5216 ;; Non-local goto support.
5218 (define_expand "save_stack_nonlocal"
5219 [(use (match_operand:OI 0 "memory_operand" ""))
5220 (use (match_operand:DI 1 "register_operand" ""))]
5223 emit_library_call (gen_rtx_SYMBOL_REF (Pmode,
5224 \"__ia64_save_stack_nonlocal\"),
5225 0, VOIDmode, 2, XEXP (operands[0], 0), Pmode,
5226 operands[1], Pmode);
5230 (define_expand "nonlocal_goto"
5231 [(use (match_operand 0 "general_operand" ""))
5232 (use (match_operand 1 "general_operand" ""))
5233 (use (match_operand 2 "general_operand" ""))
5234 (use (match_operand 3 "general_operand" ""))]
5237 emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_nonlocal_goto\"),
5238 LCT_NORETURN, VOIDmode, 3,
5240 copy_to_reg (XEXP (operands[2], 0)), Pmode,
5241 operands[3], Pmode);
5246 ;; The rest of the setjmp processing happens with the nonlocal_goto expander.
5247 ;; ??? This is not tested.
5248 (define_expand "builtin_setjmp_setup"
5249 [(use (match_operand:DI 0 "" ""))]
5252 emit_move_insn (ia64_gp_save_reg (0), gen_rtx_REG (DImode, GR_REG (1)));
5256 (define_expand "builtin_setjmp_receiver"
5257 [(use (match_operand:DI 0 "" ""))]
5260 emit_move_insn (gen_rtx_REG (DImode, GR_REG (1)), ia64_gp_save_reg (0));
5264 (define_expand "eh_epilogue"
5265 [(use (match_operand:DI 0 "register_operand" "r"))
5266 (use (match_operand:DI 1 "register_operand" "r"))
5267 (use (match_operand:DI 2 "register_operand" "r"))]
5270 rtx bsp = gen_rtx_REG (Pmode, 10);
5271 rtx sp = gen_rtx_REG (Pmode, 9);
5273 if (GET_CODE (operands[0]) != REG || REGNO (operands[0]) != 10)
5275 emit_move_insn (bsp, operands[0]);
5278 if (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != 9)
5280 emit_move_insn (sp, operands[2]);
5283 emit_insn (gen_rtx_USE (VOIDmode, sp));
5284 emit_insn (gen_rtx_USE (VOIDmode, bsp));
5286 cfun->machine->ia64_eh_epilogue_sp = sp;
5287 cfun->machine->ia64_eh_epilogue_bsp = bsp;
5290 ;; Builtin apply support.
5292 (define_expand "restore_stack_nonlocal"
5293 [(use (match_operand:DI 0 "register_operand" ""))
5294 (use (match_operand:OI 1 "memory_operand" ""))]
5297 emit_library_call (gen_rtx_SYMBOL_REF (Pmode,
5298 "__ia64_restore_stack_nonlocal"),
5300 copy_to_reg (XEXP (operands[1], 0)), Pmode);
5305 ;;; Intrinsics support.
5308 [(set (mem:BLK (match_dup 0))
5309 (unspec:BLK [(mem:BLK (match_dup 0))] UNSPEC_MF))]
5312 operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode));
5313 MEM_VOLATILE_P (operands[0]) = 1;
5316 (define_insn "*mf_internal"
5317 [(set (match_operand:BLK 0 "" "")
5318 (unspec:BLK [(match_operand:BLK 1 "" "")] UNSPEC_MF))]
5321 [(set_attr "itanium_class" "syst_m")])
5323 (define_insn "fetchadd_acq_si"
5324 [(set (match_operand:SI 0 "gr_register_operand" "=r")
5326 (set (match_operand:SI 1 "not_postinc_memory_operand" "+S")
5327 (unspec:SI [(match_dup 1)
5328 (match_operand:SI 2 "fetchadd_operand" "n")]
5329 UNSPEC_FETCHADD_ACQ))]
5331 "fetchadd4.acq %0 = %1, %2"
5332 [(set_attr "itanium_class" "sem")])
5334 (define_insn "fetchadd_acq_di"
5335 [(set (match_operand:DI 0 "gr_register_operand" "=r")
5337 (set (match_operand:DI 1 "not_postinc_memory_operand" "+S")
5338 (unspec:DI [(match_dup 1)
5339 (match_operand:DI 2 "fetchadd_operand" "n")]
5340 UNSPEC_FETCHADD_ACQ))]
5342 "fetchadd8.acq %0 = %1, %2"
5343 [(set_attr "itanium_class" "sem")])
5345 (define_insn "cmpxchg_acq_si"
5346 [(set (match_operand:SI 0 "gr_register_operand" "=r")
5348 (set (match_operand:SI 1 "not_postinc_memory_operand" "+S")
5349 (unspec:SI [(match_dup 1)
5350 (match_operand:SI 2 "gr_register_operand" "r")
5351 (match_operand:SI 3 "ar_ccv_reg_operand" "")]
5352 UNSPEC_CMPXCHG_ACQ))]
5354 "cmpxchg4.acq %0 = %1, %2, %3"
5355 [(set_attr "itanium_class" "sem")])
5357 (define_insn "cmpxchg_acq_di"
5358 [(set (match_operand:DI 0 "gr_register_operand" "=r")
5360 (set (match_operand:DI 1 "not_postinc_memory_operand" "+S")
5361 (unspec:DI [(match_dup 1)
5362 (match_operand:DI 2 "gr_register_operand" "r")
5363 (match_operand:DI 3 "ar_ccv_reg_operand" "")]
5364 UNSPEC_CMPXCHG_ACQ))]
5366 "cmpxchg8.acq %0 = %1, %2, %3"
5367 [(set_attr "itanium_class" "sem")])
5369 (define_insn "xchgsi"
5370 [(set (match_operand:SI 0 "gr_register_operand" "=r")
5371 (match_operand:SI 1 "not_postinc_memory_operand" "+S"))
5373 (match_operand:SI 2 "gr_register_operand" "r"))]
5376 [(set_attr "itanium_class" "sem")])
5378 (define_insn "xchgdi"
5379 [(set (match_operand:DI 0 "gr_register_operand" "=r")
5380 (match_operand:DI 1 "not_postinc_memory_operand" "+S"))
5382 (match_operand:DI 2 "gr_register_operand" "r"))]
5385 [(set_attr "itanium_class" "sem")])
5390 [(match_operator 0 "predicate_operator"
5391 [(match_operand:BI 1 "register_operand" "c")
5396 (define_insn "pred_rel_mutex"
5397 [(set (match_operand:BI 0 "register_operand" "+c")
5398 (unspec:BI [(match_dup 0)] UNSPEC_PRED_REL_MUTEX))]
5400 ".pred.rel.mutex %0, %I0"
5401 [(set_attr "itanium_class" "ignore")
5402 (set_attr "predicable" "no")])
5404 (define_insn "safe_across_calls_all"
5405 [(unspec_volatile [(const_int 0)] UNSPECV_PSAC_ALL)]
5407 ".pred.safe_across_calls p1-p63"
5408 [(set_attr "itanium_class" "ignore")
5409 (set_attr "predicable" "no")])
5411 (define_insn "safe_across_calls_normal"
5412 [(unspec_volatile [(const_int 0)] UNSPECV_PSAC_NORMAL)]
5415 emit_safe_across_calls (asm_out_file);
5418 [(set_attr "itanium_class" "ignore")
5419 (set_attr "predicable" "no")])
5421 ;; UNSPEC instruction definition to "swizzle" 32 bit pointer into 64 bit
5422 ;; pointer. This is used by the HP-UX 32 bit mode.
5424 (define_insn "ptr_extend"
5425 [(set (match_operand:DI 0 "gr_register_operand" "=r")
5426 (unspec:DI [(match_operand:SI 1 "gr_register_operand" "r")]
5430 [(set_attr "itanium_class" "ialu")])
5433 ;; Optimizations for ptr_extend
5435 (define_insn "*ptr_extend_plus_1"
5436 [(set (match_operand:DI 0 "gr_register_operand" "=r")
5438 [(plus:SI (match_operand:SI 1 "basereg_operand" "r")
5439 (match_operand:SI 2 "gr_reg_or_14bit_operand" "rI"))]
5443 [(set_attr "itanium_class" "ialu")])
5445 (define_insn "*ptr_extend_plus_2"
5446 [(set (match_operand:DI 0 "gr_register_operand" "=r")
5448 [(plus:SI (match_operand:SI 1 "gr_register_operand" "r")
5449 (match_operand:SI 2 "basereg_operand" "r"))]
5453 [(set_attr "itanium_class" "ialu")])