1 ;;- Machine description for GNU compiler, Motorola 68000 Version
2 ;; Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
3 ;; 2002, 2003, 2004, 2005, 2006, 2007
4 ;; Free Software Foundation, Inc.
6 ;; This file is part of GCC.
8 ;; GCC 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 3, or (at your option)
13 ;; GCC 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 GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>.
22 ;;- Information about MCF5200 port.
24 ;;- The MCF5200 "ColdFire" architecture is a reduced version of the
25 ;;- 68k ISA. Differences include reduced support for byte and word
26 ;;- operands and the removal of BCD, bitfield, rotate, and integer
27 ;;- divide instructions. The TARGET_COLDFIRE flag turns the use of the
28 ;;- removed opcodes and addressing modes off.
32 ;;- instruction definitions
34 ;;- @@The original PO technology requires these to be ordered by speed,
35 ;;- @@ so that assigner will pick the fastest.
37 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
39 ;;- When naming insn's (operand 0 of define_insn) be careful about using
40 ;;- names from other targets machine descriptions.
42 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
43 ;;- updates for most instructions.
45 ;;- Operand classes for the register allocator:
46 ;;- 'a' one of the address registers can be used.
47 ;;- 'd' one of the data registers can be used.
48 ;;- 'f' one of the m68881/fpu registers can be used
49 ;;- 'r' either a data or an address register can be used.
51 ;;- Immediate Floating point operator constraints
52 ;;- 'G' a floating point constant that is *NOT* one of the standard
53 ;; 68881 constant values (to force calling output_move_const_double
54 ;; to get it from rom if it is a 68881 constant).
56 ;; See the functions standard_XXX_constant_p in output-m68k.c for more
59 ;;- Immediate integer operand constraints:
61 ;;- 'J' -32768 .. 32767
62 ;;- 'K' all integers EXCEPT -128 .. 127
64 ;;- 'M' all integers EXCEPT -256 .. 255
70 ;;- "%." size separator ("." or "") move%.l d0,d1
71 ;;- "%-" push operand "sp@-" move%.l d0,%-
72 ;;- "%+" pop operand "sp@+" move%.l d0,%+
73 ;;- "%@" top of stack "sp@" move%.l d0,%@
74 ;;- "%!" fpcr register
75 ;;- "%$" single-precision fp specifier ("s" or "") f%$add.x fp0,fp1
76 ;;- "%&" double-precision fp specifier ("d" or "") f%&add.x fp0,fp1
78 ;;- Information about 68040 port.
80 ;;- The 68040 executes all 68030 and 68881/2 instructions, but some must
81 ;;- be emulated in software by the OS. It is faster to avoid these
82 ;;- instructions and issue a library call rather than trapping into
83 ;;- the kernel. The affected instructions are fintrz and fscale. The
84 ;;- TUNE_68040 flag turns the use of the opcodes off.
86 ;;- The '040 also implements a set of new floating-point instructions
87 ;;- which specify the rounding precision in the opcode. This finally
88 ;;- permit the 68k series to be truly IEEE compliant, and solves all
89 ;;- issues of excess precision accumulating in the extended registers.
90 ;;- By default, GCC does not use these instructions, since such code will
91 ;;- not run on an '030. To use these instructions, use the -m68040-only
94 ;;- These new instructions aren't directly in the md. They are brought
95 ;;- into play by defining "%$" and "%&" to expand to "s" and "d" rather
98 ;;- Information about 68060 port.
100 ;;- The 68060 executes all 68030 and 68881/2 instructions, but some must
101 ;;- be emulated in software by the OS. It is faster to avoid these
102 ;;- instructions and issue a library call rather than trapping into
103 ;;- the kernel. The affected instructions are: divs.l <ea>,Dr:Dq;
104 ;;- divu.l <ea>,Dr:Dq; muls.l <ea>,Dr:Dq; mulu.l <ea>,Dr:Dq; and
105 ;;- fscale. The TUNE_68060 flag turns the use of the opcodes off.
107 ;;- Some of these insn's are composites of several m68000 op codes.
108 ;;- The assembler (or final @@??) insures that the appropriate one is
122 ;; UNSPEC_VOLATILE usage:
125 [(UNSPECV_BLOCKAGE 0)
128 ;; Registers by name.
139 (include "predicates.md")
140 (include "constraints.md")
142 ;; ::::::::::::::::::::
146 ;; ::::::::::::::::::::
149 (define_attr "cpu" "cfv1, cfv2, cfv3, cfv4, unknown"
150 (const (symbol_ref "m68k_sched_cpu")))
153 (define_attr "mac" "no, cf_mac, cf_emac"
154 (const (symbol_ref "m68k_sched_mac")))
156 ;; Instruction type for use in scheduling description.
157 ;; _l and _w suffixes indicate size of the operands of instruction.
158 ;; alu - usual arithmetic or logic instruction.
159 ;; aluq - arithmetic or logic instruction which has a quick immediate (the one
160 ;; that is encoded in the instruction word) for its Y operand.
161 ;; alux - Arithmetic instruction that uses carry bit (e.g., addx and subx).
162 ;; bcc - conditional branch.
163 ;; bitr - bit operation that only updates flags.
164 ;; bitrw - bit operation that updates flags and output operand.
165 ;; bra, bsr, clr, cmp, div, ext - corresponding instruction.
166 ;; falu, fbcc, fcmp, fdiv, fmove, fmul, fneg, fsqrt, ftst - corresponding
168 ;; ib - fake instruction to subscribe slots in ColdFire V1,V2,V3 instruction
170 ;; ignore - fake instruction.
171 ;; jmp, jsr, lea, link, mov3q, move, moveq, mul - corresponding instruction.
172 ;; mvsz - mvs or mvz instruction.
173 ;; neg, nop, pea, rts, scc - corresponding instruction.
174 ;; shift - arithmetic or logical shift instruction.
175 ;; trap, tst, unlk - corresponding instruction.
177 "alu_l,aluq_l,alux_l,bcc,bitr,bitrw,bra,bsr,clr,clr_l,cmp,cmp_l,
179 falu,fbcc,fcmp,fdiv,fmove,fmul,fneg,fsqrt,ftst,
181 jmp,jsr,lea,link,mov3q_l,move,move_l,moveq_l,mul_w,mul_l,mvsz,neg_l,nop,
185 (const_string "unknown"))
187 ;; Index of the X or Y operand in recog_data.operand[].
188 ;; Should be used only within opx_type and opy_type.
189 (define_attr "opx" "" (const_int 0))
190 (define_attr "opy" "" (const_int 1))
192 ;; Type of the Y operand.
193 ;; See m68k.c: enum attr_op_type.
194 (define_attr "opy_type"
195 "none,Rn,FPn,mem1,mem234,mem5,mem6,mem7,imm_q,imm_w,imm_l"
196 (cond [(eq_attr "type" "ext,fbcc,ftst,neg_l,bcc,bra,bsr,clr,clr_l,ib,ignore,
197 jmp,jsr,nop,rts,scc,trap,tst,tst_l,
198 unlk,unknown") (const_string "none")
199 (eq_attr "type" "lea,pea")
200 (symbol_ref "m68k_sched_attr_opy_type (insn, 1)")]
201 (symbol_ref "m68k_sched_attr_opy_type (insn, 0)")))
203 ;; Type of the X operand.
204 ;; See m68k.c: enum attr_op_type.
205 (define_attr "opx_type"
206 "none,Rn,FPn,mem1,mem234,mem5,mem6,mem7,imm_q,imm_w,imm_l"
207 (cond [(eq_attr "type" "ib,ignore,nop,rts,trap,unlk,
208 unknown") (const_string "none")
209 (eq_attr "type" "pea") (const_string "mem1")
210 (eq_attr "type" "jmp,jsr")
211 (symbol_ref "m68k_sched_attr_opx_type (insn, 1)")]
212 (symbol_ref "m68k_sched_attr_opx_type (insn, 0)")))
214 ;; Access to the X operand: none, read, write, read/write, unknown.
215 ;; Access to the Y operand is either none (if opy_type is none)
216 ;; or read otherwise.
217 (define_attr "opx_access" "none, r, w, rw"
218 (cond [(eq_attr "type" "ib,ignore,nop,rts,trap,unlk,
219 unknown") (const_string "none")
220 (eq_attr "type" "bcc,bra,bsr,bitr,cmp,cmp_l,fbcc,fcmp,ftst,
221 jmp,jsr,tst,tst_l") (const_string "r")
222 (eq_attr "type" "clr,clr_l,fneg,fmove,lea,
223 mov3q_l,move,move_l,moveq_l,mvsz,
224 pea,scc") (const_string "w")
225 (eq_attr "type" "alu_l,aluq_l,alux_l,bitrw,div_w,div_l,ext,
226 falu,fdiv,fmul,fsqrt,link,mul_w,mul_l,
227 neg_l,shift") (const_string "rw")]
228 ;; Should never be used.
229 (symbol_ref "(gcc_unreachable (), OPX_ACCESS_NONE)")))
231 ;; Memory accesses of the insn.
232 ;; 00 - no memory references
233 ;; 10 - memory is read
234 ;; i0 - indexed memory is read
235 ;; 01 - memory is written
236 ;; 0i - indexed memory is written
237 ;; 11 - memory is read, memory is written
238 ;; i1 - indexed memory is read, memory is written
239 ;; 1i - memory is read, indexed memory is written
240 (define_attr "op_mem" "00, 10, i0, 01, 0i, 11, i1, 1i"
241 (symbol_ref "m68k_sched_attr_op_mem (insn)"))
243 ;; Instruction size in words.
244 (define_attr "size" "1,2,3"
245 (symbol_ref "m68k_sched_attr_size (insn)"))
248 ;; Mode macros for floating point operations.
249 ;; Valid floating point modes
250 (define_mode_iterator FP [SF DF (XF "TARGET_68881")])
251 ;; Mnemonic infix to round result
252 (define_mode_attr round [(SF "%$") (DF "%&") (XF "")])
253 ;; Mnemonic infix to round result for mul or div instruction
254 (define_mode_attr round_mul [(SF "sgl") (DF "%&") (XF "")])
255 ;; Suffix specifying source operand format
256 (define_mode_attr prec [(SF "s") (DF "d") (XF "x")])
257 ;; Allowable D registers
258 (define_mode_attr dreg [(SF "d") (DF "") (XF "")])
259 ;; Allowable 68881 constant constraints
260 (define_mode_attr const [(SF "F") (DF "G") (XF "")])
263 (define_insn_and_split "*movdf_internal"
264 [(set (match_operand:DF 0 "push_operand" "=m, m")
265 (match_operand:DF 1 "general_operand" "f, ro<>E"))]
270 "&& reload_completed && (extract_constrain_insn_cached (insn), which_alternative == 1)"
273 m68k_emit_move_double (operands);
276 [(set_attr "type" "fmove,*")])
278 (define_insn_and_split "pushdi"
279 [(set (match_operand:DI 0 "push_operand" "=m")
280 (match_operand:DI 1 "general_operand" "ro<>Fi"))]
283 "&& reload_completed"
286 m68k_emit_move_double (operands);
290 ;; We don't want to allow a constant operand for test insns because
291 ;; (set (cc0) (const_int foo)) has no mode information. Such insns will
292 ;; be folded while optimizing anyway.
294 (define_expand "tstdi"
295 [(parallel [(set (cc0)
296 (match_operand:DI 0 "nonimmediate_operand" ""))
297 (clobber (match_scratch:SI 1 ""))
298 (clobber (match_scratch:DI 2 ""))])]
300 "m68k_last_compare_had_fp_operands = 0;")
304 (match_operand:DI 0 "nonimmediate_operand" "am,d"))
305 (clobber (match_scratch:SI 1 "=X,d"))
306 (clobber (match_scratch:DI 2 "=d,X"))]
309 if (which_alternative == 0)
313 xoperands[0] = operands[2];
314 xoperands[1] = operands[0];
315 output_move_double (xoperands);
316 cc_status.flags |= CC_REVERSED; /*|*/
317 return "neg%.l %R2\;negx%.l %2";
319 if (find_reg_note (insn, REG_DEAD, operands[0]))
321 cc_status.flags |= CC_REVERSED; /*|*/
322 return "neg%.l %R0\;negx%.l %0";
326 'sub' clears %1, and also clears the X cc bit
327 'tst' sets the Z cc bit according to the low part of the DImode operand
328 'subx %1' (i.e. subx #0) acts as a (non-existent) tstx on the high part.
330 return "sub%.l %1,%1\;tst%.l %R0\;subx%.l %1,%0";
333 (define_expand "tstsi"
335 (match_operand:SI 0 "nonimmediate_operand" ""))]
337 "m68k_last_compare_had_fp_operands = 0;")
339 ;; If you think that the 68020 does not support tstl a0,
340 ;; reread page B-167 of the 68020 manual more carefully.
341 (define_insn "*tstsi_internal_68020_cf"
343 (match_operand:SI 0 "nonimmediate_operand" "rm"))]
344 "TARGET_68020 || TARGET_COLDFIRE"
346 [(set_attr "type" "tst_l")])
348 ;; On an address reg, cmpw may replace cmpl.
349 (define_insn "*tstsi_internal"
351 (match_operand:SI 0 "nonimmediate_operand" "dm,r"))]
352 "!(TARGET_68020 || TARGET_COLDFIRE)"
356 [(set_attr "type" "tst_l,cmp")])
358 ;; This can't use an address register, because comparisons
359 ;; with address registers as second operand always test the whole word.
360 (define_expand "tsthi"
362 (match_operand:HI 0 "nonimmediate_operand" ""))]
364 "m68k_last_compare_had_fp_operands = 0;")
366 (define_insn "*tsthi_internal"
368 (match_operand:HI 0 "nonimmediate_operand" "dm"))]
371 [(set_attr "type" "tst")])
373 (define_expand "tstqi"
375 (match_operand:QI 0 "nonimmediate_operand" ""))]
377 "m68k_last_compare_had_fp_operands = 0;")
379 (define_insn "*tstqi_internal"
381 (match_operand:QI 0 "nonimmediate_operand" "dm"))]
384 [(set_attr "type" "tst")])
386 (define_expand "tst<mode>"
388 (match_operand:FP 0 "general_operand" ""))]
391 m68k_last_compare_had_fp_operands = 1;
394 (define_insn "tst<mode>_68881"
396 (match_operand:FP 0 "general_operand" "f<FP:dreg>m"))]
399 cc_status.flags = CC_IN_68881;
400 if (FP_REG_P (operands[0]))
402 return "ftst%.<FP:prec> %0";
404 [(set_attr "type" "ftst")])
406 (define_insn "tst<mode>_cf"
408 (match_operand:FP 0 "general_operand" "f<FP:dreg><Q>U"))]
409 "TARGET_COLDFIRE_FPU"
411 cc_status.flags = CC_IN_68881;
412 if (FP_REG_P (operands[0]))
414 return "ftst%.<FP:prec> %0";
416 [(set_attr "type" "ftst")])
419 ;; compare instructions.
421 (define_expand "cmpdi"
424 (compare (match_operand:DI 0 "nonimmediate_operand" "")
425 (match_operand:DI 1 "general_operand" "")))
426 (clobber (match_dup 2))])]
428 "m68k_last_compare_had_fp_operands = 0; operands[2] = gen_reg_rtx (DImode);")
432 (compare (match_operand:DI 1 "nonimmediate_operand" "0,d")
433 (match_operand:DI 2 "general_operand" "d,0")))
434 (clobber (match_operand:DI 0 "register_operand" "=d,d"))]
437 if (rtx_equal_p (operands[0], operands[1]))
438 return "sub%.l %R2,%R0\;subx%.l %2,%0";
441 cc_status.flags |= CC_REVERSED; /*|*/
442 return "sub%.l %R1,%R0\;subx%.l %1,%0";
446 (define_expand "cmpsi"
448 (compare (match_operand:SI 0 "nonimmediate_operand" "")
449 (match_operand:SI 1 "general_operand" "")))]
452 m68k_last_compare_had_fp_operands = 0;
455 ;; A composite of the cmp, cmpa, cmpi & cmpm m68000 op codes.
458 (compare (match_operand:SI 0 "nonimmediate_operand" "rKT,rKs,mSr,mSa,>")
459 (match_operand:SI 1 "general_src_operand" "mSr,mSa,KTr,Ksr,>")))]
462 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
463 return "cmpm%.l %1,%0";
464 if (REG_P (operands[1])
465 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
467 cc_status.flags |= CC_REVERSED; /*|*/
468 return "cmp%.l %d0,%d1";
470 if (ADDRESS_REG_P (operands[0])
471 && GET_CODE (operands[1]) == CONST_INT
472 && INTVAL (operands[1]) < 0x8000
473 && INTVAL (operands[1]) >= -0x8000)
474 return "cmp%.w %1,%0";
475 return "cmp%.l %d1,%d0";
478 (define_insn "*cmpsi_cf"
480 (compare (match_operand:SI 0 "nonimmediate_operand" "mrKs,r")
481 (match_operand:SI 1 "general_operand" "r,mrKs")))]
484 if (REG_P (operands[1])
485 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
487 cc_status.flags |= CC_REVERSED; /*|*/
488 return "cmp%.l %d0,%d1";
490 return "cmp%.l %d1,%d0";
492 [(set_attr "type" "cmp_l")])
494 (define_expand "cmphi"
496 (compare (match_operand:HI 0 "nonimmediate_src_operand" "")
497 (match_operand:HI 1 "general_src_operand" "")))]
499 "m68k_last_compare_had_fp_operands = 0;")
503 (compare (match_operand:HI 0 "nonimmediate_src_operand" "rnmS,d,n,mS,>")
504 (match_operand:HI 1 "general_src_operand" "d,rnmS,mS,n,>")))]
507 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
508 return "cmpm%.w %1,%0";
509 if ((REG_P (operands[1]) && !ADDRESS_REG_P (operands[1]))
510 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
512 cc_status.flags |= CC_REVERSED; /*|*/
513 return "cmp%.w %d0,%d1";
515 return "cmp%.w %d1,%d0";
518 (define_expand "cmpqi"
520 (compare (match_operand:QI 0 "nonimmediate_src_operand" "")
521 (match_operand:QI 1 "general_src_operand" "")))]
523 "m68k_last_compare_had_fp_operands = 0;")
527 (compare (match_operand:QI 0 "nonimmediate_src_operand" "dn,dmS,>")
528 (match_operand:QI 1 "general_src_operand" "dmS,nd,>")))]
531 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
532 return "cmpm%.b %1,%0";
533 if (REG_P (operands[1])
534 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
536 cc_status.flags |= CC_REVERSED; /*|*/
537 return "cmp%.b %d0,%d1";
539 return "cmp%.b %d1,%d0";
542 (define_expand "cmp<mode>"
544 (compare (match_operand:FP 0 "register_operand" "")
545 (match_operand:FP 1 "fp_src_operand" "")))]
547 "m68k_last_compare_had_fp_operands = 1;")
549 (define_insn "*cmp<mode>_68881"
551 (compare (match_operand:FP 0 "fp_src_operand" "f,f,<FP:dreg>mF")
552 (match_operand:FP 1 "fp_src_operand" "f,<FP:dreg>mF,f")))]
554 && (register_operand (operands[0], <MODE>mode)
555 || register_operand (operands[1], <MODE>mode))"
558 fcmp%.<FP:prec> %f1,%0
559 fcmp%.<FP:prec> %0,%f1"
560 [(set_attr "type" "fcmp")])
562 (define_insn "*cmp<mode>_cf"
564 (compare (match_operand:FP 0 "fp_src_operand" "f,f,<FP:dreg><Q>U")
565 (match_operand:FP 1 "fp_src_operand" "f,<FP:dreg><Q>U,f")))]
567 && (register_operand (operands[0], <MODE>mode)
568 || register_operand (operands[1], <MODE>mode))"
571 fcmp%.<FP:prec> %f1,%0
572 fcmp%.<FP:prec> %0,%f1"
573 [(set_attr "type" "fcmp")])
575 ;; Recognizers for btst instructions.
577 ;; ColdFire/5200 only allows "<Q>" type addresses when the bit position is
578 ;; specified as a constant, so we must disable all patterns that may extract
579 ;; from a MEM at a constant bit position if we can't use this as a constraint.
582 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_src_operand" "oS")
584 (minus:SI (const_int 7)
585 (match_operand:SI 1 "general_operand" "di"))))]
588 return output_btst (operands, operands[1], operands[0], insn, 7);
591 ;; This is the same as the above pattern except for the constraints. The 'i'
595 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o")
597 (minus:SI (const_int 7)
598 (match_operand:SI 1 "general_operand" "d"))))]
601 return output_btst (operands, operands[1], operands[0], insn, 7);
605 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d")
607 (minus:SI (const_int 31)
608 (match_operand:SI 1 "general_operand" "di"))))]
611 return output_btst (operands, operands[1], operands[0], insn, 31);
614 ;; The following two patterns are like the previous two
615 ;; except that they use the fact that bit-number operands
616 ;; are automatically masked to 3 or 5 bits.
619 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o")
621 (minus:SI (const_int 7)
623 (match_operand:SI 1 "register_operand" "d")
627 return output_btst (operands, operands[1], operands[0], insn, 7);
631 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d")
633 (minus:SI (const_int 31)
635 (match_operand:SI 1 "register_operand" "d")
639 return output_btst (operands, operands[1], operands[0], insn, 31);
642 ;; Nonoffsettable mem refs are ok in this one pattern
643 ;; since we don't try to adjust them.
645 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "m")
647 (match_operand:SI 1 "const_int_operand" "n")))]
648 "(unsigned) INTVAL (operands[1]) < 8 && !TARGET_COLDFIRE"
650 operands[1] = GEN_INT (7 - INTVAL (operands[1]));
651 return output_btst (operands, operands[1], operands[0], insn, 7);
655 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "do")
657 (match_operand:SI 1 "const_int_operand" "n")))]
660 if (GET_CODE (operands[0]) == MEM)
662 operands[0] = adjust_address (operands[0], QImode,
663 INTVAL (operands[1]) / 8);
664 operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
665 return output_btst (operands, operands[1], operands[0], insn, 7);
667 operands[1] = GEN_INT (31 - INTVAL (operands[1]));
668 return output_btst (operands, operands[1], operands[0], insn, 31);
671 ;; This is the same as the above pattern except for the constraints.
672 ;; The 'o' has been replaced with 'Q'.
675 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "dQ")
677 (match_operand:SI 1 "const_int_operand" "n")))]
680 if (GET_CODE (operands[0]) == MEM)
682 operands[0] = adjust_address (operands[0], QImode,
683 INTVAL (operands[1]) / 8);
684 operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
685 return output_btst (operands, operands[1], operands[0], insn, 7);
687 operands[1] = GEN_INT (31 - INTVAL (operands[1]));
688 return output_btst (operands, operands[1], operands[0], insn, 31);
694 ;; A special case in which it is not desirable
695 ;; to reload the constant into a data register.
696 (define_insn "pushexthisi_const"
697 [(set (match_operand:SI 0 "push_operand" "=m,m,m")
698 (match_operand:SI 1 "const_int_operand" "C0,R,J"))]
699 "INTVAL (operands[1]) >= -0x8000 && INTVAL (operands[1]) < 0x8000"
704 [(set_attr "type" "clr_l,mov3q_l,pea")])
707 ;(define_insn "swapsi"
708 ; [(set (match_operand:SI 0 "nonimmediate_operand" "+r")
709 ; (match_operand:SI 1 "general_operand" "+r"))
710 ; (set (match_dup 1) (match_dup 0))]
714 ;; Special case of fullword move when source is zero for 68000_10.
715 ;; moveq is faster on the 68000.
716 (define_insn "*movsi_const0_68000_10"
717 [(set (match_operand:SI 0 "movsi_const0_operand" "=d,a,g")
724 [(set_attr "type" "moveq_l,alu_l,clr_l")
725 (set_attr "opy" "*,0,*")])
727 ;; Special case of fullword move when source is zero for 68040_60.
728 ;; On the '040, 'subl an,an' takes 2 clocks while lea takes only 1
729 (define_insn "*movsi_const0_68040_60"
730 [(set (match_operand:SI 0 "movsi_const0_operand" "=a,g")
734 if (which_alternative == 0)
735 return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0";
736 else if (which_alternative == 1)
744 [(set_attr "type" "lea,clr_l")])
746 ;; Special case of fullword move when source is zero.
747 (define_insn "*movsi_const0"
748 [(set (match_operand:SI 0 "movsi_const0_operand" "=a,g")
750 "!(TUNE_68000_10 || TUNE_68040_60)"
754 [(set_attr "type" "alu_l,clr_l")
755 (set_attr "opy" "0,*")])
757 ;; General case of fullword move.
759 ;; This is the main "hook" for PIC code. When generating
760 ;; PIC, movsi is responsible for determining when the source address
761 ;; needs PIC relocation and appropriately calling legitimize_pic_address
762 ;; to perform the actual relocation.
764 ;; In both the PIC and non-PIC cases the patterns generated will
765 ;; matched by the next define_insn.
766 (define_expand "movsi"
767 [(set (match_operand:SI 0 "" "")
768 (match_operand:SI 1 "" ""))]
771 rtx tmp, base, offset;
773 if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode))
775 /* The source is an address which requires PIC relocation.
776 Call legitimize_pic_address with the source, mode, and a relocation
777 register (a new pseudo, or the final destination if reload_in_progress
778 is set). Then fall through normally */
779 rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
780 operands[1] = legitimize_pic_address (operands[1], SImode, temp);
782 else if (flag_pic && TARGET_PCREL && ! reload_in_progress)
784 /* Don't allow writes to memory except via a register;
785 the m68k doesn't consider PC-relative addresses to be writable. */
786 if (symbolic_operand (operands[0], SImode))
787 operands[0] = force_reg (SImode, XEXP (operands[0], 0));
788 else if (GET_CODE (operands[0]) == MEM
789 && symbolic_operand (XEXP (operands[0], 0), SImode))
790 operands[0] = gen_rtx_MEM (SImode,
791 force_reg (SImode, XEXP (operands[0], 0)));
793 if (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P)
795 split_const (operands[1], &base, &offset);
796 if (GET_CODE (base) == SYMBOL_REF
797 && !offset_within_block_p (base, INTVAL (offset)))
799 tmp = !can_create_pseudo_p () ? operands[0] : gen_reg_rtx (SImode);
800 emit_move_insn (tmp, base);
801 emit_insn (gen_addsi3 (operands[0], tmp, offset));
807 ;; General case of fullword move.
808 (define_insn "*movsi_m68k"
809 ;; Notes: make sure no alternative allows g vs g.
810 ;; We don't allow f-regs since fixed point cannot go in them.
811 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<")
812 (match_operand:SI 1 "general_src_operand" "damSnT,n,i"))]
813 "!TARGET_COLDFIRE && reload_completed"
815 return output_move_simode (operands);
818 ;; Before reload is completed the register constraints
819 ;; force integer constants in range for a moveq to be reloaded
820 ;; if they are headed for memory.
821 (define_insn "*movsi_m68k2"
822 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<")
823 (match_operand:SI 1 "general_src_operand" "damSKT,n,i"))]
827 return output_move_simode (operands);
830 ;; ColdFire move instructions can have at most one operand of mode >= 6.
831 (define_insn "*movsi_cf"
832 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d, d, d, d, d, a,Ap, a, r<Q>,g, U")
833 (match_operand:SI 1 "general_operand" " R,CQ,CW,CZ,CS,Ci,J,J Cs,Cs, g, Rr<Q>,U"))]
836 switch (which_alternative)
839 return "mov3q%.l %1,%0";
842 return "moveq %1,%0";
846 unsigned u = INTVAL (operands[1]);
848 operands[1] = GEN_INT ((u << 16) | (u >> 16)); /*|*/
849 return "moveq %1,%0\n\tswap %0";
853 return "mvz%.w %1,%0";
856 return "mvs%.w %1,%0";
859 return "move%.l %1,%0";
862 return "move%.w %1,%0";
873 return "move%.l %1,%0";
880 [(set_attr "type" "mov3q_l,moveq_l,*,mvsz,mvsz,move_l,move,pea,lea,move_l,move_l,move_l")])
882 ;; Special case of fullword move, where we need to get a non-GOT PIC
883 ;; reference into an address register.
885 [(set (match_operand:SI 0 "nonimmediate_operand" "=a<")
886 (match_operand:SI 1 "pcrel_address" ""))]
889 if (push_operand (operands[0], SImode))
894 (define_expand "movhi"
895 [(set (match_operand:HI 0 "nonimmediate_operand" "")
896 (match_operand:HI 1 "general_operand" ""))]
901 [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
902 (match_operand:HI 1 "general_src_operand" "gS"))]
904 "* return output_move_himode (operands);")
907 [(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g,U")
908 (match_operand:HI 1 "general_operand" "g,r<Q>,U"))]
910 "* return output_move_himode (operands);")
912 (define_expand "movstricthi"
913 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" ""))
914 (match_operand:HI 1 "general_src_operand" ""))]
919 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
920 (match_operand:HI 1 "general_src_operand" "rmSn"))]
922 "* return output_move_stricthi (operands);")
925 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+d,m"))
926 (match_operand:HI 1 "general_src_operand" "rmn,r"))]
928 "* return output_move_stricthi (operands);")
930 (define_expand "movqi"
931 [(set (match_operand:QI 0 "nonimmediate_operand" "")
932 (match_operand:QI 1 "general_src_operand" ""))]
937 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
938 (match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
940 "* return output_move_qimode (operands);")
943 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>,dm,U,d*a")
944 (match_operand:QI 1 "general_src_operand" "dmi,d<Q>,U,di*a"))]
946 "* return output_move_qimode (operands);")
948 (define_expand "movstrictqi"
949 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
950 (match_operand:QI 1 "general_src_operand" ""))]
955 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
956 (match_operand:QI 1 "general_src_operand" "dmSn"))]
958 "* return output_move_strictqi (operands);")
960 (define_insn "*movstrictqi_cf"
961 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d, Ac, d,m"))
962 (match_operand:QI 1 "general_src_operand" "C0,C0, dmn,d"))]
969 [(set_attr "type" "clr,clr,move,move")])
971 (define_expand "pushqi1"
972 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2)))
973 (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int 1)))
974 (match_operand:QI 0 "general_operand" ""))]
978 (define_expand "reload_insf"
979 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
980 (match_operand:SF 1 "general_operand" "mf"))
981 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
982 "TARGET_COLDFIRE_FPU"
984 if (emit_move_sequence (operands, SFmode, operands[2]))
987 /* We don't want the clobber emitted, so handle this ourselves. */
988 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
992 (define_expand "reload_outsf"
993 [(set (match_operand:SF 0 "general_operand" "")
994 (match_operand:SF 1 "register_operand" "f"))
995 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
996 "TARGET_COLDFIRE_FPU"
998 if (emit_move_sequence (operands, SFmode, operands[2]))
1001 /* We don't want the clobber emitted, so handle this ourselves. */
1002 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
1006 (define_expand "movsf"
1007 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1008 (match_operand:SF 1 "general_operand" ""))]
1013 [(set (match_operand:SF 0 "nonimmediate_operand" "=rmf")
1014 (match_operand:SF 1 "general_operand" "rmfF"))]
1017 if (FP_REG_P (operands[0]))
1019 if (FP_REG_P (operands[1]))
1020 return "f%$move%.x %1,%0";
1021 else if (ADDRESS_REG_P (operands[1]))
1022 return "move%.l %1,%-\;f%$move%.s %+,%0";
1023 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
1024 return output_move_const_single (operands);
1025 return "f%$move%.s %f1,%0";
1027 if (FP_REG_P (operands[1]))
1029 if (ADDRESS_REG_P (operands[0]))
1030 return "fmove%.s %1,%-\;move%.l %+,%0";
1031 return "fmove%.s %f1,%0";
1033 if (operands[1] == CONST0_RTX (SFmode)
1034 /* clr insns on 68000 read before writing. */
1035 && ((TARGET_68010 || TARGET_COLDFIRE)
1036 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
1038 if (ADDRESS_REG_P (operands[0]))
1040 /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */
1042 return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0";
1044 return "sub%.l %0,%0";
1046 /* moveq is faster on the 68000. */
1047 if (DATA_REG_P (operands[0]) && TUNE_68000_10)
1048 return "moveq #0,%0";
1051 return "move%.l %1,%0";
1054 (define_insn "movsf_cf_soft"
1055 [(set (match_operand:SF 0 "nonimmediate_operand" "=r<Q>,g,U")
1056 (match_operand:SF 1 "general_operand" "g,r<Q>,U"))]
1057 "TARGET_COLDFIRE && !TARGET_COLDFIRE_FPU"
1059 [(set_attr "type" "move_l")])
1061 ;; SFmode MEMs are restricted to modes 2-4 if TARGET_COLDFIRE_FPU.
1062 ;; The move instructions can handle all combinations.
1063 (define_insn "movsf_cf_hard"
1064 [(set (match_operand:SF 0 "nonimmediate_operand" "=r<Q>U, f, f,mr,f,r<Q>,f
1066 (match_operand:SF 1 "general_operand" " f, r<Q>U,f,rm,F,F, m
1068 "TARGET_COLDFIRE_FPU"
1070 if (which_alternative == 4 || which_alternative == 5) {
1074 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
1075 REAL_VALUE_TO_TARGET_SINGLE (r, l);
1076 xoperands[0] = operands[0];
1077 xoperands[1] = GEN_INT (l);
1078 if (which_alternative == 5) {
1080 if (ADDRESS_REG_P (xoperands[0]))
1081 output_asm_insn ("sub%.l %0,%0", xoperands);
1083 output_asm_insn ("clr%.l %0", xoperands);
1085 if (GET_CODE (operands[0]) == MEM
1086 && symbolic_operand (XEXP (operands[0], 0), SImode))
1087 output_asm_insn ("move%.l %1,%-;move%.l %+,%0", xoperands);
1089 output_asm_insn ("move%.l %1,%0", xoperands);
1093 output_asm_insn ("move%.l %1,%-;fsmove%.s %+,%0", xoperands);
1095 output_asm_insn ("clr%.l %-;fsmove%.s %+,%0", xoperands);
1098 if (FP_REG_P (operands[0]))
1100 if (ADDRESS_REG_P (operands[1]))
1101 return "move%.l %1,%-;fsmove%.s %+,%0";
1102 if (FP_REG_P (operands[1]))
1103 return "fsmove%.d %1,%0";
1104 return "fsmove%.s %f1,%0";
1106 if (FP_REG_P (operands[1]))
1108 if (ADDRESS_REG_P (operands[0]))
1109 return "fmove%.s %1,%-;move%.l %+,%0";
1110 return "fmove%.s %f1,%0";
1112 if (operands[1] == CONST0_RTX (SFmode))
1114 if (ADDRESS_REG_P (operands[0]))
1115 return "sub%.l %0,%0";
1118 return "move%.l %1,%0";
1121 (define_expand "reload_indf"
1122 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
1123 (match_operand:DF 1 "general_operand" "mf"))
1124 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
1125 "TARGET_COLDFIRE_FPU"
1127 if (emit_move_sequence (operands, DFmode, operands[2]))
1130 /* We don't want the clobber emitted, so handle this ourselves. */
1131 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
1135 (define_expand "reload_outdf"
1136 [(set (match_operand:DF 0 "general_operand" "")
1137 (match_operand:DF 1 "register_operand" "f"))
1138 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
1139 "TARGET_COLDFIRE_FPU"
1141 if (emit_move_sequence (operands, DFmode, operands[2]))
1144 /* We don't want the clobber emitted, so handle this ourselves. */
1145 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
1149 (define_expand "movdf"
1150 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1151 (match_operand:DF 1 "general_operand" ""))]
1154 if (TARGET_COLDFIRE_FPU)
1155 if (emit_move_sequence (operands, DFmode, 0))
1160 [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,rf,rf,&rof<>")
1161 (match_operand:DF 1 "general_operand" "*rf,m,0,*rofE<>"))]
1162 ; [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
1163 ; (match_operand:DF 1 "general_operand" "rf,m,rofF<>"))]
1166 if (FP_REG_P (operands[0]))
1168 if (FP_REG_P (operands[1]))
1169 return "f%&move%.x %1,%0";
1170 if (REG_P (operands[1]))
1173 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1174 output_asm_insn ("move%.l %1,%-", xoperands);
1175 output_asm_insn ("move%.l %1,%-", operands);
1176 return "f%&move%.d %+,%0";
1178 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1179 return output_move_const_double (operands);
1180 return "f%&move%.d %f1,%0";
1182 else if (FP_REG_P (operands[1]))
1184 if (REG_P (operands[0]))
1186 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1187 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1188 return "move%.l %+,%0";
1191 return "fmove%.d %f1,%0";
1193 return output_move_double (operands);
1196 (define_insn_and_split "movdf_cf_soft"
1197 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,g")
1198 (match_operand:DF 1 "general_operand" "g,r"))]
1199 "TARGET_COLDFIRE && !TARGET_COLDFIRE_FPU"
1201 "&& reload_completed"
1204 m68k_emit_move_double (operands);
1208 (define_insn "movdf_cf_hard"
1209 [(set (match_operand:DF 0 "nonimmediate_operand" "=f, <Q>U,r,f,r,r,m,f")
1210 (match_operand:DF 1 "general_operand" " f<Q>U,f, f,r,r,m,r,E"))]
1211 "TARGET_COLDFIRE_FPU"
1217 switch (which_alternative)
1220 return "fdmove%.d %1,%0";
1222 return "fmove%.d %1,%0";
1224 return "fmove%.d %1,%-;move%.l %+,%0;move%.l %+,%R0";
1226 return "move%.l %R1,%-;move%.l %1,%-;fdmove%.d %+,%0";
1227 case 4: case 5: case 6:
1228 return output_move_double (operands);
1230 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
1231 REAL_VALUE_TO_TARGET_DOUBLE (r, l);
1232 xoperands[0] = operands[0];
1233 xoperands[1] = GEN_INT (l[0]);
1234 xoperands[2] = GEN_INT (l[1]);
1235 if (operands[1] == CONST0_RTX (DFmode))
1236 output_asm_insn ("clr%.l %-;clr%.l %-;fdmove%.d %+,%0",
1240 output_asm_insn ("clr%.l %-;move%.l %1,%-;fdmove%.d %+,%0",
1243 output_asm_insn ("move%.l %2,%-;move%.l %1,%-;fdmove%.d %+,%0",
1249 ;; ??? The XFmode patterns are schizophrenic about whether constants are
1250 ;; allowed. Most but not all have predicates and constraint that disallow
1251 ;; constants. Most but not all have output templates that handle constants.
1252 ;; See also LEGITIMATE_CONSTANT_P.
1254 (define_expand "movxf"
1255 [(set (match_operand:XF 0 "nonimmediate_operand" "")
1256 (match_operand:XF 1 "general_operand" ""))]
1259 /* We can't rewrite operands during reload. */
1260 if (! reload_in_progress)
1262 if (CONSTANT_P (operands[1]))
1264 operands[1] = force_const_mem (XFmode, operands[1]);
1265 if (! memory_address_p (XFmode, XEXP (operands[1], 0)))
1266 operands[1] = adjust_address (operands[1], XFmode, 0);
1268 if (flag_pic && TARGET_PCREL)
1270 /* Don't allow writes to memory except via a register; the
1271 m68k doesn't consider PC-relative addresses to be writable. */
1272 if (GET_CODE (operands[0]) == MEM
1273 && symbolic_operand (XEXP (operands[0], 0), SImode))
1274 operands[0] = gen_rtx_MEM (XFmode,
1275 force_reg (SImode, XEXP (operands[0], 0)));
1281 [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,!r,!f,!r,m,!r")
1282 (match_operand:XF 1 "nonimmediate_operand" "m,f,f,f,r,!r,!r,m"))]
1285 if (FP_REG_P (operands[0]))
1287 if (FP_REG_P (operands[1]))
1288 return "fmove%.x %1,%0";
1289 if (REG_P (operands[1]))
1292 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
1293 output_asm_insn ("move%.l %1,%-", xoperands);
1294 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1295 output_asm_insn ("move%.l %1,%-", xoperands);
1296 output_asm_insn ("move%.l %1,%-", operands);
1297 return "fmove%.x %+,%0";
1299 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1300 return "fmove%.x %1,%0";
1301 return "fmove%.x %f1,%0";
1303 if (FP_REG_P (operands[1]))
1305 if (REG_P (operands[0]))
1307 output_asm_insn ("fmove%.x %f1,%-\;move%.l %+,%0", operands);
1308 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1309 output_asm_insn ("move%.l %+,%0", operands);
1310 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1311 return "move%.l %+,%0";
1313 /* Must be memory destination. */
1314 return "fmove%.x %f1,%0";
1316 return output_move_double (operands);
1320 [(set (match_operand:XF 0 "nonimmediate_operand" "=rm,rf,&rof<>")
1321 (match_operand:XF 1 "nonimmediate_operand" "rf,m,rof<>"))]
1322 "! TARGET_68881 && ! TARGET_COLDFIRE"
1324 if (FP_REG_P (operands[0]))
1326 if (FP_REG_P (operands[1]))
1327 return "fmove%.x %1,%0";
1328 if (REG_P (operands[1]))
1331 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
1332 output_asm_insn ("move%.l %1,%-", xoperands);
1333 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1334 output_asm_insn ("move%.l %1,%-", xoperands);
1335 output_asm_insn ("move%.l %1,%-", operands);
1336 return "fmove%.x %+,%0";
1338 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1339 return "fmove%.x %1,%0";
1340 return "fmove%.x %f1,%0";
1342 if (FP_REG_P (operands[1]))
1344 if (REG_P (operands[0]))
1346 output_asm_insn ("fmove%.x %f1,%-\;move%.l %+,%0", operands);
1347 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1348 output_asm_insn ("move%.l %+,%0", operands);
1349 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1350 return "move%.l %+,%0";
1353 return "fmove%.x %f1,%0";
1355 return output_move_double (operands);
1359 [(set (match_operand:XF 0 "nonimmediate_operand" "=r,g")
1360 (match_operand:XF 1 "nonimmediate_operand" "g,r"))]
1361 "! TARGET_68881 && TARGET_COLDFIRE"
1362 "* return output_move_double (operands);")
1364 (define_expand "movdi"
1365 ;; Let's see if it really still needs to handle fp regs, and, if so, why.
1366 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1367 (match_operand:DI 1 "general_operand" ""))]
1371 ;; movdi can apply to fp regs in some cases
1373 ;; Let's see if it really still needs to handle fp regs, and, if so, why.
1374 [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r,&ro<>")
1375 (match_operand:DI 1 "general_operand" "rF,m,roi<>F"))]
1376 ; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&r,&ro<>,!&rm,!&f")
1377 ; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF"))]
1378 ; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&rf,&ro<>,!&rm,!&f")
1379 ; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF,rfF"))]
1382 if (FP_REG_P (operands[0]))
1384 if (FP_REG_P (operands[1]))
1385 return "fmove%.x %1,%0";
1386 if (REG_P (operands[1]))
1389 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1390 output_asm_insn ("move%.l %1,%-", xoperands);
1391 output_asm_insn ("move%.l %1,%-", operands);
1392 return "fmove%.d %+,%0";
1394 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1395 return output_move_const_double (operands);
1396 return "fmove%.d %f1,%0";
1398 else if (FP_REG_P (operands[1]))
1400 if (REG_P (operands[0]))
1402 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1403 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1404 return "move%.l %+,%0";
1407 return "fmove%.d %f1,%0";
1409 return output_move_double (operands);
1413 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,g")
1414 (match_operand:DI 1 "general_operand" "g,r"))]
1416 "* return output_move_double (operands);")
1418 ;; Thus goes after the move instructions
1419 ;; because the move instructions are better (require no spilling)
1420 ;; when they can apply. It goes before the add/sub insns
1421 ;; so we will prefer it to them.
1423 (define_insn "pushasi"
1424 [(set (match_operand:SI 0 "push_operand" "=m")
1425 (match_operand:SI 1 "address_operand" "p"))]
1428 [(set_attr "type" "pea")])
1430 ;; truncation instructions
1431 (define_insn "truncsiqi2"
1432 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
1434 (match_operand:SI 1 "general_src_operand" "doJS,i")))]
1437 if (GET_CODE (operands[0]) == REG)
1439 /* Must clear condition codes, since the move.l bases them on
1440 the entire 32 bits, not just the desired 8 bits. */
1442 return "move%.l %1,%0";
1444 if (GET_CODE (operands[1]) == MEM)
1445 operands[1] = adjust_address (operands[1], QImode, 3);
1446 return "move%.b %1,%0";
1449 (define_insn "trunchiqi2"
1450 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
1452 (match_operand:HI 1 "general_src_operand" "doJS,i")))]
1455 if (GET_CODE (operands[0]) == REG
1456 && (GET_CODE (operands[1]) == MEM
1457 || GET_CODE (operands[1]) == CONST_INT))
1459 /* Must clear condition codes, since the move.w bases them on
1460 the entire 16 bits, not just the desired 8 bits. */
1462 return "move%.w %1,%0";
1464 if (GET_CODE (operands[0]) == REG)
1466 /* Must clear condition codes, since the move.l bases them on
1467 the entire 32 bits, not just the desired 8 bits. */
1469 return "move%.l %1,%0";
1471 if (GET_CODE (operands[1]) == MEM)
1472 operands[1] = adjust_address (operands[1], QImode, 1);
1473 return "move%.b %1,%0";
1476 (define_insn "truncsihi2"
1477 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm,d")
1479 (match_operand:SI 1 "general_src_operand" "roJS,i")))]
1482 if (GET_CODE (operands[0]) == REG)
1484 /* Must clear condition codes, since the move.l bases them on
1485 the entire 32 bits, not just the desired 8 bits. */
1487 return "move%.l %1,%0";
1489 if (GET_CODE (operands[1]) == MEM)
1490 operands[1] = adjust_address (operands[1], QImode, 2);
1491 return "move%.w %1,%0";
1494 ;; zero extension instructions
1496 ;; two special patterns to match various post_inc/pre_dec patterns
1497 (define_insn_and_split "*zero_extend_inc"
1498 [(set (match_operand 0 "post_inc_operand" "")
1499 (zero_extend (match_operand 1 "register_operand" "")))]
1500 "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT &&
1501 GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT &&
1502 GET_MODE_SIZE (GET_MODE (operands[0])) == GET_MODE_SIZE (GET_MODE (operands[1])) * 2"
1510 operands[0] = adjust_address (operands[0], GET_MODE (operands[1]), 0);
1513 (define_insn_and_split "*zero_extend_dec"
1514 [(set (match_operand 0 "pre_dec_operand" "")
1515 (zero_extend (match_operand 1 "register_operand" "")))]
1516 "(GET_MODE (operands[0]) != HImode || XEXP (XEXP (operands[0], 0), 0) != stack_pointer_rtx) &&
1517 GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT &&
1518 GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT &&
1519 GET_MODE_SIZE (GET_MODE (operands[0])) == GET_MODE_SIZE (GET_MODE (operands[1])) * 2"
1527 operands[0] = adjust_address (operands[0], GET_MODE (operands[1]), 0);
1530 (define_insn_and_split "zero_extendqidi2"
1531 [(set (match_operand:DI 0 "register_operand" "")
1532 (zero_extend:DI (match_operand:QI 1 "nonimmediate_src_operand" "")))]
1537 (zero_extend:SI (match_dup 1)))
1541 operands[2] = gen_lowpart (SImode, operands[0]);
1542 operands[3] = gen_highpart (SImode, operands[0]);
1545 (define_insn_and_split "zero_extendhidi2"
1546 [(set (match_operand:DI 0 "register_operand" "")
1547 (zero_extend:DI (match_operand:HI 1 "nonimmediate_src_operand" "")))]
1552 (zero_extend:SI (match_dup 1)))
1556 operands[2] = gen_lowpart (SImode, operands[0]);
1557 operands[3] = gen_highpart (SImode, operands[0]);
1560 (define_expand "zero_extendsidi2"
1561 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1562 (zero_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "")))]
1565 if (GET_CODE (operands[0]) == MEM
1566 && GET_CODE (operands[1]) == MEM)
1567 operands[1] = force_reg (SImode, operands[1]);
1570 (define_insn_and_split "*zero_extendsidi2"
1571 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1572 (zero_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "")))]
1573 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
1581 operands[2] = gen_lowpart (SImode, operands[0]);
1582 operands[3] = gen_highpart (SImode, operands[0]);
1585 (define_insn "*zero_extendhisi2_cf"
1586 [(set (match_operand:SI 0 "register_operand" "=d")
1587 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1590 [(set_attr "type" "mvsz")])
1592 (define_insn "zero_extendhisi2"
1593 [(set (match_operand:SI 0 "register_operand" "=d")
1594 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1598 (define_expand "zero_extendqihi2"
1599 [(set (match_operand:HI 0 "register_operand" "")
1600 (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "")))]
1604 (define_insn "*zero_extendqihi2"
1605 [(set (match_operand:HI 0 "register_operand" "=d")
1606 (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1610 (define_insn "*zero_extendqisi2_cfv4"
1611 [(set (match_operand:SI 0 "register_operand" "=d")
1612 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1615 [(set_attr "type" "mvsz")])
1617 (define_insn "zero_extendqisi2"
1618 [(set (match_operand:SI 0 "register_operand" "=d")
1619 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1623 ;; these two pattern split everything else which isn't matched by
1624 ;; something else above
1626 [(set (match_operand 0 "register_operand" "")
1627 (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))]
1630 && reg_mentioned_p (operands[0], operands[1])"
1631 [(set (strict_low_part (match_dup 2))
1634 (match_op_dup 4 [(match_dup 0) (match_dup 3)]))]
1636 operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
1637 operands[3] = GEN_INT (GET_MODE_MASK (GET_MODE (operands[1])));
1638 operands[4] = gen_rtx_AND (GET_MODE (operands[0]), operands[0], operands[3]);
1642 [(set (match_operand 0 "register_operand" "")
1643 (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))]
1644 "!ISA_HAS_MVS_MVZ && reload_completed"
1647 (set (strict_low_part (match_dup 2))
1650 operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
1653 ;; sign extension instructions
1655 (define_insn "extendqidi2"
1656 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1657 (sign_extend:DI (match_operand:QI 1 "general_src_operand" "rmS")))]
1661 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1662 if (ISA_HAS_MVS_MVZ)
1663 return "mvs%.b %1,%2\;smi %0\;extb%.l %0";
1664 if (TARGET_68020 || TARGET_COLDFIRE)
1666 if (ADDRESS_REG_P (operands[1]))
1667 return "move%.w %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
1669 return "move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
1673 if (ADDRESS_REG_P (operands[1]))
1674 return "move%.w %1,%2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0\;smi %0";
1676 return "move%.b %1,%2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0\;smi %0";
1680 (define_insn "extendhidi2"
1681 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1683 (match_operand:HI 1 "general_src_operand" "rmS")))]
1687 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1688 if (ISA_HAS_MVS_MVZ)
1689 return "mvs%.w %1,%2\;smi %0\;extb%.l %0";
1690 if (TARGET_68020 || TARGET_COLDFIRE)
1691 return "move%.w %1,%2\;ext%.l %2\;smi %0\;extb%.l %0";
1693 return "move%.w %1,%2\;ext%.l %2\;smi %0\;ext%.w %0\;ext%.l %0";
1696 (define_insn "extendsidi2"
1697 [(set (match_operand:DI 0 "register_operand" "=d")
1698 (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm")))]
1702 if (TARGET_68020 || TARGET_COLDFIRE)
1703 return "move%.l %1,%R0\;smi %0\;extb%.l %0";
1705 return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
1708 (define_insn "*extendsidi2_mem"
1709 [(set (match_operand:DI 0 "memory_operand" "=o,<")
1710 (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm")))
1711 (clobber (match_scratch:SI 2 "=d,d"))]
1715 operands[3] = adjust_address (operands[0], SImode,
1716 which_alternative == 0 ? 4 : 0);
1717 operands[0] = adjust_address (operands[0], SImode, 0);
1718 if (TARGET_68020 || TARGET_COLDFIRE)
1719 return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
1721 return "move%.l %1,%3\;smi %2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0";
1724 ;; Special case when one can avoid register clobbering, copy and test
1725 ;; Maybe there is a way to make that the general case, by forcing the
1726 ;; result of the SI tree to be in the lower register of the DI target
1728 (define_insn "extendplussidi"
1729 [(set (match_operand:DI 0 "register_operand" "=d")
1730 (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rmn")
1731 (match_operand:SI 2 "general_operand" "rmn"))))]
1735 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1736 if (GET_CODE (operands[1]) == CONST_INT
1737 && (unsigned) INTVAL (operands[1]) > 8)
1739 rtx tmp = operands[1];
1741 operands[1] = operands[2];
1744 if (GET_CODE (operands[1]) == REG
1745 && REGNO (operands[1]) == REGNO (operands[3]))
1746 output_asm_insn ("add%.l %2,%3", operands);
1748 output_asm_insn ("move%.l %2,%3\;add%.l %1,%3", operands);
1749 if (TARGET_68020 || TARGET_COLDFIRE)
1750 return "smi %0\;extb%.l %0";
1752 return "smi %0\;ext%.w %0\;ext%.l %0";
1755 (define_expand "extendhisi2"
1756 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1758 (match_operand:HI 1 "nonimmediate_src_operand" "")))]
1762 (define_insn "*cfv4_extendhisi2"
1763 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1765 (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1768 [(set_attr "type" "mvsz")])
1770 (define_insn "*68k_extendhisi2"
1771 [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a")
1773 (match_operand:HI 1 "nonimmediate_src_operand" "0,rmS")))]
1778 [(set_attr "type" "ext,move")])
1780 (define_insn "extendqihi2"
1781 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
1782 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0")))]
1785 [(set_attr "type" "ext")])
1787 (define_expand "extendqisi2"
1788 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1789 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
1790 "TARGET_68020 || TARGET_COLDFIRE"
1793 (define_insn "*cfv4_extendqisi2"
1794 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1795 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "rms")))]
1798 [(set_attr "type" "mvsz")])
1800 (define_insn "*68k_extendqisi2"
1801 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1802 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))]
1803 "TARGET_68020 || (TARGET_COLDFIRE && !ISA_HAS_MVS_MVZ)"
1805 [(set_attr "type" "ext")])
1807 ;; Conversions between float and double.
1809 (define_expand "extendsfdf2"
1810 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1812 (match_operand:SF 1 "general_operand" "")))]
1817 [(set (match_operand:DF 0 "nonimmediate_operand" "=*fdm,f")
1819 (match_operand:SF 1 "general_operand" "f,dmF")))]
1822 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
1824 if (REGNO (operands[0]) == REGNO (operands[1]))
1826 /* Extending float to double in an fp-reg is a no-op.
1827 NOTICE_UPDATE_CC has already assumed that the
1828 cc will be set. So cancel what it did. */
1829 cc_status = cc_prev_status;
1832 return "f%&move%.x %1,%0";
1834 if (FP_REG_P (operands[0]))
1835 return "f%&move%.s %f1,%0";
1836 if (DATA_REG_P (operands[0]) && FP_REG_P (operands[1]))
1838 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1839 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1840 return "move%.l %+,%0";
1842 return "fmove%.d %f1,%0";
1845 (define_insn "extendsfdf2_cf"
1846 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
1848 (match_operand:SF 1 "general_operand" "f,<Q>U")))]
1849 "TARGET_COLDFIRE_FPU"
1851 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
1853 if (REGNO (operands[0]) == REGNO (operands[1]))
1855 /* Extending float to double in an fp-reg is a no-op.
1856 NOTICE_UPDATE_CC has already assumed that the
1857 cc will be set. So cancel what it did. */
1858 cc_status = cc_prev_status;
1861 return "fdmove%.d %1,%0";
1863 return "fdmove%.s %f1,%0";
1866 ;; This cannot output into an f-reg because there is no way to be
1867 ;; sure of truncating in that case.
1868 (define_expand "truncdfsf2"
1869 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1871 (match_operand:DF 1 "general_operand" "")))]
1875 ;; On the '040 we can truncate in a register accurately and easily.
1877 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
1879 (match_operand:DF 1 "general_operand" "fmG")))]
1880 "TARGET_68881 && TARGET_68040"
1882 if (FP_REG_P (operands[1]))
1883 return "f%$move%.x %1,%0";
1884 return "f%$move%.d %f1,%0";
1887 (define_insn "truncdfsf2_cf"
1888 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,d<Q>U")
1890 (match_operand:DF 1 "general_operand" "<Q>U,f")))]
1891 "TARGET_COLDFIRE_FPU"
1895 [(set_attr "type" "fmove")])
1897 (define_insn "*truncdfsf2_68881"
1898 [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
1900 (match_operand:DF 1 "general_operand" "f")))]
1903 [(set_attr "type" "fmove")])
1905 ;; Conversion between fixed point and floating point.
1906 ;; Note that among the fix-to-float insns
1907 ;; the ones that start with SImode come first.
1908 ;; That is so that an operand that is a CONST_INT
1909 ;; (and therefore lacks a specific machine mode).
1910 ;; will be recognized as SImode (which is always valid)
1911 ;; rather than as QImode or HImode.
1913 (define_expand "floatsi<mode>2"
1914 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1915 (float:FP (match_operand:SI 1 "general_operand" "")))]
1919 (define_insn "floatsi<mode>2_68881"
1920 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1921 (float:FP (match_operand:SI 1 "general_operand" "dmi")))]
1923 "f<FP:round>move%.l %1,%0"
1924 [(set_attr "type" "fmove")])
1926 (define_insn "floatsi<mode>2_cf"
1927 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1928 (float:FP (match_operand:SI 1 "general_operand" "d<Q>U")))]
1929 "TARGET_COLDFIRE_FPU"
1930 "f<FP:prec>move%.l %1,%0"
1931 [(set_attr "type" "fmove")])
1934 (define_expand "floathi<mode>2"
1935 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1936 (float:FP (match_operand:HI 1 "general_operand" "")))]
1940 (define_insn "floathi<mode>2_68881"
1941 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1942 (float:FP (match_operand:HI 1 "general_operand" "dmn")))]
1945 [(set_attr "type" "fmove")])
1947 (define_insn "floathi<mode>2_cf"
1948 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1949 (float:FP (match_operand:HI 1 "general_operand" "d<Q>U")))]
1950 "TARGET_COLDFIRE_FPU"
1952 [(set_attr "type" "fmove")])
1955 (define_expand "floatqi<mode>2"
1956 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1957 (float:FP (match_operand:QI 1 "general_operand" "")))]
1961 (define_insn "floatqi<mode>2_68881"
1962 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1963 (float:FP (match_operand:QI 1 "general_operand" "dmn")))]
1966 [(set_attr "type" "fmove")])
1968 (define_insn "floatqi<mode>2_cf"
1969 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1970 (float:FP (match_operand:QI 1 "general_operand" "d<Q>U")))]
1971 "TARGET_COLDFIRE_FPU"
1973 [(set_attr "type" "fmove")])
1976 ;; New routines to convert floating-point values to integers
1977 ;; to be used on the '040. These should be faster than trapping
1978 ;; into the kernel to emulate fintrz. They should also be faster
1979 ;; than calling the subroutines fixsfsi or fixdfsi.
1981 (define_insn "fix_truncdfsi2"
1982 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
1983 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1984 (clobber (match_scratch:SI 2 "=d"))
1985 (clobber (match_scratch:SI 3 "=d"))]
1986 "TARGET_68881 && TUNE_68040"
1989 return "fmovem%.l %!,%2\;moveq #16,%3\;or%.l %2,%3\;and%.w #-33,%3\;fmovem%.l %3,%!\;fmove%.l %1,%0\;fmovem%.l %2,%!";
1992 (define_insn "fix_truncdfhi2"
1993 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
1994 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1995 (clobber (match_scratch:SI 2 "=d"))
1996 (clobber (match_scratch:SI 3 "=d"))]
1997 "TARGET_68881 && TUNE_68040"
2000 return "fmovem%.l %!,%2\;moveq #16,%3\;or%.l %2,%3\;and%.w #-33,%3\;fmovem%.l %3,%!\;fmove%.w %1,%0\;fmovem%.l %2,%!";
2003 (define_insn "fix_truncdfqi2"
2004 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
2005 (fix:QI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
2006 (clobber (match_scratch:SI 2 "=d"))
2007 (clobber (match_scratch:SI 3 "=d"))]
2008 "TARGET_68881 && TUNE_68040"
2011 return "fmovem%.l %!,%2\;moveq #16,%3\;or%.l %2,%3\;and%.w #-33,%3\;fmovem%.l %3,%!\;fmove%.b %1,%0\;fmovem%.l %2,%!";
2014 ;; Convert a float to a float whose value is an integer.
2015 ;; This is the first stage of converting it to an integer type.
2017 (define_expand "ftrunc<mode>2"
2018 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2019 (fix:FP (match_operand:FP 1 "general_operand" "")))]
2020 "TARGET_HARD_FLOAT && !TUNE_68040"
2023 (define_insn "ftrunc<mode>2_68881"
2024 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2025 (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
2026 "TARGET_68881 && !TUNE_68040"
2028 if (FP_REG_P (operands[1]))
2029 return "fintrz%.x %f1,%0";
2030 return "fintrz%.<FP:prec> %f1,%0";
2032 [(set_attr "type" "falu")])
2034 (define_insn "ftrunc<mode>2_cf"
2035 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2036 (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
2037 "TARGET_COLDFIRE_FPU"
2039 if (FP_REG_P (operands[1]))
2040 return "fintrz%.d %f1,%0";
2041 return "fintrz%.<FP:prec> %f1,%0";
2043 [(set_attr "type" "falu")])
2045 ;; Convert a float whose value is an integer
2046 ;; to an actual integer. Second stage of converting float to integer type.
2047 (define_expand "fix<mode>qi2"
2048 [(set (match_operand:QI 0 "nonimmediate_operand" "")
2049 (fix:QI (match_operand:FP 1 "general_operand" "")))]
2053 (define_insn "fix<mode>qi2_68881"
2054 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
2055 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
2058 [(set_attr "type" "fmove")])
2060 (define_insn "fix<mode>qi2_cf"
2061 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>U")
2062 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
2063 "TARGET_COLDFIRE_FPU"
2065 [(set_attr "type" "fmove")])
2067 (define_expand "fix<mode>hi2"
2068 [(set (match_operand:HI 0 "nonimmediate_operand" "")
2069 (fix:HI (match_operand:FP 1 "general_operand" "")))]
2073 (define_insn "fix<mode>hi2_68881"
2074 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
2075 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
2078 [(set_attr "type" "fmove")])
2080 (define_insn "fix<mode>hi2_cf"
2081 [(set (match_operand:HI 0 "nonimmediate_operand" "=d<Q>U")
2082 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
2083 "TARGET_COLDFIRE_FPU"
2085 [(set_attr "type" "fmove")])
2087 (define_expand "fix<mode>si2"
2088 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2089 (fix:SI (match_operand:FP 1 "general_operand" "")))]
2093 (define_insn "fix<mode>si2_68881"
2094 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
2095 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
2098 [(set_attr "type" "fmove")])
2100 (define_insn "fix<mode>si2_cf"
2101 [(set (match_operand:SI 0 "nonimmediate_operand" "=d<Q>U")
2102 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
2103 "TARGET_COLDFIRE_FPU"
2105 [(set_attr "type" "fmove")])
2110 (define_insn "adddi_lshrdi_63"
2111 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
2112 (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "rm")
2115 (clobber (match_scratch:SI 2 "=d"))]
2118 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
2119 if (REG_P (operands[1]) && REGNO (operands[1]) == REGNO (operands[0]))
2121 "move%.l %1,%2\;add%.l %2,%2\;subx%.l %2,%2\;sub%.l %2,%3\;subx%.l %2,%0";
2122 if (GET_CODE (operands[1]) == REG)
2123 operands[4] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2124 else if (GET_CODE (XEXP (operands[1], 0)) == POST_INC
2125 || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
2126 operands[4] = operands[1];
2128 operands[4] = adjust_address (operands[1], SImode, 4);
2129 if (GET_CODE (operands[1]) == MEM
2130 && GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
2131 output_asm_insn ("move%.l %4,%3", operands);
2132 output_asm_insn ("move%.l %1,%0\;smi %2", operands);
2133 if (TARGET_68020 || TARGET_COLDFIRE)
2134 output_asm_insn ("extb%.l %2", operands);
2136 output_asm_insn ("ext%.w %2\;ext%.l %2", operands);
2137 if (GET_CODE (operands[1]) != MEM
2138 || GET_CODE (XEXP (operands[1], 0)) != PRE_DEC)
2139 output_asm_insn ("move%.l %4,%3", operands);
2140 return "sub%.l %2,%3\;subx%.l %2,%0";
2143 (define_insn "adddi_sexthishl32"
2144 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
2145 (plus:DI (ashift:DI (sign_extend:DI
2146 (match_operand:HI 1 "general_operand" "rm,rm,rm,rm"))
2148 (match_operand:DI 2 "general_operand" "0,0,0,0")))
2149 (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
2153 if (ADDRESS_REG_P (operands[0]))
2154 return "add%.w %1,%0";
2155 else if (ADDRESS_REG_P (operands[3]))
2156 return "move%.w %1,%3\;add%.l %3,%0";
2158 return "move%.w %1,%3\;ext%.l %3\;add%.l %3,%0";
2161 (define_insn "*adddi_dilshr32"
2162 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,o")
2163 (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")
2165 (match_operand:DI 2 "general_operand" "0,0")))]
2169 if (GET_CODE (operands[0]) == REG)
2170 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
2172 operands[2] = adjust_address (operands[0], SImode, 4);
2173 return "add%.l %1,%2\;negx%.l %0\;neg%.l %0";
2176 (define_insn "*adddi_dilshr32_cf"
2177 [(set (match_operand:DI 0 "register_operand" "=d")
2178 (plus:DI (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "ro")
2180 (match_operand:DI 2 "register_operand" "0")))]
2184 return "add%.l %1,%R0\;negx%.l %0\;neg%.l %0";
2187 (define_insn "adddi_dishl32"
2188 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
2189 ;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
2190 ;; (ashift:DI (match_operand:DI 1 "general_operand" "ro")
2191 ;; (const_int 32))))]
2192 (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,d")
2194 (match_operand:DI 2 "general_operand" "0,0")))]
2198 if (GET_CODE (operands[1]) == REG)
2199 operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2201 operands[1] = adjust_address (operands[1], SImode, 4);
2202 return "add%.l %1,%0";
2204 [(set_attr "type" "alu_l")])
2206 (define_insn "adddi3"
2207 [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
2208 (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0")
2209 (match_operand:DI 2 "general_operand" "d,no>,d,a")))
2210 (clobber (match_scratch:SI 3 "=&d,&d,X,&d"))]
2213 if (DATA_REG_P (operands[0]))
2215 if (DATA_REG_P (operands[2]))
2216 return "add%.l %R2,%R0\;addx%.l %2,%0";
2217 else if (GET_CODE (operands[2]) == MEM
2218 && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
2219 return "move%.l %2,%3\;add%.l %2,%R0\;addx%.l %3,%0";
2225 if (GET_CODE (operands[2]) == REG)
2227 low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
2230 else if (CONSTANT_P (operands[2]))
2231 split_double (operands[2], &high, &low);
2234 low = adjust_address (operands[2], SImode, 4);
2238 operands[1] = low, operands[2] = high;
2239 xoperands[0] = operands[3];
2240 if (GET_CODE (operands[1]) == CONST_INT
2241 && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2242 xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
2244 xoperands[1] = operands[2];
2246 output_asm_insn (output_move_simode (xoperands), xoperands);
2247 if (GET_CODE (operands[1]) == CONST_INT)
2249 if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
2250 return "addq%.l %1,%R0\;addx%.l %3,%0";
2251 else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2253 operands[1] = GEN_INT (-INTVAL (operands[1]));
2254 return "subq%.l %1,%R0\;subx%.l %3,%0";
2257 return "add%.l %1,%R0\;addx%.l %3,%0";
2262 gcc_assert (GET_CODE (operands[0]) == MEM);
2264 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2266 operands[1] = gen_rtx_MEM (SImode,
2267 plus_constant (XEXP(operands[0], 0), -8));
2268 return "move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1";
2270 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2272 operands[1] = XEXP(operands[0], 0);
2273 return "add%.l %R2,%0\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%1";
2277 operands[1] = adjust_address (operands[0], SImode, 4);
2278 return "add%.l %R2,%1\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%0";
2283 (define_insn "addsi_lshrsi_31"
2284 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
2285 (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
2290 operands[2] = operands[0];
2291 operands[3] = gen_label_rtx();
2292 if (GET_CODE (operands[0]) == MEM)
2294 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2295 operands[0] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
2296 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2297 operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
2299 output_asm_insn ("move%.l %1,%0", operands);
2300 output_asm_insn ("jpl %l3", operands);
2301 output_asm_insn ("addq%.l #1,%2", operands);
2302 (*targetm.asm_out.internal_label) (asm_out_file, "L",
2303 CODE_LABEL_NUMBER (operands[3]));
2307 (define_expand "addsi3"
2308 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2309 (plus:SI (match_operand:SI 1 "general_operand" "")
2310 (match_operand:SI 2 "general_src_operand" "")))]
2314 ;; Note that the middle two alternatives are near-duplicates
2315 ;; in order to handle insns generated by reload.
2316 ;; This is needed since they are not themselves reloaded,
2317 ;; so commutativity won't apply to them.
2318 (define_insn "*addsi3_internal"
2319 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,d,a")
2320 (plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0,0")
2321 (match_operand:SI 2 "general_src_operand" "dIKLT,rJK,a,mSrIKLT,mSrIKLs")))]
2325 "* return output_addsi3 (operands);")
2327 (define_insn_and_split "*addsi3_5200"
2328 [(set (match_operand:SI 0 "nonimmediate_operand" "=mr,mr,a,m,r, ?a, ?a,?a,?a")
2329 (plus:SI (match_operand:SI 1 "general_operand" "%0, 0, 0,0,0, a, a, r, a")
2330 (match_operand:SI 2 "general_src_operand" " I, L, J,d,mrKi,Cj, r, a, J")))]
2333 switch (which_alternative)
2336 return "addq%.l %2,%0";
2339 operands[2] = GEN_INT (- INTVAL (operands[2]));
2340 return "subq%.l %2,%0";
2344 return "add%.l %2,%0";
2347 /* move%.l %2,%0\n\tadd%.l %1,%0 */
2351 return MOTOROLA ? "lea (%1,%2.l),%0" : "lea %1@(0,%2:l),%0";
2354 return MOTOROLA ? "lea (%2,%1.l),%0" : "lea %2@(0,%1:l),%0";
2358 return MOTOROLA ? "lea (%c2,%1),%0" : "lea %1@(%c2),%0";
2365 "&& reload_completed && (extract_constrain_insn_cached (insn), which_alternative == 5) && !operands_match_p (operands[0], operands[1])"
2369 (plus:SI (match_dup 0)
2372 [(set_attr "type" "aluq_l,aluq_l,lea,alu_l,alu_l,*,lea,lea,lea")
2373 (set_attr "opy" "2,2,*,2,2,*,*,*,*")
2374 (set_attr "opy_type" "*,*,mem5,*,*,*,mem6,mem6,mem5")])
2377 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
2378 (plus:SI (match_operand:SI 1 "general_operand" "0")
2380 (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
2384 (define_insn "addhi3"
2385 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
2386 (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
2387 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
2390 if (GET_CODE (operands[2]) == CONST_INT)
2392 /* If the constant would be a negative number when interpreted as
2393 HImode, make it negative. This is usually, but not always, done
2394 elsewhere in the compiler. First check for constants out of range,
2395 which could confuse us. */
2397 if (INTVAL (operands[2]) >= 32768)
2398 operands[2] = GEN_INT (INTVAL (operands[2]) - 65536);
2400 if (INTVAL (operands[2]) > 0
2401 && INTVAL (operands[2]) <= 8)
2402 return "addq%.w %2,%0";
2403 if (INTVAL (operands[2]) < 0
2404 && INTVAL (operands[2]) >= -8)
2406 operands[2] = GEN_INT (- INTVAL (operands[2]));
2407 return "subq%.w %2,%0";
2409 /* On the CPU32 it is faster to use two addqw instructions to
2410 add a small integer (8 < N <= 16) to a register.
2411 Likewise for subqw. */
2412 if (TUNE_CPU32 && REG_P (operands[0]))
2414 if (INTVAL (operands[2]) > 8
2415 && INTVAL (operands[2]) <= 16)
2417 operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
2418 return "addq%.w #8,%0\;addq%.w %2,%0";
2420 if (INTVAL (operands[2]) < -8
2421 && INTVAL (operands[2]) >= -16)
2423 operands[2] = GEN_INT (- INTVAL (operands[2]) - 8);
2424 return "subq%.w #8,%0\;subq%.w %2,%0";
2427 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2428 return MOTOROLA ? "lea (%c2,%0),%0" : "lea %0@(%c2),%0";
2430 return "add%.w %2,%0";
2433 ;; These insns must use MATCH_DUP instead of the more expected
2434 ;; use of a matching constraint because the "output" here is also
2435 ;; an input, so you can't use the matching constraint. That also means
2436 ;; that you can't use the "%", so you need patterns with the matched
2437 ;; operand in both positions.
2440 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2441 (plus:HI (match_dup 0)
2442 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
2445 if (GET_CODE (operands[1]) == CONST_INT)
2447 /* If the constant would be a negative number when interpreted as
2448 HImode, make it negative. This is usually, but not always, done
2449 elsewhere in the compiler. First check for constants out of range,
2450 which could confuse us. */
2452 if (INTVAL (operands[1]) >= 32768)
2453 operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
2455 if (INTVAL (operands[1]) > 0
2456 && INTVAL (operands[1]) <= 8)
2457 return "addq%.w %1,%0";
2458 if (INTVAL (operands[1]) < 0
2459 && INTVAL (operands[1]) >= -8)
2461 operands[1] = GEN_INT (- INTVAL (operands[1]));
2462 return "subq%.w %1,%0";
2464 /* On the CPU32 it is faster to use two addqw instructions to
2465 add a small integer (8 < N <= 16) to a register.
2466 Likewise for subqw. */
2467 if (TUNE_CPU32 && REG_P (operands[0]))
2469 if (INTVAL (operands[1]) > 8
2470 && INTVAL (operands[1]) <= 16)
2472 operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
2473 return "addq%.w #8,%0\;addq%.w %1,%0";
2475 if (INTVAL (operands[1]) < -8
2476 && INTVAL (operands[1]) >= -16)
2478 operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
2479 return "subq%.w #8,%0\;subq%.w %1,%0";
2482 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2483 return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";
2485 return "add%.w %1,%0";
2489 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2490 (plus:HI (match_operand:HI 1 "general_src_operand" "dn,rmSn")
2494 if (GET_CODE (operands[1]) == CONST_INT)
2496 /* If the constant would be a negative number when interpreted as
2497 HImode, make it negative. This is usually, but not always, done
2498 elsewhere in the compiler. First check for constants out of range,
2499 which could confuse us. */
2501 if (INTVAL (operands[1]) >= 32768)
2502 operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
2504 if (INTVAL (operands[1]) > 0
2505 && INTVAL (operands[1]) <= 8)
2506 return "addq%.w %1,%0";
2507 if (INTVAL (operands[1]) < 0
2508 && INTVAL (operands[1]) >= -8)
2510 operands[1] = GEN_INT (- INTVAL (operands[1]));
2511 return "subq%.w %1,%0";
2513 /* On the CPU32 it is faster to use two addqw instructions to
2514 add a small integer (8 < N <= 16) to a register.
2515 Likewise for subqw. */
2516 if (TUNE_CPU32 && REG_P (operands[0]))
2518 if (INTVAL (operands[1]) > 8
2519 && INTVAL (operands[1]) <= 16)
2521 operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
2522 return "addq%.w #8,%0\;addq%.w %1,%0";
2524 if (INTVAL (operands[1]) < -8
2525 && INTVAL (operands[1]) >= -16)
2527 operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
2528 return "subq%.w #8,%0\;subq%.w %1,%0";
2531 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2532 return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";
2534 return "add%.w %1,%0";
2537 (define_insn "addqi3"
2538 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
2539 (plus:QI (match_operand:QI 1 "general_operand" "%0,0")
2540 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
2543 if (GET_CODE (operands[2]) == CONST_INT)
2545 if (INTVAL (operands[2]) >= 128)
2546 operands[2] = GEN_INT (INTVAL (operands[2]) - 256);
2548 if (INTVAL (operands[2]) > 0
2549 && INTVAL (operands[2]) <= 8)
2550 return "addq%.b %2,%0";
2551 if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8)
2553 operands[2] = GEN_INT (- INTVAL (operands[2]));
2554 return "subq%.b %2,%0";
2557 return "add%.b %2,%0";
2561 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2562 (plus:QI (match_dup 0)
2563 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
2566 if (GET_CODE (operands[1]) == CONST_INT)
2568 if (INTVAL (operands[1]) >= 128)
2569 operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
2571 if (INTVAL (operands[1]) > 0
2572 && INTVAL (operands[1]) <= 8)
2573 return "addq%.b %1,%0";
2574 if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
2576 operands[1] = GEN_INT (- INTVAL (operands[1]));
2577 return "subq%.b %1,%0";
2580 return "add%.b %1,%0";
2584 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2585 (plus:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
2589 if (GET_CODE (operands[1]) == CONST_INT)
2591 if (INTVAL (operands[1]) >= 128)
2592 operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
2594 if (INTVAL (operands[1]) > 0
2595 && INTVAL (operands[1]) <= 8)
2596 return "addq%.b %1,%0";
2597 if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
2599 operands[1] = GEN_INT (- INTVAL (operands[1]));
2600 return "subq%.b %1,%0";
2603 return "add%.b %1,%0";
2606 (define_expand "add<mode>3"
2607 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2608 (plus:FP (match_operand:FP 1 "general_operand" "")
2609 (match_operand:FP 2 "general_operand" "")))]
2613 (define_insn "add<mode>3_floatsi_68881"
2614 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2615 (plus:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
2616 (match_operand:FP 1 "general_operand" "0")))]
2618 "f<FP:round>add%.l %2,%0"
2619 [(set_attr "type" "falu")
2620 (set_attr "opy" "2")])
2622 (define_insn "add<mode>3_floathi_68881"
2623 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2624 (plus:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
2625 (match_operand:FP 1 "general_operand" "0")))]
2627 "f<FP:round>add%.w %2,%0"
2628 [(set_attr "type" "falu")
2629 (set_attr "opy" "2")])
2631 (define_insn "add<mode>3_floatqi_68881"
2632 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2633 (plus:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
2634 (match_operand:FP 1 "general_operand" "0")))]
2636 "f<FP:round>add%.b %2,%0"
2637 [(set_attr "type" "falu")
2638 (set_attr "opy" "2")])
2640 (define_insn "add<mode>3_68881"
2641 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2642 (plus:FP (match_operand:FP 1 "general_operand" "%0")
2643 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2646 if (FP_REG_P (operands[2]))
2647 return "f<FP:round>add%.x %2,%0";
2648 return "f<FP:round>add%.<FP:prec> %f2,%0";
2650 [(set_attr "type" "falu")
2651 (set_attr "opy" "2")])
2653 (define_insn "add<mode>3_cf"
2654 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2655 (plus:FP (match_operand:FP 1 "general_operand" "%0")
2656 (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
2657 "TARGET_COLDFIRE_FPU"
2659 if (FP_REG_P (operands[2]))
2660 return "f<FP:prec>add%.d %2,%0";
2661 return "f<FP:prec>add%.<FP:prec> %2,%0";
2663 [(set_attr "type" "falu")
2664 (set_attr "opy" "2")])
2666 ;; subtract instructions
2668 (define_insn "subdi_sexthishl32"
2669 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
2670 (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
2671 (ashift:DI (sign_extend:DI (match_operand:HI 2 "general_operand" "rm,rm,rm,rm"))
2673 (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
2677 if (ADDRESS_REG_P (operands[0]))
2678 return "sub%.w %2,%0";
2679 else if (ADDRESS_REG_P (operands[3]))
2680 return "move%.w %2,%3\;sub%.l %3,%0";
2682 return "move%.w %2,%3\;ext%.l %3\;sub%.l %3,%0";
2685 (define_insn "subdi_dishl32"
2686 [(set (match_operand:DI 0 "nonimmediate_operand" "+ro")
2687 (minus:DI (match_dup 0)
2688 (ashift:DI (match_operand:DI 1 "general_operand" "ro")
2693 if (GET_CODE (operands[1]) == REG)
2694 operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2696 operands[1] = adjust_address (operands[1], SImode, 4);
2697 return "sub%.l %1,%0";
2699 [(set_attr "type" "alu_l")])
2701 (define_insn "subdi3"
2702 [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
2703 (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
2704 (match_operand:DI 2 "general_operand" "d,no>,d,a")))
2705 (clobber (match_scratch:SI 3 "=&d,&d,X,&d"))]
2708 if (DATA_REG_P (operands[0]))
2710 if (DATA_REG_P (operands[2]))
2711 return "sub%.l %R2,%R0\;subx%.l %2,%0";
2712 else if (GET_CODE (operands[2]) == MEM
2713 && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
2715 return "move%.l %2,%3\;sub%.l %2,%R0\;subx%.l %3,%0";
2722 if (GET_CODE (operands[2]) == REG)
2724 low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
2727 else if (CONSTANT_P (operands[2]))
2728 split_double (operands[2], &high, &low);
2731 low = adjust_address (operands[2], SImode, 4);
2735 operands[1] = low, operands[2] = high;
2736 xoperands[0] = operands[3];
2737 if (GET_CODE (operands[1]) == CONST_INT
2738 && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2739 xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
2741 xoperands[1] = operands[2];
2743 output_asm_insn (output_move_simode (xoperands), xoperands);
2744 if (GET_CODE (operands[1]) == CONST_INT)
2746 if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
2747 return "subq%.l %1,%R0\;subx%.l %3,%0";
2748 else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2750 operands[1] = GEN_INT (-INTVAL (operands[1]));
2751 return "addq%.l %1,%R0\;addx%.l %3,%0";
2754 return "sub%.l %1,%R0\;subx%.l %3,%0";
2759 gcc_assert (GET_CODE (operands[0]) == MEM);
2761 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2764 = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[0], 0), -8));
2765 return "move%.l %0,%3\;sub%.l %R2,%0\;subx%.l %2,%3\;move%.l %3,%1";
2767 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2769 operands[1] = XEXP(operands[0], 0);
2770 return "sub%.l %R2,%0\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%1";
2774 operands[1] = adjust_address (operands[0], SImode, 4);
2775 return "sub%.l %R2,%1\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%0";
2780 (define_insn "subsi3"
2781 [(set (match_operand:SI 0 "nonimmediate_operand" "=mda,m,d,a")
2782 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
2783 (match_operand:SI 2 "general_src_operand" "I,dT,mSrT,mSrs")))]
2790 [(set_attr "type" "aluq_l,alu_l,alu_l,alu_l")
2791 (set_attr "opy" "2")])
2794 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
2795 (minus:SI (match_operand:SI 1 "general_operand" "0")
2797 (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
2801 (define_insn "subhi3"
2802 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
2803 (minus:HI (match_operand:HI 1 "general_operand" "0,0")
2804 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
2809 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2810 (minus:HI (match_dup 0)
2811 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
2815 (define_insn "subqi3"
2816 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
2817 (minus:QI (match_operand:QI 1 "general_operand" "0,0")
2818 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
2823 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2824 (minus:QI (match_dup 0)
2825 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
2829 (define_expand "sub<mode>3"
2830 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2831 (minus:FP (match_operand:FP 1 "general_operand" "")
2832 (match_operand:FP 2 "general_operand" "")))]
2836 (define_insn "sub<mode>3_floatsi_68881"
2837 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2838 (minus:FP (match_operand:FP 1 "general_operand" "0")
2839 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
2841 "f<FP:round>sub%.l %2,%0"
2842 [(set_attr "type" "falu")
2843 (set_attr "opy" "2")])
2845 (define_insn "sub<mode>3_floathi_68881"
2846 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2847 (minus:FP (match_operand:FP 1 "general_operand" "0")
2848 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
2850 "f<FP:round>sub%.w %2,%0"
2851 [(set_attr "type" "falu")
2852 (set_attr "opy" "2")])
2854 (define_insn "sub<mode>3_floatqi_68881"
2855 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2856 (minus:FP (match_operand:FP 1 "general_operand" "0")
2857 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
2859 "f<FP:round>sub%.b %2,%0"
2860 [(set_attr "type" "falu")
2861 (set_attr "opy" "2")])
2863 (define_insn "sub<mode>3_68881"
2864 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2865 (minus:FP (match_operand:FP 1 "general_operand" "0")
2866 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2869 if (FP_REG_P (operands[2]))
2870 return "f<FP:round>sub%.x %2,%0";
2871 return "f<FP:round>sub%.<FP:prec> %f2,%0";
2873 [(set_attr "type" "falu")
2874 (set_attr "opy" "2")])
2876 (define_insn "sub<mode>3_cf"
2877 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2878 (minus:FP (match_operand:FP 1 "general_operand" "0")
2879 (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
2880 "TARGET_COLDFIRE_FPU"
2882 if (FP_REG_P (operands[2]))
2883 return "f<FP:prec>sub%.d %2,%0";
2884 return "f<FP:prec>sub%.<FP:prec> %2,%0";
2886 [(set_attr "type" "falu")
2887 (set_attr "opy" "2")])
2889 ;; multiply instructions
2891 (define_insn "mulhi3"
2892 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
2893 (mult:HI (match_operand:HI 1 "general_operand" "%0")
2894 (match_operand:HI 2 "general_src_operand" "dmSn")))]
2897 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2899 [(set_attr "type" "mul_w")
2900 (set_attr "opy" "2")])
2902 (define_insn "mulhisi3"
2903 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2904 (mult:SI (sign_extend:SI
2905 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2907 (match_operand:HI 2 "nonimmediate_src_operand" "dmS"))))]
2910 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2912 [(set_attr "type" "mul_w")
2913 (set_attr "opy" "2")])
2915 (define_insn "*mulhisisi3_s"
2916 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2917 (mult:SI (sign_extend:SI
2918 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2919 (match_operand:SI 2 "const_int_operand" "n")))]
2920 "INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) <= 0x7fff"
2922 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2924 [(set_attr "type" "mul_w")
2925 (set_attr "opy" "2")])
2927 (define_expand "mulsi3"
2928 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2929 (mult:SI (match_operand:SI 1 "general_operand" "")
2930 (match_operand:SI 2 "general_operand" "")))]
2931 "TARGET_68020 || TARGET_COLDFIRE"
2934 (define_insn "*mulsi3_68020"
2935 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2936 (mult:SI (match_operand:SI 1 "general_operand" "%0")
2937 (match_operand:SI 2 "general_src_operand" "dmSTK")))]
2941 [(set_attr "type" "mul_l")
2942 (set_attr "opy" "2")])
2944 (define_insn "*mulsi3_cf"
2945 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2946 (mult:SI (match_operand:SI 1 "general_operand" "%0")
2947 (match_operand:SI 2 "general_operand" "d<Q>")))]
2950 [(set_attr "type" "mul_l")
2951 (set_attr "opy" "2")])
2953 (define_insn "umulhisi3"
2954 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2955 (mult:SI (zero_extend:SI
2956 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2958 (match_operand:HI 2 "nonimmediate_src_operand" "dmS"))))]
2961 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
2963 [(set_attr "type" "mul_w")
2964 (set_attr "opy" "2")])
2966 (define_insn "*mulhisisi3_z"
2967 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2968 (mult:SI (zero_extend:SI
2969 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2970 (match_operand:SI 2 "const_int_operand" "n")))]
2971 "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 0xffff"
2973 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
2975 [(set_attr "type" "mul_w")
2976 (set_attr "opy" "2")])
2978 ;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
2979 ;; proper matching constraint. This is because the matching is between
2980 ;; the high-numbered word of the DImode operand[0] and operand[1].
2981 (define_expand "umulsidi3"
2983 [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
2984 (mult:SI (match_operand:SI 1 "register_operand" "")
2985 (match_operand:SI 2 "register_operand" "")))
2986 (set (subreg:SI (match_dup 0) 0)
2987 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2988 (zero_extend:DI (match_dup 2)))
2989 (const_int 32))))])]
2990 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2994 [(set (match_operand:SI 0 "register_operand" "=d")
2995 (mult:SI (match_operand:SI 1 "register_operand" "%0")
2996 (match_operand:SI 2 "nonimmediate_operand" "dm")))
2997 (set (match_operand:SI 3 "register_operand" "=d")
2998 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2999 (zero_extend:DI (match_dup 2)))
3001 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3004 ; Match immediate case. For 2.4 only match things < 2^31.
3005 ; It's tricky with larger values in these patterns since we need to match
3006 ; values between the two parallel multiplies, between a CONST_DOUBLE and
3009 [(set (match_operand:SI 0 "register_operand" "=d")
3010 (mult:SI (match_operand:SI 1 "register_operand" "%0")
3011 (match_operand:SI 2 "const_int_operand" "n")))
3012 (set (match_operand:SI 3 "register_operand" "=d")
3013 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
3016 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE
3017 && (unsigned) INTVAL (operands[2]) <= 0x7fffffff"
3020 (define_expand "mulsidi3"
3022 [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
3023 (mult:SI (match_operand:SI 1 "register_operand" "")
3024 (match_operand:SI 2 "register_operand" "")))
3025 (set (subreg:SI (match_dup 0) 0)
3026 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
3027 (sign_extend:DI (match_dup 2)))
3028 (const_int 32))))])]
3029 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3033 [(set (match_operand:SI 0 "register_operand" "=d")
3034 (mult:SI (match_operand:SI 1 "register_operand" "%0")
3035 (match_operand:SI 2 "nonimmediate_operand" "dm")))
3036 (set (match_operand:SI 3 "register_operand" "=d")
3037 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
3038 (sign_extend:DI (match_dup 2)))
3040 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3044 [(set (match_operand:SI 0 "register_operand" "=d")
3045 (mult:SI (match_operand:SI 1 "register_operand" "%0")
3046 (match_operand:SI 2 "const_int_operand" "n")))
3047 (set (match_operand:SI 3 "register_operand" "=d")
3048 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
3051 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3054 (define_expand "umulsi3_highpart"
3056 [(set (match_operand:SI 0 "register_operand" "")
3059 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" ""))
3060 (zero_extend:DI (match_operand:SI 2 "general_operand" "")))
3062 (clobber (match_dup 3))])]
3063 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3065 operands[3] = gen_reg_rtx (SImode);
3067 if (GET_CODE (operands[2]) == CONST_INT)
3069 operands[2] = immed_double_const (INTVAL (operands[2]) & 0xffffffff,
3072 /* We have to adjust the operand order for the matching constraints. */
3073 emit_insn (gen_const_umulsi3_highpart (operands[0], operands[3],
3074 operands[1], operands[2]));
3080 [(set (match_operand:SI 0 "register_operand" "=d")
3083 (mult:DI (zero_extend:DI (match_operand:SI 2 "register_operand" "%1"))
3084 (zero_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
3086 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3087 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3090 (define_insn "const_umulsi3_highpart"
3091 [(set (match_operand:SI 0 "register_operand" "=d")
3094 (mult:DI (zero_extend:DI (match_operand:SI 2 "register_operand" "1"))
3095 (match_operand:DI 3 "const_uint32_operand" "n"))
3097 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3098 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3101 (define_expand "smulsi3_highpart"
3103 [(set (match_operand:SI 0 "register_operand" "")
3106 (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" ""))
3107 (sign_extend:DI (match_operand:SI 2 "general_operand" "")))
3109 (clobber (match_dup 3))])]
3110 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3112 operands[3] = gen_reg_rtx (SImode);
3113 if (GET_CODE (operands[2]) == CONST_INT)
3115 /* We have to adjust the operand order for the matching constraints. */
3116 emit_insn (gen_const_smulsi3_highpart (operands[0], operands[3],
3117 operands[1], operands[2]));
3123 [(set (match_operand:SI 0 "register_operand" "=d")
3126 (mult:DI (sign_extend:DI (match_operand:SI 2 "register_operand" "%1"))
3127 (sign_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
3129 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3130 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3133 (define_insn "const_smulsi3_highpart"
3134 [(set (match_operand:SI 0 "register_operand" "=d")
3137 (mult:DI (sign_extend:DI (match_operand:SI 2 "register_operand" "1"))
3138 (match_operand:DI 3 "const_sint32_operand" "n"))
3140 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3141 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3144 (define_expand "mul<mode>3"
3145 [(set (match_operand:FP 0 "nonimmediate_operand" "")
3146 (mult:FP (match_operand:FP 1 "general_operand" "")
3147 (match_operand:FP 2 "general_operand" "")))]
3151 (define_insn "mul<mode>3_floatsi_68881"
3152 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3153 (mult:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
3154 (match_operand:FP 1 "general_operand" "0")))]
3158 ? "f<FP:round>mul%.l %2,%0"
3159 : "f<FP:round_mul>mul%.l %2,%0";
3161 [(set_attr "type" "fmul")
3162 (set_attr "opy" "2")])
3164 (define_insn "mul<mode>3_floathi_68881"
3165 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3166 (mult:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
3167 (match_operand:FP 1 "general_operand" "0")))]
3171 ? "f<FP:round>mul%.w %2,%0"
3172 : "f<FP:round_mul>mul%.w %2,%0";
3174 [(set_attr "type" "fmul")
3175 (set_attr "opy" "2")])
3177 (define_insn "mul<mode>3_floatqi_68881"
3178 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3179 (mult:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
3180 (match_operand:FP 1 "general_operand" "0")))]
3184 ? "f<FP:round>mul%.b %2,%0"
3185 : "f<FP:round_mul>mul%.b %2,%0";
3187 [(set_attr "type" "fmul")
3188 (set_attr "opy" "2")])
3190 (define_insn "muldf_68881"
3191 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
3192 (mult:DF (match_operand:DF 1 "general_operand" "%0")
3193 (match_operand:DF 2 "general_operand" "fmG")))]
3196 if (GET_CODE (operands[2]) == CONST_DOUBLE
3197 && floating_exact_log2 (operands[2]) && !TUNE_68040_60)
3199 int i = floating_exact_log2 (operands[2]);
3200 operands[2] = GEN_INT (i);
3201 return "fscale%.l %2,%0";
3203 if (REG_P (operands[2]))
3204 return "f%&mul%.x %2,%0";
3205 return "f%&mul%.d %f2,%0";
3208 (define_insn "mulsf_68881"
3209 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
3210 (mult:SF (match_operand:SF 1 "general_operand" "%0")
3211 (match_operand:SF 2 "general_operand" "fdmF")))]
3214 if (FP_REG_P (operands[2]))
3215 return (TARGET_68040
3217 : "fsglmul%.x %2,%0");
3218 return (TARGET_68040
3220 : "fsglmul%.s %f2,%0");
3223 (define_insn "mulxf3_68881"
3224 [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
3225 (mult:XF (match_operand:XF 1 "nonimmediate_operand" "%0")
3226 (match_operand:XF 2 "nonimmediate_operand" "fm")))]
3229 return "fmul%.x %f2,%0";
3232 (define_insn "fmul<mode>3_cf"
3233 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3234 (mult:FP (match_operand:FP 1 "general_operand" "%0")
3235 (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
3236 "TARGET_COLDFIRE_FPU"
3238 if (FP_REG_P (operands[2]))
3239 return "f<FP:prec>mul%.d %2,%0";
3240 return "f<FP:prec>mul%.<FP:prec> %2,%0";
3242 [(set_attr "type" "fmul")
3243 (set_attr "opy" "2")])
3245 ;; divide instructions
3247 (define_expand "div<mode>3"
3248 [(set (match_operand:FP 0 "nonimmediate_operand" "")
3249 (div:FP (match_operand:FP 1 "general_operand" "")
3250 (match_operand:FP 2 "general_operand" "")))]
3254 (define_insn "div<mode>3_floatsi_68881"
3255 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3256 (div:FP (match_operand:FP 1 "general_operand" "0")
3257 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
3261 ? "f<FP:round>div%.l %2,%0"
3262 : "f<FP:round_mul>div%.l %2,%0";
3265 (define_insn "div<mode>3_floathi_68881"
3266 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3267 (div:FP (match_operand:FP 1 "general_operand" "0")
3268 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
3272 ? "f<FP:round>div%.w %2,%0"
3273 : "f<FP:round_mul>div%.w %2,%0";
3276 (define_insn "div<mode>3_floatqi_68881"
3277 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3278 (div:FP (match_operand:FP 1 "general_operand" "0")
3279 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
3283 ? "f<FP:round>div%.b %2,%0"
3284 : "f<FP:round_mul>div%.b %2,%0";
3287 (define_insn "div<mode>3_68881"
3288 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3289 (div:FP (match_operand:FP 1 "general_operand" "0")
3290 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
3293 if (FP_REG_P (operands[2]))
3294 return (TARGET_68040
3295 ? "f<FP:round>div%.x %2,%0"
3296 : "f<FP:round_mul>div%.x %2,%0");
3297 return (TARGET_68040
3298 ? "f<FP:round>div%.<FP:prec> %f2,%0"
3299 : "f<FP:round_mul>div%.<FP:prec> %f2,%0");
3302 (define_insn "div<mode>3_cf"
3303 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3304 (div:FP (match_operand:FP 1 "general_operand" "0")
3305 (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
3306 "TARGET_COLDFIRE_FPU"
3308 if (FP_REG_P (operands[2]))
3309 return "f<FP:prec>div%.d %2,%0";
3310 return "f<FP:prec>div%.<FP:prec> %2,%0";
3312 [(set_attr "type" "fdiv")
3313 (set_attr "opy" "2")])
3315 ;; Remainder instructions.
3317 (define_expand "divmodsi4"
3319 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3320 (div:SI (match_operand:SI 1 "general_operand" "")
3321 (match_operand:SI 2 "general_src_operand" "")))
3322 (set (match_operand:SI 3 "nonimmediate_operand" "")
3323 (mod:SI (match_dup 1) (match_dup 2)))])]
3324 "TARGET_68020 || TARGET_CF_HWDIV"
3328 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3329 (div:SI (match_operand:SI 1 "general_operand" "0")
3330 (match_operand:SI 2 "general_src_operand" "d<Q>U")))
3331 (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
3332 (mod:SI (match_dup 1) (match_dup 2)))]
3335 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3336 return "divs%.l %2,%0";
3337 else if (find_reg_note (insn, REG_UNUSED, operands[0]))
3338 return "rems%.l %2,%3:%0";
3340 return "rems%.l %2,%3:%0\;divs%.l %2,%0";
3342 [(set_attr "type" "div_l")
3343 (set_attr "opy" "2")])
3346 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3347 (div:SI (match_operand:SI 1 "general_operand" "0")
3348 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3349 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3350 (mod:SI (match_dup 1) (match_dup 2)))]
3353 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3354 return "divs%.l %2,%0";
3356 return "divsl%.l %2,%3:%0";
3359 (define_expand "udivmodsi4"
3361 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3362 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3363 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3364 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3365 (umod:SI (match_dup 1) (match_dup 2)))])]
3366 "TARGET_68020 || TARGET_CF_HWDIV"
3370 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3371 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3372 (match_operand:SI 2 "general_src_operand" "d<Q>U")))
3373 (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
3374 (umod:SI (match_dup 1) (match_dup 2)))]
3377 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3378 return "divu%.l %2,%0";
3379 else if (find_reg_note (insn, REG_UNUSED, operands[0]))
3380 return "remu%.l %2,%3:%0";
3382 return "remu%.l %2,%3:%0\;divu%.l %2,%0";
3384 [(set_attr "type" "div_l")
3385 (set_attr "opy" "2")])
3388 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3389 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3390 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3391 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3392 (umod:SI (match_dup 1) (match_dup 2)))]
3393 "TARGET_68020 && !TARGET_COLDFIRE"
3395 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3396 return "divu%.l %2,%0";
3398 return "divul%.l %2,%3:%0";
3401 (define_insn "divmodhi4"
3402 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3403 (div:HI (match_operand:HI 1 "general_operand" "0")
3404 (match_operand:HI 2 "general_src_operand" "dmSKT")))
3405 (set (match_operand:HI 3 "nonimmediate_operand" "=d")
3406 (mod:HI (match_dup 1) (match_dup 2)))]
3407 "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
3409 output_asm_insn (MOTOROLA ?
3410 "ext%.l %0\;divs%.w %2,%0" :
3411 "extl %0\;divs %2,%0",
3413 if (!find_reg_note(insn, REG_UNUSED, operands[3]))
3416 return "move%.l %0,%3\;swap %3";
3422 (define_insn "udivmodhi4"
3423 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3424 (udiv:HI (match_operand:HI 1 "general_operand" "0")
3425 (match_operand:HI 2 "general_src_operand" "dmSKT")))
3426 (set (match_operand:HI 3 "nonimmediate_operand" "=d")
3427 (umod:HI (match_dup 1) (match_dup 2)))]
3428 "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
3430 if (ISA_HAS_MVS_MVZ)
3431 output_asm_insn (MOTOROLA ?
3432 "mvz%.w %0,%0\;divu%.w %2,%0" :
3433 "mvz%.w %0,%0\;divu %2,%0",
3436 output_asm_insn (MOTOROLA ?
3437 "and%.l #0xFFFF,%0\;divu%.w %2,%0" :
3438 "and%.l #0xFFFF,%0\;divu %2,%0",
3441 if (!find_reg_note(insn, REG_UNUSED, operands[3]))
3444 return "move%.l %0,%3\;swap %3";
3450 ;; logical-and instructions
3452 ;; "anddi3" is mainly here to help combine().
3453 (define_insn "anddi3"
3454 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3455 (and:DI (match_operand:DI 1 "general_operand" "%0,0")
3456 (match_operand:DI 2 "general_operand" "dn,don")))]
3460 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3461 if (CONSTANT_P (operands[2]))
3465 split_double (operands[2], &hi, &lo);
3467 switch (INTVAL (hi))
3470 output_asm_insn ("clr%.l %0", operands);
3478 xoperands[0] = operands[0];
3480 output_asm_insn (output_andsi3 (xoperands), xoperands);
3483 if (GET_CODE (operands[0]) == REG)
3484 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3486 operands[0] = adjust_address (operands[0], SImode, 4);
3487 switch (INTVAL (lo))
3490 output_asm_insn ("clr%.l %0", operands);
3498 xoperands[0] = operands[0];
3500 output_asm_insn (output_andsi3 (xoperands), xoperands);
3505 if (GET_CODE (operands[0]) != REG)
3507 operands[1] = adjust_address (operands[0], SImode, 4);
3508 return "and%.l %2,%0\;and%.l %R2,%1";
3510 if (GET_CODE (operands[2]) != REG)
3512 operands[1] = adjust_address (operands[2], SImode, 4);
3513 return "and%.l %2,%0\;and%.l %1,%R0";
3515 return "and%.l %2,%0\;and%.l %R2,%R0";
3518 ;; Prevent AND from being made with sp. This doesn't exist in the machine
3519 ;; and reload will cause inefficient code. Since sp is a FIXED_REG, we
3520 ;; can't allocate pseudos into it.
3522 (define_expand "andsi3"
3523 [(set (match_operand:SI 0 "not_sp_operand" "")
3524 (and:SI (match_operand:SI 1 "general_operand" "")
3525 (match_operand:SI 2 "general_src_operand" "")))]
3529 ;; produced by split operations after reload finished
3530 (define_insn "*andsi3_split"
3531 [(set (match_operand:SI 0 "register_operand" "=d")
3532 (and:SI (match_operand:SI 1 "register_operand" "0")
3533 (match_operand:SI 2 "const_int_operand" "i")))]
3534 "reload_completed && !TARGET_COLDFIRE"
3536 return output_andsi3 (operands);
3539 (define_insn "andsi3_internal"
3540 [(set (match_operand:SI 0 "not_sp_operand" "=m,d")
3541 (and:SI (match_operand:SI 1 "general_operand" "%0,0")
3542 (match_operand:SI 2 "general_src_operand" "dKT,dmSM")))]
3545 return output_andsi3 (operands);
3548 (define_insn "andsi3_5200"
3549 [(set (match_operand:SI 0 "not_sp_operand" "=m,d")
3550 (and:SI (match_operand:SI 1 "general_operand" "%0,0")
3551 (match_operand:SI 2 "general_src_operand" "d,dmsK")))]
3555 && DATA_REG_P (operands[0])
3556 && GET_CODE (operands[2]) == CONST_INT)
3558 if (INTVAL (operands[2]) == 0x000000ff)
3559 return "mvz%.b %0,%0";
3560 else if (INTVAL (operands[2]) == 0x0000ffff)
3561 return "mvz%.w %0,%0";
3563 return output_andsi3 (operands);
3566 (define_insn "andhi3"
3567 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
3568 (and:HI (match_operand:HI 1 "general_operand" "%0,0")
3569 (match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
3574 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3575 (and:HI (match_dup 0)
3576 (match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
3581 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3582 (and:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
3587 (define_insn "andqi3"
3588 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
3589 (and:QI (match_operand:QI 1 "general_operand" "%0,0")
3590 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
3595 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3596 (and:QI (match_dup 0)
3597 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
3602 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3603 (and:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
3608 ;; inclusive-or instructions
3610 (define_insn "iordi_zext"
3611 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3612 (ior:DI (zero_extend:DI (match_operand 1 "general_operand" "dn,dmn"))
3613 (match_operand:DI 2 "general_operand" "0,0")))]
3619 if (GET_CODE (operands[0]) == REG)
3620 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3622 operands[0] = adjust_address (operands[0], SImode, 4);
3623 if (GET_MODE (operands[1]) == SImode)
3624 return "or%.l %1,%0";
3625 byte_mode = (GET_MODE (operands[1]) == QImode);
3626 if (GET_CODE (operands[0]) == MEM)
3627 operands[0] = adjust_address (operands[0], byte_mode ? QImode : HImode,
3630 return "or%.b %1,%0";
3632 return "or%.w %1,%0";
3635 ;; "iordi3" is mainly here to help combine().
3636 (define_insn "iordi3"
3637 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3638 (ior:DI (match_operand:DI 1 "general_operand" "%0,0")
3639 (match_operand:DI 2 "general_operand" "dn,don")))]
3643 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3644 if (CONSTANT_P (operands[2]))
3648 split_double (operands[2], &hi, &lo);
3650 switch (INTVAL (hi))
3655 /* FIXME : a scratch register would be welcome here if operand[0]
3656 is not a register */
3657 output_asm_insn ("move%.l #-1,%0", operands);
3663 xoperands[0] = operands[0];
3665 output_asm_insn (output_iorsi3 (xoperands), xoperands);
3668 if (GET_CODE (operands[0]) == REG)
3669 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3671 operands[0] = adjust_address (operands[0], SImode, 4);
3672 switch (INTVAL (lo))
3677 /* FIXME : a scratch register would be welcome here if operand[0]
3678 is not a register */
3679 output_asm_insn ("move%.l #-1,%0", operands);
3685 xoperands[0] = operands[0];
3687 output_asm_insn (output_iorsi3 (xoperands), xoperands);
3692 if (GET_CODE (operands[0]) != REG)
3694 operands[1] = adjust_address (operands[0], SImode, 4);
3695 return "or%.l %2,%0\;or%.l %R2,%1";
3697 if (GET_CODE (operands[2]) != REG)
3699 operands[1] = adjust_address (operands[2], SImode, 4);
3700 return "or%.l %2,%0\;or%.l %1,%R0";
3702 return "or%.l %2,%0\;or%.l %R2,%R0";
3705 (define_expand "iorsi3"
3706 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3707 (ior:SI (match_operand:SI 1 "general_operand" "")
3708 (match_operand:SI 2 "general_src_operand" "")))]
3712 (define_insn "iorsi3_internal"
3713 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
3714 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
3715 (match_operand:SI 2 "general_src_operand" "dKT,dmSMT")))]
3718 return output_iorsi3 (operands);
3721 (define_insn "iorsi3_5200"
3722 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
3723 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
3724 (match_operand:SI 2 "general_src_operand" "d,dmsK")))]
3727 return output_iorsi3 (operands);
3730 (define_insn "iorhi3"
3731 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
3732 (ior:HI (match_operand:HI 1 "general_operand" "%0,0")
3733 (match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
3738 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3739 (ior:HI (match_dup 0)
3740 (match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
3745 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3746 (ior:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
3751 (define_insn "iorqi3"
3752 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
3753 (ior:QI (match_operand:QI 1 "general_operand" "%0,0")
3754 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
3759 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3760 (ior:QI (match_dup 0)
3761 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
3766 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3767 (ior:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
3772 ;; On all 68k models, this makes faster code in a special case.
3773 ;; See also ashlsi_16, ashrsi_16 and lshrsi_16.
3775 (define_insn "iorsi_zexthi_ashl16"
3776 [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
3777 (ior:SI (zero_extend:SI (match_operand:HI 1 "general_operand" "rmn"))
3778 (ashift:SI (match_operand:SI 2 "general_operand" "or")
3783 if (GET_CODE (operands[2]) != REG)
3784 operands[2] = adjust_address (operands[2], HImode, 2);
3785 if (GET_CODE (operands[2]) != REG
3786 || REGNO (operands[2]) != REGNO (operands[0]))
3787 output_asm_insn ("move%.w %2,%0", operands);
3788 return "swap %0\;mov%.w %1,%0";
3791 (define_insn "iorsi_zext"
3792 [(set (match_operand:SI 0 "nonimmediate_operand" "=o,d")
3793 (ior:SI (zero_extend:SI (match_operand 1 "general_operand" "dn,dmn"))
3794 (match_operand:SI 2 "general_operand" "0,0")))]
3800 byte_mode = (GET_MODE (operands[1]) == QImode);
3801 if (GET_CODE (operands[0]) == MEM)
3802 operands[0] = adjust_address (operands[0], byte_mode ? QImode : HImode,
3805 return "or%.b %1,%0";
3807 return "or%.w %1,%0";
3812 ;; "xordi3" is mainly here to help combine().
3813 (define_insn "xordi3"
3814 [(set (match_operand:DI 0 "nonimmediate_operand" "=od")
3815 (xor:DI (match_operand:DI 1 "general_operand" "%0")
3816 (match_operand:DI 2 "general_operand" "dn")))]
3820 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3822 if (CONSTANT_P (operands[2]))
3826 split_double (operands[2], &hi, &lo);
3828 switch (INTVAL (hi))
3833 output_asm_insn ("not%.l %0", operands);
3836 /* FIXME : a scratch register would be welcome here if
3837 -128 <= INTVAL (hi) < -1 */
3841 xoperands[0] = operands[0];
3843 output_asm_insn (output_xorsi3 (xoperands), xoperands);
3846 if (GET_CODE (operands[0]) == REG)
3847 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3849 operands[0] = adjust_address (operands[0], SImode, 4);
3850 switch (INTVAL (lo))
3855 output_asm_insn ("not%.l %0", operands);
3858 /* FIXME : a scratch register would be welcome here if
3859 -128 <= INTVAL (lo) < -1 */
3861 /* FIXME : this should be merged with xorsi3 */
3865 xoperands[0] = operands[0];
3867 output_asm_insn (output_xorsi3 (xoperands), xoperands);
3872 if (GET_CODE (operands[0]) != REG)
3874 operands[1] = adjust_address (operands[0], SImode, 4);
3875 return "eor%.l %2,%0\;eor%.l %R2,%1";
3877 if (GET_CODE (operands[2]) != REG)
3879 operands[1] = adjust_address (operands[2], SImode, 4);
3880 return "eor%.l %2,%0\;eor%.l %1,%R0";
3882 return "eor%.l %2,%0\;eor%.l %R2,%R0";
3885 (define_expand "xorsi3"
3886 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3887 (xor:SI (match_operand:SI 1 "general_operand" "")
3888 (match_operand:SI 2 "general_operand" "")))]
3892 (define_insn "xorsi3_internal"
3893 [(set (match_operand:SI 0 "nonimmediate_operand" "=do,m")
3894 (xor:SI (match_operand:SI 1 "general_operand" "%0,0")
3895 (match_operand:SI 2 "general_operand" "di,dKT")))]
3899 return output_xorsi3 (operands);
3902 (define_insn "xorsi3_5200"
3903 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm,d")
3904 (xor:SI (match_operand:SI 1 "general_operand" "%0,0")
3905 (match_operand:SI 2 "general_operand" "d,Ks")))]
3908 return output_xorsi3 (operands);
3911 (define_insn "xorhi3"
3912 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
3913 (xor:HI (match_operand:HI 1 "general_operand" "%0")
3914 (match_operand:HI 2 "general_operand" "dn")))]
3919 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3920 (xor:HI (match_dup 0)
3921 (match_operand:HI 1 "general_operand" "dn")))]
3926 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3927 (xor:HI (match_operand:HI 1 "general_operand" "dn")
3932 (define_insn "xorqi3"
3933 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
3934 (xor:QI (match_operand:QI 1 "general_operand" "%0")
3935 (match_operand:QI 2 "general_operand" "dn")))]
3940 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3941 (xor:QI (match_dup 0)
3942 (match_operand:QI 1 "general_operand" "dn")))]
3947 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3948 (xor:QI (match_operand:QI 1 "general_operand" "dn")
3953 ;; negation instructions
3955 (define_expand "negdi2"
3956 [(set (match_operand:DI 0 "nonimmediate_operand" "")
3957 (neg:DI (match_operand:DI 1 "general_operand" "")))]
3960 if (TARGET_COLDFIRE)
3961 emit_insn (gen_negdi2_5200 (operands[0], operands[1]));
3963 emit_insn (gen_negdi2_internal (operands[0], operands[1]));
3967 (define_insn "negdi2_internal"
3968 [(set (match_operand:DI 0 "nonimmediate_operand" "=<,do,!*a")
3969 (neg:DI (match_operand:DI 1 "general_operand" "0,0,0")))]
3972 if (which_alternative == 0)
3973 return "neg%.l %0\;negx%.l %0";
3974 if (GET_CODE (operands[0]) == REG)
3975 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3977 operands[1] = adjust_address (operands[0], SImode, 4);
3978 if (ADDRESS_REG_P (operands[0]))
3979 return "exg %/d0,%1\;neg%.l %/d0\;exg %/d0,%1\;exg %/d0,%0\;negx%.l %/d0\;exg %/d0,%0";
3981 return "neg%.l %1\;negx%.l %0";
3984 (define_insn "negdi2_5200"
3985 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
3986 (neg:DI (match_operand:DI 1 "general_operand" "0")))]
3989 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3990 return "neg%.l %1\;negx%.l %0";
3993 (define_expand "negsi2"
3994 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3995 (neg:SI (match_operand:SI 1 "general_operand" "")))]
3998 if (TARGET_COLDFIRE)
3999 emit_insn (gen_negsi2_5200 (operands[0], operands[1]));
4001 emit_insn (gen_negsi2_internal (operands[0], operands[1]));
4005 (define_insn "negsi2_internal"
4006 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
4007 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
4010 [(set_attr "type" "neg_l")])
4012 (define_insn "negsi2_5200"
4013 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
4014 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
4017 [(set_attr "type" "neg_l")])
4019 (define_insn "neghi2"
4020 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
4021 (neg:HI (match_operand:HI 1 "general_operand" "0")))]
4026 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
4027 (neg:HI (match_dup 0)))]
4031 (define_insn "negqi2"
4032 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
4033 (neg:QI (match_operand:QI 1 "general_operand" "0")))]
4038 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
4039 (neg:QI (match_dup 0)))]
4043 ;; If using software floating point, just flip the sign bit.
4045 (define_expand "negsf2"
4046 [(set (match_operand:SF 0 "nonimmediate_operand" "")
4047 (neg:SF (match_operand:SF 1 "general_operand" "")))]
4050 if (!TARGET_HARD_FLOAT)
4055 target = operand_subword_force (operands[0], 0, SFmode);
4056 result = expand_binop (SImode, xor_optab,
4057 operand_subword_force (operands[1], 0, SFmode),
4058 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
4059 gcc_assert (result);
4061 if (result != target)
4062 emit_move_insn (result, target);
4064 /* Make a place for REG_EQUAL. */
4065 emit_move_insn (operands[0], operands[0]);
4070 (define_expand "negdf2"
4071 [(set (match_operand:DF 0 "nonimmediate_operand" "")
4072 (neg:DF (match_operand:DF 1 "general_operand" "")))]
4075 if (!TARGET_HARD_FLOAT)
4082 target = operand_subword (operands[0], 0, 1, DFmode);
4083 result = expand_binop (SImode, xor_optab,
4084 operand_subword_force (operands[1], 0, DFmode),
4085 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
4086 gcc_assert (result);
4088 if (result != target)
4089 emit_move_insn (result, target);
4091 emit_move_insn (operand_subword (operands[0], 1, 1, DFmode),
4092 operand_subword_force (operands[1], 1, DFmode));
4094 insns = get_insns ();
4102 (define_expand "negxf2"
4103 [(set (match_operand:XF 0 "nonimmediate_operand" "")
4104 (neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
4114 target = operand_subword (operands[0], 0, 1, XFmode);
4115 result = expand_binop (SImode, xor_optab,
4116 operand_subword_force (operands[1], 0, XFmode),
4117 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
4118 gcc_assert (result);
4120 if (result != target)
4121 emit_move_insn (result, target);
4123 emit_move_insn (operand_subword (operands[0], 1, 1, XFmode),
4124 operand_subword_force (operands[1], 1, XFmode));
4125 emit_move_insn (operand_subword (operands[0], 2, 1, XFmode),
4126 operand_subword_force (operands[1], 2, XFmode));
4128 insns = get_insns ();
4136 (define_insn "neg<mode>2_68881"
4137 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4138 (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,0")))]
4141 if (DATA_REG_P (operands[0]))
4143 operands[1] = GEN_INT (31);
4144 return "bchg %1,%0";
4146 if (FP_REG_P (operands[1]))
4147 return "f<FP:round>neg%.x %1,%0";
4148 return "f<FP:round>neg%.<FP:prec> %f1,%0";
4151 (define_insn "neg<mode>2_cf"
4152 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4153 (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
4154 "TARGET_COLDFIRE_FPU"
4156 if (DATA_REG_P (operands[0]))
4158 operands[1] = GEN_INT (31);
4159 return "bchg %1,%0";
4161 if (FP_REG_P (operands[1]))
4162 return "f<FP:prec>neg%.d %1,%0";
4163 return "f<FP:prec>neg%.<FP:prec> %1,%0";
4166 ;; Sqrt instruction for the 68881
4168 (define_expand "sqrt<mode>2"
4169 [(set (match_operand:FP 0 "nonimmediate_operand" "")
4170 (sqrt:FP (match_operand:FP 1 "general_operand" "")))]
4174 (define_insn "sqrt<mode>2_68881"
4175 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
4176 (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
4179 if (FP_REG_P (operands[1]))
4180 return "f<FP:round>sqrt%.x %1,%0";
4181 return "f<FP:round>sqrt%.<FP:prec> %1,%0";
4183 [(set_attr "type" "fsqrt")])
4185 (define_insn "sqrt<mode>2_cf"
4186 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
4187 (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
4188 "TARGET_COLDFIRE_FPU"
4190 if (FP_REG_P (operands[1]))
4191 return "f<FP:prec>sqrt%.d %1,%0";
4192 return "f<FP:prec>sqrt%.<FP:prec> %1,%0";
4194 [(set_attr "type" "fsqrt")])
4195 ;; Absolute value instructions
4196 ;; If using software floating point, just zero the sign bit.
4198 (define_expand "abssf2"
4199 [(set (match_operand:SF 0 "nonimmediate_operand" "")
4200 (abs:SF (match_operand:SF 1 "general_operand" "")))]
4203 if (!TARGET_HARD_FLOAT)
4208 target = operand_subword_force (operands[0], 0, SFmode);
4209 result = expand_binop (SImode, and_optab,
4210 operand_subword_force (operands[1], 0, SFmode),
4211 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
4212 gcc_assert (result);
4214 if (result != target)
4215 emit_move_insn (result, target);
4217 /* Make a place for REG_EQUAL. */
4218 emit_move_insn (operands[0], operands[0]);
4223 (define_expand "absdf2"
4224 [(set (match_operand:DF 0 "nonimmediate_operand" "")
4225 (abs:DF (match_operand:DF 1 "general_operand" "")))]
4228 if (!TARGET_HARD_FLOAT)
4235 target = operand_subword (operands[0], 0, 1, DFmode);
4236 result = expand_binop (SImode, and_optab,
4237 operand_subword_force (operands[1], 0, DFmode),
4238 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
4239 gcc_assert (result);
4241 if (result != target)
4242 emit_move_insn (result, target);
4244 emit_move_insn (operand_subword (operands[0], 1, 1, DFmode),
4245 operand_subword_force (operands[1], 1, DFmode));
4247 insns = get_insns ();
4255 (define_expand "absxf2"
4256 [(set (match_operand:XF 0 "nonimmediate_operand" "")
4257 (abs:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
4267 target = operand_subword (operands[0], 0, 1, XFmode);
4268 result = expand_binop (SImode, and_optab,
4269 operand_subword_force (operands[1], 0, XFmode),
4270 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
4271 gcc_assert (result);
4273 if (result != target)
4274 emit_move_insn (result, target);
4276 emit_move_insn (operand_subword (operands[0], 1, 1, XFmode),
4277 operand_subword_force (operands[1], 1, XFmode));
4278 emit_move_insn (operand_subword (operands[0], 2, 1, XFmode),
4279 operand_subword_force (operands[1], 2, XFmode));
4281 insns = get_insns ();
4289 (define_insn "abs<mode>2_68881"
4290 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4291 (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,0")))]
4294 if (DATA_REG_P (operands[0]))
4296 operands[1] = GEN_INT (31);
4297 return "bclr %1,%0";
4299 if (FP_REG_P (operands[1]))
4300 return "f<FP:round>abs%.x %1,%0";
4301 return "f<FP:round>abs%.<FP:prec> %f1,%0";
4304 (define_insn "abs<mode>2_cf"
4305 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4306 (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
4307 "TARGET_COLDFIRE_FPU"
4309 if (DATA_REG_P (operands[0]))
4311 operands[1] = GEN_INT (31);
4312 return "bclr %1,%0";
4314 if (FP_REG_P (operands[1]))
4315 return "f<FP:prec>abs%.d %1,%0";
4316 return "f<FP:prec>abs%.<FP:prec> %1,%0";
4318 [(set_attr "type" "bitrw,fneg")])
4320 ;; bit indexing instructions
4322 ;; ColdFire ff1 instruction implements clz.
4323 (define_insn "clzsi2"
4324 [(set (match_operand:SI 0 "register_operand" "=d")
4325 (clz:SI (match_operand:SI 1 "register_operand" "0")))]
4328 [(set_attr "type" "ext")])
4330 ;; one complement instructions
4332 ;; "one_cmpldi2" is mainly here to help combine().
4333 (define_insn "one_cmpldi2"
4334 [(set (match_operand:DI 0 "nonimmediate_operand" "=dm")
4335 (not:DI (match_operand:DI 1 "general_operand" "0")))]
4339 if (GET_CODE (operands[0]) == REG)
4340 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4341 else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC
4342 || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
4343 operands[1] = operands[0];
4345 operands[1] = adjust_address (operands[0], SImode, 4);
4346 return "not%.l %1\;not%.l %0";
4349 (define_expand "one_cmplsi2"
4350 [(set (match_operand:SI 0 "nonimmediate_operand" "")
4351 (not:SI (match_operand:SI 1 "general_operand" "")))]
4354 if (TARGET_COLDFIRE)
4355 emit_insn (gen_one_cmplsi2_5200 (operands[0], operands[1]));
4357 emit_insn (gen_one_cmplsi2_internal (operands[0], operands[1]));
4361 (define_insn "one_cmplsi2_internal"
4362 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
4363 (not:SI (match_operand:SI 1 "general_operand" "0")))]
4367 (define_insn "one_cmplsi2_5200"
4368 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
4369 (not:SI (match_operand:SI 1 "general_operand" "0")))]
4372 [(set_attr "type" "neg_l")])
4374 (define_insn "one_cmplhi2"
4375 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
4376 (not:HI (match_operand:HI 1 "general_operand" "0")))]
4381 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
4382 (not:HI (match_dup 0)))]
4386 (define_insn "one_cmplqi2"
4387 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
4388 (not:QI (match_operand:QI 1 "general_operand" "0")))]
4393 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
4394 (not:QI (match_dup 0)))]
4398 ;; arithmetic shift instructions
4399 ;; We don't need the shift memory by 1 bit instruction
4401 (define_insn "ashldi_extsi"
4402 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro")
4404 (match_operator:DI 2 "extend_operator"
4405 [(match_operand:SI 1 "general_operand" "rm")])
4410 if (GET_CODE (operands[0]) == REG)
4411 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4413 operands[2] = adjust_address (operands[0], SImode, 4);
4414 if (ADDRESS_REG_P (operands[0]))
4415 return "move%.l %1,%0\;sub%.l %2,%2";
4417 return "move%.l %1,%0\;clr%.l %2";
4420 (define_insn "ashldi_sexthi"
4421 [(set (match_operand:DI 0 "nonimmediate_operand" "=m,a*d")
4422 (ashift:DI (sign_extend:DI (match_operand:HI 1 "general_operand" "rm,rm"))
4424 (clobber (match_scratch:SI 2 "=a,X"))]
4428 if (GET_CODE (operands[0]) == MEM)
4430 if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
4431 return "clr%.l %0\;move%.w %1,%2\;move%.l %2,%0";
4432 else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
4433 return "move%.w %1,%2\;move%.l %2,%0\;clr%.l %0";
4436 operands[3] = adjust_address (operands[0], SImode, 4);
4437 return "move%.w %1,%2\;move%.l %2,%0\;clr%.l %3";
4440 else if (DATA_REG_P (operands[0]))
4441 return "move%.w %1,%0\;ext%.l %0\;clr%.l %R0";
4443 return "move%.w %1,%0\;sub%.l %R0,%R0";
4446 (define_insn "*ashldi3_const1"
4447 [(set (match_operand:DI 0 "register_operand" "=d")
4448 (ashift:DI (match_operand:DI 1 "register_operand" "0")
4451 "add%.l %R0,%R0\;addx%.l %0,%0")
4454 [(set (match_operand:DI 0 "register_operand" "")
4455 (ashift:DI (match_operand:DI 1 "register_operand" "")
4457 "reload_completed && !TARGET_COLDFIRE"
4459 (ashift:DI (match_dup 1) (const_int 1)))
4461 (ashift:DI (match_dup 0) (const_int 1)))]
4465 [(set (match_operand:DI 0 "register_operand" "")
4466 (ashift:DI (match_operand:DI 1 "register_operand" "")
4468 "reload_completed && !TARGET_COLDFIRE"
4470 (ashift:DI (match_dup 1) (const_int 2)))
4472 (ashift:DI (match_dup 0) (const_int 1)))]
4476 [(set (match_operand:DI 0 "register_operand" "")
4477 (ashift:DI (match_operand:DI 1 "register_operand" "")
4479 "reload_completed && !TARGET_COLDFIRE"
4481 (rotate:SI (match_dup 2) (const_int 8)))
4483 (rotate:SI (match_dup 3) (const_int 8)))
4484 (set (strict_low_part (subreg:QI (match_dup 0) 3))
4485 (subreg:QI (match_dup 0) 7))
4486 (set (strict_low_part (subreg:QI (match_dup 0) 7))
4489 operands[2] = gen_highpart (SImode, operands[0]);
4490 operands[3] = gen_lowpart (SImode, operands[0]);
4494 [(set (match_operand:DI 0 "register_operand" "")
4495 (ashift:DI (match_operand:DI 1 "register_operand" "")
4497 "reload_completed && !TARGET_COLDFIRE"
4499 (rotate:SI (match_dup 2) (const_int 16)))
4501 (rotate:SI (match_dup 3) (const_int 16)))
4502 (set (strict_low_part (subreg:HI (match_dup 0) 2))
4503 (subreg:HI (match_dup 0) 6))
4504 (set (strict_low_part (subreg:HI (match_dup 0) 6))
4507 operands[2] = gen_highpart (SImode, operands[0]);
4508 operands[3] = gen_lowpart (SImode, operands[0]);
4512 [(set (match_operand:DI 0 "pre_dec_operand" "")
4513 (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "")
4516 [(set (match_dup 0) (const_int 0))
4517 (set (match_dup 0) (match_dup 1))]
4519 operands[0] = adjust_address(operands[0], SImode, 0);
4520 operands[1] = gen_lowpart(SImode, operands[1]);
4524 [(set (match_operand:DI 0 "post_inc_operand" "")
4525 (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "")
4528 [(set (match_dup 0) (match_dup 1))
4529 (set (match_dup 0) (const_int 0))]
4531 operands[0] = adjust_address(operands[0], SImode, 0);
4532 operands[1] = gen_lowpart(SImode, operands[1]);
4535 (define_insn_and_split "*ashldi3_const32"
4536 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro<>")
4537 (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "ro")
4541 "&& reload_completed"
4542 [(set (match_dup 4) (match_dup 3))
4543 (set (match_dup 2) (const_int 0))]
4544 "split_di(operands, 2, operands + 2, operands + 4);")
4547 [(set (match_operand:DI 0 "register_operand" "")
4548 (ashift:DI (match_operand:DI 1 "register_operand" "")
4549 (match_operand 2 "const_int_operand" "")))]
4550 "reload_completed && !TARGET_COLDFIRE
4551 && INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 40"
4552 [(set (match_dup 4) (ashift:SI (match_dup 4) (match_dup 2)))
4553 (set (match_dup 3) (match_dup 4))
4554 (set (match_dup 4) (const_int 0))]
4556 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
4557 operands[3] = gen_highpart (SImode, operands[0]);
4558 operands[4] = gen_lowpart (SImode, operands[0]);
4562 [(set (match_operand:DI 0 "register_operand" "")
4563 (ashift:DI (match_operand:DI 1 "register_operand" "")
4565 "reload_completed && !TARGET_COLDFIRE"
4566 [(set (match_dup 2) (match_dup 3))
4568 (rotate:SI (match_dup 2) (const_int 16)))
4569 (set (match_dup 3) (const_int 0))
4570 (set (strict_low_part (subreg:HI (match_dup 0) 2))
4573 operands[2] = gen_highpart (SImode, operands[0]);
4574 operands[3] = gen_lowpart (SImode, operands[0]);
4578 [(set (match_operand:DI 0 "register_operand" "")
4579 (ashift:DI (match_operand:DI 1 "register_operand" "")
4580 (match_operand 2 "const_int_operand" "")))]
4581 "reload_completed && !TARGET_COLDFIRE
4582 && INTVAL (operands[2]) > 40 && INTVAL (operands[2]) <= 63"
4583 [(set (match_dup 3) (match_dup 2))
4584 (set (match_dup 4) (ashift:SI (match_dup 4) (match_dup 3)))
4585 (set (match_dup 3) (match_dup 4))
4586 (set (match_dup 4) (const_int 0))]
4588 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
4589 operands[3] = gen_highpart (SImode, operands[0]);
4590 operands[4] = gen_lowpart (SImode, operands[0]);
4593 (define_insn "*ashldi3"
4594 [(set (match_operand:DI 0 "register_operand" "=d")
4595 (ashift:DI (match_operand:DI 1 "register_operand" "0")
4596 (match_operand 2 "const_int_operand" "n")))]
4598 && ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
4599 || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
4600 || (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
4603 (define_expand "ashldi3"
4604 [(set (match_operand:DI 0 "register_operand" "")
4605 (ashift:DI (match_operand:DI 1 "register_operand" "")
4606 (match_operand 2 "const_int_operand" "")))]
4609 /* ??? This is a named pattern like this is not allowed to FAIL based
4611 if (GET_CODE (operands[2]) != CONST_INT
4612 || ((INTVAL (operands[2]) < 1 || INTVAL (operands[2]) > 3)
4613 && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
4614 && (INTVAL (operands[2]) < 32 || INTVAL (operands[2]) > 63)))
4618 ;; On most 68k models, this makes faster code in a special case.
4620 (define_insn "ashlsi_16"
4621 [(set (match_operand:SI 0 "register_operand" "=d")
4622 (ashift:SI (match_operand:SI 1 "register_operand" "0")
4627 return "swap %0\;clr%.w %0";
4630 ;; ashift patterns : use lsl instead of asl, because lsl always clears the
4631 ;; overflow bit, so we must not set CC_NO_OVERFLOW.
4633 ;; On the 68000, this makes faster code in a special case.
4635 (define_insn "ashlsi_17_24"
4636 [(set (match_operand:SI 0 "register_operand" "=d")
4637 (ashift:SI (match_operand:SI 1 "register_operand" "0")
4638 (match_operand:SI 2 "const_int_operand" "n")))]
4640 && INTVAL (operands[2]) > 16
4641 && INTVAL (operands[2]) <= 24"
4645 operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
4646 return "lsl%.w %2,%0\;swap %0\;clr%.w %0";
4649 (define_insn "ashlsi3"
4650 [(set (match_operand:SI 0 "register_operand" "=d")
4651 (ashift:SI (match_operand:SI 1 "register_operand" "0")
4652 (match_operand:SI 2 "general_operand" "dI")))]
4655 if (operands[2] == const1_rtx)
4657 cc_status.flags = CC_NO_OVERFLOW;
4658 return "add%.l %0,%0";
4660 return "lsl%.l %2,%0";
4663 (define_insn "ashlhi3"
4664 [(set (match_operand:HI 0 "register_operand" "=d")
4665 (ashift:HI (match_operand:HI 1 "register_operand" "0")
4666 (match_operand:HI 2 "general_operand" "dI")))]
4671 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
4672 (ashift:HI (match_dup 0)
4673 (match_operand:HI 1 "general_operand" "dI")))]
4677 (define_insn "ashlqi3"
4678 [(set (match_operand:QI 0 "register_operand" "=d")
4679 (ashift:QI (match_operand:QI 1 "register_operand" "0")
4680 (match_operand:QI 2 "general_operand" "dI")))]
4685 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
4686 (ashift:QI (match_dup 0)
4687 (match_operand:QI 1 "general_operand" "dI")))]
4691 ;; On most 68k models, this makes faster code in a special case.
4693 (define_insn "ashrsi_16"
4694 [(set (match_operand:SI 0 "register_operand" "=d")
4695 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4698 "swap %0\;ext%.l %0")
4700 ;; On the 68000, this makes faster code in a special case.
4703 [(set (match_operand:SI 0 "register_operand" "=d")
4704 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4705 (match_operand:SI 2 "const_int_operand" "n")))]
4707 && INTVAL (operands[2]) > 16
4708 && INTVAL (operands[2]) <= 24"
4710 operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
4711 return "swap %0\;asr%.w %2,%0\;ext%.l %0";
4714 (define_insn "subreghi1ashrdi_const32"
4715 [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
4716 (subreg:HI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
4717 (const_int 32)) 6))]
4720 if (GET_CODE (operands[1]) != REG)
4721 operands[1] = adjust_address (operands[1], HImode, 2);
4722 return "move%.w %1,%0";
4724 [(set_attr "type" "move")])
4726 (define_insn "subregsi1ashrdi_const32"
4727 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
4728 (subreg:SI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
4729 (const_int 32)) 4))]
4732 return "move%.l %1,%0";
4734 [(set_attr "type" "move_l")])
4736 (define_insn "*ashrdi3_const1"
4737 [(set (match_operand:DI 0 "register_operand" "=d")
4738 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
4742 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4743 return "asr%.l #1,%0\;roxr%.l #1,%1";
4747 [(set (match_operand:DI 0 "register_operand" "")
4748 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4750 "reload_completed && !TARGET_COLDFIRE"
4752 (ashiftrt:DI (match_dup 1) (const_int 1)))
4754 (ashiftrt:DI (match_dup 0) (const_int 1)))]
4758 [(set (match_operand:DI 0 "register_operand" "")
4759 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4761 "reload_completed && !TARGET_COLDFIRE"
4763 (ashiftrt:DI (match_dup 1) (const_int 2)))
4765 (ashiftrt:DI (match_dup 0) (const_int 1)))]
4769 [(set (match_operand:DI 0 "register_operand" "")
4770 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4772 "reload_completed && !TARGET_COLDFIRE"
4773 [(set (strict_low_part (subreg:QI (match_dup 0) 7))
4774 (subreg:QI (match_dup 0) 3))
4776 (ashiftrt:SI (match_dup 2) (const_int 8)))
4778 (rotatert:SI (match_dup 3) (const_int 8)))]
4780 operands[2] = gen_highpart (SImode, operands[0]);
4781 operands[3] = gen_lowpart (SImode, operands[0]);
4785 [(set (match_operand:DI 0 "register_operand" "")
4786 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4788 "reload_completed && !TARGET_COLDFIRE"
4789 [(set (strict_low_part (subreg:HI (match_dup 0) 6))
4790 (subreg:HI (match_dup 0) 2))
4792 (rotate:SI (match_dup 2) (const_int 16)))
4794 (rotate:SI (match_dup 3) (const_int 16)))
4796 (sign_extend:SI (subreg:HI (match_dup 2) 2)))]
4798 operands[2] = gen_highpart (SImode, operands[0]);
4799 operands[3] = gen_lowpart (SImode, operands[0]);
4802 (define_insn "*ashrdi_const32"
4803 [(set (match_operand:DI 0 "register_operand" "=d")
4804 (ashiftrt:DI (match_operand:DI 1 "nonimmediate_src_operand" "ro")
4810 return "move%.l %1,%R0\;smi %0\;extb%.l %0";
4812 return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
4815 (define_insn "*ashrdi_const32_mem"
4816 [(set (match_operand:DI 0 "memory_operand" "=o,<")
4817 (ashiftrt:DI (match_operand:DI 1 "nonimmediate_src_operand" "ro,ro")
4819 (clobber (match_scratch:SI 2 "=d,d"))]
4823 operands[3] = adjust_address (operands[0], SImode,
4824 which_alternative == 0 ? 4 : 0);
4825 operands[0] = adjust_address (operands[0], SImode, 0);
4826 if (TARGET_68020 || TARGET_COLDFIRE)
4827 return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
4829 return "move%.l %1,%3\;smi %2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0";
4833 [(set (match_operand:DI 0 "register_operand" "")
4834 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4836 "reload_completed && !TARGET_COLDFIRE"
4838 (ashiftrt:SI (match_dup 3) (const_int 31)))
4841 "split_di(operands, 1, operands + 2, operands + 3);")
4843 ;; The predicate below must be general_operand, because ashrdi3 allows that
4844 (define_insn "ashrdi_const"
4845 [(set (match_operand:DI 0 "register_operand" "=d")
4846 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
4847 (match_operand 2 "const_int_operand" "n")))]
4849 && ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
4850 || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
4851 || INTVAL (operands[2]) == 31
4852 || (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
4854 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4856 if (INTVAL (operands[2]) == 48)
4857 return "swap %0\;ext%.l %0\;move%.l %0,%1\;smi %0\;ext%.w %0";
4858 if (INTVAL (operands[2]) == 31)
4859 return "add%.l %1,%1\;addx%.l %0,%0\;move%.l %0,%1\;subx%.l %0,%0";
4860 if (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63)
4862 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
4863 output_asm_insn (INTVAL (operands[2]) <= 8 ? "asr%.l %2,%0" :
4864 "moveq %2,%1\;asr%.l %1,%0", operands);
4865 output_asm_insn ("mov%.l %0,%1\;smi %0", operands);
4866 return INTVAL (operands[2]) >= 15 ? "ext%.w %d0" :
4867 TARGET_68020 ? "extb%.l %0" : "ext%.w %0\;ext%.l %0";
4872 (define_expand "ashrdi3"
4873 [(set (match_operand:DI 0 "register_operand" "")
4874 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4875 (match_operand 2 "const_int_operand" "")))]
4878 /* ??? This is a named pattern like this is not allowed to FAIL based
4880 if (GET_CODE (operands[2]) != CONST_INT
4881 || ((INTVAL (operands[2]) < 1 || INTVAL (operands[2]) > 3)
4882 && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
4883 && (INTVAL (operands[2]) < 31 || INTVAL (operands[2]) > 63)))
4887 ;; On all 68k models, this makes faster code in a special case.
4889 (define_insn "ashrsi_31"
4890 [(set (match_operand:SI 0 "register_operand" "=d")
4891 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4895 return "add%.l %0,%0\;subx%.l %0,%0";
4898 (define_insn "ashrsi3"
4899 [(set (match_operand:SI 0 "register_operand" "=d")
4900 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4901 (match_operand:SI 2 "general_operand" "dI")))]
4904 [(set_attr "type" "shift")
4905 (set_attr "opy" "2")])
4907 (define_insn "ashrhi3"
4908 [(set (match_operand:HI 0 "register_operand" "=d")
4909 (ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
4910 (match_operand:HI 2 "general_operand" "dI")))]
4915 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
4916 (ashiftrt:HI (match_dup 0)
4917 (match_operand:HI 1 "general_operand" "dI")))]
4921 (define_insn "ashrqi3"
4922 [(set (match_operand:QI 0 "register_operand" "=d")
4923 (ashiftrt:QI (match_operand:QI 1 "register_operand" "0")
4924 (match_operand:QI 2 "general_operand" "dI")))]
4929 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
4930 (ashiftrt:QI (match_dup 0)
4931 (match_operand:QI 1 "general_operand" "dI")))]
4935 ;; logical shift instructions
4937 ;; commented out because of reload problems in 950612-1.c
4940 ;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro")
4941 ;; (const_int 32)) 4))
4942 ;; (set (match_operand:SI 1 "nonimmediate_operand" "=dm")
4943 ;; (subreg:SI (lshiftrt:DI (match_dup 0)
4944 ;; (const_int 32)) 4))]
4947 ;; return "move%.l %0,%1";
4952 ;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro")
4953 ;; (const_int 32)) 0))
4954 ;; (set (match_operand:DI 1 "nonimmediate_operand" "=do")
4955 ;; (lshiftrt:DI (match_dup 0)
4956 ;; (const_int 32)))]
4959 ;; if (GET_CODE (operands[1]) == REG)
4960 ;; operands[2] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
4962 ;; operands[2] = adjust_address (operands[1], SImode, 4);
4963 ;; return "move%.l %0,%2\;clr%.l %1";
4966 (define_insn "subreg1lshrdi_const32"
4967 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
4968 (subreg:SI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
4969 (const_int 32)) 4))]
4972 [(set_attr "type" "move_l")])
4974 (define_insn "*lshrdi3_const1"
4975 [(set (match_operand:DI 0 "register_operand" "=d")
4976 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
4979 "lsr%.l #1,%0\;roxr%.l #1,%R0")
4982 [(set (match_operand:DI 0 "register_operand" "")
4983 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
4985 "reload_completed && !TARGET_COLDFIRE"
4987 (lshiftrt:DI (match_dup 1) (const_int 1)))
4989 (lshiftrt:DI (match_dup 0) (const_int 1)))]
4993 [(set (match_operand:DI 0 "register_operand" "")
4994 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
4996 "reload_completed && !TARGET_COLDFIRE"
4998 (lshiftrt:DI (match_dup 1) (const_int 2)))
5000 (lshiftrt:DI (match_dup 0) (const_int 1)))]
5004 [(set (match_operand:DI 0 "register_operand" "")
5005 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5007 "reload_completed && !TARGET_COLDFIRE"
5008 [(set (strict_low_part (subreg:QI (match_dup 0) 7))
5009 (subreg:QI (match_dup 0) 3))
5011 (lshiftrt:SI (match_dup 2) (const_int 8)))
5013 (rotatert:SI (match_dup 3) (const_int 8)))]
5015 operands[2] = gen_highpart (SImode, operands[0]);
5016 operands[3] = gen_lowpart (SImode, operands[0]);
5020 [(set (match_operand:DI 0 "register_operand" "")
5021 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5023 "reload_completed && !TARGET_COLDFIRE"
5024 [(set (strict_low_part (subreg:HI (match_dup 0) 6))
5025 (subreg:HI (match_dup 0) 2))
5026 (set (strict_low_part (subreg:HI (match_dup 0) 2))
5029 (rotate:SI (match_dup 3) (const_int 16)))
5031 (rotate:SI (match_dup 2) (const_int 16)))]
5033 operands[2] = gen_highpart (SImode, operands[0]);
5034 operands[3] = gen_lowpart (SImode, operands[0]);
5038 [(set (match_operand:DI 0 "pre_dec_operand" "")
5039 (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "")
5042 [(set (match_dup 0) (match_dup 1))
5043 (set (match_dup 0) (const_int 0))]
5045 operands[0] = adjust_address(operands[0], SImode, 0);
5046 operands[1] = gen_highpart(SImode, operands[1]);
5050 [(set (match_operand:DI 0 "post_inc_operand" "")
5051 (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "")
5054 [(set (match_dup 0) (const_int 0))
5055 (set (match_dup 0) (match_dup 1))]
5057 operands[0] = adjust_address(operands[0], SImode, 0);
5058 operands[1] = gen_highpart(SImode, operands[1]);
5062 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5063 (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "")
5066 [(set (match_dup 2) (match_dup 5))
5067 (set (match_dup 4) (const_int 0))]
5068 "split_di(operands, 2, operands + 2, operands + 4);")
5070 (define_insn "*lshrdi_const32"
5071 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro<>")
5072 (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
5078 [(set (match_operand:DI 0 "register_operand" "")
5079 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5080 (match_operand 2 "const_int_operand" "")))]
5081 "reload_completed && !TARGET_COLDFIRE
5082 && INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 40"
5083 [(set (match_dup 3) (lshiftrt:SI (match_dup 3) (match_dup 2)))
5084 (set (match_dup 4) (match_dup 3))
5085 (set (match_dup 3) (const_int 0))]
5087 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
5088 operands[3] = gen_highpart (SImode, operands[0]);
5089 operands[4] = gen_lowpart (SImode, operands[0]);
5093 [(set (match_operand:DI 0 "register_operand" "")
5094 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5097 [(set (match_dup 3) (match_dup 2))
5098 (set (strict_low_part (subreg:HI (match_dup 0) 6))
5100 (set (match_dup 2) (const_int 0))
5102 (rotate:SI (match_dup 3) (const_int 16)))]
5104 operands[2] = gen_highpart (SImode, operands[0]);
5105 operands[3] = gen_lowpart (SImode, operands[0]);
5109 [(set (match_operand:DI 0 "register_operand" "")
5110 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5111 (match_operand 2 "const_int_operand" "")))]
5112 "reload_completed && !TARGET_COLDFIRE
5113 && INTVAL (operands[2]) > 40 && INTVAL (operands[2]) <= 62"
5114 [(set (match_dup 4) (match_dup 2))
5115 (set (match_dup 3) (lshiftrt:SI (match_dup 3) (match_dup 4)))
5116 (set (match_dup 4) (match_dup 3))
5117 (set (match_dup 3) (const_int 0))]
5119 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
5120 operands[3] = gen_highpart (SImode, operands[0]);
5121 operands[4] = gen_lowpart (SImode, operands[0]);
5124 (define_insn "*lshrdi_const63"
5125 [(set (match_operand:DI 0 "register_operand" "=d")
5126 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
5129 "add%.l %0,%0\;clr%.l %0\;clr%.l %R1\;addx%.l %R1,%R1")
5131 (define_insn "*lshrdi3_const"
5132 [(set (match_operand:DI 0 "register_operand" "=d")
5133 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
5134 (match_operand 2 "const_int_operand" "n")))]
5136 && ((INTVAL (operands[2]) >= 2 && INTVAL (operands[2]) <= 3)
5137 || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
5138 || (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63)))"
5141 (define_expand "lshrdi3"
5142 [(set (match_operand:DI 0 "register_operand" "")
5143 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5144 (match_operand 2 "const_int_operand" "")))]
5147 /* ??? This is a named pattern like this is not allowed to FAIL based
5149 if (GET_CODE (operands[2]) != CONST_INT
5150 || ((INTVAL (operands[2]) < 1 || INTVAL (operands[2]) > 3)
5151 && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
5152 && (INTVAL (operands[2]) < 32 || INTVAL (operands[2]) > 63)))
5156 ;; On all 68k models, this makes faster code in a special case.
5158 (define_insn "lshrsi_31"
5159 [(set (match_operand:SI 0 "register_operand" "=d")
5160 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5164 return "add%.l %0,%0\;subx%.l %0,%0\;neg%.l %0";
5167 ;; On most 68k models, this makes faster code in a special case.
5169 (define_insn "lshrsi_16"
5170 [(set (match_operand:SI 0 "register_operand" "=d")
5171 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5176 return "clr%.w %0\;swap %0";
5179 ;; On the 68000, this makes faster code in a special case.
5181 (define_insn "lshrsi_17_24"
5182 [(set (match_operand:SI 0 "register_operand" "=d")
5183 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5184 (match_operand:SI 2 "const_int_operand" "n")))]
5186 && INTVAL (operands[2]) > 16
5187 && INTVAL (operands[2]) <= 24"
5189 /* I think lsr%.w sets the CC properly. */
5190 operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
5191 return "clr%.w %0\;swap %0\;lsr%.w %2,%0";
5194 (define_insn "lshrsi3"
5195 [(set (match_operand:SI 0 "register_operand" "=d")
5196 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5197 (match_operand:SI 2 "general_operand" "dI")))]
5200 [(set_attr "type" "shift")
5201 (set_attr "opy" "2")])
5203 (define_insn "lshrhi3"
5204 [(set (match_operand:HI 0 "register_operand" "=d")
5205 (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
5206 (match_operand:HI 2 "general_operand" "dI")))]
5211 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
5212 (lshiftrt:HI (match_dup 0)
5213 (match_operand:HI 1 "general_operand" "dI")))]
5217 (define_insn "lshrqi3"
5218 [(set (match_operand:QI 0 "register_operand" "=d")
5219 (lshiftrt:QI (match_operand:QI 1 "register_operand" "0")
5220 (match_operand:QI 2 "general_operand" "dI")))]
5225 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
5226 (lshiftrt:QI (match_dup 0)
5227 (match_operand:QI 1 "general_operand" "dI")))]
5231 ;; rotate instructions
5233 (define_insn "rotlsi3"
5234 [(set (match_operand:SI 0 "register_operand" "=d")
5235 (rotate:SI (match_operand:SI 1 "register_operand" "0")
5236 (match_operand:SI 2 "general_operand" "dINO")))]
5239 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 16)
5241 else if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 16)
5243 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
5244 return "ror%.l %2,%0";
5247 return "rol%.l %2,%0";
5250 (define_insn "rotlhi3"
5251 [(set (match_operand:HI 0 "register_operand" "=d")
5252 (rotate:HI (match_operand:HI 1 "register_operand" "0")
5253 (match_operand:HI 2 "general_operand" "dIP")))]
5256 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
5258 operands[2] = GEN_INT (16 - INTVAL (operands[2]));
5259 return "ror%.w %2,%0";
5262 return "rol%.w %2,%0";
5266 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
5267 (rotate:HI (match_dup 0)
5268 (match_operand:HI 1 "general_operand" "dIP")))]
5271 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
5273 operands[2] = GEN_INT (16 - INTVAL (operands[2]));
5274 return "ror%.w %2,%0";
5277 return "rol%.w %2,%0";
5280 (define_insn "rotlqi3"
5281 [(set (match_operand:QI 0 "register_operand" "=d")
5282 (rotate:QI (match_operand:QI 1 "register_operand" "0")
5283 (match_operand:QI 2 "general_operand" "dI")))]
5286 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
5288 operands[2] = GEN_INT (8 - INTVAL (operands[2]));
5289 return "ror%.b %2,%0";
5292 return "rol%.b %2,%0";
5296 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
5297 (rotate:QI (match_dup 0)
5298 (match_operand:QI 1 "general_operand" "dI")))]
5301 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
5303 operands[2] = GEN_INT (8 - INTVAL (operands[2]));
5304 return "ror%.b %2,%0";
5307 return "rol%.b %2,%0";
5310 (define_insn "rotrsi3"
5311 [(set (match_operand:SI 0 "register_operand" "=d")
5312 (rotatert:SI (match_operand:SI 1 "register_operand" "0")
5313 (match_operand:SI 2 "general_operand" "dI")))]
5317 (define_insn "rotrhi3"
5318 [(set (match_operand:HI 0 "register_operand" "=d")
5319 (rotatert:HI (match_operand:HI 1 "register_operand" "0")
5320 (match_operand:HI 2 "general_operand" "dI")))]
5325 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
5326 (rotatert:HI (match_dup 0)
5327 (match_operand:HI 1 "general_operand" "dI")))]
5331 (define_insn "rotrqi3"
5332 [(set (match_operand:QI 0 "register_operand" "=d")
5333 (rotatert:QI (match_operand:QI 1 "register_operand" "0")
5334 (match_operand:QI 2 "general_operand" "dI")))]
5339 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
5340 (rotatert:QI (match_dup 0)
5341 (match_operand:QI 1 "general_operand" "dI")))]
5346 ;; Bit set/clear in memory byte.
5348 ;; set bit, bit number is int
5349 (define_insn "bsetmemqi"
5350 [(set (match_operand:QI 0 "memory_operand" "+m")
5351 (ior:QI (subreg:QI (ashift:SI (const_int 1)
5352 (match_operand:SI 1 "general_operand" "d")) 3)
5357 return "bset %1,%0";
5359 [(set_attr "type" "bitrw")])
5361 ;; set bit, bit number is (sign/zero)_extended from HImode/QImode
5362 (define_insn "*bsetmemqi_ext"
5363 [(set (match_operand:QI 0 "memory_operand" "+m")
5364 (ior:QI (subreg:QI (ashift:SI (const_int 1)
5365 (match_operator:SI 2 "extend_operator"
5366 [(match_operand 1 "general_operand" "d")])) 3)
5371 return "bset %1,%0";
5373 [(set_attr "type" "bitrw")])
5375 ;; clear bit, bit number is int
5376 (define_insn "bclrmemqi"
5377 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+m")
5379 (minus:SI (const_int 7)
5380 (match_operand:SI 1 "general_operand" "d")))
5385 return "bclr %1,%0";
5387 [(set_attr "type" "bitrw")])
5389 ;; clear bit, bit number is (sign/zero)_extended from HImode/QImode
5390 (define_insn "*bclrmemqi_ext"
5391 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+m")
5393 (minus:SI (const_int 7)
5394 (match_operator:SI 2 "extend_operator"
5395 [(match_operand 1 "general_operand" "d")])))
5400 return "bclr %1,%0";
5402 [(set_attr "type" "bitrw")])
5404 ;; Special cases of bit-field insns which we should
5405 ;; recognize in preference to the general case.
5406 ;; These handle aligned 8-bit and 16-bit fields,
5407 ;; which can usually be done with move instructions.
5410 ; Special case for 32-bit field in memory. This only occurs when 32-bit
5411 ; alignment of structure members is specified.
5413 ; The move is allowed to be odd byte aligned, because that's still faster
5414 ; than an odd byte aligned bit-field instruction.
5417 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5419 (match_operand:SI 1 "const_int_operand" "n"))
5420 (match_operand:SI 2 "general_src_operand" "rmSi"))]
5421 "TARGET_68020 && TARGET_BITFIELD
5422 && (INTVAL (operands[1]) % 8) == 0
5423 && ! mode_dependent_address_p (XEXP (operands[0], 0))"
5426 = adjust_address (operands[0], SImode, INTVAL (operands[1]) / 8);
5428 return "move%.l %2,%0";
5432 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+do")
5433 (match_operand:SI 1 "const_int_operand" "n")
5434 (match_operand:SI 2 "const_int_operand" "n"))
5435 (match_operand:SI 3 "register_operand" "d"))]
5436 "TARGET_68020 && TARGET_BITFIELD
5437 && (INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16)
5438 && INTVAL (operands[2]) % INTVAL (operands[1]) == 0
5439 && (GET_CODE (operands[0]) == REG
5440 || ! mode_dependent_address_p (XEXP (operands[0], 0)))"
5442 if (REG_P (operands[0]))
5444 if (INTVAL (operands[1]) + INTVAL (operands[2]) != 32)
5445 return "bfins %3,%0{%b2:%b1}";
5448 operands[0] = adjust_address (operands[0],
5449 INTVAL (operands[1]) == 8 ? QImode : HImode,
5450 INTVAL (operands[2]) / 8);
5452 if (GET_CODE (operands[3]) == MEM)
5453 operands[3] = adjust_address (operands[3],
5454 INTVAL (operands[1]) == 8 ? QImode : HImode,
5455 (32 - INTVAL (operands[1])) / 8);
5457 if (INTVAL (operands[1]) == 8)
5458 return "move%.b %3,%0";
5459 return "move%.w %3,%0";
5464 ; Special case for 32-bit field in memory. This only occurs when 32-bit
5465 ; alignment of structure members is specified.
5467 ; The move is allowed to be odd byte aligned, because that's still faster
5468 ; than an odd byte aligned bit-field instruction.
5471 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
5472 (zero_extract:SI (match_operand:QI 1 "memory_src_operand" "oS")
5474 (match_operand:SI 2 "const_int_operand" "n")))]
5475 "TARGET_68020 && TARGET_BITFIELD
5476 && (INTVAL (operands[2]) % 8) == 0
5477 && ! mode_dependent_address_p (XEXP (operands[1], 0))"
5480 = adjust_address (operands[1], SImode, INTVAL (operands[2]) / 8);
5482 return "move%.l %1,%0";
5486 [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
5487 (zero_extract:SI (match_operand:SI 1 "register_operand" "do")
5488 (match_operand:SI 2 "const_int_operand" "n")
5489 (match_operand:SI 3 "const_int_operand" "n")))]
5490 "TARGET_68020 && TARGET_BITFIELD
5491 && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
5492 && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
5493 && (GET_CODE (operands[1]) == REG
5494 || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
5496 cc_status.flags |= CC_NOT_NEGATIVE;
5497 if (REG_P (operands[1]))
5499 if (INTVAL (operands[2]) + INTVAL (operands[3]) != 32)
5500 return "bfextu %1{%b3:%b2},%0";
5504 = adjust_address (operands[1], SImode, INTVAL (operands[3]) / 8);
5506 output_asm_insn ("clr%.l %0", operands);
5507 if (GET_CODE (operands[0]) == MEM)
5508 operands[0] = adjust_address (operands[0],
5509 INTVAL (operands[2]) == 8 ? QImode : HImode,
5510 (32 - INTVAL (operands[1])) / 8);
5512 if (INTVAL (operands[2]) == 8)
5513 return "move%.b %1,%0";
5514 return "move%.w %1,%0";
5518 ; Special case for 32-bit field in memory. This only occurs when 32-bit
5519 ; alignment of structure members is specified.
5521 ; The move is allowed to be odd byte aligned, because that's still faster
5522 ; than an odd byte aligned bit-field instruction.
5525 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
5526 (sign_extract:SI (match_operand:QI 1 "memory_src_operand" "oS")
5528 (match_operand:SI 2 "const_int_operand" "n")))]
5529 "TARGET_68020 && TARGET_BITFIELD
5530 && (INTVAL (operands[2]) % 8) == 0
5531 && ! mode_dependent_address_p (XEXP (operands[1], 0))"
5534 = adjust_address (operands[1], SImode, INTVAL (operands[2]) / 8);
5536 return "move%.l %1,%0";
5540 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
5541 (sign_extract:SI (match_operand:SI 1 "register_operand" "do")
5542 (match_operand:SI 2 "const_int_operand" "n")
5543 (match_operand:SI 3 "const_int_operand" "n")))]
5544 "TARGET_68020 && TARGET_BITFIELD
5545 && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
5546 && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
5547 && (GET_CODE (operands[1]) == REG
5548 || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
5550 if (REG_P (operands[1]))
5552 if (INTVAL (operands[2]) + INTVAL (operands[3]) != 32)
5553 return "bfexts %1{%b3:%b2},%0";
5557 = adjust_address (operands[1],
5558 INTVAL (operands[2]) == 8 ? QImode : HImode,
5559 INTVAL (operands[3]) / 8);
5561 if (INTVAL (operands[2]) == 8)
5562 return "move%.b %1,%0\;extb%.l %0";
5563 return "move%.w %1,%0\;ext%.l %0";
5566 ;; Bit-field instructions, general cases.
5567 ;; "o,d" constraint causes a nonoffsettable memref to match the "o"
5568 ;; so that its address is reloaded.
5570 (define_expand "extv"
5571 [(set (match_operand:SI 0 "register_operand" "")
5572 (sign_extract:SI (match_operand:SI 1 "general_operand" "")
5573 (match_operand:SI 2 "const_int_operand" "")
5574 (match_operand:SI 3 "const_int_operand" "")))]
5575 "TARGET_68020 && TARGET_BITFIELD"
5579 [(set (match_operand:SI 0 "register_operand" "=d")
5580 (sign_extract:SI (match_operand:QI 1 "memory_operand" "o")
5581 (match_operand:SI 2 "nonmemory_operand" "dn")
5582 (match_operand:SI 3 "nonmemory_operand" "dn")))]
5583 "TARGET_68020 && TARGET_BITFIELD"
5584 "bfexts %1{%b3:%b2},%0")
5586 (define_expand "extzv"
5587 [(set (match_operand:SI 0 "register_operand" "")
5588 (zero_extract:SI (match_operand:SI 1 "general_operand" "")
5589 (match_operand:SI 2 "const_int_operand" "")
5590 (match_operand:SI 3 "const_int_operand" "")))]
5591 "TARGET_68020 && TARGET_BITFIELD"
5595 [(set (match_operand:SI 0 "register_operand" "=d")
5596 (zero_extract:SI (match_operand:QI 1 "memory_operand" "o")
5597 (match_operand:SI 2 "nonmemory_operand" "dn")
5598 (match_operand:SI 3 "nonmemory_operand" "dn")))]
5599 "TARGET_68020 && TARGET_BITFIELD"
5601 if (GET_CODE (operands[2]) == CONST_INT)
5603 if (INTVAL (operands[2]) != 32)
5604 cc_status.flags |= CC_NOT_NEGATIVE;
5610 return "bfextu %1{%b3:%b2},%0";
5614 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5615 (match_operand:SI 1 "nonmemory_operand" "dn")
5616 (match_operand:SI 2 "nonmemory_operand" "dn"))
5617 (xor:SI (zero_extract:SI (match_dup 0) (match_dup 1) (match_dup 2))
5618 (match_operand 3 "const_int_operand" "n")))]
5619 "TARGET_68020 && TARGET_BITFIELD
5620 && (INTVAL (operands[3]) == -1
5621 || (GET_CODE (operands[1]) == CONST_INT
5622 && (~ INTVAL (operands[3]) & ((1 << INTVAL (operands[1]))- 1)) == 0))"
5625 return "bfchg %0{%b2:%b1}";
5629 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5630 (match_operand:SI 1 "nonmemory_operand" "dn")
5631 (match_operand:SI 2 "nonmemory_operand" "dn"))
5633 "TARGET_68020 && TARGET_BITFIELD"
5636 return "bfclr %0{%b2:%b1}";
5640 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5641 (match_operand:SI 1 "general_operand" "dn")
5642 (match_operand:SI 2 "general_operand" "dn"))
5644 "TARGET_68020 && TARGET_BITFIELD"
5647 return "bfset %0{%b2:%b1}";
5650 (define_expand "insv"
5651 [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "")
5652 (match_operand:SI 1 "const_int_operand" "")
5653 (match_operand:SI 2 "const_int_operand" ""))
5654 (match_operand:SI 3 "register_operand" ""))]
5655 "TARGET_68020 && TARGET_BITFIELD"
5659 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5660 (match_operand:SI 1 "nonmemory_operand" "dn")
5661 (match_operand:SI 2 "nonmemory_operand" "dn"))
5662 (match_operand:SI 3 "register_operand" "d"))]
5663 "TARGET_68020 && TARGET_BITFIELD"
5664 "bfins %3,%0{%b2:%b1}")
5666 ;; Now recognize bit-field insns that operate on registers
5667 ;; (or at least were intended to do so).
5670 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
5671 (sign_extract:SI (match_operand:SI 1 "register_operand" "d")
5672 (match_operand:SI 2 "const_int_operand" "n")
5673 (match_operand:SI 3 "const_int_operand" "n")))]
5674 "TARGET_68020 && TARGET_BITFIELD"
5675 "bfexts %1{%b3:%b2},%0")
5678 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
5679 (zero_extract:SI (match_operand:SI 1 "register_operand" "d")
5680 (match_operand:SI 2 "const_int_operand" "n")
5681 (match_operand:SI 3 "const_int_operand" "n")))]
5682 "TARGET_68020 && TARGET_BITFIELD"
5684 if (GET_CODE (operands[2]) == CONST_INT)
5686 if (INTVAL (operands[2]) != 32)
5687 cc_status.flags |= CC_NOT_NEGATIVE;
5693 return "bfextu %1{%b3:%b2},%0";
5697 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+d")
5698 (match_operand:SI 1 "const_int_operand" "n")
5699 (match_operand:SI 2 "const_int_operand" "n"))
5701 "TARGET_68020 && TARGET_BITFIELD"
5704 return "bfclr %0{%b2:%b1}";
5708 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+d")
5709 (match_operand:SI 1 "const_int_operand" "n")
5710 (match_operand:SI 2 "const_int_operand" "n"))
5712 "TARGET_68020 && TARGET_BITFIELD"
5715 return "bfset %0{%b2:%b1}";
5719 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+d")
5720 (match_operand:SI 1 "const_int_operand" "n")
5721 (match_operand:SI 2 "const_int_operand" "n"))
5722 (match_operand:SI 3 "register_operand" "d"))]
5723 "TARGET_68020 && TARGET_BITFIELD"
5726 /* These special cases are now recognized by a specific pattern. */
5727 if (GET_CODE (operands[1]) == CONST_INT && GET_CODE (operands[2]) == CONST_INT
5728 && INTVAL (operands[1]) == 16 && INTVAL (operands[2]) == 16)
5729 return "move%.w %3,%0";
5730 if (GET_CODE (operands[1]) == CONST_INT && GET_CODE (operands[2]) == CONST_INT
5731 && INTVAL (operands[1]) == 24 && INTVAL (operands[2]) == 8)
5732 return "move%.b %3,%0";
5734 return "bfins %3,%0{%b2:%b1}";
5737 ;; Special patterns for optimizing bit-field instructions.
5741 (zero_extract:SI (match_operand:QI 0 "memory_operand" "o")
5742 (match_operand:SI 1 "const_int_operand" "n")
5743 (match_operand:SI 2 "general_operand" "dn")))]
5744 "TARGET_68020 && TARGET_BITFIELD"
5746 if (operands[1] == const1_rtx
5747 && GET_CODE (operands[2]) == CONST_INT)
5749 int width = GET_CODE (operands[0]) == REG ? 31 : 7;
5750 return output_btst (operands,
5751 GEN_INT (width - INTVAL (operands[2])),
5752 operands[0], insn, 1000);
5753 /* Pass 1000 as SIGNPOS argument so that btst will
5754 not think we are testing the sign bit for an `and'
5755 and assume that nonzero implies a negative result. */
5757 if (INTVAL (operands[1]) != 32)
5758 cc_status.flags = CC_NOT_NEGATIVE;
5759 return "bftst %0{%b2:%b1}";
5763 ;;; now handle the register cases
5766 (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
5767 (match_operand:SI 1 "const_int_operand" "n")
5768 (match_operand:SI 2 "general_operand" "dn")))]
5769 "TARGET_68020 && TARGET_BITFIELD"
5771 if (operands[1] == const1_rtx
5772 && GET_CODE (operands[2]) == CONST_INT)
5774 int width = GET_CODE (operands[0]) == REG ? 31 : 7;
5775 return output_btst (operands, GEN_INT (width - INTVAL (operands[2])),
5776 operands[0], insn, 1000);
5777 /* Pass 1000 as SIGNPOS argument so that btst will
5778 not think we are testing the sign bit for an `and'
5779 and assume that nonzero implies a negative result. */
5781 if (INTVAL (operands[1]) != 32)
5782 cc_status.flags = CC_NOT_NEGATIVE;
5783 return "bftst %0{%b2:%b1}";
5786 (define_insn "scc0_di"
5787 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
5788 (match_operator 1 "valid_dbcc_comparison_p"
5789 [(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
5792 return output_scc_di (operands[1], operands[2], const0_rtx, operands[0]);
5795 (define_insn "scc0_di_5200"
5796 [(set (match_operand:QI 0 "nonimmediate_operand" "=d")
5797 (match_operator 1 "valid_dbcc_comparison_p"
5798 [(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
5801 return output_scc_di (operands[1], operands[2], const0_rtx, operands[0]);
5804 (define_insn "scc_di"
5805 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,dm")
5806 (match_operator 1 "valid_dbcc_comparison_p"
5807 [(match_operand:DI 2 "general_operand" "ro,r")
5808 (match_operand:DI 3 "general_operand" "r,ro")]))]
5811 return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
5814 (define_insn "scc_di_5200"
5815 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d")
5816 (match_operator 1 "valid_dbcc_comparison_p"
5817 [(match_operand:DI 2 "general_operand" "ro,r")
5818 (match_operand:DI 3 "general_operand" "r,ro")]))]
5821 return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
5824 ;; Note that operand 0 of an SCC insn is supported in the hardware as
5825 ;; memory, but we cannot allow it to be in memory in case the address
5826 ;; needs to be reloaded.
5828 (define_expand "seq"
5829 [(set (match_operand:QI 0 "register_operand" "")
5830 (eq:QI (cc0) (const_int 0)))]
5833 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5834 && m68k_last_compare_had_fp_operands)
5836 m68k_last_compare_had_fp_operands = 0;
5842 [(set (match_operand:QI 0 "register_operand" "=d")
5843 (eq:QI (cc0) (const_int 0)))]
5846 cc_status = cc_prev_status;
5847 OUTPUT_JUMP ("seq %0", "fseq %0", "seq %0");
5850 (define_expand "sne"
5851 [(set (match_operand:QI 0 "register_operand" "")
5852 (ne:QI (cc0) (const_int 0)))]
5855 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5856 && m68k_last_compare_had_fp_operands)
5858 m68k_last_compare_had_fp_operands = 0;
5864 [(set (match_operand:QI 0 "register_operand" "=d")
5865 (ne:QI (cc0) (const_int 0)))]
5868 cc_status = cc_prev_status;
5869 OUTPUT_JUMP ("sne %0", "fsne %0", "sne %0");
5872 (define_expand "sgt"
5873 [(set (match_operand:QI 0 "register_operand" "")
5874 (gt:QI (cc0) (const_int 0)))]
5877 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5878 && m68k_last_compare_had_fp_operands)
5880 m68k_last_compare_had_fp_operands = 0;
5886 [(set (match_operand:QI 0 "register_operand" "=d")
5887 (gt:QI (cc0) (const_int 0)))]
5890 cc_status = cc_prev_status;
5891 OUTPUT_JUMP ("sgt %0", "fsgt %0", 0);
5894 (define_expand "sgtu"
5895 [(set (match_operand:QI 0 "register_operand" "")
5896 (gtu:QI (cc0) (const_int 0)))]
5901 [(set (match_operand:QI 0 "register_operand" "=d")
5902 (gtu:QI (cc0) (const_int 0)))]
5905 cc_status = cc_prev_status;
5909 (define_expand "slt"
5910 [(set (match_operand:QI 0 "register_operand" "")
5911 (lt:QI (cc0) (const_int 0)))]
5914 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5915 && m68k_last_compare_had_fp_operands)
5917 m68k_last_compare_had_fp_operands = 0;
5923 [(set (match_operand:QI 0 "register_operand" "=d")
5924 (lt:QI (cc0) (const_int 0)))]
5927 cc_status = cc_prev_status;
5928 OUTPUT_JUMP ("slt %0", "fslt %0", "smi %0");
5931 (define_expand "sltu"
5932 [(set (match_operand:QI 0 "register_operand" "")
5933 (ltu:QI (cc0) (const_int 0)))]
5938 [(set (match_operand:QI 0 "register_operand" "=d")
5939 (ltu:QI (cc0) (const_int 0)))]
5942 cc_status = cc_prev_status;
5946 (define_expand "sge"
5947 [(set (match_operand:QI 0 "register_operand" "")
5948 (ge:QI (cc0) (const_int 0)))]
5951 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5952 && m68k_last_compare_had_fp_operands)
5954 m68k_last_compare_had_fp_operands = 0;
5960 [(set (match_operand:QI 0 "register_operand" "=d")
5961 (ge:QI (cc0) (const_int 0)))]
5964 cc_status = cc_prev_status;
5965 OUTPUT_JUMP ("sge %0", "fsge %0", "spl %0");
5968 (define_expand "sgeu"
5969 [(set (match_operand:QI 0 "register_operand" "")
5970 (geu:QI (cc0) (const_int 0)))]
5975 [(set (match_operand:QI 0 "register_operand" "=d")
5976 (geu:QI (cc0) (const_int 0)))]
5979 cc_status = cc_prev_status;
5982 [(set_attr "type" "scc")])
5984 (define_expand "sle"
5985 [(set (match_operand:QI 0 "register_operand" "")
5986 (le:QI (cc0) (const_int 0)))]
5989 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5990 && m68k_last_compare_had_fp_operands)
5992 m68k_last_compare_had_fp_operands = 0;
5998 [(set (match_operand:QI 0 "register_operand" "=d")
5999 (le:QI (cc0) (const_int 0)))]
6002 cc_status = cc_prev_status;
6003 OUTPUT_JUMP ("sle %0", "fsle %0", 0);
6006 (define_expand "sleu"
6007 [(set (match_operand:QI 0 "register_operand" "")
6008 (leu:QI (cc0) (const_int 0)))]
6013 [(set (match_operand:QI 0 "register_operand" "=d")
6014 (leu:QI (cc0) (const_int 0)))]
6017 cc_status = cc_prev_status;
6020 [(set_attr "type" "scc")])
6022 (define_expand "sordered"
6023 [(set (match_operand:QI 0 "register_operand" "")
6024 (ordered:QI (cc0) (const_int 0)))]
6025 "TARGET_68881 && !TUNE_68060"
6027 gcc_assert (m68k_last_compare_had_fp_operands);
6028 m68k_last_compare_had_fp_operands = 0;
6031 (define_insn "*sordered_1"
6032 [(set (match_operand:QI 0 "register_operand" "=d")
6033 (ordered:QI (cc0) (const_int 0)))]
6034 "TARGET_68881 && !TUNE_68060"
6036 cc_status = cc_prev_status;
6040 (define_expand "sunordered"
6041 [(set (match_operand:QI 0 "register_operand" "")
6042 (unordered:QI (cc0) (const_int 0)))]
6043 "TARGET_68881 && !TUNE_68060"
6045 gcc_assert (m68k_last_compare_had_fp_operands);
6046 m68k_last_compare_had_fp_operands = 0;
6049 (define_insn "*sunordered_1"
6050 [(set (match_operand:QI 0 "register_operand" "=d")
6051 (unordered:QI (cc0) (const_int 0)))]
6052 "TARGET_68881 && !TUNE_68060"
6054 cc_status = cc_prev_status;
6058 (define_expand "suneq"
6059 [(set (match_operand:QI 0 "register_operand" "")
6060 (uneq:QI (cc0) (const_int 0)))]
6061 "TARGET_68881 && !TUNE_68060"
6063 gcc_assert (m68k_last_compare_had_fp_operands);
6064 m68k_last_compare_had_fp_operands = 0;
6067 (define_insn "*suneq_1"
6068 [(set (match_operand:QI 0 "register_operand" "=d")
6069 (uneq:QI (cc0) (const_int 0)))]
6070 "TARGET_68881 && !TUNE_68060"
6072 cc_status = cc_prev_status;
6076 (define_expand "sunge"
6077 [(set (match_operand:QI 0 "register_operand" "")
6078 (unge:QI (cc0) (const_int 0)))]
6079 "TARGET_68881 && !TUNE_68060"
6081 gcc_assert (m68k_last_compare_had_fp_operands);
6082 m68k_last_compare_had_fp_operands = 0;
6085 (define_insn "*sunge_1"
6086 [(set (match_operand:QI 0 "register_operand" "=d")
6087 (unge:QI (cc0) (const_int 0)))]
6088 "TARGET_68881 && !TUNE_68060"
6090 cc_status = cc_prev_status;
6094 (define_expand "sungt"
6095 [(set (match_operand:QI 0 "register_operand" "")
6096 (ungt:QI (cc0) (const_int 0)))]
6097 "TARGET_68881 && !TUNE_68060"
6099 gcc_assert (m68k_last_compare_had_fp_operands);
6100 m68k_last_compare_had_fp_operands = 0;
6103 (define_insn "*sungt_1"
6104 [(set (match_operand:QI 0 "register_operand" "=d")
6105 (ungt:QI (cc0) (const_int 0)))]
6106 "TARGET_68881 && !TUNE_68060"
6108 cc_status = cc_prev_status;
6112 (define_expand "sunle"
6113 [(set (match_operand:QI 0 "register_operand" "")
6114 (unle:QI (cc0) (const_int 0)))]
6115 "TARGET_68881 && !TUNE_68060"
6117 gcc_assert (m68k_last_compare_had_fp_operands);
6118 m68k_last_compare_had_fp_operands = 0;
6121 (define_insn "*sunle_1"
6122 [(set (match_operand:QI 0 "register_operand" "=d")
6123 (unle:QI (cc0) (const_int 0)))]
6124 "TARGET_68881 && !TUNE_68060"
6126 cc_status = cc_prev_status;
6130 (define_expand "sunlt"
6131 [(set (match_operand:QI 0 "register_operand" "")
6132 (unlt:QI (cc0) (const_int 0)))]
6133 "TARGET_68881 && !TUNE_68060"
6135 gcc_assert (m68k_last_compare_had_fp_operands);
6136 m68k_last_compare_had_fp_operands = 0;
6139 (define_insn "*sunlt_1"
6140 [(set (match_operand:QI 0 "register_operand" "=d")
6141 (unlt:QI (cc0) (const_int 0)))]
6142 "TARGET_68881 && !TUNE_68060"
6144 cc_status = cc_prev_status;
6148 (define_expand "sltgt"
6149 [(set (match_operand:QI 0 "register_operand" "")
6150 (ltgt:QI (cc0) (const_int 0)))]
6151 "TARGET_68881 && !TUNE_68060"
6153 gcc_assert (m68k_last_compare_had_fp_operands);
6154 m68k_last_compare_had_fp_operands = 0;
6157 (define_insn "*sltgt_1"
6158 [(set (match_operand:QI 0 "register_operand" "=d")
6159 (ltgt:QI (cc0) (const_int 0)))]
6160 "TARGET_68881 && !TUNE_68060"
6162 cc_status = cc_prev_status;
6166 (define_insn "*fsogt_1"
6167 [(set (match_operand:QI 0 "register_operand" "=d")
6168 (not:QI (unle:QI (cc0) (const_int 0))))]
6169 "TARGET_68881 && !TUNE_68060"
6171 cc_status = cc_prev_status;
6175 (define_insn "*fsoge_1"
6176 [(set (match_operand:QI 0 "register_operand" "=d")
6177 (not:QI (unlt:QI (cc0) (const_int 0))))]
6178 "TARGET_68881 && !TUNE_68060"
6180 cc_status = cc_prev_status;
6184 (define_insn "*fsolt_1"
6185 [(set (match_operand:QI 0 "register_operand" "=d")
6186 (not:QI (unge:QI (cc0) (const_int 0))))]
6187 "TARGET_68881 && !TUNE_68060"
6189 cc_status = cc_prev_status;
6193 (define_insn "*fsole_1"
6194 [(set (match_operand:QI 0 "register_operand" "=d")
6195 (not:QI (ungt:QI (cc0) (const_int 0))))]
6196 "TARGET_68881 && !TUNE_68060"
6198 cc_status = cc_prev_status;
6202 ;; Basic conditional jump instructions.
6204 (define_insn "beq0_di"
6206 (if_then_else (eq (match_operand:DI 0 "general_operand" "d*ao,<>")
6208 (label_ref (match_operand 1 "" ","))
6210 (clobber (match_scratch:SI 2 "=d,d"))]
6214 if (which_alternative == 1)
6215 return "move%.l %0,%2\;or%.l %0,%2\;jeq %l1";
6216 if ((cc_prev_status.value1
6217 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6218 || (cc_prev_status.value2
6219 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6221 cc_status = cc_prev_status;
6224 if (GET_CODE (operands[0]) == REG)
6225 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
6227 operands[3] = adjust_address (operands[0], SImode, 4);
6228 if (! ADDRESS_REG_P (operands[0]))
6230 if (reg_overlap_mentioned_p (operands[2], operands[0]))
6232 if (reg_overlap_mentioned_p (operands[2], operands[3]))
6233 return "or%.l %0,%2\;jeq %l1";
6235 return "or%.l %3,%2\;jeq %l1";
6237 return "move%.l %0,%2\;or%.l %3,%2\;jeq %l1";
6239 operands[4] = gen_label_rtx();
6240 if (TARGET_68020 || TARGET_COLDFIRE)
6241 output_asm_insn ("tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1", operands);
6243 output_asm_insn ("cmp%.w #0,%0\;jne %l4\;cmp%.w #0,%3\;jeq %l1", operands);
6244 (*targetm.asm_out.internal_label) (asm_out_file, "L",
6245 CODE_LABEL_NUMBER (operands[4]));
6249 (define_insn "bne0_di"
6251 (if_then_else (ne (match_operand:DI 0 "general_operand" "do,*a")
6253 (label_ref (match_operand 1 "" ","))
6255 (clobber (match_scratch:SI 2 "=d,X"))]
6258 if ((cc_prev_status.value1
6259 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6260 || (cc_prev_status.value2
6261 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6263 cc_status = cc_prev_status;
6267 if (GET_CODE (operands[0]) == REG)
6268 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
6270 operands[3] = adjust_address (operands[0], SImode, 4);
6271 if (!ADDRESS_REG_P (operands[0]))
6273 if (reg_overlap_mentioned_p (operands[2], operands[0]))
6275 if (reg_overlap_mentioned_p (operands[2], operands[3]))
6276 return "or%.l %0,%2\;jne %l1";
6278 return "or%.l %3,%2\;jne %l1";
6280 return "move%.l %0,%2\;or%.l %3,%2\;jne %l1";
6282 if (TARGET_68020 || TARGET_COLDFIRE)
6283 return "tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1";
6285 return "cmp%.w #0,%0\;jne %l1\;cmp%.w #0,%3\;jne %l1";
6288 (define_insn "bge0_di"
6290 (if_then_else (ge (match_operand:DI 0 "general_operand" "ro")
6292 (label_ref (match_operand 1 "" ""))
6296 if ((cc_prev_status.value1
6297 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6298 || (cc_prev_status.value2
6299 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6301 cc_status = cc_prev_status;
6302 return cc_status.flags & CC_REVERSED ? "jle %l1" : "jpl %l1";
6305 if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
6306 output_asm_insn("tst%.l %0", operands);
6309 /* On an address reg, cmpw may replace cmpl. */
6310 output_asm_insn("cmp%.w #0,%0", operands);
6315 (define_insn "blt0_di"
6317 (if_then_else (lt (match_operand:DI 0 "general_operand" "ro")
6319 (label_ref (match_operand 1 "" ""))
6323 if ((cc_prev_status.value1
6324 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6325 || (cc_prev_status.value2
6326 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6328 cc_status = cc_prev_status;
6329 return cc_status.flags & CC_REVERSED ? "jgt %l1" : "jmi %l1";
6332 if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
6333 output_asm_insn("tst%.l %0", operands);
6336 /* On an address reg, cmpw may replace cmpl. */
6337 output_asm_insn("cmp%.w #0,%0", operands);
6344 (if_then_else (eq (cc0)
6346 (label_ref (match_operand 0 "" ""))
6350 OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
6352 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6356 (if_then_else (ne (cc0)
6358 (label_ref (match_operand 0 "" ""))
6362 OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
6364 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6368 (if_then_else (gt (cc0)
6370 (label_ref (match_operand 0 "" ""))
6374 OUTPUT_JUMP ("jgt %l0", "fjgt %l0", 0);
6376 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6380 (if_then_else (gtu (cc0)
6382 (label_ref (match_operand 0 "" ""))
6386 [(set_attr "type" "bcc")])
6390 (if_then_else (lt (cc0)
6392 (label_ref (match_operand 0 "" ""))
6396 OUTPUT_JUMP ("jlt %l0", "fjlt %l0", "jmi %l0");
6398 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6402 (if_then_else (ltu (cc0)
6404 (label_ref (match_operand 0 "" ""))
6408 [(set_attr "type" "bcc")])
6412 (if_then_else (ge (cc0)
6414 (label_ref (match_operand 0 "" ""))
6418 OUTPUT_JUMP ("jge %l0", "fjge %l0", "jpl %l0");
6423 (if_then_else (geu (cc0)
6425 (label_ref (match_operand 0 "" ""))
6429 [(set_attr "type" "bcc")])
6433 (if_then_else (le (cc0)
6435 (label_ref (match_operand 0 "" ""))
6439 OUTPUT_JUMP ("jle %l0", "fjle %l0", 0);
6441 [(set_attr "type" "bcc")])
6445 (if_then_else (leu (cc0)
6447 (label_ref (match_operand 0 "" ""))
6451 [(set_attr "type" "bcc")])
6453 (define_insn "bordered"
6455 (if_then_else (ordered (cc0) (const_int 0))
6456 (label_ref (match_operand 0 "" ""))
6460 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6463 [(set_attr "type" "fbcc")])
6465 (define_insn "bunordered"
6467 (if_then_else (unordered (cc0) (const_int 0))
6468 (label_ref (match_operand 0 "" ""))
6472 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6475 [(set_attr "type" "fbcc")])
6477 (define_insn "buneq"
6479 (if_then_else (uneq (cc0) (const_int 0))
6480 (label_ref (match_operand 0 "" ""))
6484 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6487 [(set_attr "type" "fbcc")])
6489 (define_insn "bunge"
6491 (if_then_else (unge (cc0) (const_int 0))
6492 (label_ref (match_operand 0 "" ""))
6496 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6499 [(set_attr "type" "fbcc")])
6501 (define_insn "bungt"
6503 (if_then_else (ungt (cc0) (const_int 0))
6504 (label_ref (match_operand 0 "" ""))
6508 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6511 [(set_attr "type" "fbcc")])
6513 (define_insn "bunle"
6515 (if_then_else (unle (cc0) (const_int 0))
6516 (label_ref (match_operand 0 "" ""))
6520 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6523 [(set_attr "type" "fbcc")])
6525 (define_insn "bunlt"
6527 (if_then_else (unlt (cc0) (const_int 0))
6528 (label_ref (match_operand 0 "" ""))
6532 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6535 [(set_attr "type" "fbcc")])
6537 (define_insn "bltgt"
6539 (if_then_else (ltgt (cc0) (const_int 0))
6540 (label_ref (match_operand 0 "" ""))
6544 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6547 [(set_attr "type" "fbcc")])
6549 ;; Negated conditional jump instructions.
6551 (define_insn "*beq_rev"
6553 (if_then_else (eq (cc0)
6556 (label_ref (match_operand 0 "" ""))))]
6559 OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
6561 [(set_attr "type" "bcc")])
6563 (define_insn "*bne_rev"
6565 (if_then_else (ne (cc0)
6568 (label_ref (match_operand 0 "" ""))))]
6571 OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
6573 [(set_attr "type" "bcc")])
6575 (define_insn "*bgt_rev"
6577 (if_then_else (gt (cc0)
6580 (label_ref (match_operand 0 "" ""))))]
6583 OUTPUT_JUMP ("jle %l0", "fjngt %l0", 0);
6585 [(set_attr "type" "bcc")])
6587 (define_insn "*bgtu_rev"
6589 (if_then_else (gtu (cc0)
6592 (label_ref (match_operand 0 "" ""))))]
6595 [(set_attr "type" "bcc")])
6597 (define_insn "*blt_rev"
6599 (if_then_else (lt (cc0)
6602 (label_ref (match_operand 0 "" ""))))]
6605 OUTPUT_JUMP ("jge %l0", "fjnlt %l0", "jpl %l0");
6607 [(set_attr "type" "bcc")])
6609 (define_insn "*bltu_rev"
6611 (if_then_else (ltu (cc0)
6614 (label_ref (match_operand 0 "" ""))))]
6617 [(set_attr "type" "bcc")])
6619 (define_insn "*bge_rev"
6621 (if_then_else (ge (cc0)
6624 (label_ref (match_operand 0 "" ""))))]
6627 OUTPUT_JUMP ("jlt %l0", "fjnge %l0", "jmi %l0");
6629 [(set_attr "type" "bcc")])
6631 (define_insn "*bgeu_rev"
6633 (if_then_else (geu (cc0)
6636 (label_ref (match_operand 0 "" ""))))]
6639 [(set_attr "type" "bcc")])
6641 (define_insn "*ble_rev"
6643 (if_then_else (le (cc0)
6646 (label_ref (match_operand 0 "" ""))))]
6649 OUTPUT_JUMP ("jgt %l0", "fjnle %l0", 0);
6651 [(set_attr "type" "bcc")])
6653 (define_insn "*bleu_rev"
6655 (if_then_else (leu (cc0)
6658 (label_ref (match_operand 0 "" ""))))]
6661 [(set_attr "type" "bcc")])
6663 (define_insn "*bordered_rev"
6665 (if_then_else (ordered (cc0) (const_int 0))
6667 (label_ref (match_operand 0 "" ""))))]
6670 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6673 [(set_attr "type" "fbcc")])
6675 (define_insn "*bunordered_rev"
6677 (if_then_else (unordered (cc0) (const_int 0))
6679 (label_ref (match_operand 0 "" ""))))]
6682 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6685 [(set_attr "type" "fbcc")])
6687 (define_insn "*buneq_rev"
6689 (if_then_else (uneq (cc0) (const_int 0))
6691 (label_ref (match_operand 0 "" ""))))]
6694 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6697 [(set_attr "type" "fbcc")])
6699 (define_insn "*bunge_rev"
6701 (if_then_else (unge (cc0) (const_int 0))
6703 (label_ref (match_operand 0 "" ""))))]
6706 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6709 [(set_attr "type" "fbcc")])
6711 (define_insn "*bungt_rev"
6713 (if_then_else (ungt (cc0) (const_int 0))
6715 (label_ref (match_operand 0 "" ""))))]
6718 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6721 [(set_attr "type" "fbcc")])
6723 (define_insn "*bunle_rev"
6725 (if_then_else (unle (cc0) (const_int 0))
6727 (label_ref (match_operand 0 "" ""))))]
6730 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6733 [(set_attr "type" "fbcc")])
6735 (define_insn "*bunlt_rev"
6737 (if_then_else (unlt (cc0) (const_int 0))
6739 (label_ref (match_operand 0 "" ""))))]
6742 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6745 [(set_attr "type" "fbcc")])
6747 (define_insn "*bltgt_rev"
6749 (if_then_else (ltgt (cc0) (const_int 0))
6751 (label_ref (match_operand 0 "" ""))))]
6754 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6757 [(set_attr "type" "fbcc")])
6759 ;; Unconditional and other jump instructions
6762 (label_ref (match_operand 0 "" "")))]
6765 [(set_attr "type" "bra")])
6767 (define_expand "tablejump"
6768 [(parallel [(set (pc) (match_operand 0 "" ""))
6769 (use (label_ref (match_operand 1 "" "")))])]
6772 #ifdef CASE_VECTOR_PC_RELATIVE
6773 operands[0] = gen_rtx_PLUS (SImode, pc_rtx,
6774 gen_rtx_SIGN_EXTEND (SImode, operands[0]));
6778 ;; Jump to variable address from dispatch table of absolute addresses.
6779 (define_insn "*tablejump_internal"
6780 [(set (pc) (match_operand:SI 0 "register_operand" "a"))
6781 (use (label_ref (match_operand 1 "" "")))]
6784 return MOTOROLA ? "jmp (%0)" : "jmp %0@";
6786 [(set_attr "type" "jmp")])
6788 ;; Jump to variable address from dispatch table of relative addresses.
6792 (sign_extend:SI (match_operand:HI 0 "register_operand" "r"))))
6793 (use (label_ref (match_operand 1 "" "")))]
6796 #ifdef ASM_RETURN_CASE_JUMP
6797 ASM_RETURN_CASE_JUMP;
6799 if (TARGET_COLDFIRE)
6801 if (ADDRESS_REG_P (operands[0]))
6802 return MOTOROLA ? "jmp (2,pc,%0.l)" : "jmp pc@(2,%0:l)";
6804 return "ext%.l %0\;jmp (2,pc,%0.l)";
6806 return "extl %0\;jmp pc@(2,%0:l)";
6809 return MOTOROLA ? "jmp (2,pc,%0.w)" : "jmp pc@(2,%0:w)";
6813 ;; Decrement-and-branch insns.
6814 (define_insn "*dbne_hi"
6817 (ne (match_operand:HI 0 "nonimmediate_operand" "+d*g")
6819 (label_ref (match_operand 1 "" ""))
6822 (plus:HI (match_dup 0)
6827 if (DATA_REG_P (operands[0]))
6828 return "dbra %0,%l1";
6829 if (GET_CODE (operands[0]) == MEM)
6830 return "subq%.w #1,%0\;jcc %l1";
6831 return "subq%.w #1,%0\;cmp%.w #-1,%0\;jne %l1";
6834 (define_insn "*dbne_si"
6837 (ne (match_operand:SI 0 "nonimmediate_operand" "+d*g")
6839 (label_ref (match_operand 1 "" ""))
6842 (plus:SI (match_dup 0)
6847 if (DATA_REG_P (operands[0]))
6848 return "dbra %0,%l1\;clr%.w %0\;subq%.l #1,%0\;jcc %l1";
6849 if (GET_CODE (operands[0]) == MEM)
6850 return "subq%.l #1,%0\;jcc %l1";
6851 return "subq%.l #1,%0\;cmp%.l #-1,%0\;jne %l1";
6854 ;; Two dbra patterns that use REG_NOTES info generated by strength_reduce.
6856 (define_insn "*dbge_hi"
6859 (ge (plus:HI (match_operand:HI 0 "nonimmediate_operand" "+d*am")
6862 (label_ref (match_operand 1 "" ""))
6865 (plus:HI (match_dup 0)
6867 "!TARGET_COLDFIRE && find_reg_note (insn, REG_NONNEG, 0)"
6870 if (DATA_REG_P (operands[0]))
6871 return "dbra %0,%l1";
6872 if (GET_CODE (operands[0]) == MEM)
6873 return "subq%.w #1,%0\;jcc %l1";
6874 return "subq%.w #1,%0\;cmp%.w #-1,%0\;jne %l1";
6877 (define_expand "decrement_and_branch_until_zero"
6878 [(parallel [(set (pc)
6880 (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "")
6883 (label_ref (match_operand 1 "" ""))
6886 (plus:SI (match_dup 0)
6891 (define_insn "*dbge_si"
6894 (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+d*am")
6897 (label_ref (match_operand 1 "" ""))
6900 (plus:SI (match_dup 0)
6902 "!TARGET_COLDFIRE && find_reg_note (insn, REG_NONNEG, 0)"
6905 if (DATA_REG_P (operands[0]))
6906 return "dbra %0,%l1\;clr%.w %0\;subq%.l #1,%0\;jcc %l1";
6907 if (GET_CODE (operands[0]) == MEM)
6908 return "subq%.l #1,%0\;jcc %l1";
6909 return "subq%.l #1,%0\;cmp%.l #-1,%0\;jne %l1";
6912 (define_expand "sibcall"
6913 [(call (match_operand:QI 0 "memory_operand" "")
6914 (match_operand:SI 1 "general_operand" ""))]
6917 operands[0] = m68k_legitimize_sibcall_address (operands[0]);
6920 (define_insn "*sibcall"
6921 [(call (mem:QI (match_operand:SI 0 "sibcall_operand" ""))
6922 (match_operand:SI 1 "general_operand" ""))]
6923 "SIBLING_CALL_P (insn)"
6925 return output_sibcall (operands[0]);
6928 (define_expand "sibcall_value"
6929 [(set (match_operand 0 "" "")
6930 (call (match_operand:QI 1 "memory_operand" "")
6931 (match_operand:SI 2 "general_operand" "")))]
6934 operands[1] = m68k_legitimize_sibcall_address (operands[1]);
6937 (define_insn "*sibcall_value"
6938 [(set (match_operand 0 "" "=rf,rf")
6939 (call (mem:QI (match_operand:SI 1 "sibcall_operand" ""))
6940 (match_operand:SI 2 "general_operand" "")))]
6941 "SIBLING_CALL_P (insn)"
6943 operands[0] = operands[1];
6944 return output_sibcall (operands[0]);
6947 ;; Call subroutine with no return value.
6948 (define_expand "call"
6949 [(call (match_operand:QI 0 "memory_operand" "")
6950 (match_operand:SI 1 "general_operand" ""))]
6951 ;; Operand 1 not really used on the m68000.
6954 operands[0] = m68k_legitimize_call_address (operands[0]);
6957 (define_insn "*call"
6958 [(call (mem:QI (match_operand:SI 0 "call_operand" "a,W"))
6959 (match_operand:SI 1 "general_operand" "g,g"))]
6960 ;; Operand 1 not really used on the m68000.
6961 "!SIBLING_CALL_P (insn)"
6963 return output_call (operands[0]);
6965 [(set_attr "type" "jsr")])
6967 ;; Call subroutine, returning value in operand 0
6968 ;; (which must be a hard register).
6969 (define_expand "call_value"
6970 [(set (match_operand 0 "" "")
6971 (call (match_operand:QI 1 "memory_operand" "")
6972 (match_operand:SI 2 "general_operand" "")))]
6973 ;; Operand 2 not really used on the m68000.
6976 operands[1] = m68k_legitimize_call_address (operands[1]);
6979 (define_insn "*non_symbolic_call_value"
6980 [(set (match_operand 0 "" "=rf,rf")
6981 (call (mem:QI (match_operand:SI 1 "non_symbolic_call_operand" "a,W"))
6982 (match_operand:SI 2 "general_operand" "g,g")))]
6983 ;; Operand 2 not really used on the m68000.
6984 "!SIBLING_CALL_P (insn)"
6986 [(set_attr "type" "jsr")
6987 (set_attr "opx" "1")])
6989 (define_insn "*symbolic_call_value_jsr"
6990 [(set (match_operand 0 "" "=rf,rf")
6991 (call (mem:QI (match_operand:SI 1 "symbolic_operand" "a,W"))
6992 (match_operand:SI 2 "general_operand" "g,g")))]
6993 ;; Operand 2 not really used on the m68000.
6994 "!SIBLING_CALL_P (insn) && m68k_symbolic_call_var == M68K_SYMBOLIC_CALL_JSR"
6996 operands[0] = operands[1];
6997 return m68k_symbolic_call;
6999 [(set_attr "type" "jsr")
7000 (set_attr "opx" "1")])
7002 (define_insn "*symbolic_call_value_bsr"
7003 [(set (match_operand 0 "" "=rf,rf")
7004 (call (mem:QI (match_operand:SI 1 "symbolic_operand" "a,W"))
7005 (match_operand:SI 2 "general_operand" "g,g")))]
7006 ;; Operand 2 not really used on the m68000.
7007 "!SIBLING_CALL_P (insn)
7008 && (m68k_symbolic_call_var == M68K_SYMBOLIC_CALL_BSR_C
7009 || m68k_symbolic_call_var == M68K_SYMBOLIC_CALL_BSR_P)"
7011 operands[0] = operands[1];
7012 return m68k_symbolic_call;
7014 [(set_attr "type" "bsr")
7015 (set_attr "opx" "1")])
7017 ;; Call subroutine returning any type.
7019 (define_expand "untyped_call"
7020 [(parallel [(call (match_operand 0 "" "")
7022 (match_operand 1 "" "")
7023 (match_operand 2 "" "")])]
7024 "NEEDS_UNTYPED_CALL"
7028 emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
7030 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7032 rtx set = XVECEXP (operands[2], 0, i);
7033 emit_move_insn (SET_DEST (set), SET_SRC (set));
7036 /* The optimizer does not know that the call sets the function value
7037 registers we stored in the result block. We avoid problems by
7038 claiming that all hard registers are used and clobbered at this
7040 emit_insn (gen_blockage ());
7045 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7046 ;; all of memory. This blocks insns from being moved across this point.
7048 (define_insn "blockage"
7049 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7057 [(set_attr "type" "nop")])
7059 (define_expand "prologue"
7063 m68k_expand_prologue ();
7067 (define_expand "epilogue"
7071 m68k_expand_epilogue (false);
7075 (define_expand "sibcall_epilogue"
7079 m68k_expand_epilogue (true);
7083 ;; Used for frameless functions which save no regs and allocate no locals.
7084 (define_expand "return"
7086 "m68k_use_return_insn ()"
7089 (define_insn "*return"
7093 switch (m68k_get_function_kind (current_function_decl))
7095 case m68k_fk_interrupt_handler:
7098 case m68k_fk_interrupt_thread:
7102 if (crtl->args.pops_args)
7104 operands[0] = GEN_INT (crtl->args.pops_args);
7111 [(set_attr "type" "rts")])
7113 (define_insn "*m68k_store_multiple"
7114 [(match_parallel 0 "" [(match_operand 1 "")])]
7115 "m68k_movem_pattern_p (operands[0], NULL, 0, true)"
7117 return m68k_output_movem (operands, operands[0], 0, true);
7120 (define_insn "*m68k_store_multiple_automod"
7121 [(match_parallel 0 ""
7122 [(set (match_operand:SI 1 "register_operand" "=a")
7123 (plus:SI (match_operand:SI 2 "register_operand" "1")
7124 (match_operand:SI 3 "const_int_operand")))])]
7125 "m68k_movem_pattern_p (operands[0], operands[1], INTVAL (operands[3]), true)"
7127 return m68k_output_movem (operands, operands[0], INTVAL (operands[3]), true);
7130 (define_insn "*m68k_load_multiple"
7131 [(match_parallel 0 "" [(match_operand 1 "")])]
7132 "m68k_movem_pattern_p (operands[0], NULL, 0, false)"
7134 return m68k_output_movem (operands, operands[0], 0, false);
7137 (define_insn "*m68k_load_multiple_automod"
7138 [(match_parallel 0 ""
7139 [(set (match_operand:SI 1 "register_operand" "=a")
7140 (plus:SI (match_operand:SI 2 "register_operand" "1")
7141 (match_operand:SI 3 "const_int_operand")))])]
7142 "m68k_movem_pattern_p (operands[0], operands[1],
7143 INTVAL (operands[3]), false)"
7145 return m68k_output_movem (operands, operands[0],
7146 INTVAL (operands[3]), false);
7149 (define_expand "link"
7151 [(set (match_operand:SI 0 "register_operand")
7152 (plus:SI (reg:SI SP_REG) (const_int -4)))
7155 (set (reg:SI SP_REG)
7156 (plus:SI (reg:SI SP_REG)
7157 (match_operand:SI 1 "const_int_operand")))])]
7158 "TARGET_68020 || INTVAL (operands[1]) >= -0x8004"
7160 operands[2] = gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, -4));
7163 (define_insn "*link"
7164 [(set (match_operand:SI 0 "register_operand" "+r")
7165 (plus:SI (reg:SI SP_REG) (const_int -4)))
7166 (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -4)))
7168 (set (reg:SI SP_REG)
7169 (plus:SI (reg:SI SP_REG)
7170 (match_operand:SI 1 "const_int_operand")))]
7171 "TARGET_68020 || INTVAL (operands[1]) >= -0x8004"
7173 operands[1] = GEN_INT (INTVAL (operands[1]) + 4);
7175 return "link %0,%1";
7176 else if (INTVAL (operands[1]) >= -0x8000)
7177 return "link.w %0,%1";
7179 return "link.l %0,%1";
7181 [(set_attr "type" "link")])
7183 (define_expand "unlink"
7185 [(set (match_operand:SI 0 "register_operand")
7187 (set (reg:SI SP_REG)
7188 (plus:SI (match_dup 0)
7192 operands[1] = gen_frame_mem (SImode, copy_rtx (operands[0]));
7195 (define_insn "*unlink"
7196 [(set (match_operand:SI 0 "register_operand" "+r")
7197 (mem:SI (match_dup 0)))
7198 (set (reg:SI SP_REG)
7199 (plus:SI (match_dup 0)
7203 [(set_attr "type" "unlk")])
7205 (define_insn "load_got"
7206 [(set (match_operand:SI 0 "register_operand" "=a")
7207 (unspec:SI [(const_int 0)] UNSPEC_GOT))]
7210 if (TARGET_ID_SHARED_LIBRARY)
7212 operands[1] = gen_rtx_REG (Pmode, PIC_REG);
7213 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
7217 if (TARGET_COLDFIRE)
7218 /* Load the full 32-bit PC-relative offset of
7219 _GLOBAL_OFFSET_TABLE_ into the PIC register, then use it to
7220 calculate the absolute value. The offset and "lea"
7221 operation word together occupy 6 bytes. */
7222 return ("move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t"
7223 "lea (-6, %%pc, %0), %0");
7225 return "lea (%%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %0";
7228 return ("movel #_GLOBAL_OFFSET_TABLE_, %0\n\t"
7229 "lea %%pc@(0,%0:l),%0");
7232 (define_insn "indirect_jump"
7233 [(set (pc) (match_operand:SI 0 "address_operand" "p"))]
7236 [(set_attr "type" "jmp")])
7238 ;; This should not be used unless the add/sub insns can't be.
7241 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
7242 (match_operand:QI 1 "address_operand" "p"))]
7246 ;; This is the first machine-dependent peephole optimization.
7247 ;; It is useful when a floating value is returned from a function call
7248 ;; and then is moved into an FP register.
7249 ;; But it is mainly intended to test the support for these optimizations.
7252 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
7253 (set (match_operand:DF 0 "register_operand" "")
7254 (match_operand:DF 1 "register_operand" ""))]
7255 "FP_REG_P (operands[0]) && !FP_REG_P (operands[1])"
7256 [(set (mem:SI (reg:SI SP_REG)) (match_dup 1))
7257 (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 2))
7258 (set (match_dup 0) (mem:DF (post_inc:SI (reg:SI SP_REG))))]
7259 "split_di(operands + 1, 1, operands + 1, operands + 2);")
7261 ;; Optimize a stack-adjust followed by a push of an argument.
7262 ;; This is said to happen frequently with -msoft-float
7263 ;; when there are consecutive library calls.
7266 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
7267 (set (match_operand:SF 0 "push_operand" "")
7268 (match_operand:SF 1 "general_operand" ""))]
7269 "!reg_mentioned_p (stack_pointer_rtx, operands[0])"
7270 [(set (match_dup 0) (match_dup 1))]
7271 "operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);")
7274 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
7275 (match_operand:SI 0 "const_int_operand" "")))
7276 (set (match_operand:SF 1 "push_operand" "")
7277 (match_operand:SF 2 "general_operand" ""))]
7278 "INTVAL (operands[0]) > 4
7279 && !reg_mentioned_p (stack_pointer_rtx, operands[2])"
7280 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 0)))
7281 (set (match_dup 1) (match_dup 2))]
7283 operands[0] = GEN_INT (INTVAL (operands[0]) - 4);
7284 operands[1] = replace_equiv_address (operands[1], stack_pointer_rtx);
7287 ;; Speed up stack adjust followed by a fullword fixedpoint push.
7288 ;; Constant operands need special care, as replacing a "pea X.w" with
7289 ;; "move.l #X,(%sp)" is often not a win.
7291 ;; Already done by the previous csa pass, left as reference.
7293 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
7294 (set (match_operand:SI 0 "push_operand" "")
7295 (match_operand:SI 1 "general_operand" ""))]
7296 "!reg_mentioned_p (stack_pointer_rtx, operands[1])"
7297 [(set (match_dup 0) (match_dup 1))]
7298 "operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);")
7300 ;; Try to use moveq, after stack push has been changed into a simple move.
7302 [(match_scratch:SI 2 "d")
7303 (set (match_operand:SI 0 "memory_operand" "")
7304 (match_operand:SI 1 "const_int_operand" ""))]
7305 "GET_CODE (XEXP (operands[0], 0)) != PRE_DEC
7306 && INTVAL (operands[1]) != 0
7307 && IN_RANGE (INTVAL (operands[1]), -0x80, 0x7f)
7308 && !valid_mov3q_const (INTVAL (operands[1]))"
7309 [(set (match_dup 2) (match_dup 1))
7310 (set (match_dup 0) (match_dup 2))])
7312 ;; This sequence adds an instruction, but is two bytes shorter.
7314 [(match_scratch:SI 2 "d")
7315 (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 12)))
7316 (set (match_operand:SI 0 "push_operand" "")
7317 (match_operand:SI 1 "const_int_operand" ""))]
7318 "INTVAL (operands[1]) != 0
7319 && IN_RANGE (INTVAL (operands[1]), -0x80, 0x7f)
7320 && !valid_mov3q_const (INTVAL (operands[1]))"
7321 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8)))
7322 (set (match_dup 2) (match_dup 1))
7323 (set (match_dup 0) (match_dup 2))]
7324 "operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);")
7326 ;; Changing pea X.w into a move.l is no real win here.
7328 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
7329 (match_operand:SI 0 "const_int_operand" "")))
7330 (set (match_operand:SI 1 "push_operand" "")
7331 (match_operand:SI 2 "general_operand" ""))]
7332 "INTVAL (operands[0]) > 4
7333 && !reg_mentioned_p (stack_pointer_rtx, operands[2])
7334 && !(CONST_INT_P (operands[2]) && INTVAL (operands[2]) != 0
7335 && IN_RANGE (INTVAL (operands[2]), -0x8000, 0x7fff)
7336 && !valid_mov3q_const (INTVAL (operands[2])))"
7337 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 0)))
7338 (set (match_dup 1) (match_dup 2))]
7340 operands[0] = GEN_INT (INTVAL (operands[0]) - 4);
7341 operands[1] = replace_equiv_address (operands[1], stack_pointer_rtx);
7344 ;; Speed up pushing a single byte/two bytes but leaving four bytes of space
7345 ;; (which differs slightly between m680x0 and ColdFire).
7348 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4)))
7349 (set (match_operand:QI 0 "memory_operand" "")
7350 (match_operand:QI 1 "register_operand" ""))]
7351 "!reg_mentioned_p (stack_pointer_rtx, operands[1])
7352 && GET_CODE (XEXP (operands[0], 0)) == PLUS
7353 && rtx_equal_p (XEXP (XEXP (operands[0], 0), 0), stack_pointer_rtx)
7354 && CONST_INT_P (XEXP (XEXP (operands[0], 0), 1))
7355 && INTVAL (XEXP (XEXP (operands[0], 0), 1)) == 3"
7356 [(set (match_dup 0) (match_dup 1))]
7358 rtx addr = gen_rtx_PRE_DEC (Pmode, stack_pointer_rtx);
7359 operands[0] = adjust_automodify_address (operands[0], SImode, addr, -3);
7360 operands[1] = simplify_gen_subreg (SImode, operands[1], QImode, 0);
7364 [(set (match_operand:QI 0 "push_operand" "")
7365 (match_operand:QI 1 "register_operand" ""))
7366 (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -3)))]
7367 "!reg_mentioned_p (stack_pointer_rtx, operands[1])"
7368 [(set (match_dup 0) (match_dup 1))]
7370 operands[0] = adjust_automodify_address (operands[0], SImode,
7371 XEXP (operands[0], 0), -3);
7372 operands[1] = simplify_gen_subreg (SImode, operands[1], QImode, 0);
7376 [(set (match_operand:HI 0 "push_operand" "")
7377 (match_operand:HI 1 "register_operand" ""))
7378 (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2)))]
7379 "!reg_mentioned_p (stack_pointer_rtx, operands[1])"
7380 [(set (match_dup 0) (match_dup 1))]
7382 operands[0] = adjust_automodify_address (operands[0], SImode,
7383 XEXP (operands[0], 0), -2);
7384 operands[1] = simplify_gen_subreg (SImode, operands[1], HImode, 0);
7387 ;; Optimize a series of strict_low_part assignments
7390 [(set (match_operand:SI 0 "register_operand" "")
7392 (set (strict_low_part (match_operand:HI 1 "register_operand" ""))
7393 (match_operand:HI 2 "general_operand" ""))]
7394 "REGNO (operands[0]) == REGNO (operands[1])
7395 && strict_low_part_peephole_ok (HImode, insn, operands[0])"
7396 [(set (strict_low_part (match_dup 1)) (match_dup 2))]
7400 [(set (match_operand:SI 0 "register_operand" "")
7402 (set (strict_low_part (match_operand:QI 1 "register_operand" ""))
7403 (match_operand:QI 2 "general_operand" ""))]
7404 "REGNO (operands[0]) == REGNO (operands[1])
7405 && strict_low_part_peephole_ok (QImode, insn, operands[0])"
7406 [(set (strict_low_part (match_dup 1)) (match_dup 2))]
7414 ;; jCC label ; abnormal loop termination
7415 ;; dbra dN, loop ; normal loop termination
7423 ;; Which moves the jCC condition outside the inner loop for free.
7427 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7428 [(cc0) (const_int 0)])
7429 (label_ref (match_operand 2 "" ""))
7434 (ne (match_operand:HI 0 "register_operand" "")
7436 (label_ref (match_operand 1 "" ""))
7439 (plus:HI (match_dup 0)
7441 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7444 output_dbcc_and_branch (operands);
7449 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7450 [(cc0) (const_int 0)])
7451 (label_ref (match_operand 2 "" ""))
7456 (ne (match_operand:SI 0 "register_operand" "")
7458 (label_ref (match_operand 1 "" ""))
7461 (plus:SI (match_dup 0)
7463 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7466 output_dbcc_and_branch (operands);
7471 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7472 [(cc0) (const_int 0)])
7473 (label_ref (match_operand 2 "" ""))
7478 (ge (plus:HI (match_operand:HI 0 "register_operand" "")
7481 (label_ref (match_operand 1 "" ""))
7484 (plus:HI (match_dup 0)
7486 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7489 output_dbcc_and_branch (operands);
7494 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7495 [(cc0) (const_int 0)])
7496 (label_ref (match_operand 2 "" ""))
7501 (ge (plus:SI (match_operand:SI 0 "register_operand" "")
7504 (label_ref (match_operand 1 "" ""))
7507 (plus:SI (match_dup 0)
7509 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7512 output_dbcc_and_branch (operands);
7517 (define_insn "extendsfxf2"
7518 [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f")
7519 (float_extend:XF (match_operand:SF 1 "general_operand" "f,rmF")))]
7522 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
7524 if (REGNO (operands[0]) == REGNO (operands[1]))
7526 /* Extending float to double in an fp-reg is a no-op.
7527 NOTICE_UPDATE_CC has already assumed that the
7528 cc will be set. So cancel what it did. */
7529 cc_status = cc_prev_status;
7532 return "f%$move%.x %1,%0";
7534 if (FP_REG_P (operands[0]))
7536 if (FP_REG_P (operands[1]))
7537 return "f%$move%.x %1,%0";
7538 else if (ADDRESS_REG_P (operands[1]))
7539 return "move%.l %1,%-\;f%$move%.s %+,%0";
7540 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
7541 return output_move_const_single (operands);
7542 return "f%$move%.s %f1,%0";
7544 return "fmove%.x %f1,%0";
7548 (define_insn "extenddfxf2"
7549 [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f")
7551 (match_operand:DF 1 "general_operand" "f,rmE")))]
7554 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
7556 if (REGNO (operands[0]) == REGNO (operands[1]))
7558 /* Extending float to double in an fp-reg is a no-op.
7559 NOTICE_UPDATE_CC has already assumed that the
7560 cc will be set. So cancel what it did. */
7561 cc_status = cc_prev_status;
7564 return "fmove%.x %1,%0";
7566 if (FP_REG_P (operands[0]))
7568 if (REG_P (operands[1]))
7571 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
7572 output_asm_insn ("move%.l %1,%-", xoperands);
7573 output_asm_insn ("move%.l %1,%-", operands);
7574 return "f%&move%.d %+,%0";
7576 if (GET_CODE (operands[1]) == CONST_DOUBLE)
7577 return output_move_const_double (operands);
7578 return "f%&move%.d %f1,%0";
7580 return "fmove%.x %f1,%0";
7583 (define_insn "truncxfdf2"
7584 [(set (match_operand:DF 0 "nonimmediate_operand" "=m,!r")
7586 (match_operand:XF 1 "general_operand" "f,f")))]
7589 if (REG_P (operands[0]))
7591 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
7592 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
7593 return "move%.l %+,%0";
7595 return "fmove%.d %f1,%0";
7598 (define_insn "truncxfsf2"
7599 [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
7601 (match_operand:XF 1 "general_operand" "f")))]
7605 (define_insn "sin<mode>2"
7606 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
7608 [(match_operand:FP 1 "general_operand" "f<FP:dreg>m")] UNSPEC_SIN))]
7609 "TARGET_68881 && flag_unsafe_math_optimizations"
7611 if (FP_REG_P (operands[1]))
7612 return "fsin%.x %1,%0";
7614 return "fsin%.<FP:prec> %1,%0";
7617 (define_insn "cos<mode>2"
7618 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
7620 [(match_operand:FP 1 "general_operand" "f<FP:dreg>m")] UNSPEC_COS))]
7621 "TARGET_68881 && flag_unsafe_math_optimizations"
7623 if (FP_REG_P (operands[1]))
7624 return "fcos%.x %1,%0";
7626 return "fcos%.<FP:prec> %1,%0";
7629 ;; Unconditional traps are assumed to have (const_int 1) for the condition.
7631 [(trap_if (const_int 1) (const_int 7))]
7634 [(set_attr "type" "trap")])
7636 (define_expand "conditional_trap"
7637 [(trap_if (match_operator 0 "valid_dbcc_comparison_p"
7638 [(cc0) (const_int 0)])
7639 (match_operand:SI 1 "const_int_operand" "I"))]
7642 if (m68k_last_compare_had_fp_operands)
7644 m68k_last_compare_had_fp_operands = 0;
7649 (define_insn "*conditional_trap"
7650 [(trap_if (match_operator 0 "valid_dbcc_comparison_p"
7651 [(cc0) (const_int 0)])
7652 (match_operand:SI 1 "const_int_operand" "I"))]
7653 "TARGET_68020 && ! flags_in_68881 ()"
7655 switch (GET_CODE (operands[0]))
7657 case EQ: return "trapeq";
7658 case NE: return "trapne";
7659 case GT: return "trapgt";
7660 case GTU: return "traphi";
7661 case LT: return "traplt";
7662 case LTU: return "trapcs";
7663 case GE: return "trapge";
7664 case GEU: return "trapcc";
7665 case LE: return "traple";
7666 case LEU: return "trapls";
7667 default: gcc_unreachable ();
7671 ;; These are to prevent the scheduler from moving stores to the frame
7672 ;; before the stack adjustment.
7673 (define_insn "stack_tie"
7674 [(set (mem:BLK (scratch))
7675 (unspec:BLK [(match_operand:SI 0 "register_operand" "r")
7676 (match_operand:SI 1 "register_operand" "r")]
7680 [(set_attr "type" "ignore")])
7682 ;; Instruction that subscribes one word in ColdFire instruction buffer.
7683 ;; This instruction is used within scheduler only and should not appear
7684 ;; in the instruction stream.
7686 [(unspec [(const_int 0)] UNSPEC_IB)]
7689 [(set_attr "type" "ib")])