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
121 ;; UNSPEC_VOLATILE usage:
124 [(UNSPECV_BLOCKAGE 0)
127 ;; Registers by name.
138 (include "predicates.md")
139 (include "constraints.md")
141 ;; ::::::::::::::::::::
145 ;; ::::::::::::::::::::
148 (define_attr "cpu" "cfv1, cfv2, cfv3, cfv4, unknown"
149 (const (symbol_ref "m68k_sched_cpu")))
152 (define_attr "mac" "no, cf_mac, cf_emac"
153 (const (symbol_ref "m68k_sched_mac")))
155 ;; Instruction type for use in scheduling description.
156 ;; _l and _w suffixes indicate size of the operands of instruction.
157 ;; alu - usual arithmetic or logic instruction.
158 ;; aluq - arithmetic or logic instruction which has a quick immediate (the one
159 ;; that is encoded in the instruction word) for its Y operand.
160 ;; alux - Arithmetic instruction that uses carry bit (e.g., addx and subx).
161 ;; bcc - conditional branch.
162 ;; bitr - bit operation that only updates flags.
163 ;; bitrw - bit operation that updates flags and output operand.
164 ;; bra, bsr, clr, cmp, div, ext - corresponding instruction.
165 ;; falu, fbcc, fcmp, fdiv, fmove, fmul, fneg, fsqrt, ftst - corresponding
167 ;; ib - fake instruction to subscribe slots in ColdFire V1,V2,V3 instruction
169 ;; ignore - fake instruction.
170 ;; jmp, jsr, lea, link, mov3q, move, moveq, mul - corresponding instruction.
171 ;; mvsz - mvs or mvz instruction.
172 ;; neg, nop, pea, rts, scc - corresponding instruction.
173 ;; shift - arithmetic or logical shift instruction.
174 ;; trap, tst, unlk - corresponding instruction.
176 "alu_l,aluq_l,alux_l,bcc,bitr,bitrw,bra,bsr,clr,clr_l,cmp,cmp_l,
178 falu,fbcc,fcmp,fdiv,fmove,fmul,fneg,fsqrt,ftst,
180 jmp,jsr,lea,link,mov3q_l,move,move_l,moveq_l,mul_w,mul_l,mvsz,neg_l,nop,
184 (const_string "unknown"))
186 ;; Index of the X or Y operand in recog_data.operand[].
187 ;; Should be used only within opx_type and opy_type.
188 (define_attr "opx" "" (const_int 0))
189 (define_attr "opy" "" (const_int 1))
191 ;; Type of the Y operand.
192 ;; See m68k.c: enum attr_op_type.
193 (define_attr "opy_type"
194 "none,Rn,FPn,mem1,mem234,mem5,mem6,mem7,imm_q,imm_w,imm_l"
195 (cond [(eq_attr "type" "ext,fbcc,ftst,neg_l,bcc,bra,bsr,clr,clr_l,ib,ignore,
196 jmp,jsr,nop,rts,scc,trap,tst,tst_l,
197 unlk,unknown") (const_string "none")
198 (eq_attr "type" "lea,pea")
199 (symbol_ref "m68k_sched_attr_opy_type (insn, 1)")]
200 (symbol_ref "m68k_sched_attr_opy_type (insn, 0)")))
202 ;; Type of the X operand.
203 ;; See m68k.c: enum attr_op_type.
204 (define_attr "opx_type"
205 "none,Rn,FPn,mem1,mem234,mem5,mem6,mem7,imm_q,imm_w,imm_l"
206 (cond [(eq_attr "type" "ib,ignore,nop,rts,trap,unlk,
207 unknown") (const_string "none")
208 (eq_attr "type" "pea") (const_string "mem1")
209 (eq_attr "type" "jmp,jsr")
210 (symbol_ref "m68k_sched_attr_opx_type (insn, 1)")]
211 (symbol_ref "m68k_sched_attr_opx_type (insn, 0)")))
213 ;; Access to the X operand: none, read, write, read/write, unknown.
214 ;; Access to the Y operand is either none (if opy_type is none)
215 ;; or read otherwise.
216 (define_attr "opx_access" "none, r, w, rw"
217 (cond [(eq_attr "type" "ib,ignore,nop,rts,trap,unlk,
218 unknown") (const_string "none")
219 (eq_attr "type" "bcc,bra,bsr,bitr,cmp,cmp_l,fbcc,fcmp,ftst,
220 jmp,jsr,tst,tst_l") (const_string "r")
221 (eq_attr "type" "clr,clr_l,fneg,fmove,lea,
222 mov3q_l,move,move_l,moveq_l,mvsz,
223 pea,scc") (const_string "w")
224 (eq_attr "type" "alu_l,aluq_l,alux_l,bitrw,div_w,div_l,ext,
225 falu,fdiv,fmul,fsqrt,link,mul_w,mul_l,
226 neg_l,shift") (const_string "rw")]
227 ;; Should never be used.
228 (symbol_ref "(gcc_unreachable (), OPX_ACCESS_NONE)")))
230 ;; Memory accesses of the insn.
231 ;; 00 - no memory references
232 ;; 10 - memory is read
233 ;; i0 - indexed memory is read
234 ;; 01 - memory is written
235 ;; 0i - indexed memory is written
236 ;; 11 - memory is read, memory is written
237 ;; i1 - indexed memory is read, memory is written
238 ;; 1i - memory is read, indexed memory is written
239 (define_attr "op_mem" "00, 10, i0, 01, 0i, 11, i1, 1i"
240 (symbol_ref "m68k_sched_attr_op_mem (insn)"))
242 ;; Instruction size in words.
243 (define_attr "size" "1,2,3"
244 (symbol_ref "m68k_sched_attr_size (insn)"))
247 ;; Mode macros for floating point operations.
248 ;; Valid floating point modes
249 (define_mode_iterator FP [SF DF (XF "TARGET_68881")])
250 ;; Mnemonic infix to round result
251 (define_mode_attr round [(SF "%$") (DF "%&") (XF "")])
252 ;; Mnemonic infix to round result for mul or div instruction
253 (define_mode_attr round_mul [(SF "sgl") (DF "%&") (XF "")])
254 ;; Suffix specifying source operand format
255 (define_mode_attr prec [(SF "s") (DF "d") (XF "x")])
256 ;; Allowable D registers
257 (define_mode_attr dreg [(SF "d") (DF "") (XF "")])
258 ;; Allowable 68881 constant constraints
259 (define_mode_attr const [(SF "F") (DF "G") (XF "")])
262 (define_insn_and_split "*movdf_internal"
263 [(set (match_operand:DF 0 "push_operand" "=m, m")
264 (match_operand:DF 1 "general_operand" "f, ro<>E"))]
269 "&& reload_completed && (extract_constrain_insn_cached (insn), which_alternative == 1)"
272 m68k_emit_move_double (operands);
275 [(set_attr "type" "fmove,*")])
277 (define_insn_and_split "pushdi"
278 [(set (match_operand:DI 0 "push_operand" "=m")
279 (match_operand:DI 1 "general_operand" "ro<>Fi"))]
282 "&& reload_completed"
285 m68k_emit_move_double (operands);
289 ;; We don't want to allow a constant operand for test insns because
290 ;; (set (cc0) (const_int foo)) has no mode information. Such insns will
291 ;; be folded while optimizing anyway.
293 (define_expand "tstdi"
294 [(parallel [(set (cc0)
295 (match_operand:DI 0 "nonimmediate_operand" ""))
296 (clobber (match_scratch:SI 1 ""))
297 (clobber (match_scratch:DI 2 ""))])]
299 "m68k_last_compare_had_fp_operands = 0;")
303 (match_operand:DI 0 "nonimmediate_operand" "am,d"))
304 (clobber (match_scratch:SI 1 "=X,d"))
305 (clobber (match_scratch:DI 2 "=d,X"))]
308 if (which_alternative == 0)
312 xoperands[0] = operands[2];
313 xoperands[1] = operands[0];
314 output_move_double (xoperands);
315 cc_status.flags |= CC_REVERSED; /*|*/
316 return "neg%.l %R2\;negx%.l %2";
318 if (find_reg_note (insn, REG_DEAD, operands[0]))
320 cc_status.flags |= CC_REVERSED; /*|*/
321 return "neg%.l %R0\;negx%.l %0";
325 'sub' clears %1, and also clears the X cc bit
326 'tst' sets the Z cc bit according to the low part of the DImode operand
327 'subx %1' (i.e. subx #0) acts as a (non-existent) tstx on the high part.
329 return "sub%.l %1,%1\;tst%.l %R0\;subx%.l %1,%0";
332 (define_expand "tstsi"
334 (match_operand:SI 0 "nonimmediate_operand" ""))]
336 "m68k_last_compare_had_fp_operands = 0;")
338 ;; If you think that the 68020 does not support tstl a0,
339 ;; reread page B-167 of the 68020 manual more carefully.
340 (define_insn "*tstsi_internal_68020_cf"
342 (match_operand:SI 0 "nonimmediate_operand" "rm"))]
343 "TARGET_68020 || TARGET_COLDFIRE"
345 [(set_attr "type" "tst_l")])
347 ;; On an address reg, cmpw may replace cmpl.
348 (define_insn "*tstsi_internal"
350 (match_operand:SI 0 "nonimmediate_operand" "dm,r"))]
351 "!(TARGET_68020 || TARGET_COLDFIRE)"
355 [(set_attr "type" "tst_l,cmp")])
357 ;; This can't use an address register, because comparisons
358 ;; with address registers as second operand always test the whole word.
359 (define_expand "tsthi"
361 (match_operand:HI 0 "nonimmediate_operand" ""))]
363 "m68k_last_compare_had_fp_operands = 0;")
365 (define_insn "*tsthi_internal"
367 (match_operand:HI 0 "nonimmediate_operand" "dm"))]
370 [(set_attr "type" "tst")])
372 (define_expand "tstqi"
374 (match_operand:QI 0 "nonimmediate_operand" ""))]
376 "m68k_last_compare_had_fp_operands = 0;")
378 (define_insn "*tstqi_internal"
380 (match_operand:QI 0 "nonimmediate_operand" "dm"))]
383 [(set_attr "type" "tst")])
385 (define_expand "tst<mode>"
387 (match_operand:FP 0 "general_operand" ""))]
390 m68k_last_compare_had_fp_operands = 1;
393 (define_insn "tst<mode>_68881"
395 (match_operand:FP 0 "general_operand" "f<FP:dreg>m"))]
398 cc_status.flags = CC_IN_68881;
399 if (FP_REG_P (operands[0]))
401 return "ftst%.<FP:prec> %0";
403 [(set_attr "type" "ftst")])
405 (define_insn "tst<mode>_cf"
407 (match_operand:FP 0 "general_operand" "f<FP:dreg><Q>U"))]
408 "TARGET_COLDFIRE_FPU"
410 cc_status.flags = CC_IN_68881;
411 if (FP_REG_P (operands[0]))
413 return "ftst%.<FP:prec> %0";
415 [(set_attr "type" "ftst")])
418 ;; compare instructions.
420 (define_expand "cmpdi"
423 (compare (match_operand:DI 0 "nonimmediate_operand" "")
424 (match_operand:DI 1 "general_operand" "")))
425 (clobber (match_dup 2))])]
427 "m68k_last_compare_had_fp_operands = 0; operands[2] = gen_reg_rtx (DImode);")
431 (compare (match_operand:DI 1 "nonimmediate_operand" "0,d")
432 (match_operand:DI 2 "general_operand" "d,0")))
433 (clobber (match_operand:DI 0 "register_operand" "=d,d"))]
436 if (rtx_equal_p (operands[0], operands[1]))
437 return "sub%.l %R2,%R0\;subx%.l %2,%0";
440 cc_status.flags |= CC_REVERSED; /*|*/
441 return "sub%.l %R1,%R0\;subx%.l %1,%0";
445 (define_expand "cmpsi"
447 (compare (match_operand:SI 0 "nonimmediate_operand" "")
448 (match_operand:SI 1 "general_operand" "")))]
451 m68k_last_compare_had_fp_operands = 0;
454 ;; A composite of the cmp, cmpa, cmpi & cmpm m68000 op codes.
457 (compare (match_operand:SI 0 "nonimmediate_operand" "rKT,rKs,mSr,mSa,>")
458 (match_operand:SI 1 "general_src_operand" "mSr,mSa,KTr,Ksr,>")))]
461 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
462 return "cmpm%.l %1,%0";
463 if (REG_P (operands[1])
464 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
466 cc_status.flags |= CC_REVERSED; /*|*/
467 return "cmp%.l %d0,%d1";
469 if (ADDRESS_REG_P (operands[0])
470 && GET_CODE (operands[1]) == CONST_INT
471 && INTVAL (operands[1]) < 0x8000
472 && INTVAL (operands[1]) >= -0x8000)
473 return "cmp%.w %1,%0";
474 return "cmp%.l %d1,%d0";
477 (define_insn "*cmpsi_cf"
479 (compare (match_operand:SI 0 "nonimmediate_operand" "mrKs,r")
480 (match_operand:SI 1 "general_operand" "r,mrKs")))]
483 if (REG_P (operands[1])
484 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
486 cc_status.flags |= CC_REVERSED; /*|*/
487 return "cmp%.l %d0,%d1";
489 return "cmp%.l %d1,%d0";
491 [(set_attr "type" "cmp_l")])
493 (define_expand "cmphi"
495 (compare (match_operand:HI 0 "nonimmediate_src_operand" "")
496 (match_operand:HI 1 "general_src_operand" "")))]
498 "m68k_last_compare_had_fp_operands = 0;")
502 (compare (match_operand:HI 0 "nonimmediate_src_operand" "rnmS,d,n,mS,>")
503 (match_operand:HI 1 "general_src_operand" "d,rnmS,mS,n,>")))]
506 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
507 return "cmpm%.w %1,%0";
508 if ((REG_P (operands[1]) && !ADDRESS_REG_P (operands[1]))
509 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
511 cc_status.flags |= CC_REVERSED; /*|*/
512 return "cmp%.w %d0,%d1";
514 return "cmp%.w %d1,%d0";
517 (define_expand "cmpqi"
519 (compare (match_operand:QI 0 "nonimmediate_src_operand" "")
520 (match_operand:QI 1 "general_src_operand" "")))]
522 "m68k_last_compare_had_fp_operands = 0;")
526 (compare (match_operand:QI 0 "nonimmediate_src_operand" "dn,dmS,>")
527 (match_operand:QI 1 "general_src_operand" "dmS,nd,>")))]
530 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
531 return "cmpm%.b %1,%0";
532 if (REG_P (operands[1])
533 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
535 cc_status.flags |= CC_REVERSED; /*|*/
536 return "cmp%.b %d0,%d1";
538 return "cmp%.b %d1,%d0";
541 (define_expand "cmp<mode>"
543 (compare (match_operand:FP 0 "register_operand" "")
544 (match_operand:FP 1 "fp_src_operand" "")))]
546 "m68k_last_compare_had_fp_operands = 1;")
548 (define_insn "*cmp<mode>_68881"
550 (compare (match_operand:FP 0 "fp_src_operand" "f,f,<FP:dreg>mF")
551 (match_operand:FP 1 "fp_src_operand" "f,<FP:dreg>mF,f")))]
553 && (register_operand (operands[0], <MODE>mode)
554 || register_operand (operands[1], <MODE>mode))"
557 fcmp%.<FP:prec> %f1,%0
558 fcmp%.<FP:prec> %0,%f1"
559 [(set_attr "type" "fcmp")])
561 (define_insn "*cmp<mode>_cf"
563 (compare (match_operand:FP 0 "fp_src_operand" "f,f,<FP:dreg><Q>U")
564 (match_operand:FP 1 "fp_src_operand" "f,<FP:dreg><Q>U,f")))]
566 && (register_operand (operands[0], <MODE>mode)
567 || register_operand (operands[1], <MODE>mode))"
570 fcmp%.<FP:prec> %f1,%0
571 fcmp%.<FP:prec> %0,%f1"
572 [(set_attr "type" "fcmp")])
574 ;; Recognizers for btst instructions.
576 ;; ColdFire/5200 only allows "<Q>" type addresses when the bit position is
577 ;; specified as a constant, so we must disable all patterns that may extract
578 ;; from a MEM at a constant bit position if we can't use this as a constraint.
581 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_src_operand" "oS")
583 (minus:SI (const_int 7)
584 (match_operand:SI 1 "general_operand" "di"))))]
587 return output_btst (operands, operands[1], operands[0], insn, 7);
590 ;; This is the same as the above pattern except for the constraints. The 'i'
594 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o")
596 (minus:SI (const_int 7)
597 (match_operand:SI 1 "general_operand" "d"))))]
600 return output_btst (operands, operands[1], operands[0], insn, 7);
604 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d")
606 (minus:SI (const_int 31)
607 (match_operand:SI 1 "general_operand" "di"))))]
610 return output_btst (operands, operands[1], operands[0], insn, 31);
613 ;; The following two patterns are like the previous two
614 ;; except that they use the fact that bit-number operands
615 ;; are automatically masked to 3 or 5 bits.
618 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o")
620 (minus:SI (const_int 7)
622 (match_operand:SI 1 "register_operand" "d")
626 return output_btst (operands, operands[1], operands[0], insn, 7);
630 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d")
632 (minus:SI (const_int 31)
634 (match_operand:SI 1 "register_operand" "d")
638 return output_btst (operands, operands[1], operands[0], insn, 31);
641 ;; Nonoffsettable mem refs are ok in this one pattern
642 ;; since we don't try to adjust them.
644 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "m")
646 (match_operand:SI 1 "const_int_operand" "n")))]
647 "(unsigned) INTVAL (operands[1]) < 8 && !TARGET_COLDFIRE"
649 operands[1] = GEN_INT (7 - INTVAL (operands[1]));
650 return output_btst (operands, operands[1], operands[0], insn, 7);
654 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "do")
656 (match_operand:SI 1 "const_int_operand" "n")))]
659 if (GET_CODE (operands[0]) == MEM)
661 operands[0] = adjust_address (operands[0], QImode,
662 INTVAL (operands[1]) / 8);
663 operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
664 return output_btst (operands, operands[1], operands[0], insn, 7);
666 operands[1] = GEN_INT (31 - INTVAL (operands[1]));
667 return output_btst (operands, operands[1], operands[0], insn, 31);
670 ;; This is the same as the above pattern except for the constraints.
671 ;; The 'o' has been replaced with 'Q'.
674 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "dQ")
676 (match_operand:SI 1 "const_int_operand" "n")))]
679 if (GET_CODE (operands[0]) == MEM)
681 operands[0] = adjust_address (operands[0], QImode,
682 INTVAL (operands[1]) / 8);
683 operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
684 return output_btst (operands, operands[1], operands[0], insn, 7);
686 operands[1] = GEN_INT (31 - INTVAL (operands[1]));
687 return output_btst (operands, operands[1], operands[0], insn, 31);
693 ;; A special case in which it is not desirable
694 ;; to reload the constant into a data register.
695 (define_insn "pushexthisi_const"
696 [(set (match_operand:SI 0 "push_operand" "=m,m,m")
697 (match_operand:SI 1 "const_int_operand" "C0,R,J"))]
698 "INTVAL (operands[1]) >= -0x8000 && INTVAL (operands[1]) < 0x8000"
703 [(set_attr "type" "clr_l,mov3q_l,pea")])
706 ;(define_insn "swapsi"
707 ; [(set (match_operand:SI 0 "nonimmediate_operand" "+r")
708 ; (match_operand:SI 1 "general_operand" "+r"))
709 ; (set (match_dup 1) (match_dup 0))]
713 ;; Special case of fullword move when source is zero for 68000_10.
714 ;; moveq is faster on the 68000.
715 (define_insn "*movsi_const0_68000_10"
716 [(set (match_operand:SI 0 "movsi_const0_operand" "=d,a,g")
723 [(set_attr "type" "moveq_l,alu_l,clr_l")
724 (set_attr "opy" "*,0,*")])
726 ;; Special case of fullword move when source is zero for 68040_60.
727 ;; On the '040, 'subl an,an' takes 2 clocks while lea takes only 1
728 (define_insn "*movsi_const0_68040_60"
729 [(set (match_operand:SI 0 "movsi_const0_operand" "=a,g")
733 if (which_alternative == 0)
734 return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0";
735 else if (which_alternative == 1)
743 [(set_attr "type" "lea,clr_l")])
745 ;; Special case of fullword move when source is zero.
746 (define_insn "*movsi_const0"
747 [(set (match_operand:SI 0 "movsi_const0_operand" "=a,g")
749 "!(TUNE_68000_10 || TUNE_68040_60)"
753 [(set_attr "type" "alu_l,clr_l")
754 (set_attr "opy" "0,*")])
756 ;; General case of fullword move.
758 ;; This is the main "hook" for PIC code. When generating
759 ;; PIC, movsi is responsible for determining when the source address
760 ;; needs PIC relocation and appropriately calling legitimize_pic_address
761 ;; to perform the actual relocation.
763 ;; In both the PIC and non-PIC cases the patterns generated will
764 ;; matched by the next define_insn.
765 (define_expand "movsi"
766 [(set (match_operand:SI 0 "" "")
767 (match_operand:SI 1 "" ""))]
770 rtx tmp, base, offset;
772 if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode))
774 /* The source is an address which requires PIC relocation.
775 Call legitimize_pic_address with the source, mode, and a relocation
776 register (a new pseudo, or the final destination if reload_in_progress
777 is set). Then fall through normally */
778 rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
779 operands[1] = legitimize_pic_address (operands[1], SImode, temp);
781 else if (flag_pic && TARGET_PCREL && ! reload_in_progress)
783 /* Don't allow writes to memory except via a register;
784 the m68k doesn't consider PC-relative addresses to be writable. */
785 if (symbolic_operand (operands[0], SImode))
786 operands[0] = force_reg (SImode, XEXP (operands[0], 0));
787 else if (GET_CODE (operands[0]) == MEM
788 && symbolic_operand (XEXP (operands[0], 0), SImode))
789 operands[0] = gen_rtx_MEM (SImode,
790 force_reg (SImode, XEXP (operands[0], 0)));
792 if (M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P)
794 split_const (operands[1], &base, &offset);
795 if (GET_CODE (base) == SYMBOL_REF
796 && !offset_within_block_p (base, INTVAL (offset)))
798 tmp = !can_create_pseudo_p () ? operands[0] : gen_reg_rtx (SImode);
799 emit_move_insn (tmp, base);
800 emit_insn (gen_addsi3 (operands[0], tmp, offset));
806 ;; General case of fullword move.
807 (define_insn "*movsi_m68k"
808 ;; Notes: make sure no alternative allows g vs g.
809 ;; We don't allow f-regs since fixed point cannot go in them.
810 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<")
811 (match_operand:SI 1 "general_src_operand" "damSnT,n,i"))]
812 "!TARGET_COLDFIRE && reload_completed"
814 return output_move_simode (operands);
817 ;; Before reload is completed the register constraints
818 ;; force integer constants in range for a moveq to be reloaded
819 ;; if they are headed for memory.
820 (define_insn "*movsi_m68k2"
821 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<")
822 (match_operand:SI 1 "general_src_operand" "damSKT,n,i"))]
826 return output_move_simode (operands);
829 ;; ColdFire move instructions can have at most one operand of mode >= 6.
830 (define_insn "*movsi_cf"
831 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d, d, d, d, d, a,Ap, a, r<Q>,g, U")
832 (match_operand:SI 1 "general_operand" " R,CQ,CW,CZ,CS,Ci,J,J Cs,Cs, g, Rr<Q>,U"))]
835 switch (which_alternative)
838 return "mov3q%.l %1,%0";
841 return "moveq %1,%0";
845 unsigned u = INTVAL (operands[1]);
847 operands[1] = GEN_INT ((u << 16) | (u >> 16)); /*|*/
848 return "moveq %1,%0\n\tswap %0";
852 return "mvz%.w %1,%0";
855 return "mvs%.w %1,%0";
858 return "move%.l %1,%0";
861 return "move%.w %1,%0";
872 return "move%.l %1,%0";
879 [(set_attr "type" "mov3q_l,moveq_l,*,mvsz,mvsz,move_l,move,pea,lea,move_l,move_l,move_l")])
881 ;; Special case of fullword move, where we need to get a non-GOT PIC
882 ;; reference into an address register.
884 [(set (match_operand:SI 0 "nonimmediate_operand" "=a<")
885 (match_operand:SI 1 "pcrel_address" ""))]
888 if (push_operand (operands[0], SImode))
893 (define_expand "movhi"
894 [(set (match_operand:HI 0 "nonimmediate_operand" "")
895 (match_operand:HI 1 "general_operand" ""))]
900 [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
901 (match_operand:HI 1 "general_src_operand" "gS"))]
903 "* return output_move_himode (operands);")
906 [(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g,U")
907 (match_operand:HI 1 "general_operand" "g,r<Q>,U"))]
909 "* return output_move_himode (operands);")
911 (define_expand "movstricthi"
912 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" ""))
913 (match_operand:HI 1 "general_src_operand" ""))]
918 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
919 (match_operand:HI 1 "general_src_operand" "rmSn"))]
921 "* return output_move_stricthi (operands);")
924 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+d,m"))
925 (match_operand:HI 1 "general_src_operand" "rmn,r"))]
927 "* return output_move_stricthi (operands);")
929 (define_expand "movqi"
930 [(set (match_operand:QI 0 "nonimmediate_operand" "")
931 (match_operand:QI 1 "general_src_operand" ""))]
936 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
937 (match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
939 "* return output_move_qimode (operands);")
942 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>,dm,U,d*a")
943 (match_operand:QI 1 "general_src_operand" "dmi,d<Q>,U,di*a"))]
945 "* return output_move_qimode (operands);")
947 (define_expand "movstrictqi"
948 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
949 (match_operand:QI 1 "general_src_operand" ""))]
954 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
955 (match_operand:QI 1 "general_src_operand" "dmSn"))]
957 "* return output_move_strictqi (operands);")
959 (define_insn "*movstrictqi_cf"
960 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d, Ac, d,m"))
961 (match_operand:QI 1 "general_src_operand" "C0,C0, dmn,d"))]
968 [(set_attr "type" "clr,clr,move,move")])
970 (define_expand "pushqi1"
971 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2)))
972 (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int 1)))
973 (match_operand:QI 0 "general_operand" ""))]
977 (define_expand "reload_insf"
978 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
979 (match_operand:SF 1 "general_operand" "mf"))
980 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
981 "TARGET_COLDFIRE_FPU"
983 if (emit_move_sequence (operands, SFmode, operands[2]))
986 /* We don't want the clobber emitted, so handle this ourselves. */
987 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
991 (define_expand "reload_outsf"
992 [(set (match_operand:SF 0 "general_operand" "")
993 (match_operand:SF 1 "register_operand" "f"))
994 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
995 "TARGET_COLDFIRE_FPU"
997 if (emit_move_sequence (operands, SFmode, operands[2]))
1000 /* We don't want the clobber emitted, so handle this ourselves. */
1001 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
1005 (define_expand "movsf"
1006 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1007 (match_operand:SF 1 "general_operand" ""))]
1012 [(set (match_operand:SF 0 "nonimmediate_operand" "=rmf")
1013 (match_operand:SF 1 "general_operand" "rmfF"))]
1016 if (FP_REG_P (operands[0]))
1018 if (FP_REG_P (operands[1]))
1019 return "f%$move%.x %1,%0";
1020 else if (ADDRESS_REG_P (operands[1]))
1021 return "move%.l %1,%-\;f%$move%.s %+,%0";
1022 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
1023 return output_move_const_single (operands);
1024 return "f%$move%.s %f1,%0";
1026 if (FP_REG_P (operands[1]))
1028 if (ADDRESS_REG_P (operands[0]))
1029 return "fmove%.s %1,%-\;move%.l %+,%0";
1030 return "fmove%.s %f1,%0";
1032 if (operands[1] == CONST0_RTX (SFmode)
1033 /* clr insns on 68000 read before writing. */
1034 && ((TARGET_68010 || TARGET_COLDFIRE)
1035 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
1037 if (ADDRESS_REG_P (operands[0]))
1039 /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */
1041 return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0";
1043 return "sub%.l %0,%0";
1045 /* moveq is faster on the 68000. */
1046 if (DATA_REG_P (operands[0]) && TUNE_68000_10)
1047 return "moveq #0,%0";
1050 return "move%.l %1,%0";
1053 (define_insn "movsf_cf_soft"
1054 [(set (match_operand:SF 0 "nonimmediate_operand" "=r<Q>,g,U")
1055 (match_operand:SF 1 "general_operand" "g,r<Q>,U"))]
1056 "TARGET_COLDFIRE && !TARGET_COLDFIRE_FPU"
1058 [(set_attr "type" "move_l")])
1060 ;; SFmode MEMs are restricted to modes 2-4 if TARGET_COLDFIRE_FPU.
1061 ;; The move instructions can handle all combinations.
1062 (define_insn "movsf_cf_hard"
1063 [(set (match_operand:SF 0 "nonimmediate_operand" "=r<Q>U, f, f,mr,f,r<Q>,f
1065 (match_operand:SF 1 "general_operand" " f, r<Q>U,f,rm,F,F, m
1067 "TARGET_COLDFIRE_FPU"
1069 if (which_alternative == 4 || which_alternative == 5) {
1073 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
1074 REAL_VALUE_TO_TARGET_SINGLE (r, l);
1075 xoperands[0] = operands[0];
1076 xoperands[1] = GEN_INT (l);
1077 if (which_alternative == 5) {
1079 if (ADDRESS_REG_P (xoperands[0]))
1080 output_asm_insn ("sub%.l %0,%0", xoperands);
1082 output_asm_insn ("clr%.l %0", xoperands);
1084 if (GET_CODE (operands[0]) == MEM
1085 && symbolic_operand (XEXP (operands[0], 0), SImode))
1086 output_asm_insn ("move%.l %1,%-;move%.l %+,%0", xoperands);
1088 output_asm_insn ("move%.l %1,%0", xoperands);
1092 output_asm_insn ("move%.l %1,%-;fsmove%.s %+,%0", xoperands);
1094 output_asm_insn ("clr%.l %-;fsmove%.s %+,%0", xoperands);
1097 if (FP_REG_P (operands[0]))
1099 if (ADDRESS_REG_P (operands[1]))
1100 return "move%.l %1,%-;fsmove%.s %+,%0";
1101 if (FP_REG_P (operands[1]))
1102 return "fsmove%.d %1,%0";
1103 return "fsmove%.s %f1,%0";
1105 if (FP_REG_P (operands[1]))
1107 if (ADDRESS_REG_P (operands[0]))
1108 return "fmove%.s %1,%-;move%.l %+,%0";
1109 return "fmove%.s %f1,%0";
1111 if (operands[1] == CONST0_RTX (SFmode))
1113 if (ADDRESS_REG_P (operands[0]))
1114 return "sub%.l %0,%0";
1117 return "move%.l %1,%0";
1120 (define_expand "reload_indf"
1121 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
1122 (match_operand:DF 1 "general_operand" "mf"))
1123 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
1124 "TARGET_COLDFIRE_FPU"
1126 if (emit_move_sequence (operands, DFmode, operands[2]))
1129 /* We don't want the clobber emitted, so handle this ourselves. */
1130 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
1134 (define_expand "reload_outdf"
1135 [(set (match_operand:DF 0 "general_operand" "")
1136 (match_operand:DF 1 "register_operand" "f"))
1137 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
1138 "TARGET_COLDFIRE_FPU"
1140 if (emit_move_sequence (operands, DFmode, operands[2]))
1143 /* We don't want the clobber emitted, so handle this ourselves. */
1144 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
1148 (define_expand "movdf"
1149 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1150 (match_operand:DF 1 "general_operand" ""))]
1153 if (TARGET_COLDFIRE_FPU)
1154 if (emit_move_sequence (operands, DFmode, 0))
1159 [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,rf,rf,&rof<>")
1160 (match_operand:DF 1 "general_operand" "*rf,m,0,*rofE<>"))]
1161 ; [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
1162 ; (match_operand:DF 1 "general_operand" "rf,m,rofF<>"))]
1165 if (FP_REG_P (operands[0]))
1167 if (FP_REG_P (operands[1]))
1168 return "f%&move%.x %1,%0";
1169 if (REG_P (operands[1]))
1172 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1173 output_asm_insn ("move%.l %1,%-", xoperands);
1174 output_asm_insn ("move%.l %1,%-", operands);
1175 return "f%&move%.d %+,%0";
1177 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1178 return output_move_const_double (operands);
1179 return "f%&move%.d %f1,%0";
1181 else if (FP_REG_P (operands[1]))
1183 if (REG_P (operands[0]))
1185 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1186 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1187 return "move%.l %+,%0";
1190 return "fmove%.d %f1,%0";
1192 return output_move_double (operands);
1195 (define_insn_and_split "movdf_cf_soft"
1196 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,g")
1197 (match_operand:DF 1 "general_operand" "g,r"))]
1198 "TARGET_COLDFIRE && !TARGET_COLDFIRE_FPU"
1200 "&& reload_completed"
1203 m68k_emit_move_double (operands);
1207 (define_insn "movdf_cf_hard"
1208 [(set (match_operand:DF 0 "nonimmediate_operand" "=f, <Q>U,r,f,r,r,m,f")
1209 (match_operand:DF 1 "general_operand" " f<Q>U,f, f,r,r,m,r,E"))]
1210 "TARGET_COLDFIRE_FPU"
1216 switch (which_alternative)
1219 return "fdmove%.d %1,%0";
1221 return "fmove%.d %1,%0";
1223 return "fmove%.d %1,%-;move%.l %+,%0;move%.l %+,%R0";
1225 return "move%.l %R1,%-;move%.l %1,%-;fdmove%.d %+,%0";
1226 case 4: case 5: case 6:
1227 return output_move_double (operands);
1229 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
1230 REAL_VALUE_TO_TARGET_DOUBLE (r, l);
1231 xoperands[0] = operands[0];
1232 xoperands[1] = GEN_INT (l[0]);
1233 xoperands[2] = GEN_INT (l[1]);
1234 if (operands[1] == CONST0_RTX (DFmode))
1235 output_asm_insn ("clr%.l %-;clr%.l %-;fdmove%.d %+,%0",
1239 output_asm_insn ("clr%.l %-;move%.l %1,%-;fdmove%.d %+,%0",
1242 output_asm_insn ("move%.l %2,%-;move%.l %1,%-;fdmove%.d %+,%0",
1248 ;; ??? The XFmode patterns are schizophrenic about whether constants are
1249 ;; allowed. Most but not all have predicates and constraint that disallow
1250 ;; constants. Most but not all have output templates that handle constants.
1251 ;; See also LEGITIMATE_CONSTANT_P.
1253 (define_expand "movxf"
1254 [(set (match_operand:XF 0 "nonimmediate_operand" "")
1255 (match_operand:XF 1 "general_operand" ""))]
1258 /* We can't rewrite operands during reload. */
1259 if (! reload_in_progress)
1261 if (CONSTANT_P (operands[1]))
1263 operands[1] = force_const_mem (XFmode, operands[1]);
1264 if (! memory_address_p (XFmode, XEXP (operands[1], 0)))
1265 operands[1] = adjust_address (operands[1], XFmode, 0);
1267 if (flag_pic && TARGET_PCREL)
1269 /* Don't allow writes to memory except via a register; the
1270 m68k doesn't consider PC-relative addresses to be writable. */
1271 if (GET_CODE (operands[0]) == MEM
1272 && symbolic_operand (XEXP (operands[0], 0), SImode))
1273 operands[0] = gen_rtx_MEM (XFmode,
1274 force_reg (SImode, XEXP (operands[0], 0)));
1280 [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,!r,!f,!r,m,!r")
1281 (match_operand:XF 1 "nonimmediate_operand" "m,f,f,f,r,!r,!r,m"))]
1284 if (FP_REG_P (operands[0]))
1286 if (FP_REG_P (operands[1]))
1287 return "fmove%.x %1,%0";
1288 if (REG_P (operands[1]))
1291 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
1292 output_asm_insn ("move%.l %1,%-", xoperands);
1293 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1294 output_asm_insn ("move%.l %1,%-", xoperands);
1295 output_asm_insn ("move%.l %1,%-", operands);
1296 return "fmove%.x %+,%0";
1298 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1299 return "fmove%.x %1,%0";
1300 return "fmove%.x %f1,%0";
1302 if (FP_REG_P (operands[1]))
1304 if (REG_P (operands[0]))
1306 output_asm_insn ("fmove%.x %f1,%-\;move%.l %+,%0", operands);
1307 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1308 output_asm_insn ("move%.l %+,%0", operands);
1309 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1310 return "move%.l %+,%0";
1312 /* Must be memory destination. */
1313 return "fmove%.x %f1,%0";
1315 return output_move_double (operands);
1319 [(set (match_operand:XF 0 "nonimmediate_operand" "=rm,rf,&rof<>")
1320 (match_operand:XF 1 "nonimmediate_operand" "rf,m,rof<>"))]
1321 "! TARGET_68881 && ! TARGET_COLDFIRE"
1323 if (FP_REG_P (operands[0]))
1325 if (FP_REG_P (operands[1]))
1326 return "fmove%.x %1,%0";
1327 if (REG_P (operands[1]))
1330 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
1331 output_asm_insn ("move%.l %1,%-", xoperands);
1332 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1333 output_asm_insn ("move%.l %1,%-", xoperands);
1334 output_asm_insn ("move%.l %1,%-", operands);
1335 return "fmove%.x %+,%0";
1337 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1338 return "fmove%.x %1,%0";
1339 return "fmove%.x %f1,%0";
1341 if (FP_REG_P (operands[1]))
1343 if (REG_P (operands[0]))
1345 output_asm_insn ("fmove%.x %f1,%-\;move%.l %+,%0", operands);
1346 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1347 output_asm_insn ("move%.l %+,%0", operands);
1348 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1349 return "move%.l %+,%0";
1352 return "fmove%.x %f1,%0";
1354 return output_move_double (operands);
1358 [(set (match_operand:XF 0 "nonimmediate_operand" "=r,g")
1359 (match_operand:XF 1 "nonimmediate_operand" "g,r"))]
1360 "! TARGET_68881 && TARGET_COLDFIRE"
1361 "* return output_move_double (operands);")
1363 (define_expand "movdi"
1364 ;; Let's see if it really still needs to handle fp regs, and, if so, why.
1365 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1366 (match_operand:DI 1 "general_operand" ""))]
1370 ;; movdi can apply to fp regs in some cases
1372 ;; Let's see if it really still needs to handle fp regs, and, if so, why.
1373 [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r,&ro<>")
1374 (match_operand:DI 1 "general_operand" "rF,m,roi<>F"))]
1375 ; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&r,&ro<>,!&rm,!&f")
1376 ; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF"))]
1377 ; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&rf,&ro<>,!&rm,!&f")
1378 ; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF,rfF"))]
1381 if (FP_REG_P (operands[0]))
1383 if (FP_REG_P (operands[1]))
1384 return "fmove%.x %1,%0";
1385 if (REG_P (operands[1]))
1388 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1389 output_asm_insn ("move%.l %1,%-", xoperands);
1390 output_asm_insn ("move%.l %1,%-", operands);
1391 return "fmove%.d %+,%0";
1393 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1394 return output_move_const_double (operands);
1395 return "fmove%.d %f1,%0";
1397 else if (FP_REG_P (operands[1]))
1399 if (REG_P (operands[0]))
1401 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1402 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1403 return "move%.l %+,%0";
1406 return "fmove%.d %f1,%0";
1408 return output_move_double (operands);
1412 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,g")
1413 (match_operand:DI 1 "general_operand" "g,r"))]
1415 "* return output_move_double (operands);")
1417 ;; Thus goes after the move instructions
1418 ;; because the move instructions are better (require no spilling)
1419 ;; when they can apply. It goes before the add/sub insns
1420 ;; so we will prefer it to them.
1422 (define_insn "pushasi"
1423 [(set (match_operand:SI 0 "push_operand" "=m")
1424 (match_operand:SI 1 "address_operand" "p"))]
1427 [(set_attr "type" "pea")])
1429 ;; truncation instructions
1430 (define_insn "truncsiqi2"
1431 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
1433 (match_operand:SI 1 "general_src_operand" "doJS,i")))]
1436 if (GET_CODE (operands[0]) == REG)
1438 /* Must clear condition codes, since the move.l bases them on
1439 the entire 32 bits, not just the desired 8 bits. */
1441 return "move%.l %1,%0";
1443 if (GET_CODE (operands[1]) == MEM)
1444 operands[1] = adjust_address (operands[1], QImode, 3);
1445 return "move%.b %1,%0";
1448 (define_insn "trunchiqi2"
1449 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
1451 (match_operand:HI 1 "general_src_operand" "doJS,i")))]
1454 if (GET_CODE (operands[0]) == REG
1455 && (GET_CODE (operands[1]) == MEM
1456 || GET_CODE (operands[1]) == CONST_INT))
1458 /* Must clear condition codes, since the move.w bases them on
1459 the entire 16 bits, not just the desired 8 bits. */
1461 return "move%.w %1,%0";
1463 if (GET_CODE (operands[0]) == REG)
1465 /* Must clear condition codes, since the move.l bases them on
1466 the entire 32 bits, not just the desired 8 bits. */
1468 return "move%.l %1,%0";
1470 if (GET_CODE (operands[1]) == MEM)
1471 operands[1] = adjust_address (operands[1], QImode, 1);
1472 return "move%.b %1,%0";
1475 (define_insn "truncsihi2"
1476 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm,d")
1478 (match_operand:SI 1 "general_src_operand" "roJS,i")))]
1481 if (GET_CODE (operands[0]) == REG)
1483 /* Must clear condition codes, since the move.l bases them on
1484 the entire 32 bits, not just the desired 8 bits. */
1486 return "move%.l %1,%0";
1488 if (GET_CODE (operands[1]) == MEM)
1489 operands[1] = adjust_address (operands[1], QImode, 2);
1490 return "move%.w %1,%0";
1493 ;; zero extension instructions
1495 ;; two special patterns to match various post_inc/pre_dec patterns
1496 (define_insn_and_split "*zero_extend_inc"
1497 [(set (match_operand 0 "post_inc_operand" "")
1498 (zero_extend (match_operand 1 "register_operand" "")))]
1499 "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT &&
1500 GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT &&
1501 GET_MODE_SIZE (GET_MODE (operands[0])) == GET_MODE_SIZE (GET_MODE (operands[1])) * 2"
1509 operands[0] = adjust_address (operands[0], GET_MODE (operands[1]), 0);
1512 (define_insn_and_split "*zero_extend_dec"
1513 [(set (match_operand 0 "pre_dec_operand" "")
1514 (zero_extend (match_operand 1 "register_operand" "")))]
1515 "(GET_MODE (operands[0]) != HImode || XEXP (XEXP (operands[0], 0), 0) != stack_pointer_rtx) &&
1516 GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT &&
1517 GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT &&
1518 GET_MODE_SIZE (GET_MODE (operands[0])) == GET_MODE_SIZE (GET_MODE (operands[1])) * 2"
1526 operands[0] = adjust_address (operands[0], GET_MODE (operands[1]), 0);
1529 (define_insn_and_split "zero_extendqidi2"
1530 [(set (match_operand:DI 0 "register_operand" "")
1531 (zero_extend:DI (match_operand:QI 1 "nonimmediate_src_operand" "")))]
1536 (zero_extend:SI (match_dup 1)))
1540 operands[2] = gen_lowpart (SImode, operands[0]);
1541 operands[3] = gen_highpart (SImode, operands[0]);
1544 (define_insn_and_split "zero_extendhidi2"
1545 [(set (match_operand:DI 0 "register_operand" "")
1546 (zero_extend:DI (match_operand:HI 1 "nonimmediate_src_operand" "")))]
1551 (zero_extend:SI (match_dup 1)))
1555 operands[2] = gen_lowpart (SImode, operands[0]);
1556 operands[3] = gen_highpart (SImode, operands[0]);
1559 (define_expand "zero_extendsidi2"
1560 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1561 (zero_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "")))]
1564 if (GET_CODE (operands[0]) == MEM
1565 && GET_CODE (operands[1]) == MEM)
1566 operands[1] = force_reg (SImode, operands[1]);
1569 (define_insn_and_split "*zero_extendsidi2"
1570 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1571 (zero_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "")))]
1572 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
1580 operands[2] = gen_lowpart (SImode, operands[0]);
1581 operands[3] = gen_highpart (SImode, operands[0]);
1584 (define_insn "*zero_extendhisi2_cf"
1585 [(set (match_operand:SI 0 "register_operand" "=d")
1586 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1589 [(set_attr "type" "mvsz")])
1591 (define_insn "zero_extendhisi2"
1592 [(set (match_operand:SI 0 "register_operand" "=d")
1593 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1597 (define_expand "zero_extendqihi2"
1598 [(set (match_operand:HI 0 "register_operand" "")
1599 (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "")))]
1603 (define_insn "*zero_extendqihi2"
1604 [(set (match_operand:HI 0 "register_operand" "=d")
1605 (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1609 (define_insn "*zero_extendqisi2_cfv4"
1610 [(set (match_operand:SI 0 "register_operand" "=d")
1611 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1614 [(set_attr "type" "mvsz")])
1616 (define_insn "zero_extendqisi2"
1617 [(set (match_operand:SI 0 "register_operand" "=d")
1618 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1622 ;; these two pattern split everything else which isn't matched by
1623 ;; something else above
1625 [(set (match_operand 0 "register_operand" "")
1626 (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))]
1629 && reg_mentioned_p (operands[0], operands[1])"
1630 [(set (strict_low_part (match_dup 2))
1633 (match_op_dup 4 [(match_dup 0) (match_dup 3)]))]
1635 operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
1636 operands[3] = GEN_INT (GET_MODE_MASK (GET_MODE (operands[1])));
1637 operands[4] = gen_rtx_AND (GET_MODE (operands[0]), operands[0], operands[3]);
1641 [(set (match_operand 0 "register_operand" "")
1642 (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))]
1643 "!ISA_HAS_MVS_MVZ && reload_completed"
1646 (set (strict_low_part (match_dup 2))
1649 operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
1652 ;; sign extension instructions
1654 (define_insn "extendqidi2"
1655 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1656 (sign_extend:DI (match_operand:QI 1 "general_src_operand" "rmS")))]
1660 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1661 if (ISA_HAS_MVS_MVZ)
1662 return "mvs%.b %1,%2\;smi %0\;extb%.l %0";
1663 if (TARGET_68020 || TARGET_COLDFIRE)
1665 if (ADDRESS_REG_P (operands[1]))
1666 return "move%.w %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
1668 return "move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
1672 if (ADDRESS_REG_P (operands[1]))
1673 return "move%.w %1,%2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0\;smi %0";
1675 return "move%.b %1,%2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0\;smi %0";
1679 (define_insn "extendhidi2"
1680 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1682 (match_operand:HI 1 "general_src_operand" "rmS")))]
1686 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1687 if (ISA_HAS_MVS_MVZ)
1688 return "mvs%.w %1,%2\;smi %0\;extb%.l %0";
1689 if (TARGET_68020 || TARGET_COLDFIRE)
1690 return "move%.w %1,%2\;ext%.l %2\;smi %0\;extb%.l %0";
1692 return "move%.w %1,%2\;ext%.l %2\;smi %0\;ext%.w %0\;ext%.l %0";
1695 (define_insn "extendsidi2"
1696 [(set (match_operand:DI 0 "register_operand" "=d")
1697 (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm")))]
1701 if (TARGET_68020 || TARGET_COLDFIRE)
1702 return "move%.l %1,%R0\;smi %0\;extb%.l %0";
1704 return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
1707 (define_insn "*extendsidi2_mem"
1708 [(set (match_operand:DI 0 "memory_operand" "=o,<")
1709 (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm")))
1710 (clobber (match_scratch:SI 2 "=d,d"))]
1714 operands[3] = adjust_address (operands[0], SImode,
1715 which_alternative == 0 ? 4 : 0);
1716 operands[0] = adjust_address (operands[0], SImode, 0);
1717 if (TARGET_68020 || TARGET_COLDFIRE)
1718 return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
1720 return "move%.l %1,%3\;smi %2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0";
1723 ;; Special case when one can avoid register clobbering, copy and test
1724 ;; Maybe there is a way to make that the general case, by forcing the
1725 ;; result of the SI tree to be in the lower register of the DI target
1727 (define_insn "extendplussidi"
1728 [(set (match_operand:DI 0 "register_operand" "=d")
1729 (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rmn")
1730 (match_operand:SI 2 "general_operand" "rmn"))))]
1734 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1735 if (GET_CODE (operands[1]) == CONST_INT
1736 && (unsigned) INTVAL (operands[1]) > 8)
1738 rtx tmp = operands[1];
1740 operands[1] = operands[2];
1743 if (GET_CODE (operands[1]) == REG
1744 && REGNO (operands[1]) == REGNO (operands[3]))
1745 output_asm_insn ("add%.l %2,%3", operands);
1747 output_asm_insn ("move%.l %2,%3\;add%.l %1,%3", operands);
1748 if (TARGET_68020 || TARGET_COLDFIRE)
1749 return "smi %0\;extb%.l %0";
1751 return "smi %0\;ext%.w %0\;ext%.l %0";
1754 (define_expand "extendhisi2"
1755 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1757 (match_operand:HI 1 "nonimmediate_src_operand" "")))]
1761 (define_insn "*cfv4_extendhisi2"
1762 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1764 (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1767 [(set_attr "type" "mvsz")])
1769 (define_insn "*68k_extendhisi2"
1770 [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a")
1772 (match_operand:HI 1 "nonimmediate_src_operand" "0,rmS")))]
1777 [(set_attr "type" "ext,move")])
1779 (define_insn "extendqihi2"
1780 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
1781 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0")))]
1784 [(set_attr "type" "ext")])
1786 (define_expand "extendqisi2"
1787 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1788 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
1789 "TARGET_68020 || TARGET_COLDFIRE"
1792 (define_insn "*cfv4_extendqisi2"
1793 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1794 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "rms")))]
1797 [(set_attr "type" "mvsz")])
1799 (define_insn "*68k_extendqisi2"
1800 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1801 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))]
1802 "TARGET_68020 || (TARGET_COLDFIRE && !ISA_HAS_MVS_MVZ)"
1804 [(set_attr "type" "ext")])
1806 ;; Conversions between float and double.
1808 (define_expand "extendsfdf2"
1809 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1811 (match_operand:SF 1 "general_operand" "")))]
1816 [(set (match_operand:DF 0 "nonimmediate_operand" "=*fdm,f")
1818 (match_operand:SF 1 "general_operand" "f,dmF")))]
1821 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
1823 if (REGNO (operands[0]) == REGNO (operands[1]))
1825 /* Extending float to double in an fp-reg is a no-op.
1826 NOTICE_UPDATE_CC has already assumed that the
1827 cc will be set. So cancel what it did. */
1828 cc_status = cc_prev_status;
1831 return "f%&move%.x %1,%0";
1833 if (FP_REG_P (operands[0]))
1834 return "f%&move%.s %f1,%0";
1835 if (DATA_REG_P (operands[0]) && FP_REG_P (operands[1]))
1837 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1838 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1839 return "move%.l %+,%0";
1841 return "fmove%.d %f1,%0";
1844 (define_insn "extendsfdf2_cf"
1845 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
1847 (match_operand:SF 1 "general_operand" "f,<Q>U")))]
1848 "TARGET_COLDFIRE_FPU"
1850 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
1852 if (REGNO (operands[0]) == REGNO (operands[1]))
1854 /* Extending float to double in an fp-reg is a no-op.
1855 NOTICE_UPDATE_CC has already assumed that the
1856 cc will be set. So cancel what it did. */
1857 cc_status = cc_prev_status;
1860 return "fdmove%.d %1,%0";
1862 return "fdmove%.s %f1,%0";
1865 ;; This cannot output into an f-reg because there is no way to be
1866 ;; sure of truncating in that case.
1867 (define_expand "truncdfsf2"
1868 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1870 (match_operand:DF 1 "general_operand" "")))]
1874 ;; On the '040 we can truncate in a register accurately and easily.
1876 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
1878 (match_operand:DF 1 "general_operand" "fmG")))]
1879 "TARGET_68881 && TARGET_68040"
1881 if (FP_REG_P (operands[1]))
1882 return "f%$move%.x %1,%0";
1883 return "f%$move%.d %f1,%0";
1886 (define_insn "truncdfsf2_cf"
1887 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,d<Q>U")
1889 (match_operand:DF 1 "general_operand" "<Q>U,f")))]
1890 "TARGET_COLDFIRE_FPU"
1894 [(set_attr "type" "fmove")])
1896 (define_insn "*truncdfsf2_68881"
1897 [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
1899 (match_operand:DF 1 "general_operand" "f")))]
1902 [(set_attr "type" "fmove")])
1904 ;; Conversion between fixed point and floating point.
1905 ;; Note that among the fix-to-float insns
1906 ;; the ones that start with SImode come first.
1907 ;; That is so that an operand that is a CONST_INT
1908 ;; (and therefore lacks a specific machine mode).
1909 ;; will be recognized as SImode (which is always valid)
1910 ;; rather than as QImode or HImode.
1912 (define_expand "floatsi<mode>2"
1913 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1914 (float:FP (match_operand:SI 1 "general_operand" "")))]
1918 (define_insn "floatsi<mode>2_68881"
1919 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1920 (float:FP (match_operand:SI 1 "general_operand" "dmi")))]
1922 "f<FP:round>move%.l %1,%0"
1923 [(set_attr "type" "fmove")])
1925 (define_insn "floatsi<mode>2_cf"
1926 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1927 (float:FP (match_operand:SI 1 "general_operand" "d<Q>U")))]
1928 "TARGET_COLDFIRE_FPU"
1929 "f<FP:prec>move%.l %1,%0"
1930 [(set_attr "type" "fmove")])
1933 (define_expand "floathi<mode>2"
1934 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1935 (float:FP (match_operand:HI 1 "general_operand" "")))]
1939 (define_insn "floathi<mode>2_68881"
1940 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1941 (float:FP (match_operand:HI 1 "general_operand" "dmn")))]
1944 [(set_attr "type" "fmove")])
1946 (define_insn "floathi<mode>2_cf"
1947 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1948 (float:FP (match_operand:HI 1 "general_operand" "d<Q>U")))]
1949 "TARGET_COLDFIRE_FPU"
1951 [(set_attr "type" "fmove")])
1954 (define_expand "floatqi<mode>2"
1955 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1956 (float:FP (match_operand:QI 1 "general_operand" "")))]
1960 (define_insn "floatqi<mode>2_68881"
1961 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1962 (float:FP (match_operand:QI 1 "general_operand" "dmn")))]
1965 [(set_attr "type" "fmove")])
1967 (define_insn "floatqi<mode>2_cf"
1968 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1969 (float:FP (match_operand:QI 1 "general_operand" "d<Q>U")))]
1970 "TARGET_COLDFIRE_FPU"
1972 [(set_attr "type" "fmove")])
1975 ;; New routines to convert floating-point values to integers
1976 ;; to be used on the '040. These should be faster than trapping
1977 ;; into the kernel to emulate fintrz. They should also be faster
1978 ;; than calling the subroutines fixsfsi or fixdfsi.
1980 (define_insn "fix_truncdfsi2"
1981 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
1982 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1983 (clobber (match_scratch:SI 2 "=d"))
1984 (clobber (match_scratch:SI 3 "=d"))]
1985 "TARGET_68881 && TUNE_68040"
1988 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,%!";
1991 (define_insn "fix_truncdfhi2"
1992 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
1993 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1994 (clobber (match_scratch:SI 2 "=d"))
1995 (clobber (match_scratch:SI 3 "=d"))]
1996 "TARGET_68881 && TUNE_68040"
1999 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,%!";
2002 (define_insn "fix_truncdfqi2"
2003 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
2004 (fix:QI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
2005 (clobber (match_scratch:SI 2 "=d"))
2006 (clobber (match_scratch:SI 3 "=d"))]
2007 "TARGET_68881 && TUNE_68040"
2010 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,%!";
2013 ;; Convert a float to a float whose value is an integer.
2014 ;; This is the first stage of converting it to an integer type.
2016 (define_expand "ftrunc<mode>2"
2017 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2018 (fix:FP (match_operand:FP 1 "general_operand" "")))]
2019 "TARGET_HARD_FLOAT && !TUNE_68040"
2022 (define_insn "ftrunc<mode>2_68881"
2023 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2024 (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
2025 "TARGET_68881 && !TUNE_68040"
2027 if (FP_REG_P (operands[1]))
2028 return "fintrz%.x %f1,%0";
2029 return "fintrz%.<FP:prec> %f1,%0";
2031 [(set_attr "type" "falu")])
2033 (define_insn "ftrunc<mode>2_cf"
2034 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2035 (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
2036 "TARGET_COLDFIRE_FPU"
2038 if (FP_REG_P (operands[1]))
2039 return "fintrz%.d %f1,%0";
2040 return "fintrz%.<FP:prec> %f1,%0";
2042 [(set_attr "type" "falu")])
2044 ;; Convert a float whose value is an integer
2045 ;; to an actual integer. Second stage of converting float to integer type.
2046 (define_expand "fix<mode>qi2"
2047 [(set (match_operand:QI 0 "nonimmediate_operand" "")
2048 (fix:QI (match_operand:FP 1 "general_operand" "")))]
2052 (define_insn "fix<mode>qi2_68881"
2053 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
2054 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
2057 [(set_attr "type" "fmove")])
2059 (define_insn "fix<mode>qi2_cf"
2060 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>U")
2061 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
2062 "TARGET_COLDFIRE_FPU"
2064 [(set_attr "type" "fmove")])
2066 (define_expand "fix<mode>hi2"
2067 [(set (match_operand:HI 0 "nonimmediate_operand" "")
2068 (fix:HI (match_operand:FP 1 "general_operand" "")))]
2072 (define_insn "fix<mode>hi2_68881"
2073 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
2074 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
2077 [(set_attr "type" "fmove")])
2079 (define_insn "fix<mode>hi2_cf"
2080 [(set (match_operand:HI 0 "nonimmediate_operand" "=d<Q>U")
2081 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
2082 "TARGET_COLDFIRE_FPU"
2084 [(set_attr "type" "fmove")])
2086 (define_expand "fix<mode>si2"
2087 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2088 (fix:SI (match_operand:FP 1 "general_operand" "")))]
2092 (define_insn "fix<mode>si2_68881"
2093 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
2094 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
2097 [(set_attr "type" "fmove")])
2099 (define_insn "fix<mode>si2_cf"
2100 [(set (match_operand:SI 0 "nonimmediate_operand" "=d<Q>U")
2101 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
2102 "TARGET_COLDFIRE_FPU"
2104 [(set_attr "type" "fmove")])
2109 (define_insn "adddi_lshrdi_63"
2110 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
2111 (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "rm")
2114 (clobber (match_scratch:SI 2 "=d"))]
2117 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
2118 if (REG_P (operands[1]) && REGNO (operands[1]) == REGNO (operands[0]))
2120 "move%.l %1,%2\;add%.l %2,%2\;subx%.l %2,%2\;sub%.l %2,%3\;subx%.l %2,%0";
2121 if (GET_CODE (operands[1]) == REG)
2122 operands[4] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2123 else if (GET_CODE (XEXP (operands[1], 0)) == POST_INC
2124 || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
2125 operands[4] = operands[1];
2127 operands[4] = adjust_address (operands[1], SImode, 4);
2128 if (GET_CODE (operands[1]) == MEM
2129 && GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
2130 output_asm_insn ("move%.l %4,%3", operands);
2131 output_asm_insn ("move%.l %1,%0\;smi %2", operands);
2132 if (TARGET_68020 || TARGET_COLDFIRE)
2133 output_asm_insn ("extb%.l %2", operands);
2135 output_asm_insn ("ext%.w %2\;ext%.l %2", operands);
2136 if (GET_CODE (operands[1]) != MEM
2137 || GET_CODE (XEXP (operands[1], 0)) != PRE_DEC)
2138 output_asm_insn ("move%.l %4,%3", operands);
2139 return "sub%.l %2,%3\;subx%.l %2,%0";
2142 (define_insn "adddi_sexthishl32"
2143 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
2144 (plus:DI (ashift:DI (sign_extend:DI
2145 (match_operand:HI 1 "general_operand" "rm,rm,rm,rm"))
2147 (match_operand:DI 2 "general_operand" "0,0,0,0")))
2148 (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
2152 if (ADDRESS_REG_P (operands[0]))
2153 return "add%.w %1,%0";
2154 else if (ADDRESS_REG_P (operands[3]))
2155 return "move%.w %1,%3\;add%.l %3,%0";
2157 return "move%.w %1,%3\;ext%.l %3\;add%.l %3,%0";
2160 (define_insn "*adddi_dilshr32"
2161 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,o")
2162 (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")
2164 (match_operand:DI 2 "general_operand" "0,0")))]
2168 if (GET_CODE (operands[0]) == REG)
2169 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
2171 operands[2] = adjust_address (operands[0], SImode, 4);
2172 return "add%.l %1,%2\;negx%.l %0\;neg%.l %0";
2175 (define_insn "*adddi_dilshr32_cf"
2176 [(set (match_operand:DI 0 "register_operand" "=d")
2177 (plus:DI (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "ro")
2179 (match_operand:DI 2 "register_operand" "0")))]
2183 return "add%.l %1,%R0\;negx%.l %0\;neg%.l %0";
2186 (define_insn "adddi_dishl32"
2187 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
2188 ;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
2189 ;; (ashift:DI (match_operand:DI 1 "general_operand" "ro")
2190 ;; (const_int 32))))]
2191 (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,d")
2193 (match_operand:DI 2 "general_operand" "0,0")))]
2197 if (GET_CODE (operands[1]) == REG)
2198 operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2200 operands[1] = adjust_address (operands[1], SImode, 4);
2201 return "add%.l %1,%0";
2203 [(set_attr "type" "alu_l")])
2205 (define_insn "adddi3"
2206 [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
2207 (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0")
2208 (match_operand:DI 2 "general_operand" "d,no>,d,a")))
2209 (clobber (match_scratch:SI 3 "=&d,&d,X,&d"))]
2212 if (DATA_REG_P (operands[0]))
2214 if (DATA_REG_P (operands[2]))
2215 return "add%.l %R2,%R0\;addx%.l %2,%0";
2216 else if (GET_CODE (operands[2]) == MEM
2217 && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
2218 return "move%.l %2,%3\;add%.l %2,%R0\;addx%.l %3,%0";
2224 if (GET_CODE (operands[2]) == REG)
2226 low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
2229 else if (CONSTANT_P (operands[2]))
2230 split_double (operands[2], &high, &low);
2233 low = adjust_address (operands[2], SImode, 4);
2237 operands[1] = low, operands[2] = high;
2238 xoperands[0] = operands[3];
2239 if (GET_CODE (operands[1]) == CONST_INT
2240 && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2241 xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
2243 xoperands[1] = operands[2];
2245 output_asm_insn (output_move_simode (xoperands), xoperands);
2246 if (GET_CODE (operands[1]) == CONST_INT)
2248 if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
2249 return "addq%.l %1,%R0\;addx%.l %3,%0";
2250 else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2252 operands[1] = GEN_INT (-INTVAL (operands[1]));
2253 return "subq%.l %1,%R0\;subx%.l %3,%0";
2256 return "add%.l %1,%R0\;addx%.l %3,%0";
2261 gcc_assert (GET_CODE (operands[0]) == MEM);
2263 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2265 operands[1] = gen_rtx_MEM (SImode,
2266 plus_constant (XEXP(operands[0], 0), -8));
2267 return "move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1";
2269 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2271 operands[1] = XEXP(operands[0], 0);
2272 return "add%.l %R2,%0\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%1";
2276 operands[1] = adjust_address (operands[0], SImode, 4);
2277 return "add%.l %R2,%1\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%0";
2282 (define_insn "addsi_lshrsi_31"
2283 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
2284 (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
2289 operands[2] = operands[0];
2290 operands[3] = gen_label_rtx();
2291 if (GET_CODE (operands[0]) == MEM)
2293 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2294 operands[0] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
2295 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2296 operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
2298 output_asm_insn ("move%.l %1,%0", operands);
2299 output_asm_insn ("jpl %l3", operands);
2300 output_asm_insn ("addq%.l #1,%2", operands);
2301 (*targetm.asm_out.internal_label) (asm_out_file, "L",
2302 CODE_LABEL_NUMBER (operands[3]));
2306 (define_expand "addsi3"
2307 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2308 (plus:SI (match_operand:SI 1 "general_operand" "")
2309 (match_operand:SI 2 "general_src_operand" "")))]
2313 ;; Note that the middle two alternatives are near-duplicates
2314 ;; in order to handle insns generated by reload.
2315 ;; This is needed since they are not themselves reloaded,
2316 ;; so commutativity won't apply to them.
2317 (define_insn "*addsi3_internal"
2318 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,d,a")
2319 (plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0,0")
2320 (match_operand:SI 2 "general_src_operand" "dIKLT,rJK,a,mSrIKLT,mSrIKLs")))]
2324 "* return output_addsi3 (operands);")
2326 (define_insn_and_split "*addsi3_5200"
2327 [(set (match_operand:SI 0 "nonimmediate_operand" "=mr,mr,m,r, ?a,?a,?a,?a")
2328 (plus:SI (match_operand:SI 1 "general_operand" "%0, 0, 0,0, a, a, r, a")
2329 (match_operand:SI 2 "general_src_operand" " I, L, d,mrKi,Cj,r, a, J")))]
2332 switch (which_alternative)
2335 return "addq%.l %2,%0";
2338 operands[2] = GEN_INT (- INTVAL (operands[2]));
2339 return "subq%.l %2,%0";
2343 return "add%.l %2,%0";
2346 /* move%.l %2,%0\n\tadd%.l %1,%0 */
2350 return MOTOROLA ? "lea (%1,%2.l),%0" : "lea %1@(0,%2:l),%0";
2353 return MOTOROLA ? "lea (%2,%1.l),%0" : "lea %2@(0,%1:l),%0";
2356 return MOTOROLA ? "lea (%c2,%1),%0" : "lea %1@(%c2),%0";
2363 "&& reload_completed && (extract_constrain_insn_cached (insn), which_alternative == 4) && !operands_match_p (operands[0], operands[1])"
2367 (plus:SI (match_dup 0)
2370 [(set_attr "type" "aluq_l,aluq_l,alu_l,alu_l,*,lea,lea,lea")
2371 (set_attr "opy" "2,2,2,2,*,*,*,*")
2372 (set_attr "opy_type" "*,*,*,*,*,mem6,mem6,mem5")])
2375 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
2376 (plus:SI (match_operand:SI 1 "general_operand" "0")
2378 (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
2382 (define_insn "addhi3"
2383 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
2384 (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
2385 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
2388 if (GET_CODE (operands[2]) == CONST_INT)
2390 /* If the constant would be a negative number when interpreted as
2391 HImode, make it negative. This is usually, but not always, done
2392 elsewhere in the compiler. First check for constants out of range,
2393 which could confuse us. */
2395 if (INTVAL (operands[2]) >= 32768)
2396 operands[2] = GEN_INT (INTVAL (operands[2]) - 65536);
2398 if (INTVAL (operands[2]) > 0
2399 && INTVAL (operands[2]) <= 8)
2400 return "addq%.w %2,%0";
2401 if (INTVAL (operands[2]) < 0
2402 && INTVAL (operands[2]) >= -8)
2404 operands[2] = GEN_INT (- INTVAL (operands[2]));
2405 return "subq%.w %2,%0";
2407 /* On the CPU32 it is faster to use two addqw instructions to
2408 add a small integer (8 < N <= 16) to a register.
2409 Likewise for subqw. */
2410 if (TUNE_CPU32 && REG_P (operands[0]))
2412 if (INTVAL (operands[2]) > 8
2413 && INTVAL (operands[2]) <= 16)
2415 operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
2416 return "addq%.w #8,%0\;addq%.w %2,%0";
2418 if (INTVAL (operands[2]) < -8
2419 && INTVAL (operands[2]) >= -16)
2421 operands[2] = GEN_INT (- INTVAL (operands[2]) - 8);
2422 return "subq%.w #8,%0\;subq%.w %2,%0";
2425 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2426 return MOTOROLA ? "lea (%c2,%0),%0" : "lea %0@(%c2),%0";
2428 return "add%.w %2,%0";
2431 ;; These insns must use MATCH_DUP instead of the more expected
2432 ;; use of a matching constraint because the "output" here is also
2433 ;; an input, so you can't use the matching constraint. That also means
2434 ;; that you can't use the "%", so you need patterns with the matched
2435 ;; operand in both positions.
2438 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2439 (plus:HI (match_dup 0)
2440 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
2443 if (GET_CODE (operands[1]) == CONST_INT)
2445 /* If the constant would be a negative number when interpreted as
2446 HImode, make it negative. This is usually, but not always, done
2447 elsewhere in the compiler. First check for constants out of range,
2448 which could confuse us. */
2450 if (INTVAL (operands[1]) >= 32768)
2451 operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
2453 if (INTVAL (operands[1]) > 0
2454 && INTVAL (operands[1]) <= 8)
2455 return "addq%.w %1,%0";
2456 if (INTVAL (operands[1]) < 0
2457 && INTVAL (operands[1]) >= -8)
2459 operands[1] = GEN_INT (- INTVAL (operands[1]));
2460 return "subq%.w %1,%0";
2462 /* On the CPU32 it is faster to use two addqw instructions to
2463 add a small integer (8 < N <= 16) to a register.
2464 Likewise for subqw. */
2465 if (TUNE_CPU32 && REG_P (operands[0]))
2467 if (INTVAL (operands[1]) > 8
2468 && INTVAL (operands[1]) <= 16)
2470 operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
2471 return "addq%.w #8,%0\;addq%.w %1,%0";
2473 if (INTVAL (operands[1]) < -8
2474 && INTVAL (operands[1]) >= -16)
2476 operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
2477 return "subq%.w #8,%0\;subq%.w %1,%0";
2480 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2481 return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";
2483 return "add%.w %1,%0";
2487 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2488 (plus:HI (match_operand:HI 1 "general_src_operand" "dn,rmSn")
2492 if (GET_CODE (operands[1]) == CONST_INT)
2494 /* If the constant would be a negative number when interpreted as
2495 HImode, make it negative. This is usually, but not always, done
2496 elsewhere in the compiler. First check for constants out of range,
2497 which could confuse us. */
2499 if (INTVAL (operands[1]) >= 32768)
2500 operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
2502 if (INTVAL (operands[1]) > 0
2503 && INTVAL (operands[1]) <= 8)
2504 return "addq%.w %1,%0";
2505 if (INTVAL (operands[1]) < 0
2506 && INTVAL (operands[1]) >= -8)
2508 operands[1] = GEN_INT (- INTVAL (operands[1]));
2509 return "subq%.w %1,%0";
2511 /* On the CPU32 it is faster to use two addqw instructions to
2512 add a small integer (8 < N <= 16) to a register.
2513 Likewise for subqw. */
2514 if (TUNE_CPU32 && REG_P (operands[0]))
2516 if (INTVAL (operands[1]) > 8
2517 && INTVAL (operands[1]) <= 16)
2519 operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
2520 return "addq%.w #8,%0\;addq%.w %1,%0";
2522 if (INTVAL (operands[1]) < -8
2523 && INTVAL (operands[1]) >= -16)
2525 operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
2526 return "subq%.w #8,%0\;subq%.w %1,%0";
2529 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2530 return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";
2532 return "add%.w %1,%0";
2535 (define_insn "addqi3"
2536 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
2537 (plus:QI (match_operand:QI 1 "general_operand" "%0,0")
2538 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
2541 if (GET_CODE (operands[2]) == CONST_INT)
2543 if (INTVAL (operands[2]) >= 128)
2544 operands[2] = GEN_INT (INTVAL (operands[2]) - 256);
2546 if (INTVAL (operands[2]) > 0
2547 && INTVAL (operands[2]) <= 8)
2548 return "addq%.b %2,%0";
2549 if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8)
2551 operands[2] = GEN_INT (- INTVAL (operands[2]));
2552 return "subq%.b %2,%0";
2555 return "add%.b %2,%0";
2559 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2560 (plus:QI (match_dup 0)
2561 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
2564 if (GET_CODE (operands[1]) == CONST_INT)
2566 if (INTVAL (operands[1]) >= 128)
2567 operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
2569 if (INTVAL (operands[1]) > 0
2570 && INTVAL (operands[1]) <= 8)
2571 return "addq%.b %1,%0";
2572 if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
2574 operands[1] = GEN_INT (- INTVAL (operands[1]));
2575 return "subq%.b %1,%0";
2578 return "add%.b %1,%0";
2582 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2583 (plus:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
2587 if (GET_CODE (operands[1]) == CONST_INT)
2589 if (INTVAL (operands[1]) >= 128)
2590 operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
2592 if (INTVAL (operands[1]) > 0
2593 && INTVAL (operands[1]) <= 8)
2594 return "addq%.b %1,%0";
2595 if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
2597 operands[1] = GEN_INT (- INTVAL (operands[1]));
2598 return "subq%.b %1,%0";
2601 return "add%.b %1,%0";
2604 (define_expand "add<mode>3"
2605 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2606 (plus:FP (match_operand:FP 1 "general_operand" "")
2607 (match_operand:FP 2 "general_operand" "")))]
2611 (define_insn "add<mode>3_floatsi_68881"
2612 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2613 (plus:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
2614 (match_operand:FP 1 "general_operand" "0")))]
2616 "f<FP:round>add%.l %2,%0"
2617 [(set_attr "type" "falu")
2618 (set_attr "opy" "2")])
2620 (define_insn "add<mode>3_floathi_68881"
2621 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2622 (plus:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
2623 (match_operand:FP 1 "general_operand" "0")))]
2625 "f<FP:round>add%.w %2,%0"
2626 [(set_attr "type" "falu")
2627 (set_attr "opy" "2")])
2629 (define_insn "add<mode>3_floatqi_68881"
2630 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2631 (plus:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
2632 (match_operand:FP 1 "general_operand" "0")))]
2634 "f<FP:round>add%.b %2,%0"
2635 [(set_attr "type" "falu")
2636 (set_attr "opy" "2")])
2638 (define_insn "add<mode>3_68881"
2639 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2640 (plus:FP (match_operand:FP 1 "general_operand" "%0")
2641 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2644 if (FP_REG_P (operands[2]))
2645 return "f<FP:round>add%.x %2,%0";
2646 return "f<FP:round>add%.<FP:prec> %f2,%0";
2648 [(set_attr "type" "falu")
2649 (set_attr "opy" "2")])
2651 (define_insn "add<mode>3_cf"
2652 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2653 (plus:FP (match_operand:FP 1 "general_operand" "%0")
2654 (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
2655 "TARGET_COLDFIRE_FPU"
2657 if (FP_REG_P (operands[2]))
2658 return "f<FP:prec>add%.d %2,%0";
2659 return "f<FP:prec>add%.<FP:prec> %2,%0";
2661 [(set_attr "type" "falu")
2662 (set_attr "opy" "2")])
2664 ;; subtract instructions
2666 (define_insn "subdi_sexthishl32"
2667 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
2668 (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
2669 (ashift:DI (sign_extend:DI (match_operand:HI 2 "general_operand" "rm,rm,rm,rm"))
2671 (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
2675 if (ADDRESS_REG_P (operands[0]))
2676 return "sub%.w %2,%0";
2677 else if (ADDRESS_REG_P (operands[3]))
2678 return "move%.w %2,%3\;sub%.l %3,%0";
2680 return "move%.w %2,%3\;ext%.l %3\;sub%.l %3,%0";
2683 (define_insn "subdi_dishl32"
2684 [(set (match_operand:DI 0 "nonimmediate_operand" "+ro")
2685 (minus:DI (match_dup 0)
2686 (ashift:DI (match_operand:DI 1 "general_operand" "ro")
2691 if (GET_CODE (operands[1]) == REG)
2692 operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2694 operands[1] = adjust_address (operands[1], SImode, 4);
2695 return "sub%.l %1,%0";
2697 [(set_attr "type" "alu_l")])
2699 (define_insn "subdi3"
2700 [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
2701 (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
2702 (match_operand:DI 2 "general_operand" "d,no>,d,a")))
2703 (clobber (match_scratch:SI 3 "=&d,&d,X,&d"))]
2706 if (DATA_REG_P (operands[0]))
2708 if (DATA_REG_P (operands[2]))
2709 return "sub%.l %R2,%R0\;subx%.l %2,%0";
2710 else if (GET_CODE (operands[2]) == MEM
2711 && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
2713 return "move%.l %2,%3\;sub%.l %2,%R0\;subx%.l %3,%0";
2720 if (GET_CODE (operands[2]) == REG)
2722 low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
2725 else if (CONSTANT_P (operands[2]))
2726 split_double (operands[2], &high, &low);
2729 low = adjust_address (operands[2], SImode, 4);
2733 operands[1] = low, operands[2] = high;
2734 xoperands[0] = operands[3];
2735 if (GET_CODE (operands[1]) == CONST_INT
2736 && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2737 xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
2739 xoperands[1] = operands[2];
2741 output_asm_insn (output_move_simode (xoperands), xoperands);
2742 if (GET_CODE (operands[1]) == CONST_INT)
2744 if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
2745 return "subq%.l %1,%R0\;subx%.l %3,%0";
2746 else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2748 operands[1] = GEN_INT (-INTVAL (operands[1]));
2749 return "addq%.l %1,%R0\;addx%.l %3,%0";
2752 return "sub%.l %1,%R0\;subx%.l %3,%0";
2757 gcc_assert (GET_CODE (operands[0]) == MEM);
2759 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2762 = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[0], 0), -8));
2763 return "move%.l %0,%3\;sub%.l %R2,%0\;subx%.l %2,%3\;move%.l %3,%1";
2765 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2767 operands[1] = XEXP(operands[0], 0);
2768 return "sub%.l %R2,%0\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%1";
2772 operands[1] = adjust_address (operands[0], SImode, 4);
2773 return "sub%.l %R2,%1\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%0";
2778 (define_insn "subsi3"
2779 [(set (match_operand:SI 0 "nonimmediate_operand" "=mda,m,d,a")
2780 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0,0")
2781 (match_operand:SI 2 "general_src_operand" "I,dT,mSrT,mSrs")))]
2788 [(set_attr "type" "aluq_l,alu_l,alu_l,alu_l")
2789 (set_attr "opy" "2")])
2792 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
2793 (minus:SI (match_operand:SI 1 "general_operand" "0")
2795 (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
2799 (define_insn "subhi3"
2800 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
2801 (minus:HI (match_operand:HI 1 "general_operand" "0,0")
2802 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
2807 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2808 (minus:HI (match_dup 0)
2809 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
2813 (define_insn "subqi3"
2814 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
2815 (minus:QI (match_operand:QI 1 "general_operand" "0,0")
2816 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
2821 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2822 (minus:QI (match_dup 0)
2823 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
2827 (define_expand "sub<mode>3"
2828 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2829 (minus:FP (match_operand:FP 1 "general_operand" "")
2830 (match_operand:FP 2 "general_operand" "")))]
2834 (define_insn "sub<mode>3_floatsi_68881"
2835 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2836 (minus:FP (match_operand:FP 1 "general_operand" "0")
2837 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
2839 "f<FP:round>sub%.l %2,%0"
2840 [(set_attr "type" "falu")
2841 (set_attr "opy" "2")])
2843 (define_insn "sub<mode>3_floathi_68881"
2844 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2845 (minus:FP (match_operand:FP 1 "general_operand" "0")
2846 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
2848 "f<FP:round>sub%.w %2,%0"
2849 [(set_attr "type" "falu")
2850 (set_attr "opy" "2")])
2852 (define_insn "sub<mode>3_floatqi_68881"
2853 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2854 (minus:FP (match_operand:FP 1 "general_operand" "0")
2855 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
2857 "f<FP:round>sub%.b %2,%0"
2858 [(set_attr "type" "falu")
2859 (set_attr "opy" "2")])
2861 (define_insn "sub<mode>3_68881"
2862 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2863 (minus:FP (match_operand:FP 1 "general_operand" "0")
2864 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2867 if (FP_REG_P (operands[2]))
2868 return "f<FP:round>sub%.x %2,%0";
2869 return "f<FP:round>sub%.<FP:prec> %f2,%0";
2871 [(set_attr "type" "falu")
2872 (set_attr "opy" "2")])
2874 (define_insn "sub<mode>3_cf"
2875 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2876 (minus:FP (match_operand:FP 1 "general_operand" "0")
2877 (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
2878 "TARGET_COLDFIRE_FPU"
2880 if (FP_REG_P (operands[2]))
2881 return "f<FP:prec>sub%.d %2,%0";
2882 return "f<FP:prec>sub%.<FP:prec> %2,%0";
2884 [(set_attr "type" "falu")
2885 (set_attr "opy" "2")])
2887 ;; multiply instructions
2889 (define_insn "mulhi3"
2890 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
2891 (mult:HI (match_operand:HI 1 "general_operand" "%0")
2892 (match_operand:HI 2 "general_src_operand" "dmSn")))]
2895 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2897 [(set_attr "type" "mul_w")
2898 (set_attr "opy" "2")])
2900 (define_insn "mulhisi3"
2901 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2902 (mult:SI (sign_extend:SI
2903 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2905 (match_operand:HI 2 "nonimmediate_src_operand" "dmS"))))]
2908 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2910 [(set_attr "type" "mul_w")
2911 (set_attr "opy" "2")])
2913 (define_insn "*mulhisisi3_s"
2914 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2915 (mult:SI (sign_extend:SI
2916 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2917 (match_operand:SI 2 "const_int_operand" "n")))]
2918 "INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) <= 0x7fff"
2920 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2922 [(set_attr "type" "mul_w")
2923 (set_attr "opy" "2")])
2925 (define_expand "mulsi3"
2926 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2927 (mult:SI (match_operand:SI 1 "general_operand" "")
2928 (match_operand:SI 2 "general_operand" "")))]
2929 "TARGET_68020 || TARGET_COLDFIRE"
2932 (define_insn "*mulsi3_68020"
2933 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2934 (mult:SI (match_operand:SI 1 "general_operand" "%0")
2935 (match_operand:SI 2 "general_src_operand" "dmSTK")))]
2939 [(set_attr "type" "mul_l")
2940 (set_attr "opy" "2")])
2942 (define_insn "*mulsi3_cf"
2943 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2944 (mult:SI (match_operand:SI 1 "general_operand" "%0")
2945 (match_operand:SI 2 "general_operand" "d<Q>")))]
2948 [(set_attr "type" "mul_l")
2949 (set_attr "opy" "2")])
2951 (define_insn "umulhisi3"
2952 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2953 (mult:SI (zero_extend:SI
2954 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2956 (match_operand:HI 2 "nonimmediate_src_operand" "dmS"))))]
2959 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
2961 [(set_attr "type" "mul_w")
2962 (set_attr "opy" "2")])
2964 (define_insn "*mulhisisi3_z"
2965 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2966 (mult:SI (zero_extend:SI
2967 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2968 (match_operand:SI 2 "const_int_operand" "n")))]
2969 "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 0xffff"
2971 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
2973 [(set_attr "type" "mul_w")
2974 (set_attr "opy" "2")])
2976 ;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
2977 ;; proper matching constraint. This is because the matching is between
2978 ;; the high-numbered word of the DImode operand[0] and operand[1].
2979 (define_expand "umulsidi3"
2981 [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
2982 (mult:SI (match_operand:SI 1 "register_operand" "")
2983 (match_operand:SI 2 "register_operand" "")))
2984 (set (subreg:SI (match_dup 0) 0)
2985 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2986 (zero_extend:DI (match_dup 2)))
2987 (const_int 32))))])]
2988 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2992 [(set (match_operand:SI 0 "register_operand" "=d")
2993 (mult:SI (match_operand:SI 1 "register_operand" "%0")
2994 (match_operand:SI 2 "nonimmediate_operand" "dm")))
2995 (set (match_operand:SI 3 "register_operand" "=d")
2996 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2997 (zero_extend:DI (match_dup 2)))
2999 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3002 ; Match immediate case. For 2.4 only match things < 2^31.
3003 ; It's tricky with larger values in these patterns since we need to match
3004 ; values between the two parallel multiplies, between a CONST_DOUBLE and
3007 [(set (match_operand:SI 0 "register_operand" "=d")
3008 (mult:SI (match_operand:SI 1 "register_operand" "%0")
3009 (match_operand:SI 2 "const_int_operand" "n")))
3010 (set (match_operand:SI 3 "register_operand" "=d")
3011 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
3014 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE
3015 && (unsigned) INTVAL (operands[2]) <= 0x7fffffff"
3018 (define_expand "mulsidi3"
3020 [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
3021 (mult:SI (match_operand:SI 1 "register_operand" "")
3022 (match_operand:SI 2 "register_operand" "")))
3023 (set (subreg:SI (match_dup 0) 0)
3024 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
3025 (sign_extend:DI (match_dup 2)))
3026 (const_int 32))))])]
3027 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3031 [(set (match_operand:SI 0 "register_operand" "=d")
3032 (mult:SI (match_operand:SI 1 "register_operand" "%0")
3033 (match_operand:SI 2 "nonimmediate_operand" "dm")))
3034 (set (match_operand:SI 3 "register_operand" "=d")
3035 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
3036 (sign_extend:DI (match_dup 2)))
3038 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3042 [(set (match_operand:SI 0 "register_operand" "=d")
3043 (mult:SI (match_operand:SI 1 "register_operand" "%0")
3044 (match_operand:SI 2 "const_int_operand" "n")))
3045 (set (match_operand:SI 3 "register_operand" "=d")
3046 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
3049 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3052 (define_expand "umulsi3_highpart"
3054 [(set (match_operand:SI 0 "register_operand" "")
3057 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" ""))
3058 (zero_extend:DI (match_operand:SI 2 "general_operand" "")))
3060 (clobber (match_dup 3))])]
3061 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3063 operands[3] = gen_reg_rtx (SImode);
3065 if (GET_CODE (operands[2]) == CONST_INT)
3067 operands[2] = immed_double_const (INTVAL (operands[2]) & 0xffffffff,
3070 /* We have to adjust the operand order for the matching constraints. */
3071 emit_insn (gen_const_umulsi3_highpart (operands[0], operands[3],
3072 operands[1], operands[2]));
3078 [(set (match_operand:SI 0 "register_operand" "=d")
3081 (mult:DI (zero_extend:DI (match_operand:SI 2 "register_operand" "%1"))
3082 (zero_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
3084 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3085 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3088 (define_insn "const_umulsi3_highpart"
3089 [(set (match_operand:SI 0 "register_operand" "=d")
3092 (mult:DI (zero_extend:DI (match_operand:SI 2 "register_operand" "1"))
3093 (match_operand:DI 3 "const_uint32_operand" "n"))
3095 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3096 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3099 (define_expand "smulsi3_highpart"
3101 [(set (match_operand:SI 0 "register_operand" "")
3104 (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" ""))
3105 (sign_extend:DI (match_operand:SI 2 "general_operand" "")))
3107 (clobber (match_dup 3))])]
3108 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3110 operands[3] = gen_reg_rtx (SImode);
3111 if (GET_CODE (operands[2]) == CONST_INT)
3113 /* We have to adjust the operand order for the matching constraints. */
3114 emit_insn (gen_const_smulsi3_highpart (operands[0], operands[3],
3115 operands[1], operands[2]));
3121 [(set (match_operand:SI 0 "register_operand" "=d")
3124 (mult:DI (sign_extend:DI (match_operand:SI 2 "register_operand" "%1"))
3125 (sign_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
3127 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3128 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3131 (define_insn "const_smulsi3_highpart"
3132 [(set (match_operand:SI 0 "register_operand" "=d")
3135 (mult:DI (sign_extend:DI (match_operand:SI 2 "register_operand" "1"))
3136 (match_operand:DI 3 "const_sint32_operand" "n"))
3138 (clobber (match_operand:SI 1 "register_operand" "=d"))]
3139 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
3142 (define_expand "mul<mode>3"
3143 [(set (match_operand:FP 0 "nonimmediate_operand" "")
3144 (mult:FP (match_operand:FP 1 "general_operand" "")
3145 (match_operand:FP 2 "general_operand" "")))]
3149 (define_insn "mul<mode>3_floatsi_68881"
3150 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3151 (mult:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
3152 (match_operand:FP 1 "general_operand" "0")))]
3156 ? "f<FP:round>mul%.l %2,%0"
3157 : "f<FP:round_mul>mul%.l %2,%0";
3159 [(set_attr "type" "fmul")
3160 (set_attr "opy" "2")])
3162 (define_insn "mul<mode>3_floathi_68881"
3163 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3164 (mult:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
3165 (match_operand:FP 1 "general_operand" "0")))]
3169 ? "f<FP:round>mul%.w %2,%0"
3170 : "f<FP:round_mul>mul%.w %2,%0";
3172 [(set_attr "type" "fmul")
3173 (set_attr "opy" "2")])
3175 (define_insn "mul<mode>3_floatqi_68881"
3176 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3177 (mult:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
3178 (match_operand:FP 1 "general_operand" "0")))]
3182 ? "f<FP:round>mul%.b %2,%0"
3183 : "f<FP:round_mul>mul%.b %2,%0";
3185 [(set_attr "type" "fmul")
3186 (set_attr "opy" "2")])
3188 (define_insn "muldf_68881"
3189 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
3190 (mult:DF (match_operand:DF 1 "general_operand" "%0")
3191 (match_operand:DF 2 "general_operand" "fmG")))]
3194 if (GET_CODE (operands[2]) == CONST_DOUBLE
3195 && floating_exact_log2 (operands[2]) && !TUNE_68040_60)
3197 int i = floating_exact_log2 (operands[2]);
3198 operands[2] = GEN_INT (i);
3199 return "fscale%.l %2,%0";
3201 if (REG_P (operands[2]))
3202 return "f%&mul%.x %2,%0";
3203 return "f%&mul%.d %f2,%0";
3206 (define_insn "mulsf_68881"
3207 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
3208 (mult:SF (match_operand:SF 1 "general_operand" "%0")
3209 (match_operand:SF 2 "general_operand" "fdmF")))]
3212 if (FP_REG_P (operands[2]))
3213 return (TARGET_68040
3215 : "fsglmul%.x %2,%0");
3216 return (TARGET_68040
3218 : "fsglmul%.s %f2,%0");
3221 (define_insn "mulxf3_68881"
3222 [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
3223 (mult:XF (match_operand:XF 1 "nonimmediate_operand" "%0")
3224 (match_operand:XF 2 "nonimmediate_operand" "fm")))]
3227 return "fmul%.x %f2,%0";
3230 (define_insn "fmul<mode>3_cf"
3231 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3232 (mult:FP (match_operand:FP 1 "general_operand" "%0")
3233 (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
3234 "TARGET_COLDFIRE_FPU"
3236 if (FP_REG_P (operands[2]))
3237 return "f<FP:prec>mul%.d %2,%0";
3238 return "f<FP:prec>mul%.<FP:prec> %2,%0";
3240 [(set_attr "type" "fmul")
3241 (set_attr "opy" "2")])
3243 ;; divide instructions
3245 (define_expand "div<mode>3"
3246 [(set (match_operand:FP 0 "nonimmediate_operand" "")
3247 (div:FP (match_operand:FP 1 "general_operand" "")
3248 (match_operand:FP 2 "general_operand" "")))]
3252 (define_insn "div<mode>3_floatsi_68881"
3253 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3254 (div:FP (match_operand:FP 1 "general_operand" "0")
3255 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
3259 ? "f<FP:round>div%.l %2,%0"
3260 : "f<FP:round_mul>div%.l %2,%0";
3263 (define_insn "div<mode>3_floathi_68881"
3264 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3265 (div:FP (match_operand:FP 1 "general_operand" "0")
3266 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
3270 ? "f<FP:round>div%.w %2,%0"
3271 : "f<FP:round_mul>div%.w %2,%0";
3274 (define_insn "div<mode>3_floatqi_68881"
3275 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3276 (div:FP (match_operand:FP 1 "general_operand" "0")
3277 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
3281 ? "f<FP:round>div%.b %2,%0"
3282 : "f<FP:round_mul>div%.b %2,%0";
3285 (define_insn "div<mode>3_68881"
3286 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3287 (div:FP (match_operand:FP 1 "general_operand" "0")
3288 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
3291 if (FP_REG_P (operands[2]))
3292 return (TARGET_68040
3293 ? "f<FP:round>div%.x %2,%0"
3294 : "f<FP:round_mul>div%.x %2,%0");
3295 return (TARGET_68040
3296 ? "f<FP:round>div%.<FP:prec> %f2,%0"
3297 : "f<FP:round_mul>div%.<FP:prec> %f2,%0");
3300 (define_insn "div<mode>3_cf"
3301 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3302 (div:FP (match_operand:FP 1 "general_operand" "0")
3303 (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
3304 "TARGET_COLDFIRE_FPU"
3306 if (FP_REG_P (operands[2]))
3307 return "f<FP:prec>div%.d %2,%0";
3308 return "f<FP:prec>div%.<FP:prec> %2,%0";
3310 [(set_attr "type" "fdiv")
3311 (set_attr "opy" "2")])
3313 ;; Remainder instructions.
3315 (define_expand "divmodsi4"
3317 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3318 (div:SI (match_operand:SI 1 "general_operand" "")
3319 (match_operand:SI 2 "general_src_operand" "")))
3320 (set (match_operand:SI 3 "nonimmediate_operand" "")
3321 (mod:SI (match_dup 1) (match_dup 2)))])]
3322 "TARGET_68020 || TARGET_CF_HWDIV"
3326 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3327 (div:SI (match_operand:SI 1 "general_operand" "0")
3328 (match_operand:SI 2 "general_src_operand" "d<Q>U")))
3329 (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
3330 (mod:SI (match_dup 1) (match_dup 2)))]
3333 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3334 return "divs%.l %2,%0";
3335 else if (find_reg_note (insn, REG_UNUSED, operands[0]))
3336 return "rems%.l %2,%3:%0";
3338 return "rems%.l %2,%3:%0\;divs%.l %2,%0";
3340 [(set_attr "type" "div_l")
3341 (set_attr "opy" "2")])
3344 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3345 (div:SI (match_operand:SI 1 "general_operand" "0")
3346 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3347 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3348 (mod:SI (match_dup 1) (match_dup 2)))]
3351 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3352 return "divs%.l %2,%0";
3354 return "divsl%.l %2,%3:%0";
3357 (define_expand "udivmodsi4"
3359 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3360 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3361 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3362 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3363 (umod:SI (match_dup 1) (match_dup 2)))])]
3364 "TARGET_68020 || TARGET_CF_HWDIV"
3368 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3369 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3370 (match_operand:SI 2 "general_src_operand" "d<Q>U")))
3371 (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
3372 (umod:SI (match_dup 1) (match_dup 2)))]
3375 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3376 return "divu%.l %2,%0";
3377 else if (find_reg_note (insn, REG_UNUSED, operands[0]))
3378 return "remu%.l %2,%3:%0";
3380 return "remu%.l %2,%3:%0\;divu%.l %2,%0";
3382 [(set_attr "type" "div_l")
3383 (set_attr "opy" "2")])
3386 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3387 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3388 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3389 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3390 (umod:SI (match_dup 1) (match_dup 2)))]
3391 "TARGET_68020 && !TARGET_COLDFIRE"
3393 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3394 return "divu%.l %2,%0";
3396 return "divul%.l %2,%3:%0";
3399 (define_insn "divmodhi4"
3400 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3401 (div:HI (match_operand:HI 1 "general_operand" "0")
3402 (match_operand:HI 2 "general_src_operand" "dmSKT")))
3403 (set (match_operand:HI 3 "nonimmediate_operand" "=d")
3404 (mod:HI (match_dup 1) (match_dup 2)))]
3405 "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
3407 output_asm_insn (MOTOROLA ?
3408 "ext%.l %0\;divs%.w %2,%0" :
3409 "extl %0\;divs %2,%0",
3411 if (!find_reg_note(insn, REG_UNUSED, operands[3]))
3414 return "move%.l %0,%3\;swap %3";
3420 (define_insn "udivmodhi4"
3421 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3422 (udiv:HI (match_operand:HI 1 "general_operand" "0")
3423 (match_operand:HI 2 "general_src_operand" "dmSKT")))
3424 (set (match_operand:HI 3 "nonimmediate_operand" "=d")
3425 (umod:HI (match_dup 1) (match_dup 2)))]
3426 "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
3428 if (ISA_HAS_MVS_MVZ)
3429 output_asm_insn (MOTOROLA ?
3430 "mvz%.w %0,%0\;divu%.w %2,%0" :
3431 "mvz%.w %0,%0\;divu %2,%0",
3434 output_asm_insn (MOTOROLA ?
3435 "and%.l #0xFFFF,%0\;divu%.w %2,%0" :
3436 "and%.l #0xFFFF,%0\;divu %2,%0",
3439 if (!find_reg_note(insn, REG_UNUSED, operands[3]))
3442 return "move%.l %0,%3\;swap %3";
3448 ;; logical-and instructions
3450 ;; "anddi3" is mainly here to help combine().
3451 (define_insn "anddi3"
3452 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3453 (and:DI (match_operand:DI 1 "general_operand" "%0,0")
3454 (match_operand:DI 2 "general_operand" "dn,don")))]
3458 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3459 if (CONSTANT_P (operands[2]))
3463 split_double (operands[2], &hi, &lo);
3465 switch (INTVAL (hi))
3468 output_asm_insn ("clr%.l %0", operands);
3476 xoperands[0] = operands[0];
3478 output_asm_insn (output_andsi3 (xoperands), xoperands);
3481 if (GET_CODE (operands[0]) == REG)
3482 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3484 operands[0] = adjust_address (operands[0], SImode, 4);
3485 switch (INTVAL (lo))
3488 output_asm_insn ("clr%.l %0", operands);
3496 xoperands[0] = operands[0];
3498 output_asm_insn (output_andsi3 (xoperands), xoperands);
3503 if (GET_CODE (operands[0]) != REG)
3505 operands[1] = adjust_address (operands[0], SImode, 4);
3506 return "and%.l %2,%0\;and%.l %R2,%1";
3508 if (GET_CODE (operands[2]) != REG)
3510 operands[1] = adjust_address (operands[2], SImode, 4);
3511 return "and%.l %2,%0\;and%.l %1,%R0";
3513 return "and%.l %2,%0\;and%.l %R2,%R0";
3516 ;; Prevent AND from being made with sp. This doesn't exist in the machine
3517 ;; and reload will cause inefficient code. Since sp is a FIXED_REG, we
3518 ;; can't allocate pseudos into it.
3520 (define_expand "andsi3"
3521 [(set (match_operand:SI 0 "not_sp_operand" "")
3522 (and:SI (match_operand:SI 1 "general_operand" "")
3523 (match_operand:SI 2 "general_src_operand" "")))]
3527 ;; produced by split operations after reload finished
3528 (define_insn "*andsi3_split"
3529 [(set (match_operand:SI 0 "register_operand" "=d")
3530 (and:SI (match_operand:SI 1 "register_operand" "0")
3531 (match_operand:SI 2 "const_int_operand" "i")))]
3532 "reload_completed && !TARGET_COLDFIRE"
3534 return output_andsi3 (operands);
3537 (define_insn "andsi3_internal"
3538 [(set (match_operand:SI 0 "not_sp_operand" "=m,d")
3539 (and:SI (match_operand:SI 1 "general_operand" "%0,0")
3540 (match_operand:SI 2 "general_src_operand" "dKT,dmSM")))]
3543 return output_andsi3 (operands);
3546 (define_insn "andsi3_5200"
3547 [(set (match_operand:SI 0 "not_sp_operand" "=m,d")
3548 (and:SI (match_operand:SI 1 "general_operand" "%0,0")
3549 (match_operand:SI 2 "general_src_operand" "d,dmsK")))]
3553 && DATA_REG_P (operands[0])
3554 && GET_CODE (operands[2]) == CONST_INT)
3556 if (INTVAL (operands[2]) == 0x000000ff)
3557 return "mvz%.b %0,%0";
3558 else if (INTVAL (operands[2]) == 0x0000ffff)
3559 return "mvz%.w %0,%0";
3561 return output_andsi3 (operands);
3564 (define_insn "andhi3"
3565 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
3566 (and:HI (match_operand:HI 1 "general_operand" "%0,0")
3567 (match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
3572 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3573 (and:HI (match_dup 0)
3574 (match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
3579 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3580 (and:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
3585 (define_insn "andqi3"
3586 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
3587 (and:QI (match_operand:QI 1 "general_operand" "%0,0")
3588 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
3593 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3594 (and:QI (match_dup 0)
3595 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
3600 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3601 (and:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
3606 ;; inclusive-or instructions
3608 (define_insn "iordi_zext"
3609 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3610 (ior:DI (zero_extend:DI (match_operand 1 "general_operand" "dn,dmn"))
3611 (match_operand:DI 2 "general_operand" "0,0")))]
3617 if (GET_CODE (operands[0]) == REG)
3618 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3620 operands[0] = adjust_address (operands[0], SImode, 4);
3621 if (GET_MODE (operands[1]) == SImode)
3622 return "or%.l %1,%0";
3623 byte_mode = (GET_MODE (operands[1]) == QImode);
3624 if (GET_CODE (operands[0]) == MEM)
3625 operands[0] = adjust_address (operands[0], byte_mode ? QImode : HImode,
3628 return "or%.b %1,%0";
3630 return "or%.w %1,%0";
3633 ;; "iordi3" is mainly here to help combine().
3634 (define_insn "iordi3"
3635 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3636 (ior:DI (match_operand:DI 1 "general_operand" "%0,0")
3637 (match_operand:DI 2 "general_operand" "dn,don")))]
3641 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3642 if (CONSTANT_P (operands[2]))
3646 split_double (operands[2], &hi, &lo);
3648 switch (INTVAL (hi))
3653 /* FIXME : a scratch register would be welcome here if operand[0]
3654 is not a register */
3655 output_asm_insn ("move%.l #-1,%0", operands);
3661 xoperands[0] = operands[0];
3663 output_asm_insn (output_iorsi3 (xoperands), xoperands);
3666 if (GET_CODE (operands[0]) == REG)
3667 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3669 operands[0] = adjust_address (operands[0], SImode, 4);
3670 switch (INTVAL (lo))
3675 /* FIXME : a scratch register would be welcome here if operand[0]
3676 is not a register */
3677 output_asm_insn ("move%.l #-1,%0", operands);
3683 xoperands[0] = operands[0];
3685 output_asm_insn (output_iorsi3 (xoperands), xoperands);
3690 if (GET_CODE (operands[0]) != REG)
3692 operands[1] = adjust_address (operands[0], SImode, 4);
3693 return "or%.l %2,%0\;or%.l %R2,%1";
3695 if (GET_CODE (operands[2]) != REG)
3697 operands[1] = adjust_address (operands[2], SImode, 4);
3698 return "or%.l %2,%0\;or%.l %1,%R0";
3700 return "or%.l %2,%0\;or%.l %R2,%R0";
3703 (define_expand "iorsi3"
3704 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3705 (ior:SI (match_operand:SI 1 "general_operand" "")
3706 (match_operand:SI 2 "general_src_operand" "")))]
3710 (define_insn "iorsi3_internal"
3711 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
3712 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
3713 (match_operand:SI 2 "general_src_operand" "dKT,dmSMT")))]
3716 return output_iorsi3 (operands);
3719 (define_insn "iorsi3_5200"
3720 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
3721 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
3722 (match_operand:SI 2 "general_src_operand" "d,dmsK")))]
3725 return output_iorsi3 (operands);
3728 (define_insn "iorhi3"
3729 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
3730 (ior:HI (match_operand:HI 1 "general_operand" "%0,0")
3731 (match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
3736 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3737 (ior:HI (match_dup 0)
3738 (match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
3743 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3744 (ior:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
3749 (define_insn "iorqi3"
3750 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
3751 (ior:QI (match_operand:QI 1 "general_operand" "%0,0")
3752 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
3757 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3758 (ior:QI (match_dup 0)
3759 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
3764 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3765 (ior:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
3770 ;; On all 68k models, this makes faster code in a special case.
3771 ;; See also ashlsi_16, ashrsi_16 and lshrsi_16.
3773 (define_insn "iorsi_zexthi_ashl16"
3774 [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
3775 (ior:SI (zero_extend:SI (match_operand:HI 1 "general_operand" "rmn"))
3776 (ashift:SI (match_operand:SI 2 "general_operand" "or")
3781 if (GET_CODE (operands[2]) != REG)
3782 operands[2] = adjust_address (operands[2], HImode, 2);
3783 if (GET_CODE (operands[2]) != REG
3784 || REGNO (operands[2]) != REGNO (operands[0]))
3785 output_asm_insn ("move%.w %2,%0", operands);
3786 return "swap %0\;mov%.w %1,%0";
3789 (define_insn "iorsi_zext"
3790 [(set (match_operand:SI 0 "nonimmediate_operand" "=o,d")
3791 (ior:SI (zero_extend:SI (match_operand 1 "general_operand" "dn,dmn"))
3792 (match_operand:SI 2 "general_operand" "0,0")))]
3798 byte_mode = (GET_MODE (operands[1]) == QImode);
3799 if (GET_CODE (operands[0]) == MEM)
3800 operands[0] = adjust_address (operands[0], byte_mode ? QImode : HImode,
3803 return "or%.b %1,%0";
3805 return "or%.w %1,%0";
3810 ;; "xordi3" is mainly here to help combine().
3811 (define_insn "xordi3"
3812 [(set (match_operand:DI 0 "nonimmediate_operand" "=od")
3813 (xor:DI (match_operand:DI 1 "general_operand" "%0")
3814 (match_operand:DI 2 "general_operand" "dn")))]
3818 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3820 if (CONSTANT_P (operands[2]))
3824 split_double (operands[2], &hi, &lo);
3826 switch (INTVAL (hi))
3831 output_asm_insn ("not%.l %0", operands);
3834 /* FIXME : a scratch register would be welcome here if
3835 -128 <= INTVAL (hi) < -1 */
3839 xoperands[0] = operands[0];
3841 output_asm_insn (output_xorsi3 (xoperands), xoperands);
3844 if (GET_CODE (operands[0]) == REG)
3845 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3847 operands[0] = adjust_address (operands[0], SImode, 4);
3848 switch (INTVAL (lo))
3853 output_asm_insn ("not%.l %0", operands);
3856 /* FIXME : a scratch register would be welcome here if
3857 -128 <= INTVAL (lo) < -1 */
3859 /* FIXME : this should be merged with xorsi3 */
3863 xoperands[0] = operands[0];
3865 output_asm_insn (output_xorsi3 (xoperands), xoperands);
3870 if (GET_CODE (operands[0]) != REG)
3872 operands[1] = adjust_address (operands[0], SImode, 4);
3873 return "eor%.l %2,%0\;eor%.l %R2,%1";
3875 if (GET_CODE (operands[2]) != REG)
3877 operands[1] = adjust_address (operands[2], SImode, 4);
3878 return "eor%.l %2,%0\;eor%.l %1,%R0";
3880 return "eor%.l %2,%0\;eor%.l %R2,%R0";
3883 (define_expand "xorsi3"
3884 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3885 (xor:SI (match_operand:SI 1 "general_operand" "")
3886 (match_operand:SI 2 "general_operand" "")))]
3890 (define_insn "xorsi3_internal"
3891 [(set (match_operand:SI 0 "nonimmediate_operand" "=do,m")
3892 (xor:SI (match_operand:SI 1 "general_operand" "%0,0")
3893 (match_operand:SI 2 "general_operand" "di,dKT")))]
3897 return output_xorsi3 (operands);
3900 (define_insn "xorsi3_5200"
3901 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm,d")
3902 (xor:SI (match_operand:SI 1 "general_operand" "%0,0")
3903 (match_operand:SI 2 "general_operand" "d,Ks")))]
3906 return output_xorsi3 (operands);
3909 (define_insn "xorhi3"
3910 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
3911 (xor:HI (match_operand:HI 1 "general_operand" "%0")
3912 (match_operand:HI 2 "general_operand" "dn")))]
3917 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3918 (xor:HI (match_dup 0)
3919 (match_operand:HI 1 "general_operand" "dn")))]
3924 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3925 (xor:HI (match_operand:HI 1 "general_operand" "dn")
3930 (define_insn "xorqi3"
3931 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
3932 (xor:QI (match_operand:QI 1 "general_operand" "%0")
3933 (match_operand:QI 2 "general_operand" "dn")))]
3938 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3939 (xor:QI (match_dup 0)
3940 (match_operand:QI 1 "general_operand" "dn")))]
3945 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3946 (xor:QI (match_operand:QI 1 "general_operand" "dn")
3951 ;; negation instructions
3953 (define_expand "negdi2"
3954 [(set (match_operand:DI 0 "nonimmediate_operand" "")
3955 (neg:DI (match_operand:DI 1 "general_operand" "")))]
3958 if (TARGET_COLDFIRE)
3959 emit_insn (gen_negdi2_5200 (operands[0], operands[1]));
3961 emit_insn (gen_negdi2_internal (operands[0], operands[1]));
3965 (define_insn "negdi2_internal"
3966 [(set (match_operand:DI 0 "nonimmediate_operand" "=<,do,!*a")
3967 (neg:DI (match_operand:DI 1 "general_operand" "0,0,0")))]
3970 if (which_alternative == 0)
3971 return "neg%.l %0\;negx%.l %0";
3972 if (GET_CODE (operands[0]) == REG)
3973 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3975 operands[1] = adjust_address (operands[0], SImode, 4);
3976 if (ADDRESS_REG_P (operands[0]))
3977 return "exg %/d0,%1\;neg%.l %/d0\;exg %/d0,%1\;exg %/d0,%0\;negx%.l %/d0\;exg %/d0,%0";
3979 return "neg%.l %1\;negx%.l %0";
3982 (define_insn "negdi2_5200"
3983 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
3984 (neg:DI (match_operand:DI 1 "general_operand" "0")))]
3987 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3988 return "neg%.l %1\;negx%.l %0";
3991 (define_expand "negsi2"
3992 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3993 (neg:SI (match_operand:SI 1 "general_operand" "")))]
3996 if (TARGET_COLDFIRE)
3997 emit_insn (gen_negsi2_5200 (operands[0], operands[1]));
3999 emit_insn (gen_negsi2_internal (operands[0], operands[1]));
4003 (define_insn "negsi2_internal"
4004 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
4005 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
4008 [(set_attr "type" "neg_l")])
4010 (define_insn "negsi2_5200"
4011 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
4012 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
4015 [(set_attr "type" "neg_l")])
4017 (define_insn "neghi2"
4018 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
4019 (neg:HI (match_operand:HI 1 "general_operand" "0")))]
4024 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
4025 (neg:HI (match_dup 0)))]
4029 (define_insn "negqi2"
4030 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
4031 (neg:QI (match_operand:QI 1 "general_operand" "0")))]
4036 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
4037 (neg:QI (match_dup 0)))]
4041 ;; If using software floating point, just flip the sign bit.
4043 (define_expand "negsf2"
4044 [(set (match_operand:SF 0 "nonimmediate_operand" "")
4045 (neg:SF (match_operand:SF 1 "general_operand" "")))]
4048 if (!TARGET_HARD_FLOAT)
4053 target = operand_subword_force (operands[0], 0, SFmode);
4054 result = expand_binop (SImode, xor_optab,
4055 operand_subword_force (operands[1], 0, SFmode),
4056 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
4057 gcc_assert (result);
4059 if (result != target)
4060 emit_move_insn (result, target);
4062 /* Make a place for REG_EQUAL. */
4063 emit_move_insn (operands[0], operands[0]);
4068 (define_expand "negdf2"
4069 [(set (match_operand:DF 0 "nonimmediate_operand" "")
4070 (neg:DF (match_operand:DF 1 "general_operand" "")))]
4073 if (!TARGET_HARD_FLOAT)
4080 target = operand_subword (operands[0], 0, 1, DFmode);
4081 result = expand_binop (SImode, xor_optab,
4082 operand_subword_force (operands[1], 0, DFmode),
4083 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
4084 gcc_assert (result);
4086 if (result != target)
4087 emit_move_insn (result, target);
4089 emit_move_insn (operand_subword (operands[0], 1, 1, DFmode),
4090 operand_subword_force (operands[1], 1, DFmode));
4092 insns = get_insns ();
4100 (define_expand "negxf2"
4101 [(set (match_operand:XF 0 "nonimmediate_operand" "")
4102 (neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
4112 target = operand_subword (operands[0], 0, 1, XFmode);
4113 result = expand_binop (SImode, xor_optab,
4114 operand_subword_force (operands[1], 0, XFmode),
4115 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
4116 gcc_assert (result);
4118 if (result != target)
4119 emit_move_insn (result, target);
4121 emit_move_insn (operand_subword (operands[0], 1, 1, XFmode),
4122 operand_subword_force (operands[1], 1, XFmode));
4123 emit_move_insn (operand_subword (operands[0], 2, 1, XFmode),
4124 operand_subword_force (operands[1], 2, XFmode));
4126 insns = get_insns ();
4134 (define_insn "neg<mode>2_68881"
4135 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4136 (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,0")))]
4139 if (DATA_REG_P (operands[0]))
4141 operands[1] = GEN_INT (31);
4142 return "bchg %1,%0";
4144 if (FP_REG_P (operands[1]))
4145 return "f<FP:round>neg%.x %1,%0";
4146 return "f<FP:round>neg%.<FP:prec> %f1,%0";
4149 (define_insn "neg<mode>2_cf"
4150 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4151 (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
4152 "TARGET_COLDFIRE_FPU"
4154 if (DATA_REG_P (operands[0]))
4156 operands[1] = GEN_INT (31);
4157 return "bchg %1,%0";
4159 if (FP_REG_P (operands[1]))
4160 return "f<FP:prec>neg%.d %1,%0";
4161 return "f<FP:prec>neg%.<FP:prec> %1,%0";
4164 ;; Sqrt instruction for the 68881
4166 (define_expand "sqrt<mode>2"
4167 [(set (match_operand:FP 0 "nonimmediate_operand" "")
4168 (sqrt:FP (match_operand:FP 1 "general_operand" "")))]
4172 (define_insn "sqrt<mode>2_68881"
4173 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
4174 (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
4177 if (FP_REG_P (operands[1]))
4178 return "f<FP:round>sqrt%.x %1,%0";
4179 return "f<FP:round>sqrt%.<FP:prec> %1,%0";
4181 [(set_attr "type" "fsqrt")])
4183 (define_insn "sqrt<mode>2_cf"
4184 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
4185 (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
4186 "TARGET_COLDFIRE_FPU"
4188 if (FP_REG_P (operands[1]))
4189 return "f<FP:prec>sqrt%.d %1,%0";
4190 return "f<FP:prec>sqrt%.<FP:prec> %1,%0";
4192 [(set_attr "type" "fsqrt")])
4193 ;; Absolute value instructions
4194 ;; If using software floating point, just zero the sign bit.
4196 (define_expand "abssf2"
4197 [(set (match_operand:SF 0 "nonimmediate_operand" "")
4198 (abs:SF (match_operand:SF 1 "general_operand" "")))]
4201 if (!TARGET_HARD_FLOAT)
4206 target = operand_subword_force (operands[0], 0, SFmode);
4207 result = expand_binop (SImode, and_optab,
4208 operand_subword_force (operands[1], 0, SFmode),
4209 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
4210 gcc_assert (result);
4212 if (result != target)
4213 emit_move_insn (result, target);
4215 /* Make a place for REG_EQUAL. */
4216 emit_move_insn (operands[0], operands[0]);
4221 (define_expand "absdf2"
4222 [(set (match_operand:DF 0 "nonimmediate_operand" "")
4223 (abs:DF (match_operand:DF 1 "general_operand" "")))]
4226 if (!TARGET_HARD_FLOAT)
4233 target = operand_subword (operands[0], 0, 1, DFmode);
4234 result = expand_binop (SImode, and_optab,
4235 operand_subword_force (operands[1], 0, DFmode),
4236 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
4237 gcc_assert (result);
4239 if (result != target)
4240 emit_move_insn (result, target);
4242 emit_move_insn (operand_subword (operands[0], 1, 1, DFmode),
4243 operand_subword_force (operands[1], 1, DFmode));
4245 insns = get_insns ();
4253 (define_expand "absxf2"
4254 [(set (match_operand:XF 0 "nonimmediate_operand" "")
4255 (abs:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
4265 target = operand_subword (operands[0], 0, 1, XFmode);
4266 result = expand_binop (SImode, and_optab,
4267 operand_subword_force (operands[1], 0, XFmode),
4268 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
4269 gcc_assert (result);
4271 if (result != target)
4272 emit_move_insn (result, target);
4274 emit_move_insn (operand_subword (operands[0], 1, 1, XFmode),
4275 operand_subword_force (operands[1], 1, XFmode));
4276 emit_move_insn (operand_subword (operands[0], 2, 1, XFmode),
4277 operand_subword_force (operands[1], 2, XFmode));
4279 insns = get_insns ();
4287 (define_insn "abs<mode>2_68881"
4288 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4289 (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,0")))]
4292 if (DATA_REG_P (operands[0]))
4294 operands[1] = GEN_INT (31);
4295 return "bclr %1,%0";
4297 if (FP_REG_P (operands[1]))
4298 return "f<FP:round>abs%.x %1,%0";
4299 return "f<FP:round>abs%.<FP:prec> %f1,%0";
4302 (define_insn "abs<mode>2_cf"
4303 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
4304 (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
4305 "TARGET_COLDFIRE_FPU"
4307 if (DATA_REG_P (operands[0]))
4309 operands[1] = GEN_INT (31);
4310 return "bclr %1,%0";
4312 if (FP_REG_P (operands[1]))
4313 return "f<FP:prec>abs%.d %1,%0";
4314 return "f<FP:prec>abs%.<FP:prec> %1,%0";
4316 [(set_attr "type" "bitrw,fneg")])
4318 ;; bit indexing instructions
4320 ;; ColdFire ff1 instruction implements clz.
4321 (define_insn "clzsi2"
4322 [(set (match_operand:SI 0 "register_operand" "=d")
4323 (clz:SI (match_operand:SI 1 "register_operand" "0")))]
4326 [(set_attr "type" "ext")])
4328 ;; one complement instructions
4330 ;; "one_cmpldi2" is mainly here to help combine().
4331 (define_insn "one_cmpldi2"
4332 [(set (match_operand:DI 0 "nonimmediate_operand" "=dm")
4333 (not:DI (match_operand:DI 1 "general_operand" "0")))]
4337 if (GET_CODE (operands[0]) == REG)
4338 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4339 else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC
4340 || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
4341 operands[1] = operands[0];
4343 operands[1] = adjust_address (operands[0], SImode, 4);
4344 return "not%.l %1\;not%.l %0";
4347 (define_expand "one_cmplsi2"
4348 [(set (match_operand:SI 0 "nonimmediate_operand" "")
4349 (not:SI (match_operand:SI 1 "general_operand" "")))]
4352 if (TARGET_COLDFIRE)
4353 emit_insn (gen_one_cmplsi2_5200 (operands[0], operands[1]));
4355 emit_insn (gen_one_cmplsi2_internal (operands[0], operands[1]));
4359 (define_insn "one_cmplsi2_internal"
4360 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
4361 (not:SI (match_operand:SI 1 "general_operand" "0")))]
4365 (define_insn "one_cmplsi2_5200"
4366 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
4367 (not:SI (match_operand:SI 1 "general_operand" "0")))]
4370 [(set_attr "type" "neg_l")])
4372 (define_insn "one_cmplhi2"
4373 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
4374 (not:HI (match_operand:HI 1 "general_operand" "0")))]
4379 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
4380 (not:HI (match_dup 0)))]
4384 (define_insn "one_cmplqi2"
4385 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
4386 (not:QI (match_operand:QI 1 "general_operand" "0")))]
4391 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
4392 (not:QI (match_dup 0)))]
4396 ;; arithmetic shift instructions
4397 ;; We don't need the shift memory by 1 bit instruction
4399 (define_insn "ashldi_extsi"
4400 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro")
4402 (match_operator:DI 2 "extend_operator"
4403 [(match_operand:SI 1 "general_operand" "rm")])
4408 if (GET_CODE (operands[0]) == REG)
4409 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4411 operands[2] = adjust_address (operands[0], SImode, 4);
4412 if (ADDRESS_REG_P (operands[0]))
4413 return "move%.l %1,%0\;sub%.l %2,%2";
4415 return "move%.l %1,%0\;clr%.l %2";
4418 (define_insn "ashldi_sexthi"
4419 [(set (match_operand:DI 0 "nonimmediate_operand" "=m,a*d")
4420 (ashift:DI (sign_extend:DI (match_operand:HI 1 "general_operand" "rm,rm"))
4422 (clobber (match_scratch:SI 2 "=a,X"))]
4426 if (GET_CODE (operands[0]) == MEM)
4428 if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
4429 return "clr%.l %0\;move%.w %1,%2\;move%.l %2,%0";
4430 else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
4431 return "move%.w %1,%2\;move%.l %2,%0\;clr%.l %0";
4434 operands[3] = adjust_address (operands[0], SImode, 4);
4435 return "move%.w %1,%2\;move%.l %2,%0\;clr%.l %3";
4438 else if (DATA_REG_P (operands[0]))
4439 return "move%.w %1,%0\;ext%.l %0\;clr%.l %R0";
4441 return "move%.w %1,%0\;sub%.l %R0,%R0";
4444 (define_insn "*ashldi3_const1"
4445 [(set (match_operand:DI 0 "register_operand" "=d")
4446 (ashift:DI (match_operand:DI 1 "register_operand" "0")
4449 "add%.l %R0,%R0\;addx%.l %0,%0")
4452 [(set (match_operand:DI 0 "register_operand" "")
4453 (ashift:DI (match_operand:DI 1 "register_operand" "")
4455 "reload_completed && !TARGET_COLDFIRE"
4457 (ashift:DI (match_dup 1) (const_int 1)))
4459 (ashift:DI (match_dup 0) (const_int 1)))]
4463 [(set (match_operand:DI 0 "register_operand" "")
4464 (ashift:DI (match_operand:DI 1 "register_operand" "")
4466 "reload_completed && !TARGET_COLDFIRE"
4468 (ashift:DI (match_dup 1) (const_int 2)))
4470 (ashift:DI (match_dup 0) (const_int 1)))]
4474 [(set (match_operand:DI 0 "register_operand" "")
4475 (ashift:DI (match_operand:DI 1 "register_operand" "")
4477 "reload_completed && !TARGET_COLDFIRE"
4479 (rotate:SI (match_dup 2) (const_int 8)))
4481 (rotate:SI (match_dup 3) (const_int 8)))
4482 (set (strict_low_part (subreg:QI (match_dup 0) 3))
4483 (subreg:QI (match_dup 0) 7))
4484 (set (strict_low_part (subreg:QI (match_dup 0) 7))
4487 operands[2] = gen_highpart (SImode, operands[0]);
4488 operands[3] = gen_lowpart (SImode, operands[0]);
4492 [(set (match_operand:DI 0 "register_operand" "")
4493 (ashift:DI (match_operand:DI 1 "register_operand" "")
4495 "reload_completed && !TARGET_COLDFIRE"
4497 (rotate:SI (match_dup 2) (const_int 16)))
4499 (rotate:SI (match_dup 3) (const_int 16)))
4500 (set (strict_low_part (subreg:HI (match_dup 0) 2))
4501 (subreg:HI (match_dup 0) 6))
4502 (set (strict_low_part (subreg:HI (match_dup 0) 6))
4505 operands[2] = gen_highpart (SImode, operands[0]);
4506 operands[3] = gen_lowpart (SImode, operands[0]);
4510 [(set (match_operand:DI 0 "pre_dec_operand" "")
4511 (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "")
4514 [(set (match_dup 0) (const_int 0))
4515 (set (match_dup 0) (match_dup 1))]
4517 operands[0] = adjust_address(operands[0], SImode, 0);
4518 operands[1] = gen_lowpart(SImode, operands[1]);
4522 [(set (match_operand:DI 0 "post_inc_operand" "")
4523 (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "")
4526 [(set (match_dup 0) (match_dup 1))
4527 (set (match_dup 0) (const_int 0))]
4529 operands[0] = adjust_address(operands[0], SImode, 0);
4530 operands[1] = gen_lowpart(SImode, operands[1]);
4533 (define_insn_and_split "*ashldi3_const32"
4534 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro<>")
4535 (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "ro")
4539 "&& reload_completed"
4540 [(set (match_dup 4) (match_dup 3))
4541 (set (match_dup 2) (const_int 0))]
4542 "split_di(operands, 2, operands + 2, operands + 4);")
4545 [(set (match_operand:DI 0 "register_operand" "")
4546 (ashift:DI (match_operand:DI 1 "register_operand" "")
4547 (match_operand 2 "const_int_operand" "")))]
4548 "reload_completed && !TARGET_COLDFIRE
4549 && INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 40"
4550 [(set (match_dup 4) (ashift:SI (match_dup 4) (match_dup 2)))
4551 (set (match_dup 3) (match_dup 4))
4552 (set (match_dup 4) (const_int 0))]
4554 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
4555 operands[3] = gen_highpart (SImode, operands[0]);
4556 operands[4] = gen_lowpart (SImode, operands[0]);
4560 [(set (match_operand:DI 0 "register_operand" "")
4561 (ashift:DI (match_operand:DI 1 "register_operand" "")
4563 "reload_completed && !TARGET_COLDFIRE"
4564 [(set (match_dup 2) (match_dup 3))
4566 (rotate:SI (match_dup 2) (const_int 16)))
4567 (set (match_dup 3) (const_int 0))
4568 (set (strict_low_part (subreg:HI (match_dup 0) 2))
4571 operands[2] = gen_highpart (SImode, operands[0]);
4572 operands[3] = gen_lowpart (SImode, operands[0]);
4576 [(set (match_operand:DI 0 "register_operand" "")
4577 (ashift:DI (match_operand:DI 1 "register_operand" "")
4578 (match_operand 2 "const_int_operand" "")))]
4579 "reload_completed && !TARGET_COLDFIRE
4580 && INTVAL (operands[2]) > 40 && INTVAL (operands[2]) <= 63"
4581 [(set (match_dup 3) (match_dup 2))
4582 (set (match_dup 4) (ashift:SI (match_dup 4) (match_dup 3)))
4583 (set (match_dup 3) (match_dup 4))
4584 (set (match_dup 4) (const_int 0))]
4586 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
4587 operands[3] = gen_highpart (SImode, operands[0]);
4588 operands[4] = gen_lowpart (SImode, operands[0]);
4591 (define_insn "*ashldi3"
4592 [(set (match_operand:DI 0 "register_operand" "=d")
4593 (ashift:DI (match_operand:DI 1 "register_operand" "0")
4594 (match_operand 2 "const_int_operand" "n")))]
4596 && ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
4597 || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
4598 || (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
4601 (define_expand "ashldi3"
4602 [(set (match_operand:DI 0 "register_operand" "")
4603 (ashift:DI (match_operand:DI 1 "register_operand" "")
4604 (match_operand 2 "const_int_operand" "")))]
4607 /* ??? This is a named pattern like this is not allowed to FAIL based
4609 if (GET_CODE (operands[2]) != CONST_INT
4610 || ((INTVAL (operands[2]) < 1 || INTVAL (operands[2]) > 3)
4611 && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
4612 && (INTVAL (operands[2]) < 32 || INTVAL (operands[2]) > 63)))
4616 ;; On most 68k models, this makes faster code in a special case.
4618 (define_insn "ashlsi_16"
4619 [(set (match_operand:SI 0 "register_operand" "=d")
4620 (ashift:SI (match_operand:SI 1 "register_operand" "0")
4625 return "swap %0\;clr%.w %0";
4628 ;; ashift patterns : use lsl instead of asl, because lsl always clears the
4629 ;; overflow bit, so we must not set CC_NO_OVERFLOW.
4631 ;; On the 68000, this makes faster code in a special case.
4633 (define_insn "ashlsi_17_24"
4634 [(set (match_operand:SI 0 "register_operand" "=d")
4635 (ashift:SI (match_operand:SI 1 "register_operand" "0")
4636 (match_operand:SI 2 "const_int_operand" "n")))]
4638 && INTVAL (operands[2]) > 16
4639 && INTVAL (operands[2]) <= 24"
4643 operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
4644 return "lsl%.w %2,%0\;swap %0\;clr%.w %0";
4647 (define_insn "ashlsi3"
4648 [(set (match_operand:SI 0 "register_operand" "=d")
4649 (ashift:SI (match_operand:SI 1 "register_operand" "0")
4650 (match_operand:SI 2 "general_operand" "dI")))]
4653 if (operands[2] == const1_rtx)
4655 cc_status.flags = CC_NO_OVERFLOW;
4656 return "add%.l %0,%0";
4658 return "lsl%.l %2,%0";
4661 (define_insn "ashlhi3"
4662 [(set (match_operand:HI 0 "register_operand" "=d")
4663 (ashift:HI (match_operand:HI 1 "register_operand" "0")
4664 (match_operand:HI 2 "general_operand" "dI")))]
4669 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
4670 (ashift:HI (match_dup 0)
4671 (match_operand:HI 1 "general_operand" "dI")))]
4675 (define_insn "ashlqi3"
4676 [(set (match_operand:QI 0 "register_operand" "=d")
4677 (ashift:QI (match_operand:QI 1 "register_operand" "0")
4678 (match_operand:QI 2 "general_operand" "dI")))]
4683 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
4684 (ashift:QI (match_dup 0)
4685 (match_operand:QI 1 "general_operand" "dI")))]
4689 ;; On most 68k models, this makes faster code in a special case.
4691 (define_insn "ashrsi_16"
4692 [(set (match_operand:SI 0 "register_operand" "=d")
4693 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4696 "swap %0\;ext%.l %0")
4698 ;; On the 68000, this makes faster code in a special case.
4701 [(set (match_operand:SI 0 "register_operand" "=d")
4702 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4703 (match_operand:SI 2 "const_int_operand" "n")))]
4705 && INTVAL (operands[2]) > 16
4706 && INTVAL (operands[2]) <= 24"
4708 operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
4709 return "swap %0\;asr%.w %2,%0\;ext%.l %0";
4712 (define_insn "subreghi1ashrdi_const32"
4713 [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
4714 (subreg:HI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
4715 (const_int 32)) 6))]
4718 if (GET_CODE (operands[1]) != REG)
4719 operands[1] = adjust_address (operands[1], HImode, 2);
4720 return "move%.w %1,%0";
4722 [(set_attr "type" "move")])
4724 (define_insn "subregsi1ashrdi_const32"
4725 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
4726 (subreg:SI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
4727 (const_int 32)) 4))]
4730 return "move%.l %1,%0";
4732 [(set_attr "type" "move_l")])
4734 (define_insn "*ashrdi3_const1"
4735 [(set (match_operand:DI 0 "register_operand" "=d")
4736 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
4740 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4741 return "asr%.l #1,%0\;roxr%.l #1,%1";
4745 [(set (match_operand:DI 0 "register_operand" "")
4746 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4748 "reload_completed && !TARGET_COLDFIRE"
4750 (ashiftrt:DI (match_dup 1) (const_int 1)))
4752 (ashiftrt:DI (match_dup 0) (const_int 1)))]
4756 [(set (match_operand:DI 0 "register_operand" "")
4757 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4759 "reload_completed && !TARGET_COLDFIRE"
4761 (ashiftrt:DI (match_dup 1) (const_int 2)))
4763 (ashiftrt:DI (match_dup 0) (const_int 1)))]
4767 [(set (match_operand:DI 0 "register_operand" "")
4768 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4770 "reload_completed && !TARGET_COLDFIRE"
4771 [(set (strict_low_part (subreg:QI (match_dup 0) 7))
4772 (subreg:QI (match_dup 0) 3))
4774 (ashiftrt:SI (match_dup 2) (const_int 8)))
4776 (rotatert:SI (match_dup 3) (const_int 8)))]
4778 operands[2] = gen_highpart (SImode, operands[0]);
4779 operands[3] = gen_lowpart (SImode, operands[0]);
4783 [(set (match_operand:DI 0 "register_operand" "")
4784 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4786 "reload_completed && !TARGET_COLDFIRE"
4787 [(set (strict_low_part (subreg:HI (match_dup 0) 6))
4788 (subreg:HI (match_dup 0) 2))
4790 (rotate:SI (match_dup 2) (const_int 16)))
4792 (rotate:SI (match_dup 3) (const_int 16)))
4794 (sign_extend:SI (subreg:HI (match_dup 2) 2)))]
4796 operands[2] = gen_highpart (SImode, operands[0]);
4797 operands[3] = gen_lowpart (SImode, operands[0]);
4800 (define_insn "*ashrdi_const32"
4801 [(set (match_operand:DI 0 "register_operand" "=d")
4802 (ashiftrt:DI (match_operand:DI 1 "nonimmediate_src_operand" "ro")
4808 return "move%.l %1,%R0\;smi %0\;extb%.l %0";
4810 return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
4813 (define_insn "*ashrdi_const32_mem"
4814 [(set (match_operand:DI 0 "memory_operand" "=o,<")
4815 (ashiftrt:DI (match_operand:DI 1 "nonimmediate_src_operand" "ro,ro")
4817 (clobber (match_scratch:SI 2 "=d,d"))]
4821 operands[3] = adjust_address (operands[0], SImode,
4822 which_alternative == 0 ? 4 : 0);
4823 operands[0] = adjust_address (operands[0], SImode, 0);
4824 if (TARGET_68020 || TARGET_COLDFIRE)
4825 return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
4827 return "move%.l %1,%3\;smi %2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0";
4831 [(set (match_operand:DI 0 "register_operand" "")
4832 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4834 "reload_completed && !TARGET_COLDFIRE"
4836 (ashiftrt:SI (match_dup 3) (const_int 31)))
4839 "split_di(operands, 1, operands + 2, operands + 3);")
4841 ;; The predicate below must be general_operand, because ashrdi3 allows that
4842 (define_insn "ashrdi_const"
4843 [(set (match_operand:DI 0 "register_operand" "=d")
4844 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
4845 (match_operand 2 "const_int_operand" "n")))]
4847 && ((INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3)
4848 || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
4849 || INTVAL (operands[2]) == 31
4850 || (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63))"
4852 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
4854 if (INTVAL (operands[2]) == 48)
4855 return "swap %0\;ext%.l %0\;move%.l %0,%1\;smi %0\;ext%.w %0";
4856 if (INTVAL (operands[2]) == 31)
4857 return "add%.l %1,%1\;addx%.l %0,%0\;move%.l %0,%1\;subx%.l %0,%0";
4858 if (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63)
4860 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
4861 output_asm_insn (INTVAL (operands[2]) <= 8 ? "asr%.l %2,%0" :
4862 "moveq %2,%1\;asr%.l %1,%0", operands);
4863 output_asm_insn ("mov%.l %0,%1\;smi %0", operands);
4864 return INTVAL (operands[2]) >= 15 ? "ext%.w %d0" :
4865 TARGET_68020 ? "extb%.l %0" : "ext%.w %0\;ext%.l %0";
4870 (define_expand "ashrdi3"
4871 [(set (match_operand:DI 0 "register_operand" "")
4872 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4873 (match_operand 2 "const_int_operand" "")))]
4876 /* ??? This is a named pattern like this is not allowed to FAIL based
4878 if (GET_CODE (operands[2]) != CONST_INT
4879 || ((INTVAL (operands[2]) < 1 || INTVAL (operands[2]) > 3)
4880 && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
4881 && (INTVAL (operands[2]) < 31 || INTVAL (operands[2]) > 63)))
4885 ;; On all 68k models, this makes faster code in a special case.
4887 (define_insn "ashrsi_31"
4888 [(set (match_operand:SI 0 "register_operand" "=d")
4889 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4893 return "add%.l %0,%0\;subx%.l %0,%0";
4896 (define_insn "ashrsi3"
4897 [(set (match_operand:SI 0 "register_operand" "=d")
4898 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
4899 (match_operand:SI 2 "general_operand" "dI")))]
4902 [(set_attr "type" "shift")
4903 (set_attr "opy" "2")])
4905 (define_insn "ashrhi3"
4906 [(set (match_operand:HI 0 "register_operand" "=d")
4907 (ashiftrt:HI (match_operand:HI 1 "register_operand" "0")
4908 (match_operand:HI 2 "general_operand" "dI")))]
4913 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
4914 (ashiftrt:HI (match_dup 0)
4915 (match_operand:HI 1 "general_operand" "dI")))]
4919 (define_insn "ashrqi3"
4920 [(set (match_operand:QI 0 "register_operand" "=d")
4921 (ashiftrt:QI (match_operand:QI 1 "register_operand" "0")
4922 (match_operand:QI 2 "general_operand" "dI")))]
4927 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
4928 (ashiftrt:QI (match_dup 0)
4929 (match_operand:QI 1 "general_operand" "dI")))]
4933 ;; logical shift instructions
4935 ;; commented out because of reload problems in 950612-1.c
4938 ;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro")
4939 ;; (const_int 32)) 4))
4940 ;; (set (match_operand:SI 1 "nonimmediate_operand" "=dm")
4941 ;; (subreg:SI (lshiftrt:DI (match_dup 0)
4942 ;; (const_int 32)) 4))]
4945 ;; return "move%.l %0,%1";
4950 ;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro")
4951 ;; (const_int 32)) 0))
4952 ;; (set (match_operand:DI 1 "nonimmediate_operand" "=do")
4953 ;; (lshiftrt:DI (match_dup 0)
4954 ;; (const_int 32)))]
4957 ;; if (GET_CODE (operands[1]) == REG)
4958 ;; operands[2] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
4960 ;; operands[2] = adjust_address (operands[1], SImode, 4);
4961 ;; return "move%.l %0,%2\;clr%.l %1";
4964 (define_insn "subreg1lshrdi_const32"
4965 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
4966 (subreg:SI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
4967 (const_int 32)) 4))]
4970 [(set_attr "type" "move_l")])
4972 (define_insn "*lshrdi3_const1"
4973 [(set (match_operand:DI 0 "register_operand" "=d")
4974 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
4977 "lsr%.l #1,%0\;roxr%.l #1,%R0")
4980 [(set (match_operand:DI 0 "register_operand" "")
4981 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
4983 "reload_completed && !TARGET_COLDFIRE"
4985 (lshiftrt:DI (match_dup 1) (const_int 1)))
4987 (lshiftrt:DI (match_dup 0) (const_int 1)))]
4991 [(set (match_operand:DI 0 "register_operand" "")
4992 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
4994 "reload_completed && !TARGET_COLDFIRE"
4996 (lshiftrt:DI (match_dup 1) (const_int 2)))
4998 (lshiftrt:DI (match_dup 0) (const_int 1)))]
5002 [(set (match_operand:DI 0 "register_operand" "")
5003 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5005 "reload_completed && !TARGET_COLDFIRE"
5006 [(set (strict_low_part (subreg:QI (match_dup 0) 7))
5007 (subreg:QI (match_dup 0) 3))
5009 (lshiftrt:SI (match_dup 2) (const_int 8)))
5011 (rotatert:SI (match_dup 3) (const_int 8)))]
5013 operands[2] = gen_highpart (SImode, operands[0]);
5014 operands[3] = gen_lowpart (SImode, operands[0]);
5018 [(set (match_operand:DI 0 "register_operand" "")
5019 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5021 "reload_completed && !TARGET_COLDFIRE"
5022 [(set (strict_low_part (subreg:HI (match_dup 0) 6))
5023 (subreg:HI (match_dup 0) 2))
5024 (set (strict_low_part (subreg:HI (match_dup 0) 2))
5027 (rotate:SI (match_dup 3) (const_int 16)))
5029 (rotate:SI (match_dup 2) (const_int 16)))]
5031 operands[2] = gen_highpart (SImode, operands[0]);
5032 operands[3] = gen_lowpart (SImode, operands[0]);
5036 [(set (match_operand:DI 0 "pre_dec_operand" "")
5037 (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "")
5040 [(set (match_dup 0) (match_dup 1))
5041 (set (match_dup 0) (const_int 0))]
5043 operands[0] = adjust_address(operands[0], SImode, 0);
5044 operands[1] = gen_highpart(SImode, operands[1]);
5048 [(set (match_operand:DI 0 "post_inc_operand" "")
5049 (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "")
5052 [(set (match_dup 0) (const_int 0))
5053 (set (match_dup 0) (match_dup 1))]
5055 operands[0] = adjust_address(operands[0], SImode, 0);
5056 operands[1] = gen_highpart(SImode, operands[1]);
5060 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5061 (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "")
5064 [(set (match_dup 2) (match_dup 5))
5065 (set (match_dup 4) (const_int 0))]
5066 "split_di(operands, 2, operands + 2, operands + 4);")
5068 (define_insn "*lshrdi_const32"
5069 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro<>")
5070 (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
5076 [(set (match_operand:DI 0 "register_operand" "")
5077 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5078 (match_operand 2 "const_int_operand" "")))]
5079 "reload_completed && !TARGET_COLDFIRE
5080 && INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 40"
5081 [(set (match_dup 3) (lshiftrt:SI (match_dup 3) (match_dup 2)))
5082 (set (match_dup 4) (match_dup 3))
5083 (set (match_dup 3) (const_int 0))]
5085 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
5086 operands[3] = gen_highpart (SImode, operands[0]);
5087 operands[4] = gen_lowpart (SImode, operands[0]);
5091 [(set (match_operand:DI 0 "register_operand" "")
5092 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5095 [(set (match_dup 3) (match_dup 2))
5096 (set (strict_low_part (subreg:HI (match_dup 0) 6))
5098 (set (match_dup 2) (const_int 0))
5100 (rotate:SI (match_dup 3) (const_int 16)))]
5102 operands[2] = gen_highpart (SImode, operands[0]);
5103 operands[3] = gen_lowpart (SImode, operands[0]);
5107 [(set (match_operand:DI 0 "register_operand" "")
5108 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5109 (match_operand 2 "const_int_operand" "")))]
5110 "reload_completed && !TARGET_COLDFIRE
5111 && INTVAL (operands[2]) > 40 && INTVAL (operands[2]) <= 62"
5112 [(set (match_dup 4) (match_dup 2))
5113 (set (match_dup 3) (lshiftrt:SI (match_dup 3) (match_dup 4)))
5114 (set (match_dup 4) (match_dup 3))
5115 (set (match_dup 3) (const_int 0))]
5117 operands[2] = GEN_INT (INTVAL (operands[2]) - 32);
5118 operands[3] = gen_highpart (SImode, operands[0]);
5119 operands[4] = gen_lowpart (SImode, operands[0]);
5122 (define_insn "*lshrdi_const63"
5123 [(set (match_operand:DI 0 "register_operand" "=d")
5124 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
5127 "add%.l %0,%0\;clr%.l %0\;clr%.l %R1\;addx%.l %R1,%R1")
5129 (define_insn "*lshrdi3_const"
5130 [(set (match_operand:DI 0 "register_operand" "=d")
5131 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
5132 (match_operand 2 "const_int_operand" "n")))]
5134 && ((INTVAL (operands[2]) >= 2 && INTVAL (operands[2]) <= 3)
5135 || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
5136 || (INTVAL (operands[2]) > 32 && INTVAL (operands[2]) <= 63)))"
5139 (define_expand "lshrdi3"
5140 [(set (match_operand:DI 0 "register_operand" "")
5141 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5142 (match_operand 2 "const_int_operand" "")))]
5145 /* ??? This is a named pattern like this is not allowed to FAIL based
5147 if (GET_CODE (operands[2]) != CONST_INT
5148 || ((INTVAL (operands[2]) < 1 || INTVAL (operands[2]) > 3)
5149 && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
5150 && (INTVAL (operands[2]) < 32 || INTVAL (operands[2]) > 63)))
5154 ;; On all 68k models, this makes faster code in a special case.
5156 (define_insn "lshrsi_31"
5157 [(set (match_operand:SI 0 "register_operand" "=d")
5158 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5162 return "add%.l %0,%0\;subx%.l %0,%0\;neg%.l %0";
5165 ;; On most 68k models, this makes faster code in a special case.
5167 (define_insn "lshrsi_16"
5168 [(set (match_operand:SI 0 "register_operand" "=d")
5169 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5174 return "clr%.w %0\;swap %0";
5177 ;; On the 68000, this makes faster code in a special case.
5179 (define_insn "lshrsi_17_24"
5180 [(set (match_operand:SI 0 "register_operand" "=d")
5181 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5182 (match_operand:SI 2 "const_int_operand" "n")))]
5184 && INTVAL (operands[2]) > 16
5185 && INTVAL (operands[2]) <= 24"
5187 /* I think lsr%.w sets the CC properly. */
5188 operands[2] = GEN_INT (INTVAL (operands[2]) - 16);
5189 return "clr%.w %0\;swap %0\;lsr%.w %2,%0";
5192 (define_insn "lshrsi3"
5193 [(set (match_operand:SI 0 "register_operand" "=d")
5194 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
5195 (match_operand:SI 2 "general_operand" "dI")))]
5198 [(set_attr "type" "shift")
5199 (set_attr "opy" "2")])
5201 (define_insn "lshrhi3"
5202 [(set (match_operand:HI 0 "register_operand" "=d")
5203 (lshiftrt:HI (match_operand:HI 1 "register_operand" "0")
5204 (match_operand:HI 2 "general_operand" "dI")))]
5209 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
5210 (lshiftrt:HI (match_dup 0)
5211 (match_operand:HI 1 "general_operand" "dI")))]
5215 (define_insn "lshrqi3"
5216 [(set (match_operand:QI 0 "register_operand" "=d")
5217 (lshiftrt:QI (match_operand:QI 1 "register_operand" "0")
5218 (match_operand:QI 2 "general_operand" "dI")))]
5223 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
5224 (lshiftrt:QI (match_dup 0)
5225 (match_operand:QI 1 "general_operand" "dI")))]
5229 ;; rotate instructions
5231 (define_insn "rotlsi3"
5232 [(set (match_operand:SI 0 "register_operand" "=d")
5233 (rotate:SI (match_operand:SI 1 "register_operand" "0")
5234 (match_operand:SI 2 "general_operand" "dINO")))]
5237 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 16)
5239 else if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 16)
5241 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
5242 return "ror%.l %2,%0";
5245 return "rol%.l %2,%0";
5248 (define_insn "rotlhi3"
5249 [(set (match_operand:HI 0 "register_operand" "=d")
5250 (rotate:HI (match_operand:HI 1 "register_operand" "0")
5251 (match_operand:HI 2 "general_operand" "dIP")))]
5254 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
5256 operands[2] = GEN_INT (16 - INTVAL (operands[2]));
5257 return "ror%.w %2,%0";
5260 return "rol%.w %2,%0";
5264 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
5265 (rotate:HI (match_dup 0)
5266 (match_operand:HI 1 "general_operand" "dIP")))]
5269 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 8)
5271 operands[2] = GEN_INT (16 - INTVAL (operands[2]));
5272 return "ror%.w %2,%0";
5275 return "rol%.w %2,%0";
5278 (define_insn "rotlqi3"
5279 [(set (match_operand:QI 0 "register_operand" "=d")
5280 (rotate:QI (match_operand:QI 1 "register_operand" "0")
5281 (match_operand:QI 2 "general_operand" "dI")))]
5284 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
5286 operands[2] = GEN_INT (8 - INTVAL (operands[2]));
5287 return "ror%.b %2,%0";
5290 return "rol%.b %2,%0";
5294 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
5295 (rotate:QI (match_dup 0)
5296 (match_operand:QI 1 "general_operand" "dI")))]
5299 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 4)
5301 operands[2] = GEN_INT (8 - INTVAL (operands[2]));
5302 return "ror%.b %2,%0";
5305 return "rol%.b %2,%0";
5308 (define_insn "rotrsi3"
5309 [(set (match_operand:SI 0 "register_operand" "=d")
5310 (rotatert:SI (match_operand:SI 1 "register_operand" "0")
5311 (match_operand:SI 2 "general_operand" "dI")))]
5315 (define_insn "rotrhi3"
5316 [(set (match_operand:HI 0 "register_operand" "=d")
5317 (rotatert:HI (match_operand:HI 1 "register_operand" "0")
5318 (match_operand:HI 2 "general_operand" "dI")))]
5323 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
5324 (rotatert:HI (match_dup 0)
5325 (match_operand:HI 1 "general_operand" "dI")))]
5329 (define_insn "rotrqi3"
5330 [(set (match_operand:QI 0 "register_operand" "=d")
5331 (rotatert:QI (match_operand:QI 1 "register_operand" "0")
5332 (match_operand:QI 2 "general_operand" "dI")))]
5337 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d"))
5338 (rotatert:QI (match_dup 0)
5339 (match_operand:QI 1 "general_operand" "dI")))]
5344 ;; Bit set/clear in memory byte.
5346 ;; set bit, bit number is int
5347 (define_insn "bsetmemqi"
5348 [(set (match_operand:QI 0 "memory_operand" "+m")
5349 (ior:QI (subreg:QI (ashift:SI (const_int 1)
5350 (match_operand:SI 1 "general_operand" "d")) 3)
5355 return "bset %1,%0";
5357 [(set_attr "type" "bitrw")])
5359 ;; set bit, bit number is (sign/zero)_extended from HImode/QImode
5360 (define_insn "*bsetmemqi_ext"
5361 [(set (match_operand:QI 0 "memory_operand" "+m")
5362 (ior:QI (subreg:QI (ashift:SI (const_int 1)
5363 (match_operator:SI 2 "extend_operator"
5364 [(match_operand 1 "general_operand" "d")])) 3)
5369 return "bset %1,%0";
5371 [(set_attr "type" "bitrw")])
5373 ;; clear bit, bit number is int
5374 (define_insn "bclrmemqi"
5375 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+m")
5377 (minus:SI (const_int 7)
5378 (match_operand:SI 1 "general_operand" "d")))
5383 return "bclr %1,%0";
5385 [(set_attr "type" "bitrw")])
5387 ;; clear bit, bit number is (sign/zero)_extended from HImode/QImode
5388 (define_insn "*bclrmemqi_ext"
5389 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+m")
5391 (minus:SI (const_int 7)
5392 (match_operator:SI 2 "extend_operator"
5393 [(match_operand 1 "general_operand" "d")])))
5398 return "bclr %1,%0";
5400 [(set_attr "type" "bitrw")])
5402 ;; Special cases of bit-field insns which we should
5403 ;; recognize in preference to the general case.
5404 ;; These handle aligned 8-bit and 16-bit fields,
5405 ;; which can usually be done with move instructions.
5408 ; Special case for 32-bit field in memory. This only occurs when 32-bit
5409 ; alignment of structure members is specified.
5411 ; The move is allowed to be odd byte aligned, because that's still faster
5412 ; than an odd byte aligned bit-field instruction.
5415 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5417 (match_operand:SI 1 "const_int_operand" "n"))
5418 (match_operand:SI 2 "general_src_operand" "rmSi"))]
5419 "TARGET_68020 && TARGET_BITFIELD
5420 && (INTVAL (operands[1]) % 8) == 0
5421 && ! mode_dependent_address_p (XEXP (operands[0], 0))"
5424 = adjust_address (operands[0], SImode, INTVAL (operands[1]) / 8);
5426 return "move%.l %2,%0";
5430 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+do")
5431 (match_operand:SI 1 "const_int_operand" "n")
5432 (match_operand:SI 2 "const_int_operand" "n"))
5433 (match_operand:SI 3 "register_operand" "d"))]
5434 "TARGET_68020 && TARGET_BITFIELD
5435 && (INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16)
5436 && INTVAL (operands[2]) % INTVAL (operands[1]) == 0
5437 && (GET_CODE (operands[0]) == REG
5438 || ! mode_dependent_address_p (XEXP (operands[0], 0)))"
5440 if (REG_P (operands[0]))
5442 if (INTVAL (operands[1]) + INTVAL (operands[2]) != 32)
5443 return "bfins %3,%0{%b2:%b1}";
5446 operands[0] = adjust_address (operands[0],
5447 INTVAL (operands[1]) == 8 ? QImode : HImode,
5448 INTVAL (operands[2]) / 8);
5450 if (GET_CODE (operands[3]) == MEM)
5451 operands[3] = adjust_address (operands[3],
5452 INTVAL (operands[1]) == 8 ? QImode : HImode,
5453 (32 - INTVAL (operands[1])) / 8);
5455 if (INTVAL (operands[1]) == 8)
5456 return "move%.b %3,%0";
5457 return "move%.w %3,%0";
5462 ; Special case for 32-bit field in memory. This only occurs when 32-bit
5463 ; alignment of structure members is specified.
5465 ; The move is allowed to be odd byte aligned, because that's still faster
5466 ; than an odd byte aligned bit-field instruction.
5469 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
5470 (zero_extract:SI (match_operand:QI 1 "memory_src_operand" "oS")
5472 (match_operand:SI 2 "const_int_operand" "n")))]
5473 "TARGET_68020 && TARGET_BITFIELD
5474 && (INTVAL (operands[2]) % 8) == 0
5475 && ! mode_dependent_address_p (XEXP (operands[1], 0))"
5478 = adjust_address (operands[1], SImode, INTVAL (operands[2]) / 8);
5480 return "move%.l %1,%0";
5484 [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
5485 (zero_extract:SI (match_operand:SI 1 "register_operand" "do")
5486 (match_operand:SI 2 "const_int_operand" "n")
5487 (match_operand:SI 3 "const_int_operand" "n")))]
5488 "TARGET_68020 && TARGET_BITFIELD
5489 && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
5490 && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
5491 && (GET_CODE (operands[1]) == REG
5492 || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
5494 cc_status.flags |= CC_NOT_NEGATIVE;
5495 if (REG_P (operands[1]))
5497 if (INTVAL (operands[2]) + INTVAL (operands[3]) != 32)
5498 return "bfextu %1{%b3:%b2},%0";
5502 = adjust_address (operands[1], SImode, INTVAL (operands[3]) / 8);
5504 output_asm_insn ("clr%.l %0", operands);
5505 if (GET_CODE (operands[0]) == MEM)
5506 operands[0] = adjust_address (operands[0],
5507 INTVAL (operands[2]) == 8 ? QImode : HImode,
5508 (32 - INTVAL (operands[1])) / 8);
5510 if (INTVAL (operands[2]) == 8)
5511 return "move%.b %1,%0";
5512 return "move%.w %1,%0";
5516 ; Special case for 32-bit field in memory. This only occurs when 32-bit
5517 ; alignment of structure members is specified.
5519 ; The move is allowed to be odd byte aligned, because that's still faster
5520 ; than an odd byte aligned bit-field instruction.
5523 [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
5524 (sign_extract:SI (match_operand:QI 1 "memory_src_operand" "oS")
5526 (match_operand:SI 2 "const_int_operand" "n")))]
5527 "TARGET_68020 && TARGET_BITFIELD
5528 && (INTVAL (operands[2]) % 8) == 0
5529 && ! mode_dependent_address_p (XEXP (operands[1], 0))"
5532 = adjust_address (operands[1], SImode, INTVAL (operands[2]) / 8);
5534 return "move%.l %1,%0";
5538 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
5539 (sign_extract:SI (match_operand:SI 1 "register_operand" "do")
5540 (match_operand:SI 2 "const_int_operand" "n")
5541 (match_operand:SI 3 "const_int_operand" "n")))]
5542 "TARGET_68020 && TARGET_BITFIELD
5543 && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
5544 && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
5545 && (GET_CODE (operands[1]) == REG
5546 || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
5548 if (REG_P (operands[1]))
5550 if (INTVAL (operands[2]) + INTVAL (operands[3]) != 32)
5551 return "bfexts %1{%b3:%b2},%0";
5555 = adjust_address (operands[1],
5556 INTVAL (operands[2]) == 8 ? QImode : HImode,
5557 INTVAL (operands[3]) / 8);
5559 if (INTVAL (operands[2]) == 8)
5560 return "move%.b %1,%0\;extb%.l %0";
5561 return "move%.w %1,%0\;ext%.l %0";
5564 ;; Bit-field instructions, general cases.
5565 ;; "o,d" constraint causes a nonoffsettable memref to match the "o"
5566 ;; so that its address is reloaded.
5568 (define_expand "extv"
5569 [(set (match_operand:SI 0 "register_operand" "")
5570 (sign_extract:SI (match_operand:SI 1 "general_operand" "")
5571 (match_operand:SI 2 "const_int_operand" "")
5572 (match_operand:SI 3 "const_int_operand" "")))]
5573 "TARGET_68020 && TARGET_BITFIELD"
5577 [(set (match_operand:SI 0 "register_operand" "=d")
5578 (sign_extract:SI (match_operand:QI 1 "memory_operand" "o")
5579 (match_operand:SI 2 "nonmemory_operand" "dn")
5580 (match_operand:SI 3 "nonmemory_operand" "dn")))]
5581 "TARGET_68020 && TARGET_BITFIELD"
5582 "bfexts %1{%b3:%b2},%0")
5584 (define_expand "extzv"
5585 [(set (match_operand:SI 0 "register_operand" "")
5586 (zero_extract:SI (match_operand:SI 1 "general_operand" "")
5587 (match_operand:SI 2 "const_int_operand" "")
5588 (match_operand:SI 3 "const_int_operand" "")))]
5589 "TARGET_68020 && TARGET_BITFIELD"
5593 [(set (match_operand:SI 0 "register_operand" "=d")
5594 (zero_extract:SI (match_operand:QI 1 "memory_operand" "o")
5595 (match_operand:SI 2 "nonmemory_operand" "dn")
5596 (match_operand:SI 3 "nonmemory_operand" "dn")))]
5597 "TARGET_68020 && TARGET_BITFIELD"
5599 if (GET_CODE (operands[2]) == CONST_INT)
5601 if (INTVAL (operands[2]) != 32)
5602 cc_status.flags |= CC_NOT_NEGATIVE;
5608 return "bfextu %1{%b3:%b2},%0";
5612 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5613 (match_operand:SI 1 "nonmemory_operand" "dn")
5614 (match_operand:SI 2 "nonmemory_operand" "dn"))
5615 (xor:SI (zero_extract:SI (match_dup 0) (match_dup 1) (match_dup 2))
5616 (match_operand 3 "const_int_operand" "n")))]
5617 "TARGET_68020 && TARGET_BITFIELD
5618 && (INTVAL (operands[3]) == -1
5619 || (GET_CODE (operands[1]) == CONST_INT
5620 && (~ INTVAL (operands[3]) & ((1 << INTVAL (operands[1]))- 1)) == 0))"
5623 return "bfchg %0{%b2:%b1}";
5627 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5628 (match_operand:SI 1 "nonmemory_operand" "dn")
5629 (match_operand:SI 2 "nonmemory_operand" "dn"))
5631 "TARGET_68020 && TARGET_BITFIELD"
5634 return "bfclr %0{%b2:%b1}";
5638 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5639 (match_operand:SI 1 "general_operand" "dn")
5640 (match_operand:SI 2 "general_operand" "dn"))
5642 "TARGET_68020 && TARGET_BITFIELD"
5645 return "bfset %0{%b2:%b1}";
5648 (define_expand "insv"
5649 [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "")
5650 (match_operand:SI 1 "const_int_operand" "")
5651 (match_operand:SI 2 "const_int_operand" ""))
5652 (match_operand:SI 3 "register_operand" ""))]
5653 "TARGET_68020 && TARGET_BITFIELD"
5657 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+o")
5658 (match_operand:SI 1 "nonmemory_operand" "dn")
5659 (match_operand:SI 2 "nonmemory_operand" "dn"))
5660 (match_operand:SI 3 "register_operand" "d"))]
5661 "TARGET_68020 && TARGET_BITFIELD"
5662 "bfins %3,%0{%b2:%b1}")
5664 ;; Now recognize bit-field insns that operate on registers
5665 ;; (or at least were intended to do so).
5668 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
5669 (sign_extract:SI (match_operand:SI 1 "register_operand" "d")
5670 (match_operand:SI 2 "const_int_operand" "n")
5671 (match_operand:SI 3 "const_int_operand" "n")))]
5672 "TARGET_68020 && TARGET_BITFIELD"
5673 "bfexts %1{%b3:%b2},%0")
5676 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
5677 (zero_extract:SI (match_operand:SI 1 "register_operand" "d")
5678 (match_operand:SI 2 "const_int_operand" "n")
5679 (match_operand:SI 3 "const_int_operand" "n")))]
5680 "TARGET_68020 && TARGET_BITFIELD"
5682 if (GET_CODE (operands[2]) == CONST_INT)
5684 if (INTVAL (operands[2]) != 32)
5685 cc_status.flags |= CC_NOT_NEGATIVE;
5691 return "bfextu %1{%b3:%b2},%0";
5695 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+d")
5696 (match_operand:SI 1 "const_int_operand" "n")
5697 (match_operand:SI 2 "const_int_operand" "n"))
5699 "TARGET_68020 && TARGET_BITFIELD"
5702 return "bfclr %0{%b2:%b1}";
5706 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+d")
5707 (match_operand:SI 1 "const_int_operand" "n")
5708 (match_operand:SI 2 "const_int_operand" "n"))
5710 "TARGET_68020 && TARGET_BITFIELD"
5713 return "bfset %0{%b2:%b1}";
5717 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+d")
5718 (match_operand:SI 1 "const_int_operand" "n")
5719 (match_operand:SI 2 "const_int_operand" "n"))
5720 (match_operand:SI 3 "register_operand" "d"))]
5721 "TARGET_68020 && TARGET_BITFIELD"
5724 /* These special cases are now recognized by a specific pattern. */
5725 if (GET_CODE (operands[1]) == CONST_INT && GET_CODE (operands[2]) == CONST_INT
5726 && INTVAL (operands[1]) == 16 && INTVAL (operands[2]) == 16)
5727 return "move%.w %3,%0";
5728 if (GET_CODE (operands[1]) == CONST_INT && GET_CODE (operands[2]) == CONST_INT
5729 && INTVAL (operands[1]) == 24 && INTVAL (operands[2]) == 8)
5730 return "move%.b %3,%0";
5732 return "bfins %3,%0{%b2:%b1}";
5735 ;; Special patterns for optimizing bit-field instructions.
5739 (zero_extract:SI (match_operand:QI 0 "memory_operand" "o")
5740 (match_operand:SI 1 "const_int_operand" "n")
5741 (match_operand:SI 2 "general_operand" "dn")))]
5742 "TARGET_68020 && TARGET_BITFIELD"
5744 if (operands[1] == const1_rtx
5745 && GET_CODE (operands[2]) == CONST_INT)
5747 int width = GET_CODE (operands[0]) == REG ? 31 : 7;
5748 return output_btst (operands,
5749 GEN_INT (width - INTVAL (operands[2])),
5750 operands[0], insn, 1000);
5751 /* Pass 1000 as SIGNPOS argument so that btst will
5752 not think we are testing the sign bit for an `and'
5753 and assume that nonzero implies a negative result. */
5755 if (INTVAL (operands[1]) != 32)
5756 cc_status.flags = CC_NOT_NEGATIVE;
5757 return "bftst %0{%b2:%b1}";
5761 ;;; now handle the register cases
5764 (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
5765 (match_operand:SI 1 "const_int_operand" "n")
5766 (match_operand:SI 2 "general_operand" "dn")))]
5767 "TARGET_68020 && TARGET_BITFIELD"
5769 if (operands[1] == const1_rtx
5770 && GET_CODE (operands[2]) == CONST_INT)
5772 int width = GET_CODE (operands[0]) == REG ? 31 : 7;
5773 return output_btst (operands, GEN_INT (width - INTVAL (operands[2])),
5774 operands[0], insn, 1000);
5775 /* Pass 1000 as SIGNPOS argument so that btst will
5776 not think we are testing the sign bit for an `and'
5777 and assume that nonzero implies a negative result. */
5779 if (INTVAL (operands[1]) != 32)
5780 cc_status.flags = CC_NOT_NEGATIVE;
5781 return "bftst %0{%b2:%b1}";
5784 (define_insn "scc0_di"
5785 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
5786 (match_operator 1 "valid_dbcc_comparison_p"
5787 [(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
5790 return output_scc_di (operands[1], operands[2], const0_rtx, operands[0]);
5793 (define_insn "scc0_di_5200"
5794 [(set (match_operand:QI 0 "nonimmediate_operand" "=d")
5795 (match_operator 1 "valid_dbcc_comparison_p"
5796 [(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
5799 return output_scc_di (operands[1], operands[2], const0_rtx, operands[0]);
5802 (define_insn "scc_di"
5803 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,dm")
5804 (match_operator 1 "valid_dbcc_comparison_p"
5805 [(match_operand:DI 2 "general_operand" "ro,r")
5806 (match_operand:DI 3 "general_operand" "r,ro")]))]
5809 return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
5812 (define_insn "scc_di_5200"
5813 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d")
5814 (match_operator 1 "valid_dbcc_comparison_p"
5815 [(match_operand:DI 2 "general_operand" "ro,r")
5816 (match_operand:DI 3 "general_operand" "r,ro")]))]
5819 return output_scc_di (operands[1], operands[2], operands[3], operands[0]);
5822 ;; Note that operand 0 of an SCC insn is supported in the hardware as
5823 ;; memory, but we cannot allow it to be in memory in case the address
5824 ;; needs to be reloaded.
5826 (define_expand "seq"
5827 [(set (match_operand:QI 0 "register_operand" "")
5828 (eq:QI (cc0) (const_int 0)))]
5831 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5832 && m68k_last_compare_had_fp_operands)
5834 m68k_last_compare_had_fp_operands = 0;
5840 [(set (match_operand:QI 0 "register_operand" "=d")
5841 (eq:QI (cc0) (const_int 0)))]
5844 cc_status = cc_prev_status;
5845 OUTPUT_JUMP ("seq %0", "fseq %0", "seq %0");
5848 (define_expand "sne"
5849 [(set (match_operand:QI 0 "register_operand" "")
5850 (ne:QI (cc0) (const_int 0)))]
5853 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5854 && m68k_last_compare_had_fp_operands)
5856 m68k_last_compare_had_fp_operands = 0;
5862 [(set (match_operand:QI 0 "register_operand" "=d")
5863 (ne:QI (cc0) (const_int 0)))]
5866 cc_status = cc_prev_status;
5867 OUTPUT_JUMP ("sne %0", "fsne %0", "sne %0");
5870 (define_expand "sgt"
5871 [(set (match_operand:QI 0 "register_operand" "")
5872 (gt:QI (cc0) (const_int 0)))]
5875 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5876 && m68k_last_compare_had_fp_operands)
5878 m68k_last_compare_had_fp_operands = 0;
5884 [(set (match_operand:QI 0 "register_operand" "=d")
5885 (gt:QI (cc0) (const_int 0)))]
5888 cc_status = cc_prev_status;
5889 OUTPUT_JUMP ("sgt %0", "fsgt %0", 0);
5892 (define_expand "sgtu"
5893 [(set (match_operand:QI 0 "register_operand" "")
5894 (gtu:QI (cc0) (const_int 0)))]
5899 [(set (match_operand:QI 0 "register_operand" "=d")
5900 (gtu:QI (cc0) (const_int 0)))]
5903 cc_status = cc_prev_status;
5907 (define_expand "slt"
5908 [(set (match_operand:QI 0 "register_operand" "")
5909 (lt:QI (cc0) (const_int 0)))]
5912 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5913 && m68k_last_compare_had_fp_operands)
5915 m68k_last_compare_had_fp_operands = 0;
5921 [(set (match_operand:QI 0 "register_operand" "=d")
5922 (lt:QI (cc0) (const_int 0)))]
5925 cc_status = cc_prev_status;
5926 OUTPUT_JUMP ("slt %0", "fslt %0", "smi %0");
5929 (define_expand "sltu"
5930 [(set (match_operand:QI 0 "register_operand" "")
5931 (ltu:QI (cc0) (const_int 0)))]
5936 [(set (match_operand:QI 0 "register_operand" "=d")
5937 (ltu:QI (cc0) (const_int 0)))]
5940 cc_status = cc_prev_status;
5944 (define_expand "sge"
5945 [(set (match_operand:QI 0 "register_operand" "")
5946 (ge:QI (cc0) (const_int 0)))]
5949 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5950 && m68k_last_compare_had_fp_operands)
5952 m68k_last_compare_had_fp_operands = 0;
5958 [(set (match_operand:QI 0 "register_operand" "=d")
5959 (ge:QI (cc0) (const_int 0)))]
5962 cc_status = cc_prev_status;
5963 OUTPUT_JUMP ("sge %0", "fsge %0", "spl %0");
5966 (define_expand "sgeu"
5967 [(set (match_operand:QI 0 "register_operand" "")
5968 (geu:QI (cc0) (const_int 0)))]
5973 [(set (match_operand:QI 0 "register_operand" "=d")
5974 (geu:QI (cc0) (const_int 0)))]
5977 cc_status = cc_prev_status;
5980 [(set_attr "type" "scc")])
5982 (define_expand "sle"
5983 [(set (match_operand:QI 0 "register_operand" "")
5984 (le:QI (cc0) (const_int 0)))]
5987 if ((TUNE_68060 || TARGET_COLDFIRE_FPU)
5988 && m68k_last_compare_had_fp_operands)
5990 m68k_last_compare_had_fp_operands = 0;
5996 [(set (match_operand:QI 0 "register_operand" "=d")
5997 (le:QI (cc0) (const_int 0)))]
6000 cc_status = cc_prev_status;
6001 OUTPUT_JUMP ("sle %0", "fsle %0", 0);
6004 (define_expand "sleu"
6005 [(set (match_operand:QI 0 "register_operand" "")
6006 (leu:QI (cc0) (const_int 0)))]
6011 [(set (match_operand:QI 0 "register_operand" "=d")
6012 (leu:QI (cc0) (const_int 0)))]
6015 cc_status = cc_prev_status;
6018 [(set_attr "type" "scc")])
6020 (define_expand "sordered"
6021 [(set (match_operand:QI 0 "register_operand" "")
6022 (ordered:QI (cc0) (const_int 0)))]
6023 "TARGET_68881 && !TUNE_68060"
6025 gcc_assert (m68k_last_compare_had_fp_operands);
6026 m68k_last_compare_had_fp_operands = 0;
6029 (define_insn "*sordered_1"
6030 [(set (match_operand:QI 0 "register_operand" "=d")
6031 (ordered:QI (cc0) (const_int 0)))]
6032 "TARGET_68881 && !TUNE_68060"
6034 cc_status = cc_prev_status;
6038 (define_expand "sunordered"
6039 [(set (match_operand:QI 0 "register_operand" "")
6040 (unordered:QI (cc0) (const_int 0)))]
6041 "TARGET_68881 && !TUNE_68060"
6043 gcc_assert (m68k_last_compare_had_fp_operands);
6044 m68k_last_compare_had_fp_operands = 0;
6047 (define_insn "*sunordered_1"
6048 [(set (match_operand:QI 0 "register_operand" "=d")
6049 (unordered:QI (cc0) (const_int 0)))]
6050 "TARGET_68881 && !TUNE_68060"
6052 cc_status = cc_prev_status;
6056 (define_expand "suneq"
6057 [(set (match_operand:QI 0 "register_operand" "")
6058 (uneq:QI (cc0) (const_int 0)))]
6059 "TARGET_68881 && !TUNE_68060"
6061 gcc_assert (m68k_last_compare_had_fp_operands);
6062 m68k_last_compare_had_fp_operands = 0;
6065 (define_insn "*suneq_1"
6066 [(set (match_operand:QI 0 "register_operand" "=d")
6067 (uneq:QI (cc0) (const_int 0)))]
6068 "TARGET_68881 && !TUNE_68060"
6070 cc_status = cc_prev_status;
6074 (define_expand "sunge"
6075 [(set (match_operand:QI 0 "register_operand" "")
6076 (unge:QI (cc0) (const_int 0)))]
6077 "TARGET_68881 && !TUNE_68060"
6079 gcc_assert (m68k_last_compare_had_fp_operands);
6080 m68k_last_compare_had_fp_operands = 0;
6083 (define_insn "*sunge_1"
6084 [(set (match_operand:QI 0 "register_operand" "=d")
6085 (unge:QI (cc0) (const_int 0)))]
6086 "TARGET_68881 && !TUNE_68060"
6088 cc_status = cc_prev_status;
6092 (define_expand "sungt"
6093 [(set (match_operand:QI 0 "register_operand" "")
6094 (ungt:QI (cc0) (const_int 0)))]
6095 "TARGET_68881 && !TUNE_68060"
6097 gcc_assert (m68k_last_compare_had_fp_operands);
6098 m68k_last_compare_had_fp_operands = 0;
6101 (define_insn "*sungt_1"
6102 [(set (match_operand:QI 0 "register_operand" "=d")
6103 (ungt:QI (cc0) (const_int 0)))]
6104 "TARGET_68881 && !TUNE_68060"
6106 cc_status = cc_prev_status;
6110 (define_expand "sunle"
6111 [(set (match_operand:QI 0 "register_operand" "")
6112 (unle:QI (cc0) (const_int 0)))]
6113 "TARGET_68881 && !TUNE_68060"
6115 gcc_assert (m68k_last_compare_had_fp_operands);
6116 m68k_last_compare_had_fp_operands = 0;
6119 (define_insn "*sunle_1"
6120 [(set (match_operand:QI 0 "register_operand" "=d")
6121 (unle:QI (cc0) (const_int 0)))]
6122 "TARGET_68881 && !TUNE_68060"
6124 cc_status = cc_prev_status;
6128 (define_expand "sunlt"
6129 [(set (match_operand:QI 0 "register_operand" "")
6130 (unlt:QI (cc0) (const_int 0)))]
6131 "TARGET_68881 && !TUNE_68060"
6133 gcc_assert (m68k_last_compare_had_fp_operands);
6134 m68k_last_compare_had_fp_operands = 0;
6137 (define_insn "*sunlt_1"
6138 [(set (match_operand:QI 0 "register_operand" "=d")
6139 (unlt:QI (cc0) (const_int 0)))]
6140 "TARGET_68881 && !TUNE_68060"
6142 cc_status = cc_prev_status;
6146 (define_expand "sltgt"
6147 [(set (match_operand:QI 0 "register_operand" "")
6148 (ltgt:QI (cc0) (const_int 0)))]
6149 "TARGET_68881 && !TUNE_68060"
6151 gcc_assert (m68k_last_compare_had_fp_operands);
6152 m68k_last_compare_had_fp_operands = 0;
6155 (define_insn "*sltgt_1"
6156 [(set (match_operand:QI 0 "register_operand" "=d")
6157 (ltgt:QI (cc0) (const_int 0)))]
6158 "TARGET_68881 && !TUNE_68060"
6160 cc_status = cc_prev_status;
6164 (define_insn "*fsogt_1"
6165 [(set (match_operand:QI 0 "register_operand" "=d")
6166 (not:QI (unle:QI (cc0) (const_int 0))))]
6167 "TARGET_68881 && !TUNE_68060"
6169 cc_status = cc_prev_status;
6173 (define_insn "*fsoge_1"
6174 [(set (match_operand:QI 0 "register_operand" "=d")
6175 (not:QI (unlt:QI (cc0) (const_int 0))))]
6176 "TARGET_68881 && !TUNE_68060"
6178 cc_status = cc_prev_status;
6182 (define_insn "*fsolt_1"
6183 [(set (match_operand:QI 0 "register_operand" "=d")
6184 (not:QI (unge:QI (cc0) (const_int 0))))]
6185 "TARGET_68881 && !TUNE_68060"
6187 cc_status = cc_prev_status;
6191 (define_insn "*fsole_1"
6192 [(set (match_operand:QI 0 "register_operand" "=d")
6193 (not:QI (ungt:QI (cc0) (const_int 0))))]
6194 "TARGET_68881 && !TUNE_68060"
6196 cc_status = cc_prev_status;
6200 ;; Basic conditional jump instructions.
6202 (define_insn "beq0_di"
6204 (if_then_else (eq (match_operand:DI 0 "general_operand" "d*ao,<>")
6206 (label_ref (match_operand 1 "" ","))
6208 (clobber (match_scratch:SI 2 "=d,d"))]
6212 if (which_alternative == 1)
6213 return "move%.l %0,%2\;or%.l %0,%2\;jeq %l1";
6214 if ((cc_prev_status.value1
6215 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6216 || (cc_prev_status.value2
6217 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6219 cc_status = cc_prev_status;
6222 if (GET_CODE (operands[0]) == REG)
6223 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
6225 operands[3] = adjust_address (operands[0], SImode, 4);
6226 if (! ADDRESS_REG_P (operands[0]))
6228 if (reg_overlap_mentioned_p (operands[2], operands[0]))
6230 if (reg_overlap_mentioned_p (operands[2], operands[3]))
6231 return "or%.l %0,%2\;jeq %l1";
6233 return "or%.l %3,%2\;jeq %l1";
6235 return "move%.l %0,%2\;or%.l %3,%2\;jeq %l1";
6237 operands[4] = gen_label_rtx();
6238 if (TARGET_68020 || TARGET_COLDFIRE)
6239 output_asm_insn ("tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1", operands);
6241 output_asm_insn ("cmp%.w #0,%0\;jne %l4\;cmp%.w #0,%3\;jeq %l1", operands);
6242 (*targetm.asm_out.internal_label) (asm_out_file, "L",
6243 CODE_LABEL_NUMBER (operands[4]));
6247 (define_insn "bne0_di"
6249 (if_then_else (ne (match_operand:DI 0 "general_operand" "do,*a")
6251 (label_ref (match_operand 1 "" ","))
6253 (clobber (match_scratch:SI 2 "=d,X"))]
6256 if ((cc_prev_status.value1
6257 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6258 || (cc_prev_status.value2
6259 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6261 cc_status = cc_prev_status;
6265 if (GET_CODE (operands[0]) == REG)
6266 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
6268 operands[3] = adjust_address (operands[0], SImode, 4);
6269 if (!ADDRESS_REG_P (operands[0]))
6271 if (reg_overlap_mentioned_p (operands[2], operands[0]))
6273 if (reg_overlap_mentioned_p (operands[2], operands[3]))
6274 return "or%.l %0,%2\;jne %l1";
6276 return "or%.l %3,%2\;jne %l1";
6278 return "move%.l %0,%2\;or%.l %3,%2\;jne %l1";
6280 if (TARGET_68020 || TARGET_COLDFIRE)
6281 return "tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1";
6283 return "cmp%.w #0,%0\;jne %l1\;cmp%.w #0,%3\;jne %l1";
6286 (define_insn "bge0_di"
6288 (if_then_else (ge (match_operand:DI 0 "general_operand" "ro")
6290 (label_ref (match_operand 1 "" ""))
6294 if ((cc_prev_status.value1
6295 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6296 || (cc_prev_status.value2
6297 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6299 cc_status = cc_prev_status;
6300 return cc_status.flags & CC_REVERSED ? "jle %l1" : "jpl %l1";
6303 if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
6304 output_asm_insn("tst%.l %0", operands);
6307 /* On an address reg, cmpw may replace cmpl. */
6308 output_asm_insn("cmp%.w #0,%0", operands);
6313 (define_insn "blt0_di"
6315 (if_then_else (lt (match_operand:DI 0 "general_operand" "ro")
6317 (label_ref (match_operand 1 "" ""))
6321 if ((cc_prev_status.value1
6322 && rtx_equal_p (cc_prev_status.value1, operands[0]))
6323 || (cc_prev_status.value2
6324 && rtx_equal_p (cc_prev_status.value2, operands[0])))
6326 cc_status = cc_prev_status;
6327 return cc_status.flags & CC_REVERSED ? "jgt %l1" : "jmi %l1";
6330 if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
6331 output_asm_insn("tst%.l %0", operands);
6334 /* On an address reg, cmpw may replace cmpl. */
6335 output_asm_insn("cmp%.w #0,%0", operands);
6342 (if_then_else (eq (cc0)
6344 (label_ref (match_operand 0 "" ""))
6348 OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
6350 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6354 (if_then_else (ne (cc0)
6356 (label_ref (match_operand 0 "" ""))
6360 OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
6362 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6366 (if_then_else (gt (cc0)
6368 (label_ref (match_operand 0 "" ""))
6372 OUTPUT_JUMP ("jgt %l0", "fjgt %l0", 0);
6374 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6378 (if_then_else (gtu (cc0)
6380 (label_ref (match_operand 0 "" ""))
6384 [(set_attr "type" "bcc")])
6388 (if_then_else (lt (cc0)
6390 (label_ref (match_operand 0 "" ""))
6394 OUTPUT_JUMP ("jlt %l0", "fjlt %l0", "jmi %l0");
6396 [(set (attr "type") (symbol_ref "m68k_sched_branch_type (insn)"))])
6400 (if_then_else (ltu (cc0)
6402 (label_ref (match_operand 0 "" ""))
6406 [(set_attr "type" "bcc")])
6410 (if_then_else (ge (cc0)
6412 (label_ref (match_operand 0 "" ""))
6416 OUTPUT_JUMP ("jge %l0", "fjge %l0", "jpl %l0");
6421 (if_then_else (geu (cc0)
6423 (label_ref (match_operand 0 "" ""))
6427 [(set_attr "type" "bcc")])
6431 (if_then_else (le (cc0)
6433 (label_ref (match_operand 0 "" ""))
6437 OUTPUT_JUMP ("jle %l0", "fjle %l0", 0);
6439 [(set_attr "type" "bcc")])
6443 (if_then_else (leu (cc0)
6445 (label_ref (match_operand 0 "" ""))
6449 [(set_attr "type" "bcc")])
6451 (define_insn "bordered"
6453 (if_then_else (ordered (cc0) (const_int 0))
6454 (label_ref (match_operand 0 "" ""))
6458 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6461 [(set_attr "type" "fbcc")])
6463 (define_insn "bunordered"
6465 (if_then_else (unordered (cc0) (const_int 0))
6466 (label_ref (match_operand 0 "" ""))
6470 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6473 [(set_attr "type" "fbcc")])
6475 (define_insn "buneq"
6477 (if_then_else (uneq (cc0) (const_int 0))
6478 (label_ref (match_operand 0 "" ""))
6482 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6485 [(set_attr "type" "fbcc")])
6487 (define_insn "bunge"
6489 (if_then_else (unge (cc0) (const_int 0))
6490 (label_ref (match_operand 0 "" ""))
6494 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6497 [(set_attr "type" "fbcc")])
6499 (define_insn "bungt"
6501 (if_then_else (ungt (cc0) (const_int 0))
6502 (label_ref (match_operand 0 "" ""))
6506 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6509 [(set_attr "type" "fbcc")])
6511 (define_insn "bunle"
6513 (if_then_else (unle (cc0) (const_int 0))
6514 (label_ref (match_operand 0 "" ""))
6518 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6521 [(set_attr "type" "fbcc")])
6523 (define_insn "bunlt"
6525 (if_then_else (unlt (cc0) (const_int 0))
6526 (label_ref (match_operand 0 "" ""))
6530 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6533 [(set_attr "type" "fbcc")])
6535 (define_insn "bltgt"
6537 (if_then_else (ltgt (cc0) (const_int 0))
6538 (label_ref (match_operand 0 "" ""))
6542 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6545 [(set_attr "type" "fbcc")])
6547 ;; Negated conditional jump instructions.
6549 (define_insn "*beq_rev"
6551 (if_then_else (eq (cc0)
6554 (label_ref (match_operand 0 "" ""))))]
6557 OUTPUT_JUMP ("jne %l0", "fjne %l0", "jne %l0");
6559 [(set_attr "type" "bcc")])
6561 (define_insn "*bne_rev"
6563 (if_then_else (ne (cc0)
6566 (label_ref (match_operand 0 "" ""))))]
6569 OUTPUT_JUMP ("jeq %l0", "fjeq %l0", "jeq %l0");
6571 [(set_attr "type" "bcc")])
6573 (define_insn "*bgt_rev"
6575 (if_then_else (gt (cc0)
6578 (label_ref (match_operand 0 "" ""))))]
6581 OUTPUT_JUMP ("jle %l0", "fjngt %l0", 0);
6583 [(set_attr "type" "bcc")])
6585 (define_insn "*bgtu_rev"
6587 (if_then_else (gtu (cc0)
6590 (label_ref (match_operand 0 "" ""))))]
6593 [(set_attr "type" "bcc")])
6595 (define_insn "*blt_rev"
6597 (if_then_else (lt (cc0)
6600 (label_ref (match_operand 0 "" ""))))]
6603 OUTPUT_JUMP ("jge %l0", "fjnlt %l0", "jpl %l0");
6605 [(set_attr "type" "bcc")])
6607 (define_insn "*bltu_rev"
6609 (if_then_else (ltu (cc0)
6612 (label_ref (match_operand 0 "" ""))))]
6615 [(set_attr "type" "bcc")])
6617 (define_insn "*bge_rev"
6619 (if_then_else (ge (cc0)
6622 (label_ref (match_operand 0 "" ""))))]
6625 OUTPUT_JUMP ("jlt %l0", "fjnge %l0", "jmi %l0");
6627 [(set_attr "type" "bcc")])
6629 (define_insn "*bgeu_rev"
6631 (if_then_else (geu (cc0)
6634 (label_ref (match_operand 0 "" ""))))]
6637 [(set_attr "type" "bcc")])
6639 (define_insn "*ble_rev"
6641 (if_then_else (le (cc0)
6644 (label_ref (match_operand 0 "" ""))))]
6647 OUTPUT_JUMP ("jgt %l0", "fjnle %l0", 0);
6649 [(set_attr "type" "bcc")])
6651 (define_insn "*bleu_rev"
6653 (if_then_else (leu (cc0)
6656 (label_ref (match_operand 0 "" ""))))]
6659 [(set_attr "type" "bcc")])
6661 (define_insn "*bordered_rev"
6663 (if_then_else (ordered (cc0) (const_int 0))
6665 (label_ref (match_operand 0 "" ""))))]
6668 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6671 [(set_attr "type" "fbcc")])
6673 (define_insn "*bunordered_rev"
6675 (if_then_else (unordered (cc0) (const_int 0))
6677 (label_ref (match_operand 0 "" ""))))]
6680 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6683 [(set_attr "type" "fbcc")])
6685 (define_insn "*buneq_rev"
6687 (if_then_else (uneq (cc0) (const_int 0))
6689 (label_ref (match_operand 0 "" ""))))]
6692 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6695 [(set_attr "type" "fbcc")])
6697 (define_insn "*bunge_rev"
6699 (if_then_else (unge (cc0) (const_int 0))
6701 (label_ref (match_operand 0 "" ""))))]
6704 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6707 [(set_attr "type" "fbcc")])
6709 (define_insn "*bungt_rev"
6711 (if_then_else (ungt (cc0) (const_int 0))
6713 (label_ref (match_operand 0 "" ""))))]
6716 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6719 [(set_attr "type" "fbcc")])
6721 (define_insn "*bunle_rev"
6723 (if_then_else (unle (cc0) (const_int 0))
6725 (label_ref (match_operand 0 "" ""))))]
6728 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6731 [(set_attr "type" "fbcc")])
6733 (define_insn "*bunlt_rev"
6735 (if_then_else (unlt (cc0) (const_int 0))
6737 (label_ref (match_operand 0 "" ""))))]
6740 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6743 [(set_attr "type" "fbcc")])
6745 (define_insn "*bltgt_rev"
6747 (if_then_else (ltgt (cc0) (const_int 0))
6749 (label_ref (match_operand 0 "" ""))))]
6752 gcc_assert (cc_prev_status.flags & CC_IN_68881);
6755 [(set_attr "type" "fbcc")])
6757 ;; Unconditional and other jump instructions
6760 (label_ref (match_operand 0 "" "")))]
6763 [(set_attr "type" "bra")])
6765 (define_expand "tablejump"
6766 [(parallel [(set (pc) (match_operand 0 "" ""))
6767 (use (label_ref (match_operand 1 "" "")))])]
6770 #ifdef CASE_VECTOR_PC_RELATIVE
6771 operands[0] = gen_rtx_PLUS (SImode, pc_rtx,
6772 gen_rtx_SIGN_EXTEND (SImode, operands[0]));
6776 ;; Jump to variable address from dispatch table of absolute addresses.
6777 (define_insn "*tablejump_internal"
6778 [(set (pc) (match_operand:SI 0 "register_operand" "a"))
6779 (use (label_ref (match_operand 1 "" "")))]
6782 return MOTOROLA ? "jmp (%0)" : "jmp %0@";
6784 [(set_attr "type" "jmp")])
6786 ;; Jump to variable address from dispatch table of relative addresses.
6790 (sign_extend:SI (match_operand:HI 0 "register_operand" "r"))))
6791 (use (label_ref (match_operand 1 "" "")))]
6794 #ifdef ASM_RETURN_CASE_JUMP
6795 ASM_RETURN_CASE_JUMP;
6797 if (TARGET_COLDFIRE)
6799 if (ADDRESS_REG_P (operands[0]))
6800 return MOTOROLA ? "jmp (2,pc,%0.l)" : "jmp pc@(2,%0:l)";
6802 return "ext%.l %0\;jmp (2,pc,%0.l)";
6804 return "extl %0\;jmp pc@(2,%0:l)";
6807 return MOTOROLA ? "jmp (2,pc,%0.w)" : "jmp pc@(2,%0:w)";
6811 ;; Decrement-and-branch insns.
6812 (define_insn "*dbne_hi"
6815 (ne (match_operand:HI 0 "nonimmediate_operand" "+d*g")
6817 (label_ref (match_operand 1 "" ""))
6820 (plus:HI (match_dup 0)
6825 if (DATA_REG_P (operands[0]))
6826 return "dbra %0,%l1";
6827 if (GET_CODE (operands[0]) == MEM)
6828 return "subq%.w #1,%0\;jcc %l1";
6829 return "subq%.w #1,%0\;cmp%.w #-1,%0\;jne %l1";
6832 (define_insn "*dbne_si"
6835 (ne (match_operand:SI 0 "nonimmediate_operand" "+d*g")
6837 (label_ref (match_operand 1 "" ""))
6840 (plus:SI (match_dup 0)
6845 if (DATA_REG_P (operands[0]))
6846 return "dbra %0,%l1\;clr%.w %0\;subq%.l #1,%0\;jcc %l1";
6847 if (GET_CODE (operands[0]) == MEM)
6848 return "subq%.l #1,%0\;jcc %l1";
6849 return "subq%.l #1,%0\;cmp%.l #-1,%0\;jne %l1";
6852 ;; Two dbra patterns that use REG_NOTES info generated by strength_reduce.
6854 (define_insn "*dbge_hi"
6857 (ge (plus:HI (match_operand:HI 0 "nonimmediate_operand" "+d*am")
6860 (label_ref (match_operand 1 "" ""))
6863 (plus:HI (match_dup 0)
6865 "!TARGET_COLDFIRE && find_reg_note (insn, REG_NONNEG, 0)"
6868 if (DATA_REG_P (operands[0]))
6869 return "dbra %0,%l1";
6870 if (GET_CODE (operands[0]) == MEM)
6871 return "subq%.w #1,%0\;jcc %l1";
6872 return "subq%.w #1,%0\;cmp%.w #-1,%0\;jne %l1";
6875 (define_expand "decrement_and_branch_until_zero"
6876 [(parallel [(set (pc)
6878 (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "")
6881 (label_ref (match_operand 1 "" ""))
6884 (plus:SI (match_dup 0)
6889 (define_insn "*dbge_si"
6892 (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+d*am")
6895 (label_ref (match_operand 1 "" ""))
6898 (plus:SI (match_dup 0)
6900 "!TARGET_COLDFIRE && find_reg_note (insn, REG_NONNEG, 0)"
6903 if (DATA_REG_P (operands[0]))
6904 return "dbra %0,%l1\;clr%.w %0\;subq%.l #1,%0\;jcc %l1";
6905 if (GET_CODE (operands[0]) == MEM)
6906 return "subq%.l #1,%0\;jcc %l1";
6907 return "subq%.l #1,%0\;cmp%.l #-1,%0\;jne %l1";
6910 (define_expand "sibcall"
6911 [(call (match_operand:QI 0 "memory_operand" "")
6912 (match_operand:SI 1 "general_operand" ""))]
6915 operands[0] = m68k_legitimize_sibcall_address (operands[0]);
6918 (define_insn "*sibcall"
6919 [(call (mem:QI (match_operand:SI 0 "sibcall_operand" ""))
6920 (match_operand:SI 1 "general_operand" ""))]
6921 "SIBLING_CALL_P (insn)"
6923 return output_sibcall (operands[0]);
6926 (define_expand "sibcall_value"
6927 [(set (match_operand 0 "" "")
6928 (call (match_operand:QI 1 "memory_operand" "")
6929 (match_operand:SI 2 "general_operand" "")))]
6932 operands[1] = m68k_legitimize_sibcall_address (operands[1]);
6935 (define_insn "*sibcall_value"
6936 [(set (match_operand 0 "" "=rf,rf")
6937 (call (mem:QI (match_operand:SI 1 "sibcall_operand" ""))
6938 (match_operand:SI 2 "general_operand" "")))]
6939 "SIBLING_CALL_P (insn)"
6941 operands[0] = operands[1];
6942 return output_sibcall (operands[0]);
6945 ;; Call subroutine with no return value.
6946 (define_expand "call"
6947 [(call (match_operand:QI 0 "memory_operand" "")
6948 (match_operand:SI 1 "general_operand" ""))]
6949 ;; Operand 1 not really used on the m68000.
6952 operands[0] = m68k_legitimize_call_address (operands[0]);
6955 (define_insn "*call"
6956 [(call (mem:QI (match_operand:SI 0 "call_operand" "a,W"))
6957 (match_operand:SI 1 "general_operand" "g,g"))]
6958 ;; Operand 1 not really used on the m68000.
6959 "!SIBLING_CALL_P (insn)"
6961 return output_call (operands[0]);
6963 [(set_attr "type" "jsr")])
6965 ;; Call subroutine, returning value in operand 0
6966 ;; (which must be a hard register).
6967 (define_expand "call_value"
6968 [(set (match_operand 0 "" "")
6969 (call (match_operand:QI 1 "memory_operand" "")
6970 (match_operand:SI 2 "general_operand" "")))]
6971 ;; Operand 2 not really used on the m68000.
6974 operands[1] = m68k_legitimize_call_address (operands[1]);
6977 (define_insn "*non_symbolic_call_value"
6978 [(set (match_operand 0 "" "=rf,rf")
6979 (call (mem:QI (match_operand:SI 1 "non_symbolic_call_operand" "a,W"))
6980 (match_operand:SI 2 "general_operand" "g,g")))]
6981 ;; Operand 2 not really used on the m68000.
6982 "!SIBLING_CALL_P (insn)"
6984 [(set_attr "type" "jsr")
6985 (set_attr "opx" "1")])
6987 (define_insn "*symbolic_call_value_jsr"
6988 [(set (match_operand 0 "" "=rf,rf")
6989 (call (mem:QI (match_operand:SI 1 "symbolic_operand" "a,W"))
6990 (match_operand:SI 2 "general_operand" "g,g")))]
6991 ;; Operand 2 not really used on the m68000.
6992 "!SIBLING_CALL_P (insn) && m68k_symbolic_call_var == M68K_SYMBOLIC_CALL_JSR"
6994 operands[0] = operands[1];
6995 return m68k_symbolic_call;
6997 [(set_attr "type" "jsr")
6998 (set_attr "opx" "1")])
7000 (define_insn "*symbolic_call_value_bsr"
7001 [(set (match_operand 0 "" "=rf,rf")
7002 (call (mem:QI (match_operand:SI 1 "symbolic_operand" "a,W"))
7003 (match_operand:SI 2 "general_operand" "g,g")))]
7004 ;; Operand 2 not really used on the m68000.
7005 "!SIBLING_CALL_P (insn)
7006 && (m68k_symbolic_call_var == M68K_SYMBOLIC_CALL_BSR_C
7007 || m68k_symbolic_call_var == M68K_SYMBOLIC_CALL_BSR_P)"
7009 operands[0] = operands[1];
7010 return m68k_symbolic_call;
7012 [(set_attr "type" "bsr")
7013 (set_attr "opx" "1")])
7015 ;; Call subroutine returning any type.
7017 (define_expand "untyped_call"
7018 [(parallel [(call (match_operand 0 "" "")
7020 (match_operand 1 "" "")
7021 (match_operand 2 "" "")])]
7022 "NEEDS_UNTYPED_CALL"
7026 emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
7028 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7030 rtx set = XVECEXP (operands[2], 0, i);
7031 emit_move_insn (SET_DEST (set), SET_SRC (set));
7034 /* The optimizer does not know that the call sets the function value
7035 registers we stored in the result block. We avoid problems by
7036 claiming that all hard registers are used and clobbered at this
7038 emit_insn (gen_blockage ());
7043 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7044 ;; all of memory. This blocks insns from being moved across this point.
7046 (define_insn "blockage"
7047 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7055 [(set_attr "type" "nop")])
7057 (define_expand "prologue"
7061 m68k_expand_prologue ();
7065 (define_expand "epilogue"
7069 m68k_expand_epilogue (false);
7073 (define_expand "sibcall_epilogue"
7077 m68k_expand_epilogue (true);
7081 ;; Used for frameless functions which save no regs and allocate no locals.
7082 (define_expand "return"
7084 "m68k_use_return_insn ()"
7087 (define_insn "*return"
7091 switch (m68k_get_function_kind (current_function_decl))
7093 case m68k_fk_interrupt_handler:
7096 case m68k_fk_interrupt_thread:
7100 if (crtl->args.pops_args)
7102 operands[0] = GEN_INT (crtl->args.pops_args);
7109 [(set_attr "type" "rts")])
7111 (define_insn "*m68k_store_multiple"
7112 [(match_parallel 0 "" [(match_operand 1 "")])]
7113 "m68k_movem_pattern_p (operands[0], NULL, 0, true)"
7115 return m68k_output_movem (operands, operands[0], 0, true);
7118 (define_insn "*m68k_store_multiple_automod"
7119 [(match_parallel 0 ""
7120 [(set (match_operand:SI 1 "register_operand" "=a")
7121 (plus:SI (match_operand:SI 2 "register_operand" "1")
7122 (match_operand:SI 3 "const_int_operand")))])]
7123 "m68k_movem_pattern_p (operands[0], operands[1], INTVAL (operands[3]), true)"
7125 return m68k_output_movem (operands, operands[0], INTVAL (operands[3]), true);
7128 (define_insn "*m68k_load_multiple"
7129 [(match_parallel 0 "" [(match_operand 1 "")])]
7130 "m68k_movem_pattern_p (operands[0], NULL, 0, false)"
7132 return m68k_output_movem (operands, operands[0], 0, false);
7135 (define_insn "*m68k_load_multiple_automod"
7136 [(match_parallel 0 ""
7137 [(set (match_operand:SI 1 "register_operand" "=a")
7138 (plus:SI (match_operand:SI 2 "register_operand" "1")
7139 (match_operand:SI 3 "const_int_operand")))])]
7140 "m68k_movem_pattern_p (operands[0], operands[1],
7141 INTVAL (operands[3]), false)"
7143 return m68k_output_movem (operands, operands[0],
7144 INTVAL (operands[3]), false);
7147 (define_expand "link"
7149 [(set (match_operand:SI 0 "register_operand")
7150 (plus:SI (reg:SI SP_REG) (const_int -4)))
7153 (set (reg:SI SP_REG)
7154 (plus:SI (reg:SI SP_REG)
7155 (match_operand:SI 1 "const_int_operand")))])]
7156 "TARGET_68020 || INTVAL (operands[1]) >= -0x8004"
7158 operands[2] = gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, -4));
7161 (define_insn "*link"
7162 [(set (match_operand:SI 0 "register_operand" "+r")
7163 (plus:SI (reg:SI SP_REG) (const_int -4)))
7164 (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -4)))
7166 (set (reg:SI SP_REG)
7167 (plus:SI (reg:SI SP_REG)
7168 (match_operand:SI 1 "const_int_operand")))]
7169 "TARGET_68020 || INTVAL (operands[1]) >= -0x8004"
7171 operands[1] = GEN_INT (INTVAL (operands[1]) + 4);
7173 return "link %0,%1";
7174 else if (INTVAL (operands[1]) >= -0x8000)
7175 return "link.w %0,%1";
7177 return "link.l %0,%1";
7179 [(set_attr "type" "link")])
7181 (define_expand "unlink"
7183 [(set (match_operand:SI 0 "register_operand")
7185 (set (reg:SI SP_REG)
7186 (plus:SI (match_dup 0)
7190 operands[1] = gen_frame_mem (SImode, copy_rtx (operands[0]));
7193 (define_insn "*unlink"
7194 [(set (match_operand:SI 0 "register_operand" "+r")
7195 (mem:SI (match_dup 0)))
7196 (set (reg:SI SP_REG)
7197 (plus:SI (match_dup 0)
7201 [(set_attr "type" "unlk")])
7203 (define_insn "load_got"
7204 [(set (match_operand:SI 0 "register_operand" "=a")
7205 (unspec:SI [(const_int 0)] UNSPEC_GOT))]
7208 if (TARGET_ID_SHARED_LIBRARY)
7210 operands[1] = gen_rtx_REG (Pmode, PIC_REG);
7211 return MOTOROLA ? "move.l %?(%1),%0" : "movel %1@(%?), %0";
7215 if (TARGET_COLDFIRE)
7216 /* Load the full 32-bit PC-relative offset of
7217 _GLOBAL_OFFSET_TABLE_ into the PIC register, then use it to
7218 calculate the absolute value. The offset and "lea"
7219 operation word together occupy 6 bytes. */
7220 return ("move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %0\n\t"
7221 "lea (-6, %%pc, %0), %0");
7223 return "lea (%%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %0";
7226 return ("movel #_GLOBAL_OFFSET_TABLE_, %0\n\t"
7227 "lea %%pc@(0,%0:l),%0");
7230 (define_insn "indirect_jump"
7231 [(set (pc) (match_operand:SI 0 "address_operand" "p"))]
7234 [(set_attr "type" "jmp")])
7236 ;; This should not be used unless the add/sub insns can't be.
7239 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
7240 (match_operand:QI 1 "address_operand" "p"))]
7244 ;; This is the first machine-dependent peephole optimization.
7245 ;; It is useful when a floating value is returned from a function call
7246 ;; and then is moved into an FP register.
7247 ;; But it is mainly intended to test the support for these optimizations.
7250 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
7251 (set (match_operand:DF 0 "register_operand" "")
7252 (match_operand:DF 1 "register_operand" ""))]
7253 "FP_REG_P (operands[0]) && !FP_REG_P (operands[1])"
7254 [(set (mem:SI (reg:SI SP_REG)) (match_dup 1))
7255 (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 2))
7256 (set (match_dup 0) (mem:DF (post_inc:SI (reg:SI SP_REG))))]
7257 "split_di(operands + 1, 1, operands + 1, operands + 2);")
7259 ;; Optimize a stack-adjust followed by a push of an argument.
7260 ;; This is said to happen frequently with -msoft-float
7261 ;; when there are consecutive library calls.
7264 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
7265 (set (match_operand:SF 0 "push_operand" "")
7266 (match_operand:SF 1 "general_operand" ""))]
7267 "!reg_mentioned_p (stack_pointer_rtx, operands[0])"
7268 [(set (match_dup 0) (match_dup 1))]
7269 "operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);")
7272 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
7273 (match_operand:SI 0 "const_int_operand" "")))
7274 (set (match_operand:SF 1 "push_operand" "")
7275 (match_operand:SF 2 "general_operand" ""))]
7276 "INTVAL (operands[0]) > 4
7277 && !reg_mentioned_p (stack_pointer_rtx, operands[2])"
7278 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 0)))
7279 (set (match_dup 1) (match_dup 2))]
7281 operands[0] = GEN_INT (INTVAL (operands[0]) - 4);
7282 operands[1] = replace_equiv_address (operands[1], stack_pointer_rtx);
7285 ;; Speed up stack adjust followed by a fullword fixedpoint push.
7286 ;; Constant operands need special care, as replacing a "pea X.w" with
7287 ;; "move.l #X,(%sp)" is often not a win.
7289 ;; Already done by the previous csa pass, left as reference.
7291 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
7292 (set (match_operand:SI 0 "push_operand" "")
7293 (match_operand:SI 1 "general_operand" ""))]
7294 "!reg_mentioned_p (stack_pointer_rtx, operands[1])"
7295 [(set (match_dup 0) (match_dup 1))]
7296 "operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);")
7298 ;; Try to use moveq, after stack push has been changed into a simple move.
7300 [(match_scratch:SI 2 "d")
7301 (set (match_operand:SI 0 "memory_operand" "")
7302 (match_operand:SI 1 "const_int_operand" ""))]
7303 "GET_CODE (XEXP (operands[0], 0)) != PRE_DEC
7304 && INTVAL (operands[1]) != 0
7305 && IN_RANGE (INTVAL (operands[1]), -0x80, 0x7f)
7306 && !valid_mov3q_const (INTVAL (operands[1]))"
7307 [(set (match_dup 2) (match_dup 1))
7308 (set (match_dup 0) (match_dup 2))])
7310 ;; This sequence adds an instruction, but is two bytes shorter.
7312 [(match_scratch:SI 2 "d")
7313 (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 12)))
7314 (set (match_operand:SI 0 "push_operand" "")
7315 (match_operand:SI 1 "const_int_operand" ""))]
7316 "INTVAL (operands[1]) != 0
7317 && IN_RANGE (INTVAL (operands[1]), -0x80, 0x7f)
7318 && !valid_mov3q_const (INTVAL (operands[1]))"
7319 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8)))
7320 (set (match_dup 2) (match_dup 1))
7321 (set (match_dup 0) (match_dup 2))]
7322 "operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);")
7324 ;; Changing pea X.w into a move.l is no real win here.
7326 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
7327 (match_operand:SI 0 "const_int_operand" "")))
7328 (set (match_operand:SI 1 "push_operand" "")
7329 (match_operand:SI 2 "general_operand" ""))]
7330 "INTVAL (operands[0]) > 4
7331 && !reg_mentioned_p (stack_pointer_rtx, operands[2])
7332 && !(CONST_INT_P (operands[2]) && INTVAL (operands[2]) != 0
7333 && IN_RANGE (INTVAL (operands[2]), -0x8000, 0x7fff)
7334 && !valid_mov3q_const (INTVAL (operands[2])))"
7335 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 0)))
7336 (set (match_dup 1) (match_dup 2))]
7338 operands[0] = GEN_INT (INTVAL (operands[0]) - 4);
7339 operands[1] = replace_equiv_address (operands[1], stack_pointer_rtx);
7342 ;; Speed up pushing a single byte/two bytes but leaving four bytes of space
7343 ;; (which differs slightly between m680x0 and ColdFire).
7346 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4)))
7347 (set (match_operand:QI 0 "memory_operand" "")
7348 (match_operand:QI 1 "register_operand" ""))]
7349 "!reg_mentioned_p (stack_pointer_rtx, operands[1])
7350 && GET_CODE (XEXP (operands[0], 0)) == PLUS
7351 && rtx_equal_p (XEXP (XEXP (operands[0], 0), 0), stack_pointer_rtx)
7352 && CONST_INT_P (XEXP (XEXP (operands[0], 0), 1))
7353 && INTVAL (XEXP (XEXP (operands[0], 0), 1)) == 3"
7354 [(set (match_dup 0) (match_dup 1))]
7356 rtx addr = gen_rtx_PRE_DEC (Pmode, stack_pointer_rtx);
7357 operands[0] = adjust_automodify_address (operands[0], SImode, addr, -3);
7358 operands[1] = simplify_gen_subreg (SImode, operands[1], QImode, 0);
7362 [(set (match_operand:QI 0 "push_operand" "")
7363 (match_operand:QI 1 "register_operand" ""))
7364 (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -3)))]
7365 "!reg_mentioned_p (stack_pointer_rtx, operands[1])"
7366 [(set (match_dup 0) (match_dup 1))]
7368 operands[0] = adjust_automodify_address (operands[0], SImode,
7369 XEXP (operands[0], 0), -3);
7370 operands[1] = simplify_gen_subreg (SImode, operands[1], QImode, 0);
7374 [(set (match_operand:HI 0 "push_operand" "")
7375 (match_operand:HI 1 "register_operand" ""))
7376 (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2)))]
7377 "!reg_mentioned_p (stack_pointer_rtx, operands[1])"
7378 [(set (match_dup 0) (match_dup 1))]
7380 operands[0] = adjust_automodify_address (operands[0], SImode,
7381 XEXP (operands[0], 0), -2);
7382 operands[1] = simplify_gen_subreg (SImode, operands[1], HImode, 0);
7385 ;; Optimize a series of strict_low_part assignments
7388 [(set (match_operand:SI 0 "register_operand" "")
7390 (set (strict_low_part (match_operand:HI 1 "register_operand" ""))
7391 (match_operand:HI 2 "general_operand" ""))]
7392 "REGNO (operands[0]) == REGNO (operands[1])
7393 && strict_low_part_peephole_ok (HImode, insn, operands[0])"
7394 [(set (strict_low_part (match_dup 1)) (match_dup 2))]
7398 [(set (match_operand:SI 0 "register_operand" "")
7400 (set (strict_low_part (match_operand:QI 1 "register_operand" ""))
7401 (match_operand:QI 2 "general_operand" ""))]
7402 "REGNO (operands[0]) == REGNO (operands[1])
7403 && strict_low_part_peephole_ok (QImode, insn, operands[0])"
7404 [(set (strict_low_part (match_dup 1)) (match_dup 2))]
7412 ;; jCC label ; abnormal loop termination
7413 ;; dbra dN, loop ; normal loop termination
7421 ;; Which moves the jCC condition outside the inner loop for free.
7425 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7426 [(cc0) (const_int 0)])
7427 (label_ref (match_operand 2 "" ""))
7432 (ne (match_operand:HI 0 "register_operand" "")
7434 (label_ref (match_operand 1 "" ""))
7437 (plus:HI (match_dup 0)
7439 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7442 output_dbcc_and_branch (operands);
7447 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7448 [(cc0) (const_int 0)])
7449 (label_ref (match_operand 2 "" ""))
7454 (ne (match_operand:SI 0 "register_operand" "")
7456 (label_ref (match_operand 1 "" ""))
7459 (plus:SI (match_dup 0)
7461 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7464 output_dbcc_and_branch (operands);
7469 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7470 [(cc0) (const_int 0)])
7471 (label_ref (match_operand 2 "" ""))
7476 (ge (plus:HI (match_operand:HI 0 "register_operand" "")
7479 (label_ref (match_operand 1 "" ""))
7482 (plus:HI (match_dup 0)
7484 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7487 output_dbcc_and_branch (operands);
7492 [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
7493 [(cc0) (const_int 0)])
7494 (label_ref (match_operand 2 "" ""))
7499 (ge (plus:SI (match_operand:SI 0 "register_operand" "")
7502 (label_ref (match_operand 1 "" ""))
7505 (plus:SI (match_dup 0)
7507 "!TARGET_COLDFIRE && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
7510 output_dbcc_and_branch (operands);
7515 (define_insn "extendsfxf2"
7516 [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f")
7517 (float_extend:XF (match_operand:SF 1 "general_operand" "f,rmF")))]
7520 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
7522 if (REGNO (operands[0]) == REGNO (operands[1]))
7524 /* Extending float to double in an fp-reg is a no-op.
7525 NOTICE_UPDATE_CC has already assumed that the
7526 cc will be set. So cancel what it did. */
7527 cc_status = cc_prev_status;
7530 return "f%$move%.x %1,%0";
7532 if (FP_REG_P (operands[0]))
7534 if (FP_REG_P (operands[1]))
7535 return "f%$move%.x %1,%0";
7536 else if (ADDRESS_REG_P (operands[1]))
7537 return "move%.l %1,%-\;f%$move%.s %+,%0";
7538 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
7539 return output_move_const_single (operands);
7540 return "f%$move%.s %f1,%0";
7542 return "fmove%.x %f1,%0";
7546 (define_insn "extenddfxf2"
7547 [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f")
7549 (match_operand:DF 1 "general_operand" "f,rmE")))]
7552 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
7554 if (REGNO (operands[0]) == REGNO (operands[1]))
7556 /* Extending float to double in an fp-reg is a no-op.
7557 NOTICE_UPDATE_CC has already assumed that the
7558 cc will be set. So cancel what it did. */
7559 cc_status = cc_prev_status;
7562 return "fmove%.x %1,%0";
7564 if (FP_REG_P (operands[0]))
7566 if (REG_P (operands[1]))
7569 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
7570 output_asm_insn ("move%.l %1,%-", xoperands);
7571 output_asm_insn ("move%.l %1,%-", operands);
7572 return "f%&move%.d %+,%0";
7574 if (GET_CODE (operands[1]) == CONST_DOUBLE)
7575 return output_move_const_double (operands);
7576 return "f%&move%.d %f1,%0";
7578 return "fmove%.x %f1,%0";
7581 (define_insn "truncxfdf2"
7582 [(set (match_operand:DF 0 "nonimmediate_operand" "=m,!r")
7584 (match_operand:XF 1 "general_operand" "f,f")))]
7587 if (REG_P (operands[0]))
7589 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
7590 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
7591 return "move%.l %+,%0";
7593 return "fmove%.d %f1,%0";
7596 (define_insn "truncxfsf2"
7597 [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
7599 (match_operand:XF 1 "general_operand" "f")))]
7603 (define_insn "sin<mode>2"
7604 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
7606 [(match_operand:FP 1 "general_operand" "f<FP:dreg>m")] UNSPEC_SIN))]
7607 "TARGET_68881 && flag_unsafe_math_optimizations"
7609 if (FP_REG_P (operands[1]))
7610 return "fsin%.x %1,%0";
7612 return "fsin%.<FP:prec> %1,%0";
7615 (define_insn "cos<mode>2"
7616 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
7618 [(match_operand:FP 1 "general_operand" "f<FP:dreg>m")] UNSPEC_COS))]
7619 "TARGET_68881 && flag_unsafe_math_optimizations"
7621 if (FP_REG_P (operands[1]))
7622 return "fcos%.x %1,%0";
7624 return "fcos%.<FP:prec> %1,%0";
7627 ;; Unconditional traps are assumed to have (const_int 1) for the condition.
7629 [(trap_if (const_int 1) (const_int 7))]
7632 [(set_attr "type" "trap")])
7634 (define_expand "conditional_trap"
7635 [(trap_if (match_operator 0 "valid_dbcc_comparison_p"
7636 [(cc0) (const_int 0)])
7637 (match_operand:SI 1 "const_int_operand" "I"))]
7640 if (m68k_last_compare_had_fp_operands)
7642 m68k_last_compare_had_fp_operands = 0;
7647 (define_insn "*conditional_trap"
7648 [(trap_if (match_operator 0 "valid_dbcc_comparison_p"
7649 [(cc0) (const_int 0)])
7650 (match_operand:SI 1 "const_int_operand" "I"))]
7651 "TARGET_68020 && ! flags_in_68881 ()"
7653 switch (GET_CODE (operands[0]))
7655 case EQ: return "trapeq";
7656 case NE: return "trapne";
7657 case GT: return "trapgt";
7658 case GTU: return "traphi";
7659 case LT: return "traplt";
7660 case LTU: return "trapcs";
7661 case GE: return "trapge";
7662 case GEU: return "trapcc";
7663 case LE: return "traple";
7664 case LEU: return "trapls";
7665 default: gcc_unreachable ();
7669 ;; These are to prevent the scheduler from moving stores to the frame
7670 ;; before the stack adjustment.
7671 (define_insn "stack_tie"
7672 [(set (mem:BLK (scratch))
7673 (unspec:BLK [(match_operand:SI 0 "register_operand" "r")
7674 (match_operand:SI 1 "register_operand" "r")]
7678 [(set_attr "type" "ignore")])
7680 ;; Instruction that subscribes one word in ColdFire instruction buffer.
7681 ;; This instruction is used within scheduler only and should not appear
7682 ;; in the instruction stream.
7684 [(unspec [(const_int 0)] UNSPEC_IB)]
7687 [(set_attr "type" "ib")])