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
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 2, 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 COPYING. If not, write to
20 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 ;; Boston, MA 02110-1301, USA.
23 ;;- Information about MCF5200 port.
25 ;;- The MCF5200 "ColdFire" architecture is a reduced version of the
26 ;;- 68k ISA. Differences include reduced support for byte and word
27 ;;- operands and the removal of BCD, bitfield, rotate, and integer
28 ;;- divide instructions. The TARGET_COLDFIRE flag turns the use of the
29 ;;- removed opcodes and addressing modes off.
33 ;;- instruction definitions
35 ;;- @@The original PO technology requires these to be ordered by speed,
36 ;;- @@ so that assigner will pick the fastest.
38 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
40 ;;- When naming insn's (operand 0 of define_insn) be careful about using
41 ;;- names from other targets machine descriptions.
43 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
44 ;;- updates for most instructions.
46 ;;- Operand classes for the register allocator:
47 ;;- 'a' one of the address registers can be used.
48 ;;- 'd' one of the data registers can be used.
49 ;;- 'f' one of the m68881/fpu registers can be used
50 ;;- 'r' either a data or an address register can be used.
52 ;;- Immediate Floating point operator constraints
53 ;;- 'G' a floating point constant that is *NOT* one of the standard
54 ;; 68881 constant values (to force calling output_move_const_double
55 ;; to get it from rom if it is a 68881 constant).
57 ;; See the functions standard_XXX_constant_p in output-m68k.c for more
60 ;;- Immediate integer operand constraints:
62 ;;- 'J' -32768 .. 32767
63 ;;- 'K' all integers EXCEPT -128 .. 127
65 ;;- 'M' all integers EXCEPT -256 .. 255
71 ;;- "%." size separator ("." or "") move%.l d0,d1
72 ;;- "%-" push operand "sp@-" move%.l d0,%-
73 ;;- "%+" pop operand "sp@+" move%.l d0,%+
74 ;;- "%@" top of stack "sp@" move%.l d0,%@
75 ;;- "%!" fpcr register
76 ;;- "%$" single-precision fp specifier ("s" or "") f%$add.x fp0,fp1
77 ;;- "%&" double-precision fp specifier ("d" or "") f%&add.x fp0,fp1
79 ;;- Information about 68040 port.
81 ;;- The 68040 executes all 68030 and 68881/2 instructions, but some must
82 ;;- be emulated in software by the OS. It is faster to avoid these
83 ;;- instructions and issue a library call rather than trapping into
84 ;;- the kernel. The affected instructions are fintrz and fscale. The
85 ;;- TUNE_68040 flag turns the use of the opcodes off.
87 ;;- The '040 also implements a set of new floating-point instructions
88 ;;- which specify the rounding precision in the opcode. This finally
89 ;;- permit the 68k series to be truly IEEE compliant, and solves all
90 ;;- issues of excess precision accumulating in the extended registers.
91 ;;- By default, GCC does not use these instructions, since such code will
92 ;;- not run on an '030. To use these instructions, use the -m68040-only
93 ;;- switch. By changing TARGET_DEFAULT to include TARGET_68040_ONLY,
94 ;;- you can make these instructions the default.
96 ;;- These new instructions aren't directly in the md. They are brought
97 ;;- into play by defining "%$" and "%&" to expand to "s" and "d" rather
100 ;;- Information about 68060 port.
102 ;;- The 68060 executes all 68030 and 68881/2 instructions, but some must
103 ;;- be emulated in software by the OS. It is faster to avoid these
104 ;;- instructions and issue a library call rather than trapping into
105 ;;- the kernel. The affected instructions are: divs.l <ea>,Dr:Dq;
106 ;;- divu.l <ea>,Dr:Dq; muls.l <ea>,Dr:Dq; mulu.l <ea>,Dr:Dq; and
107 ;;- fscale. The TUNE_68060 flag turns the use of the opcodes off.
109 ;;- Some of these insn's are composites of several m68000 op codes.
110 ;;- The assembler (or final @@??) insures that the appropriate one is
120 ;; UNSPEC_VOLATILE usage:
123 [(UNSPECV_BLOCKAGE 0)
126 ;; Registers by name.
132 (include "predicates.md")
134 ;; Mode macros for floating point operations.
135 ;; Valid floating point modes
136 (define_mode_macro FP [SF DF (XF "TARGET_68881")])
137 ;; Mnemonic infix to round result
138 (define_mode_attr round [(SF "%$") (DF "%&") (XF "")])
139 ;; Mnemonic infix to round result for mul or div instruction
140 (define_mode_attr round_mul [(SF "sgl") (DF "%&") (XF "")])
141 ;; Suffix specifying source operand format
142 (define_mode_attr prec [(SF "s") (DF "d") (XF "x")])
143 ;; Allowable D registers
144 (define_mode_attr dreg [(SF "d") (DF "") (XF "")])
145 ;; Allowable 68881 constant constraints
146 (define_mode_attr const [(SF "F") (DF "G") (XF "")])
149 [(set (match_operand:DF 0 "push_operand" "=m")
150 (match_operand:DF 1 "general_operand" "ro<>fyE"))]
153 if (FP_REG_P (operands[1]))
154 return "fmove%.d %f1,%0";
155 return output_move_double (operands);
158 (define_insn "pushdi"
159 [(set (match_operand:DI 0 "push_operand" "=m")
160 (match_operand:DI 1 "general_operand" "ro<>Fyi"))]
163 return output_move_double (operands);
166 ;; We don't want to allow a constant operand for test insns because
167 ;; (set (cc0) (const_int foo)) has no mode information. Such insns will
168 ;; be folded while optimizing anyway.
170 (define_expand "tstdi"
171 [(parallel [(set (cc0)
172 (match_operand:DI 0 "nonimmediate_operand" ""))
173 (clobber (match_scratch:SI 1 ""))
174 (clobber (match_scratch:DI 2 ""))])]
176 "m68k_last_compare_had_fp_operands = 0;")
180 (match_operand:DI 0 "nonimmediate_operand" "am,d"))
181 (clobber (match_scratch:SI 1 "=X,d"))
182 (clobber (match_scratch:DI 2 "=d,X"))]
185 if (which_alternative == 0)
189 xoperands[0] = operands[2];
190 xoperands[1] = operands[0];
191 output_move_double (xoperands);
192 cc_status.flags |= CC_REVERSED;
193 return "neg%.l %R2\;negx%.l %2";
195 if (find_reg_note (insn, REG_DEAD, operands[0]))
197 cc_status.flags |= CC_REVERSED;
198 return "neg%.l %R0\;negx%.l %0";
202 'sub' clears %1, and also clears the X cc bit
203 'tst' sets the Z cc bit according to the low part of the DImode operand
204 'subx %1' (i.e. subx #0) acts as a (non-existent) tstx on the high part.
206 return "sub%.l %1,%1\;tst%.l %R0\;subx%.l %1,%0";
209 (define_expand "tstsi"
211 (match_operand:SI 0 "nonimmediate_operand" ""))]
213 "m68k_last_compare_had_fp_operands = 0;")
217 (match_operand:SI 0 "nonimmediate_operand" "rm"))]
220 if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
222 /* If you think that the 68020 does not support tstl a0,
223 reread page B-167 of the 68020 manual more carefully. */
224 /* On an address reg, cmpw may replace cmpl. */
225 return "cmp%.w #0,%0";
228 ;; This can't use an address register, because comparisons
229 ;; with address registers as second operand always test the whole word.
230 (define_expand "tsthi"
232 (match_operand:HI 0 "nonimmediate_operand" ""))]
234 "m68k_last_compare_had_fp_operands = 0;")
238 (match_operand:HI 0 "nonimmediate_operand" "dm"))]
242 (define_expand "tstqi"
244 (match_operand:QI 0 "nonimmediate_operand" ""))]
246 "m68k_last_compare_had_fp_operands = 0;")
250 (match_operand:QI 0 "nonimmediate_operand" "dm"))]
254 (define_expand "tst<mode>"
256 (match_operand:FP 0 "general_operand" ""))]
259 m68k_last_compare_had_fp_operands = 1;
262 (define_insn "tst<mode>_68881"
264 (match_operand:FP 0 "general_operand" "f<FP:dreg>m"))]
267 cc_status.flags = CC_IN_68881;
268 if (FP_REG_P (operands[0]))
270 return "ftst%.<FP:prec> %0";
273 (define_insn "tst<mode>_cf"
275 (match_operand:FP 0 "general_operand" "f<FP:dreg><Q>U"))]
276 "TARGET_COLDFIRE_FPU"
278 cc_status.flags = CC_IN_68881;
279 if (FP_REG_P (operands[0]))
281 return "ftst%.<FP:prec> %0";
285 ;; compare instructions.
287 (define_expand "cmpdi"
290 (compare (match_operand:DI 0 "nonimmediate_operand" "")
291 (match_operand:DI 1 "general_operand" "")))
292 (clobber (match_dup 2))])]
294 "m68k_last_compare_had_fp_operands = 0; operands[2] = gen_reg_rtx (DImode);")
298 (compare (match_operand:DI 1 "nonimmediate_operand" "0,d")
299 (match_operand:DI 2 "general_operand" "d,0")))
300 (clobber (match_operand:DI 0 "register_operand" "=d,d"))]
303 if (rtx_equal_p (operands[0], operands[1]))
304 return "sub%.l %R2,%R0\;subx%.l %2,%0";
307 cc_status.flags |= CC_REVERSED;
308 return "sub%.l %R1,%R0\;subx%.l %1,%0";
312 ;; This is the second "hook" for PIC code (in addition to movsi). See
313 ;; comment of movsi for a description of PIC handling.
314 (define_expand "cmpsi"
316 (compare (match_operand:SI 0 "nonimmediate_operand" "")
317 (match_operand:SI 1 "general_operand" "")))]
320 m68k_last_compare_had_fp_operands = 0;
321 if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode))
323 /* The source is an address which requires PIC relocation.
324 Call legitimize_pic_address with the source, mode, and a relocation
325 register (a new pseudo, or the final destination if reload_in_progress
326 is set). Then fall through normally */
327 rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
328 operands[1] = legitimize_pic_address (operands[1], SImode, temp);
332 ;; A composite of the cmp, cmpa, cmpi & cmpm m68000 op codes.
335 (compare (match_operand:SI 0 "nonimmediate_operand" "rKT,rKs,mSr,mSa,>")
336 (match_operand:SI 1 "general_src_operand" "mSr,mSa,KTr,Ksr,>")))]
339 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
340 return "cmpm%.l %1,%0";
341 if (REG_P (operands[1])
342 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
344 cc_status.flags |= CC_REVERSED;
345 return "cmp%.l %d0,%d1";
347 if (ADDRESS_REG_P (operands[0])
348 && GET_CODE (operands[1]) == CONST_INT
349 && INTVAL (operands[1]) < 0x8000
350 && INTVAL (operands[1]) >= -0x8000)
351 return "cmp%.w %1,%0";
352 return "cmp%.l %d1,%d0";
357 (compare (match_operand:SI 0 "nonimmediate_operand" "mrKs,r")
358 (match_operand:SI 1 "general_operand" "r,mrKs")))]
361 if (REG_P (operands[1])
362 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
364 cc_status.flags |= CC_REVERSED;
365 return "cmp%.l %d0,%d1";
367 return "cmp%.l %d1,%d0";
370 (define_expand "cmphi"
372 (compare (match_operand:HI 0 "nonimmediate_src_operand" "")
373 (match_operand:HI 1 "general_src_operand" "")))]
375 "m68k_last_compare_had_fp_operands = 0;")
379 (compare (match_operand:HI 0 "nonimmediate_src_operand" "rnmS,d,n,mS,>")
380 (match_operand:HI 1 "general_src_operand" "d,rnmS,mS,n,>")))]
383 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
384 return "cmpm%.w %1,%0";
385 if ((REG_P (operands[1]) && !ADDRESS_REG_P (operands[1]))
386 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
388 cc_status.flags |= CC_REVERSED;
389 return "cmp%.w %d0,%d1";
391 return "cmp%.w %d1,%d0";
394 (define_expand "cmpqi"
396 (compare (match_operand:QI 0 "nonimmediate_src_operand" "")
397 (match_operand:QI 1 "general_src_operand" "")))]
399 "m68k_last_compare_had_fp_operands = 0;")
403 (compare (match_operand:QI 0 "nonimmediate_src_operand" "dn,dmS,>")
404 (match_operand:QI 1 "general_src_operand" "dmS,nd,>")))]
407 if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
408 return "cmpm%.b %1,%0";
409 if (REG_P (operands[1])
410 || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM))
412 cc_status.flags |= CC_REVERSED;
413 return "cmp%.b %d0,%d1";
415 return "cmp%.b %d1,%d0";
418 (define_expand "cmp<mode>"
420 (compare (match_operand:FP 0 "general_operand" "")
421 (match_operand:FP 1 "general_operand" "")))]
424 m68k_last_compare_had_fp_operands = 1;
425 if (TARGET_COLDFIRE && !reload_completed)
426 operands[1] = force_reg (<MODE>mode, operands[1]);
429 (define_insn "cmp<mode>_68881"
431 (compare (match_operand:FP 0 "general_operand" "f,m<FP:const>")
432 (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,f")))]
435 cc_status.flags = CC_IN_68881;
436 if (FP_REG_P (operands[0]))
438 if (FP_REG_P (operands[1]))
439 return "fcmp%.x %1,%0";
441 return "fcmp%.<FP:prec> %f1,%0";
443 cc_status.flags |= CC_REVERSED;
444 return "fcmp%.<FP:prec> %f0,%1";
447 (define_insn "cmp<mode>_cf"
449 (compare (match_operand:FP 0 "general_operand" "f,<FP:dreg><Q>U")
450 (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,f")))]
451 "TARGET_COLDFIRE_FPU"
453 cc_status.flags = CC_IN_68881;
454 if (FP_REG_P (operands[0]))
456 if (FP_REG_P (operands[1]))
457 return "fcmp%.d %1,%0";
459 return "fcmp%.<FP:prec> %f1,%0";
461 cc_status.flags |= CC_REVERSED;
462 return "fcmp%.<FP:prec> %f0,%1";
465 ;; Recognizers for btst instructions.
467 ;; ColdFire/5200 only allows "<Q>" type addresses when the bit position is
468 ;; specified as a constant, so we must disable all patterns that may extract
469 ;; from a MEM at a constant bit position if we can't use this as a constraint.
472 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_src_operand" "oS")
474 (minus:SI (const_int 7)
475 (match_operand:SI 1 "general_operand" "di"))))]
478 return output_btst (operands, operands[1], operands[0], insn, 7);
481 ;; This is the same as the above pattern except for the constraints. The 'i'
485 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o")
487 (minus:SI (const_int 7)
488 (match_operand:SI 1 "general_operand" "d"))))]
491 return output_btst (operands, operands[1], operands[0], insn, 7);
495 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d")
497 (minus:SI (const_int 31)
498 (match_operand:SI 1 "general_operand" "di"))))]
501 return output_btst (operands, operands[1], operands[0], insn, 31);
504 ;; The following two patterns are like the previous two
505 ;; except that they use the fact that bit-number operands
506 ;; are automatically masked to 3 or 5 bits.
509 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o")
511 (minus:SI (const_int 7)
513 (match_operand:SI 1 "register_operand" "d")
517 return output_btst (operands, operands[1], operands[0], insn, 7);
521 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d")
523 (minus:SI (const_int 31)
525 (match_operand:SI 1 "register_operand" "d")
529 return output_btst (operands, operands[1], operands[0], insn, 31);
532 ;; Nonoffsettable mem refs are ok in this one pattern
533 ;; since we don't try to adjust them.
535 [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "m")
537 (match_operand:SI 1 "const_int_operand" "n")))]
538 "(unsigned) INTVAL (operands[1]) < 8 && !TARGET_COLDFIRE"
540 operands[1] = GEN_INT (7 - INTVAL (operands[1]));
541 return output_btst (operands, operands[1], operands[0], insn, 7);
545 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "do")
547 (match_operand:SI 1 "const_int_operand" "n")))]
550 if (GET_CODE (operands[0]) == MEM)
552 operands[0] = adjust_address (operands[0], QImode,
553 INTVAL (operands[1]) / 8);
554 operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
555 return output_btst (operands, operands[1], operands[0], insn, 7);
557 operands[1] = GEN_INT (31 - INTVAL (operands[1]));
558 return output_btst (operands, operands[1], operands[0], insn, 31);
561 ;; This is the same as the above pattern except for the constraints.
562 ;; The 'o' has been replaced with 'Q'.
565 [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "dQ")
567 (match_operand:SI 1 "const_int_operand" "n")))]
570 if (GET_CODE (operands[0]) == MEM)
572 operands[0] = adjust_address (operands[0], QImode,
573 INTVAL (operands[1]) / 8);
574 operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8);
575 return output_btst (operands, operands[1], operands[0], insn, 7);
577 operands[1] = GEN_INT (31 - INTVAL (operands[1]));
578 return output_btst (operands, operands[1], operands[0], insn, 31);
584 ;; A special case in which it is not desirable
585 ;; to reload the constant into a data register.
586 (define_insn "pushexthisi_const"
587 [(set (match_operand:SI 0 "push_operand" "=m")
588 (match_operand:SI 1 "const_int_operand" "J"))]
589 "INTVAL (operands[1]) >= -0x8000 && INTVAL (operands[1]) < 0x8000"
591 if (operands[1] == const0_rtx)
593 if (valid_mov3q_const(operands[1]))
594 return "mov3q%.l %1,%-";
599 ;(define_insn "swapsi"
600 ; [(set (match_operand:SI 0 "nonimmediate_operand" "+r")
601 ; (match_operand:SI 1 "general_operand" "+r"))
602 ; (set (match_dup 1) (match_dup 0))]
606 ;; Special case of fullword move when source is zero.
607 ;; The reason this is special is to avoid loading a zero
608 ;; into a data reg with moveq in order to store it elsewhere.
610 (define_insn "movsi_const0"
611 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
613 ;; clr insns on 68000 read before writing.
614 ;; This isn't so on the 68010, but we have no TARGET_68010.
615 "((TARGET_68020 || TARGET_COLDFIRE)
616 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))"
618 if (ADDRESS_REG_P (operands[0]))
620 /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */
622 return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0";
624 return "sub%.l %0,%0";
626 /* moveq is faster on the 68000. */
627 if (DATA_REG_P (operands[0]) && TUNE_68000_10)
628 return "moveq #0,%0";
632 ;; General case of fullword move.
634 ;; This is the main "hook" for PIC code. When generating
635 ;; PIC, movsi is responsible for determining when the source address
636 ;; needs PIC relocation and appropriately calling legitimize_pic_address
637 ;; to perform the actual relocation.
639 ;; In both the PIC and non-PIC cases the patterns generated will
640 ;; matched by the next define_insn.
641 (define_expand "movsi"
642 [(set (match_operand:SI 0 "nonimmediate_operand" "")
643 (match_operand:SI 1 "general_operand" ""))]
646 if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode))
648 /* The source is an address which requires PIC relocation.
649 Call legitimize_pic_address with the source, mode, and a relocation
650 register (a new pseudo, or the final destination if reload_in_progress
651 is set). Then fall through normally */
652 rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
653 operands[1] = legitimize_pic_address (operands[1], SImode, temp);
655 else if (flag_pic && TARGET_PCREL && ! reload_in_progress)
657 /* Don't allow writes to memory except via a register;
658 the m68k doesn't consider PC-relative addresses to be writable. */
659 if (symbolic_operand (operands[0], SImode))
660 operands[0] = force_reg (SImode, XEXP (operands[0], 0));
661 else if (GET_CODE (operands[0]) == MEM
662 && symbolic_operand (XEXP (operands[0], 0), SImode))
663 operands[0] = gen_rtx_MEM (SImode,
664 force_reg (SImode, XEXP (operands[0], 0)));
668 ;; General case of fullword move. The register constraints
669 ;; force integer constants in range for a moveq to be reloaded
670 ;; if they are headed for memory.
672 ;; Notes: make sure no alternative allows g vs g.
673 ;; We don't allow f-regs since fixed point cannot go in them.
674 [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<")
675 (match_operand:SI 1 "general_src_operand" "daymSKT,n,i"))]
679 return output_move_simode (operands);
682 (define_insn "*movsi_cf"
683 [(set (match_operand:SI 0 "nonimmediate_operand" "=r<Q>,g,U")
684 (match_operand:SI 1 "general_operand" "g,r<Q>,U"))]
685 "TARGET_COLDFIRE && !TARGET_ISAB"
686 "* return output_move_simode (operands);")
688 (define_insn "*movsi_cfv4"
689 [(set (match_operand:SI 0 "nonimmediate_operand" "=r<Q>,g,U")
690 (match_operand:SI 1 "general_operand" "Rg,Rr<Q>,U"))]
692 "* return output_move_simode (operands);")
694 ;; Special case of fullword move, where we need to get a non-GOT PIC
695 ;; reference into an address register.
697 [(set (match_operand:SI 0 "nonimmediate_operand" "=a<")
698 (match_operand:SI 1 "pcrel_address" ""))]
701 if (push_operand (operands[0], SImode))
706 (define_expand "movhi"
707 [(set (match_operand:HI 0 "nonimmediate_operand" "")
708 (match_operand:HI 1 "general_operand" ""))]
713 [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
714 (match_operand:HI 1 "general_src_operand" "gS"))]
716 "* return output_move_himode (operands);")
719 [(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g,U")
720 (match_operand:HI 1 "general_operand" "g,r<Q>,U"))]
722 "* return output_move_himode (operands);")
724 (define_expand "movstricthi"
725 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" ""))
726 (match_operand:HI 1 "general_src_operand" ""))]
731 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
732 (match_operand:HI 1 "general_src_operand" "rmSn"))]
734 "* return output_move_stricthi (operands);")
737 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+d,m"))
738 (match_operand:HI 1 "general_src_operand" "rmn,r"))]
740 "* return output_move_stricthi (operands);")
742 (define_expand "movqi"
743 [(set (match_operand:QI 0 "nonimmediate_operand" "")
744 (match_operand:QI 1 "general_src_operand" ""))]
749 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
750 (match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
752 "* return output_move_qimode (operands);")
755 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>,dm,U,d*a")
756 (match_operand:QI 1 "general_src_operand" "dmi,d<Q>,U,di*a"))]
758 "* return output_move_qimode (operands);")
760 (define_expand "movstrictqi"
761 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
762 (match_operand:QI 1 "general_src_operand" ""))]
767 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
768 (match_operand:QI 1 "general_src_operand" "dmSn"))]
770 "* return output_move_strictqi (operands);")
773 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m"))
774 (match_operand:QI 1 "general_src_operand" "dmn,d"))]
776 "* return output_move_strictqi (operands);")
778 (define_expand "pushqi1"
779 [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2)))
780 (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int 1)))
781 (match_operand:QI 0 "general_operand" ""))]
785 (define_expand "reload_insf"
786 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
787 (match_operand:SF 1 "general_operand" "mf"))
788 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
789 "TARGET_COLDFIRE_FPU"
791 if (emit_move_sequence (operands, SFmode, operands[2]))
794 /* We don't want the clobber emitted, so handle this ourselves. */
795 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
799 (define_expand "reload_outsf"
800 [(set (match_operand:SF 0 "general_operand" "")
801 (match_operand:SF 1 "register_operand" "f"))
802 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
803 "TARGET_COLDFIRE_FPU"
805 if (emit_move_sequence (operands, SFmode, operands[2]))
808 /* We don't want the clobber emitted, so handle this ourselves. */
809 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
813 (define_expand "movsf"
814 [(set (match_operand:SF 0 "nonimmediate_operand" "")
815 (match_operand:SF 1 "general_operand" ""))]
820 [(set (match_operand:SF 0 "nonimmediate_operand" "=rmf")
821 (match_operand:SF 1 "general_operand" "rmfF"))]
824 if (FP_REG_P (operands[0]))
826 if (FP_REG_P (operands[1]))
827 return "f%$move%.x %1,%0";
828 else if (ADDRESS_REG_P (operands[1]))
829 return "move%.l %1,%-\;f%$move%.s %+,%0";
830 else if (GET_CODE (operands[1]) == CONST_DOUBLE)
831 return output_move_const_single (operands);
832 return "f%$move%.s %f1,%0";
834 if (FP_REG_P (operands[1]))
836 if (ADDRESS_REG_P (operands[0]))
837 return "fmove%.s %1,%-\;move%.l %+,%0";
838 return "fmove%.s %f1,%0";
840 if (operands[1] == CONST0_RTX (SFmode)
841 /* clr insns on 68000 read before writing.
842 This isn't so on the 68010, but we have no TARGET_68010. */
843 && ((TARGET_68020 || TARGET_COLDFIRE)
844 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0]))))
846 if (ADDRESS_REG_P (operands[0]))
848 /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */
850 return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0";
852 return "sub%.l %0,%0";
854 /* moveq is faster on the 68000. */
855 if (DATA_REG_P (operands[0]) && TUNE_68000_10)
856 return "moveq #0,%0";
859 return "move%.l %1,%0";
862 (define_insn "movsf_cf_soft"
863 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,g")
864 (match_operand:SF 1 "general_operand" "g,r"))]
865 "TARGET_COLDFIRE && !TARGET_COLDFIRE_FPU"
867 return "move%.l %1,%0";
870 (define_insn "movsf_cf_hard"
871 [(set (match_operand:SF 0 "nonimmediate_operand" "=r<Q>U, f, f,mr,f,r<Q>,f
873 (match_operand:SF 1 "general_operand" " f, r<Q>U,f,rm,F,F, m
875 "TARGET_COLDFIRE_FPU"
877 if (which_alternative == 4 || which_alternative == 5) {
881 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
882 REAL_VALUE_TO_TARGET_SINGLE (r, l);
883 xoperands[0] = operands[0];
884 xoperands[1] = GEN_INT (l);
885 if (which_alternative == 5) {
887 if (ADDRESS_REG_P (xoperands[0]))
888 output_asm_insn ("sub%.l %0,%0", xoperands);
890 output_asm_insn ("clr%.l %0", xoperands);
892 if (GET_CODE (operands[0]) == MEM
893 && symbolic_operand (XEXP (operands[0], 0), SImode))
894 output_asm_insn ("move%.l %1,%-;move%.l %+,%0", xoperands);
896 output_asm_insn ("move%.l %1,%0", xoperands);
900 output_asm_insn ("move%.l %1,%-;fsmove%.s %+,%0", xoperands);
902 output_asm_insn ("clr%.l %-;fsmove%.s %+,%0", xoperands);
905 if (FP_REG_P (operands[0]))
907 if (ADDRESS_REG_P (operands[1]))
908 return "move%.l %1,%-;f%$smove%.s %+,%0";
909 if (FP_REG_P (operands[1]))
910 return "f%$move%.d %1,%0";
911 if (GET_CODE (operands[1]) == CONST_DOUBLE)
912 return output_move_const_single (operands);
913 return "f%$move%.s %f1,%0";
915 if (FP_REG_P (operands[1]))
917 if (ADDRESS_REG_P (operands[0]))
918 return "fmove%.s %1,%-;move%.l %+,%0";
919 return "fmove%.s %f1,%0";
921 if (operands[1] == CONST0_RTX (SFmode))
923 if (ADDRESS_REG_P (operands[0]))
924 return "sub%.l %0,%0";
927 return "move%.l %1,%0";
930 (define_expand "reload_indf"
931 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
932 (match_operand:DF 1 "general_operand" "mf"))
933 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
934 "TARGET_COLDFIRE_FPU"
936 if (emit_move_sequence (operands, DFmode, operands[2]))
939 /* We don't want the clobber emitted, so handle this ourselves. */
940 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
944 (define_expand "reload_outdf"
945 [(set (match_operand:DF 0 "general_operand" "")
946 (match_operand:DF 1 "register_operand" "f"))
947 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
948 "TARGET_COLDFIRE_FPU"
950 if (emit_move_sequence (operands, DFmode, operands[2]))
953 /* We don't want the clobber emitted, so handle this ourselves. */
954 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
958 (define_expand "movdf"
959 [(set (match_operand:DF 0 "nonimmediate_operand" "")
960 (match_operand:DF 1 "general_operand" ""))]
963 if (TARGET_COLDFIRE_FPU)
964 if (emit_move_sequence (operands, DFmode, 0))
969 [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,rf,rf,&rof<>")
970 (match_operand:DF 1 "general_operand" "*rf,m,0,*rofE<>"))]
971 ; [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
972 ; (match_operand:DF 1 "general_operand" "rf,m,rofF<>"))]
975 if (FP_REG_P (operands[0]))
977 if (FP_REG_P (operands[1]))
978 return "f%&move%.x %1,%0";
979 if (REG_P (operands[1]))
982 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
983 output_asm_insn ("move%.l %1,%-", xoperands);
984 output_asm_insn ("move%.l %1,%-", operands);
985 return "f%&move%.d %+,%0";
987 if (GET_CODE (operands[1]) == CONST_DOUBLE)
988 return output_move_const_double (operands);
989 return "f%&move%.d %f1,%0";
991 else if (FP_REG_P (operands[1]))
993 if (REG_P (operands[0]))
995 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
996 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
997 return "move%.l %+,%0";
1000 return "fmove%.d %f1,%0";
1002 return output_move_double (operands);
1005 (define_insn "movdf_cf_soft"
1006 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,g")
1007 (match_operand:DF 1 "general_operand" "g,r"))]
1008 "TARGET_COLDFIRE && !TARGET_COLDFIRE_FPU"
1010 return output_move_double (operands);
1013 (define_insn "movdf_cf_hard"
1014 [(set (match_operand:DF 0 "nonimmediate_operand" "=f, <Q>U,r,f,r,r,m,f")
1015 (match_operand:DF 1 "general_operand" " f<Q>U,f, f,r,r,m,r,E"))]
1016 "TARGET_COLDFIRE_FPU"
1022 switch (which_alternative)
1025 return "fmove%.d %1,%0";
1027 return "fmove%.d %1,%-;move%.l %+,%0;move%.l %+,%R0";
1029 return "move%.l %R1,%-;move%.l %1,%-;f%&move%.d %+,%0";
1031 return "move%.l %1,%0;move%.l %R1,%R0";
1033 return output_move_double (operands);
1035 REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
1036 REAL_VALUE_TO_TARGET_DOUBLE (r, l);
1037 xoperands[0] = operands[0];
1038 xoperands[1] = GEN_INT (l[0]);
1039 xoperands[2] = GEN_INT (l[1]);
1040 if (operands[1] == CONST0_RTX (DFmode))
1041 output_asm_insn ("clr%.l %-;clr%.l %-;fdmove%.d %+,%0",
1045 output_asm_insn ("clr%.l %-;move%.l %1,%-;fdmove%.d %+,%0",
1048 output_asm_insn ("move%.l %2,%-;move%.l %1,%-;fdmove%.d %+,%0",
1054 ;; ??? The XFmode patterns are schizophrenic about whether constants are
1055 ;; allowed. Most but not all have predicates and constraint that disallow
1056 ;; constants. Most but not all have output templates that handle constants.
1057 ;; See also LEGITIMATE_CONSTANT_P.
1059 (define_expand "movxf"
1060 [(set (match_operand:XF 0 "nonimmediate_operand" "")
1061 (match_operand:XF 1 "general_operand" ""))]
1064 /* We can't rewrite operands during reload. */
1065 if (! reload_in_progress)
1067 if (CONSTANT_P (operands[1]))
1069 operands[1] = force_const_mem (XFmode, operands[1]);
1070 if (! memory_address_p (XFmode, XEXP (operands[1], 0)))
1071 operands[1] = adjust_address (operands[1], XFmode, 0);
1073 if (flag_pic && TARGET_PCREL)
1075 /* Don't allow writes to memory except via a register; the
1076 m68k doesn't consider PC-relative addresses to be writable. */
1077 if (GET_CODE (operands[0]) == MEM
1078 && symbolic_operand (XEXP (operands[0], 0), SImode))
1079 operands[0] = gen_rtx_MEM (XFmode,
1080 force_reg (SImode, XEXP (operands[0], 0)));
1086 [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,!r,!f,!r,m,!r")
1087 (match_operand:XF 1 "nonimmediate_operand" "m,f,f,f,r,!r,!r,m"))]
1090 if (FP_REG_P (operands[0]))
1092 if (FP_REG_P (operands[1]))
1093 return "fmove%.x %1,%0";
1094 if (REG_P (operands[1]))
1097 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
1098 output_asm_insn ("move%.l %1,%-", xoperands);
1099 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1100 output_asm_insn ("move%.l %1,%-", xoperands);
1101 output_asm_insn ("move%.l %1,%-", operands);
1102 return "fmove%.x %+,%0";
1104 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1105 return "fmove%.x %1,%0";
1106 return "fmove%.x %f1,%0";
1108 if (FP_REG_P (operands[1]))
1110 if (REG_P (operands[0]))
1112 output_asm_insn ("fmove%.x %f1,%-\;move%.l %+,%0", operands);
1113 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1114 output_asm_insn ("move%.l %+,%0", operands);
1115 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1116 return "move%.l %+,%0";
1118 /* Must be memory destination. */
1119 return "fmove%.x %f1,%0";
1121 return output_move_double (operands);
1125 [(set (match_operand:XF 0 "nonimmediate_operand" "=rm,rf,&rof<>")
1126 (match_operand:XF 1 "nonimmediate_operand" "rf,m,rof<>"))]
1127 "! TARGET_68881 && ! TARGET_COLDFIRE"
1129 if (FP_REG_P (operands[0]))
1131 if (FP_REG_P (operands[1]))
1132 return "fmove%.x %1,%0";
1133 if (REG_P (operands[1]))
1136 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
1137 output_asm_insn ("move%.l %1,%-", xoperands);
1138 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1139 output_asm_insn ("move%.l %1,%-", xoperands);
1140 output_asm_insn ("move%.l %1,%-", operands);
1141 return "fmove%.x %+,%0";
1143 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1144 return "fmove%.x %1,%0";
1145 return "fmove%.x %f1,%0";
1147 if (FP_REG_P (operands[1]))
1149 if (REG_P (operands[0]))
1151 output_asm_insn ("fmove%.x %f1,%-\;move%.l %+,%0", operands);
1152 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1153 output_asm_insn ("move%.l %+,%0", operands);
1154 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1155 return "move%.l %+,%0";
1158 return "fmove%.x %f1,%0";
1160 return output_move_double (operands);
1164 [(set (match_operand:XF 0 "nonimmediate_operand" "=r,g")
1165 (match_operand:XF 1 "nonimmediate_operand" "g,r"))]
1166 "! TARGET_68881 && TARGET_COLDFIRE"
1167 "* return output_move_double (operands);")
1169 (define_expand "movdi"
1170 ;; Let's see if it really still needs to handle fp regs, and, if so, why.
1171 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1172 (match_operand:DI 1 "general_operand" ""))]
1176 ;; movdi can apply to fp regs in some cases
1178 ;; Let's see if it really still needs to handle fp regs, and, if so, why.
1179 [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r,&ro<>")
1180 (match_operand:DI 1 "general_operand" "rF,m,roi<>F"))]
1181 ; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&r,&ro<>,!&rm,!&f")
1182 ; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF"))]
1183 ; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&rf,&ro<>,!&rm,!&f")
1184 ; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF,rfF"))]
1187 if (FP_REG_P (operands[0]))
1189 if (FP_REG_P (operands[1]))
1190 return "fmove%.x %1,%0";
1191 if (REG_P (operands[1]))
1194 xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1195 output_asm_insn ("move%.l %1,%-", xoperands);
1196 output_asm_insn ("move%.l %1,%-", operands);
1197 return "fmove%.d %+,%0";
1199 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1200 return output_move_const_double (operands);
1201 return "fmove%.d %f1,%0";
1203 else if (FP_REG_P (operands[1]))
1205 if (REG_P (operands[0]))
1207 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1208 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1209 return "move%.l %+,%0";
1212 return "fmove%.d %f1,%0";
1214 return output_move_double (operands);
1218 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,g")
1219 (match_operand:DI 1 "general_operand" "g,r"))]
1221 "* return output_move_double (operands);")
1223 ;; Thus goes after the move instructions
1224 ;; because the move instructions are better (require no spilling)
1225 ;; when they can apply. It goes before the add/sub insns
1226 ;; so we will prefer it to them.
1228 (define_insn "pushasi"
1229 [(set (match_operand:SI 0 "push_operand" "=m")
1230 (match_operand:SI 1 "address_operand" "p"))]
1234 ;; truncation instructions
1235 (define_insn "truncsiqi2"
1236 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
1238 (match_operand:SI 1 "general_src_operand" "doJS,i")))]
1241 if (GET_CODE (operands[0]) == REG)
1243 /* Must clear condition codes, since the move.l bases them on
1244 the entire 32 bits, not just the desired 8 bits. */
1246 return "move%.l %1,%0";
1248 if (GET_CODE (operands[1]) == MEM)
1249 operands[1] = adjust_address (operands[1], QImode, 3);
1250 return "move%.b %1,%0";
1253 (define_insn "trunchiqi2"
1254 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
1256 (match_operand:HI 1 "general_src_operand" "doJS,i")))]
1259 if (GET_CODE (operands[0]) == REG
1260 && (GET_CODE (operands[1]) == MEM
1261 || GET_CODE (operands[1]) == CONST_INT))
1263 /* Must clear condition codes, since the move.w bases them on
1264 the entire 16 bits, not just the desired 8 bits. */
1266 return "move%.w %1,%0";
1268 if (GET_CODE (operands[0]) == REG)
1270 /* Must clear condition codes, since the move.l bases them on
1271 the entire 32 bits, not just the desired 8 bits. */
1273 return "move%.l %1,%0";
1275 if (GET_CODE (operands[1]) == MEM)
1276 operands[1] = adjust_address (operands[1], QImode, 1);
1277 return "move%.b %1,%0";
1280 (define_insn "truncsihi2"
1281 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm,d")
1283 (match_operand:SI 1 "general_src_operand" "roJS,i")))]
1286 if (GET_CODE (operands[0]) == REG)
1288 /* Must clear condition codes, since the move.l bases them on
1289 the entire 32 bits, not just the desired 8 bits. */
1291 return "move%.l %1,%0";
1293 if (GET_CODE (operands[1]) == MEM)
1294 operands[1] = adjust_address (operands[1], QImode, 2);
1295 return "move%.w %1,%0";
1298 ;; zero extension instructions
1300 ;; two special patterns to match various post_inc/pre_dec patterns
1301 (define_insn_and_split "*zero_extend_inc"
1302 [(set (match_operand 0 "post_inc_operand" "")
1303 (zero_extend (match_operand 1 "register_operand" "")))]
1304 "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT &&
1305 GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT &&
1306 GET_MODE_SIZE (GET_MODE (operands[0])) == GET_MODE_SIZE (GET_MODE (operands[1])) * 2"
1314 operands[0] = adjust_address (operands[0], GET_MODE (operands[1]), 0);
1317 (define_insn_and_split "*zero_extend_dec"
1318 [(set (match_operand 0 "pre_dec_operand" "")
1319 (zero_extend (match_operand 1 "register_operand" "")))]
1320 "(GET_MODE (operands[0]) != HImode || XEXP (XEXP (operands[0], 0), 0) != stack_pointer_rtx) &&
1321 GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT &&
1322 GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT &&
1323 GET_MODE_SIZE (GET_MODE (operands[0])) == GET_MODE_SIZE (GET_MODE (operands[1])) * 2"
1331 operands[0] = adjust_address (operands[0], GET_MODE (operands[1]), 0);
1334 (define_insn_and_split "zero_extendqidi2"
1335 [(set (match_operand:DI 0 "register_operand" "")
1336 (zero_extend:DI (match_operand:QI 1 "nonimmediate_src_operand" "")))]
1341 (zero_extend:SI (match_dup 1)))
1345 operands[2] = gen_lowpart (SImode, operands[0]);
1346 operands[3] = gen_highpart (SImode, operands[0]);
1349 (define_insn_and_split "zero_extendhidi2"
1350 [(set (match_operand:DI 0 "register_operand" "")
1351 (zero_extend:DI (match_operand:HI 1 "nonimmediate_src_operand" "")))]
1356 (zero_extend:SI (match_dup 1)))
1360 operands[2] = gen_lowpart (SImode, operands[0]);
1361 operands[3] = gen_highpart (SImode, operands[0]);
1364 (define_expand "zero_extendsidi2"
1365 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1366 (zero_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "")))]
1369 if (GET_CODE (operands[0]) == MEM
1370 && GET_CODE (operands[1]) == MEM)
1371 operands[1] = force_reg (SImode, operands[1]);
1374 (define_insn_and_split "*zero_extendsidi2"
1375 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1376 (zero_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "")))]
1377 "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
1385 operands[2] = gen_lowpart (SImode, operands[0]);
1386 operands[3] = gen_highpart (SImode, operands[0]);
1389 (define_insn "*zero_extendhisi2_cf"
1390 [(set (match_operand:SI 0 "register_operand" "=d")
1391 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1395 (define_insn "zero_extendhisi2"
1396 [(set (match_operand:SI 0 "register_operand" "=d")
1397 (zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1401 (define_expand "zero_extendqihi2"
1402 [(set (match_operand:HI 0 "register_operand" "")
1403 (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "")))]
1407 (define_insn "*zero_extendqihi2"
1408 [(set (match_operand:HI 0 "register_operand" "=d")
1409 (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1413 (define_insn "*zero_extendqisi2_cfv4"
1414 [(set (match_operand:SI 0 "register_operand" "=d")
1415 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1419 (define_insn "zero_extendqisi2"
1420 [(set (match_operand:SI 0 "register_operand" "=d")
1421 (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))]
1425 ;; these two pattern split everything else which isn't matched by
1426 ;; something else above
1428 [(set (match_operand 0 "register_operand" "")
1429 (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))]
1432 && reg_mentioned_p (operands[0], operands[1])"
1433 [(set (strict_low_part (match_dup 2))
1436 (match_op_dup 4 [(match_dup 0) (match_dup 3)]))]
1438 operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
1439 operands[3] = GEN_INT (GET_MODE_MASK (GET_MODE (operands[1])));
1440 operands[4] = gen_rtx_AND (GET_MODE (operands[0]), operands[0], operands[3]);
1444 [(set (match_operand 0 "register_operand" "")
1445 (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))]
1446 "!TARGET_ISAB && reload_completed"
1449 (set (strict_low_part (match_dup 2))
1452 operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
1455 ;; sign extension instructions
1457 (define_insn "extendqidi2"
1458 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1459 (sign_extend:DI (match_operand:QI 1 "general_src_operand" "rmS")))]
1463 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1465 return "mvs%.b %1,%2\;smi %0\;extb%.l %0";
1466 if (TARGET_68020 || TARGET_COLDFIRE)
1468 if (ADDRESS_REG_P (operands[1]))
1469 return "move%.w %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
1471 return "move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
1475 if (ADDRESS_REG_P (operands[1]))
1476 return "move%.w %1,%2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0\;smi %0";
1478 return "move%.b %1,%2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0\;smi %0";
1482 (define_insn "extendhidi2"
1483 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1485 (match_operand:HI 1 "general_src_operand" "rmS")))]
1489 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1491 return "mvs%.w %1,%2\;smi %0\;extb%.l %0";
1492 if (TARGET_68020 || TARGET_COLDFIRE)
1493 return "move%.w %1,%2\;ext%.l %2\;smi %0\;extb%.l %0";
1495 return "move%.w %1,%2\;ext%.l %2\;smi %0\;ext%.w %0\;ext%.l %0";
1498 (define_insn "extendsidi2"
1499 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1501 (match_operand:SI 1 "general_operand" "rm")))]
1505 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1506 if (TARGET_68020 || TARGET_COLDFIRE)
1507 return "move%.l %1,%2\;smi %0\;extb%.l %0";
1509 return "move%.l %1,%2\;smi %0\;ext%.w %0\;ext%.l %0";
1512 ;; Special case when one can avoid register clobbering, copy and test
1513 ;; Maybe there is a way to make that the general case, by forcing the
1514 ;; result of the SI tree to be in the lower register of the DI target
1516 (define_insn "extendplussidi"
1517 [(set (match_operand:DI 0 "register_operand" "=d")
1518 (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rmn")
1519 (match_operand:SI 2 "general_operand" "rmn"))))]
1523 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1524 if (GET_CODE (operands[1]) == CONST_INT
1525 && (unsigned) INTVAL (operands[1]) > 8)
1527 rtx tmp = operands[1];
1529 operands[1] = operands[2];
1532 if (GET_CODE (operands[1]) == REG
1533 && REGNO (operands[1]) == REGNO (operands[3]))
1534 output_asm_insn ("add%.l %2,%3", operands);
1536 output_asm_insn ("move%.l %2,%3\;add%.l %1,%3", operands);
1537 if (TARGET_68020 || TARGET_COLDFIRE)
1538 return "smi %0\;extb%.l %0";
1540 return "smi %0\;ext%.w %0\;ext%.l %0";
1543 (define_expand "extendhisi2"
1544 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1546 (match_operand:HI 1 "nonimmediate_src_operand" "")))]
1550 (define_insn "*cfv4_extendhisi2"
1551 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1553 (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))]
1557 (define_insn "*68k_extendhisi2"
1558 [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a")
1560 (match_operand:HI 1 "nonimmediate_src_operand" "0,rmS")))]
1563 if (ADDRESS_REG_P (operands[0]))
1564 return "move%.w %1,%0";
1568 (define_insn "extendqihi2"
1569 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
1570 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0")))]
1574 (define_expand "extendqisi2"
1575 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1576 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
1577 "TARGET_68020 || TARGET_COLDFIRE"
1580 (define_insn "*cfv4_extendqisi2"
1581 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1582 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "rms")))]
1586 (define_insn "*68k_extendqisi2"
1587 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
1588 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))]
1589 "TARGET_68020 || (TARGET_COLDFIRE && !TARGET_ISAB)"
1592 ;; Conversions between float and double.
1594 (define_expand "extendsfdf2"
1595 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1597 (match_operand:SF 1 "general_operand" "")))]
1602 [(set (match_operand:DF 0 "nonimmediate_operand" "=*fdm,f")
1604 (match_operand:SF 1 "general_operand" "f,dmF")))]
1607 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
1609 if (REGNO (operands[0]) == REGNO (operands[1]))
1611 /* Extending float to double in an fp-reg is a no-op.
1612 NOTICE_UPDATE_CC has already assumed that the
1613 cc will be set. So cancel what it did. */
1614 cc_status = cc_prev_status;
1617 return "f%&move%.x %1,%0";
1619 if (FP_REG_P (operands[0]))
1620 return "f%&move%.s %f1,%0";
1621 if (DATA_REG_P (operands[0]) && FP_REG_P (operands[1]))
1623 output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands);
1624 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1625 return "move%.l %+,%0";
1627 return "fmove%.d %f1,%0";
1630 (define_insn "extendsfdf2_cf"
1631 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
1633 (match_operand:SF 1 "general_operand" "f,<Q>U")))]
1634 "TARGET_COLDFIRE_FPU"
1636 if (FP_REG_P (operands[0]) && FP_REG_P (operands[1]))
1638 if (REGNO (operands[0]) == REGNO (operands[1]))
1640 /* Extending float to double in an fp-reg is a no-op.
1641 NOTICE_UPDATE_CC has already assumed that the
1642 cc will be set. So cancel what it did. */
1643 cc_status = cc_prev_status;
1646 return "f%&move%.d %1,%0";
1648 return "f%&move%.s %f1,%0";
1651 ;; This cannot output into an f-reg because there is no way to be
1652 ;; sure of truncating in that case.
1653 (define_expand "truncdfsf2"
1654 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1656 (match_operand:DF 1 "general_operand" "")))]
1660 ;; On the '040 we can truncate in a register accurately and easily.
1662 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
1664 (match_operand:DF 1 "general_operand" "fmG")))]
1665 "TARGET_68881 && TARGET_68040_ONLY"
1667 if (FP_REG_P (operands[1]))
1668 return "f%$move%.x %1,%0";
1669 return "f%$move%.d %f1,%0";
1672 (define_insn "truncdfsf2_cf"
1673 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,d<Q>U")
1675 (match_operand:DF 1 "general_operand" "<Q>U,f")))]
1676 "TARGET_COLDFIRE_FPU"
1682 [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
1684 (match_operand:DF 1 "general_operand" "f")))]
1688 ;; Conversion between fixed point and floating point.
1689 ;; Note that among the fix-to-float insns
1690 ;; the ones that start with SImode come first.
1691 ;; That is so that an operand that is a CONST_INT
1692 ;; (and therefore lacks a specific machine mode).
1693 ;; will be recognized as SImode (which is always valid)
1694 ;; rather than as QImode or HImode.
1696 (define_expand "floatsi<mode>2"
1697 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1698 (float:FP (match_operand:SI 1 "general_operand" "")))]
1702 (define_insn "floatsi<mode>2_68881"
1703 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1704 (float:FP (match_operand:SI 1 "general_operand" "dmi")))]
1706 "f<FP:round>move%.l %1,%0")
1708 (define_insn "floatsi<mode>2_cf"
1709 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1710 (float:FP (match_operand:SI 1 "general_operand" "d<Q>U")))]
1711 "TARGET_COLDFIRE_FPU"
1712 "f<FP:prec>move%.l %1,%0")
1715 (define_expand "floathi<mode>2"
1716 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1717 (float:FP (match_operand:HI 1 "general_operand" "")))]
1721 (define_insn "floathi<mode>2_68881"
1722 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1723 (float:FP (match_operand:HI 1 "general_operand" "dmn")))]
1727 (define_insn "floathi<mode>2_cf"
1728 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1729 (float:FP (match_operand:HI 1 "general_operand" "d<Q>U")))]
1730 "TARGET_COLDFIRE_FPU"
1734 (define_expand "floatqi<mode>2"
1735 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1736 (float:FP (match_operand:QI 1 "general_operand" "")))]
1740 (define_insn "floatqi<mode>2_68881"
1741 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1742 (float:FP (match_operand:QI 1 "general_operand" "dmn")))]
1746 (define_insn "floatqi<mode>2_cf"
1747 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1748 (float:FP (match_operand:QI 1 "general_operand" "d<Q>U")))]
1749 "TARGET_COLDFIRE_FPU"
1753 ;; New routines to convert floating-point values to integers
1754 ;; to be used on the '040. These should be faster than trapping
1755 ;; into the kernel to emulate fintrz. They should also be faster
1756 ;; than calling the subroutines fixsfsi or fixdfsi.
1758 (define_insn "fix_truncdfsi2"
1759 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
1760 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1761 (clobber (match_scratch:SI 2 "=d"))
1762 (clobber (match_scratch:SI 3 "=d"))]
1763 "TARGET_68881 && TUNE_68040"
1766 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,%!";
1769 (define_insn "fix_truncdfhi2"
1770 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
1771 (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1772 (clobber (match_scratch:SI 2 "=d"))
1773 (clobber (match_scratch:SI 3 "=d"))]
1774 "TARGET_68881 && TUNE_68040"
1777 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,%!";
1780 (define_insn "fix_truncdfqi2"
1781 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
1782 (fix:QI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
1783 (clobber (match_scratch:SI 2 "=d"))
1784 (clobber (match_scratch:SI 3 "=d"))]
1785 "TARGET_68881 && TUNE_68040"
1788 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,%!";
1791 ;; Convert a float to a float whose value is an integer.
1792 ;; This is the first stage of converting it to an integer type.
1794 (define_expand "ftrunc<mode>2"
1795 [(set (match_operand:FP 0 "nonimmediate_operand" "")
1796 (fix:FP (match_operand:FP 1 "general_operand" "")))]
1797 "TARGET_HARD_FLOAT && !TUNE_68040"
1800 (define_insn "ftrunc<mode>2_68881"
1801 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1802 (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
1803 "TARGET_68881 && !TUNE_68040"
1805 if (FP_REG_P (operands[1]))
1806 return "fintrz%.x %f1,%0";
1807 return "fintrz%.<FP:prec> %f1,%0";
1810 (define_insn "ftrunc<mode>2_cf"
1811 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
1812 (fix:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
1813 "TARGET_COLDFIRE_FPU"
1815 if (FP_REG_P (operands[1]))
1816 return "fintrz%.d %f1,%0";
1817 return "fintrz%.<FP:prec> %f1,%0";
1820 ;; Convert a float whose value is an integer
1821 ;; to an actual integer. Second stage of converting float to integer type.
1822 (define_expand "fix<mode>qi2"
1823 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1824 (fix:QI (match_operand:FP 1 "general_operand" "")))]
1828 (define_insn "fix<mode>qi2_68881"
1829 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
1830 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
1834 (define_insn "fix<mode>qi2_cf"
1835 [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>U")
1836 (fix:QI (match_operand:FP 1 "general_operand" "f")))]
1837 "TARGET_COLDFIRE_FPU"
1840 (define_expand "fix<mode>hi2"
1841 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1842 (fix:HI (match_operand:FP 1 "general_operand" "")))]
1846 (define_insn "fix<mode>hi2_68881"
1847 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
1848 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
1852 (define_insn "fix<mode>hi2_cf"
1853 [(set (match_operand:HI 0 "nonimmediate_operand" "=d<Q>U")
1854 (fix:HI (match_operand:FP 1 "general_operand" "f")))]
1855 "TARGET_COLDFIRE_FPU"
1858 (define_expand "fix<mode>si2"
1859 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1860 (fix:SI (match_operand:FP 1 "general_operand" "")))]
1864 (define_insn "fix<mode>si2_68881"
1865 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
1866 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
1870 (define_insn "fix<mode>si2_cf"
1871 [(set (match_operand:SI 0 "nonimmediate_operand" "=d<Q>U")
1872 (fix:SI (match_operand:FP 1 "general_operand" "f")))]
1873 "TARGET_COLDFIRE_FPU"
1879 (define_insn "adddi_lshrdi_63"
1880 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1881 (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "rm")
1884 (clobber (match_scratch:SI 2 "=d"))]
1887 operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1888 if (REG_P (operands[1]) && REGNO (operands[1]) == REGNO (operands[0]))
1890 "move%.l %1,%2\;add%.l %2,%2\;subx%.l %2,%2\;sub%.l %2,%3\;subx%.l %2,%0";
1891 if (GET_CODE (operands[1]) == REG)
1892 operands[4] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1893 else if (GET_CODE (XEXP (operands[1], 0)) == POST_INC
1894 || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
1895 operands[4] = operands[1];
1897 operands[4] = adjust_address (operands[1], SImode, 4);
1898 if (GET_CODE (operands[1]) == MEM
1899 && GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
1900 output_asm_insn ("move%.l %4,%3", operands);
1901 output_asm_insn ("move%.l %1,%0\;smi %2", operands);
1902 if (TARGET_68020 || TARGET_COLDFIRE)
1903 output_asm_insn ("extb%.l %2", operands);
1905 output_asm_insn ("ext%.w %2\;ext%.l %2", operands);
1906 if (GET_CODE (operands[1]) != MEM
1907 || GET_CODE (XEXP (operands[1], 0)) != PRE_DEC)
1908 output_asm_insn ("move%.l %4,%3", operands);
1909 return "sub%.l %2,%3\;subx%.l %2,%0";
1912 (define_insn "adddi_sexthishl32"
1913 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
1914 (plus:DI (ashift:DI (sign_extend:DI
1915 (match_operand:HI 1 "general_operand" "rm,rm,rm,rm"))
1917 (match_operand:DI 2 "general_operand" "0,0,0,0")))
1918 (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
1922 if (ADDRESS_REG_P (operands[0]))
1923 return "add%.w %1,%0";
1924 else if (ADDRESS_REG_P (operands[3]))
1925 return "move%.w %1,%3\;add%.l %3,%0";
1927 return "move%.w %1,%3\;ext%.l %3\;add%.l %3,%0";
1930 (define_insn "adddi_dilshr32"
1931 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,o")
1932 ;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
1933 ;; (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
1934 ;; (const_int 32))))]
1935 (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")
1937 (match_operand:DI 2 "general_operand" "0,0")))]
1941 if (GET_CODE (operands[0]) == REG)
1942 operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
1944 operands[2] = adjust_address (operands[0], SImode, 4);
1945 return "add%.l %1,%2\;negx%.l %0\;neg%.l %0";
1948 (define_insn "adddi_dishl32"
1949 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
1950 ;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
1951 ;; (ashift:DI (match_operand:DI 1 "general_operand" "ro")
1952 ;; (const_int 32))))]
1953 (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,d")
1955 (match_operand:DI 2 "general_operand" "0,0")))]
1959 if (GET_CODE (operands[1]) == REG)
1960 operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
1962 operands[1] = adjust_address (operands[1], SImode, 4);
1963 return "add%.l %1,%0";
1966 (define_insn "adddi3"
1967 [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")
1968 (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0,0")
1969 (match_operand:DI 2 "general_operand" "<,d,no>,d,a")))
1970 (clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]
1973 if (DATA_REG_P (operands[0]))
1975 if (DATA_REG_P (operands[2]))
1976 return "add%.l %R2,%R0\;addx%.l %2,%0";
1977 else if (GET_CODE (operands[2]) == MEM
1978 && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
1979 return "move%.l %2,%3\;add%.l %2,%R0\;addx%.l %3,%0";
1985 if (GET_CODE (operands[2]) == REG)
1987 low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
1990 else if (CONSTANT_P (operands[2]))
1991 split_double (operands[2], &high, &low);
1994 low = adjust_address (operands[2], SImode, 4);
1998 operands[1] = low, operands[2] = high;
1999 xoperands[0] = operands[3];
2000 if (GET_CODE (operands[1]) == CONST_INT
2001 && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2002 xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
2004 xoperands[1] = operands[2];
2006 output_asm_insn (output_move_simode (xoperands), xoperands);
2007 if (GET_CODE (operands[1]) == CONST_INT)
2009 if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
2010 return "addq%.l %1,%R0\;addx%.l %3,%0";
2011 else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2013 operands[1] = GEN_INT (-INTVAL (operands[1]));
2014 return "subq%.l %1,%R0\;subx%.l %3,%0";
2017 return "add%.l %1,%R0\;addx%.l %3,%0";
2022 gcc_assert (GET_CODE (operands[0]) == MEM);
2023 if (GET_CODE (operands[2]) == MEM
2024 && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC)
2025 return "add%.l %2,%0\;addx%.l %2,%0";
2027 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2029 operands[1] = gen_rtx_MEM (SImode,
2030 plus_constant (XEXP(operands[0], 0), -8));
2031 return "move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1";
2033 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2035 operands[1] = XEXP(operands[0], 0);
2036 return "add%.l %R2,%0\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%1";
2040 operands[1] = adjust_address (operands[0], SImode, 4);
2041 return "add%.l %R2,%1\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%0";
2046 (define_insn "addsi_lshrsi_31"
2047 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
2048 (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
2053 operands[2] = operands[0];
2054 operands[3] = gen_label_rtx();
2055 if (GET_CODE (operands[0]) == MEM)
2057 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2058 operands[0] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
2059 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2060 operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
2062 output_asm_insn ("move%.l %1,%0", operands);
2063 output_asm_insn (MOTOROLA ? "jbpl %l3" : "jpl %l3", operands);
2064 output_asm_insn ("addq%.l #1,%2", operands);
2065 (*targetm.asm_out.internal_label) (asm_out_file, "L",
2066 CODE_LABEL_NUMBER (operands[3]));
2070 (define_expand "addsi3"
2071 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2072 (plus:SI (match_operand:SI 1 "general_operand" "")
2073 (match_operand:SI 2 "general_src_operand" "")))]
2077 ;; Note that the middle two alternatives are near-duplicates
2078 ;; in order to handle insns generated by reload.
2079 ;; This is needed since they are not themselves reloaded,
2080 ;; so commutativity won't apply to them.
2081 (define_insn "*addsi3_internal"
2082 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,d,a")
2083 (plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0,0")
2084 (match_operand:SI 2 "general_src_operand" "dIKLT,rJK,a,mSrIKLT,mSrIKLs")))]
2088 "* return output_addsi3 (operands);")
2090 (define_insn "*addsi3_5200"
2091 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,r")
2092 (plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0")
2093 (match_operand:SI 2 "general_src_operand" "dIL,rJK,a,mrIKLi")))]
2095 "* return output_addsi3 (operands);")
2098 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
2099 (plus:SI (match_operand:SI 1 "general_operand" "0")
2101 (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
2105 (define_insn "addhi3"
2106 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
2107 (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
2108 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
2111 if (GET_CODE (operands[2]) == CONST_INT)
2113 /* If the constant would be a negative number when interpreted as
2114 HImode, make it negative. This is usually, but not always, done
2115 elsewhere in the compiler. First check for constants out of range,
2116 which could confuse us. */
2118 if (INTVAL (operands[2]) >= 32768)
2119 operands[2] = GEN_INT (INTVAL (operands[2]) - 65536);
2121 if (INTVAL (operands[2]) > 0
2122 && INTVAL (operands[2]) <= 8)
2123 return "addq%.w %2,%0";
2124 if (INTVAL (operands[2]) < 0
2125 && INTVAL (operands[2]) >= -8)
2127 operands[2] = GEN_INT (- INTVAL (operands[2]));
2128 return "subq%.w %2,%0";
2130 /* On the CPU32 it is faster to use two addqw instructions to
2131 add a small integer (8 < N <= 16) to a register.
2132 Likewise for subqw. */
2133 if (TUNE_CPU32 && REG_P (operands[0]))
2135 if (INTVAL (operands[2]) > 8
2136 && INTVAL (operands[2]) <= 16)
2138 operands[2] = GEN_INT (INTVAL (operands[2]) - 8);
2139 return "addq%.w #8,%0\;addq%.w %2,%0";
2141 if (INTVAL (operands[2]) < -8
2142 && INTVAL (operands[2]) >= -16)
2144 operands[2] = GEN_INT (- INTVAL (operands[2]) - 8);
2145 return "subq%.w #8,%0\;subq%.w %2,%0";
2148 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2149 return MOTOROLA ? "lea (%c2,%0),%0" : "lea %0@(%c2),%0";
2151 return "add%.w %2,%0";
2154 ;; These insns must use MATCH_DUP instead of the more expected
2155 ;; use of a matching constraint because the "output" here is also
2156 ;; an input, so you can't use the matching constraint. That also means
2157 ;; that you can't use the "%", so you need patterns with the matched
2158 ;; operand in both positions.
2161 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2162 (plus:HI (match_dup 0)
2163 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
2166 if (GET_CODE (operands[1]) == CONST_INT)
2168 /* If the constant would be a negative number when interpreted as
2169 HImode, make it negative. This is usually, but not always, done
2170 elsewhere in the compiler. First check for constants out of range,
2171 which could confuse us. */
2173 if (INTVAL (operands[1]) >= 32768)
2174 operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
2176 if (INTVAL (operands[1]) > 0
2177 && INTVAL (operands[1]) <= 8)
2178 return "addq%.w %1,%0";
2179 if (INTVAL (operands[1]) < 0
2180 && INTVAL (operands[1]) >= -8)
2182 operands[1] = GEN_INT (- INTVAL (operands[1]));
2183 return "subq%.w %1,%0";
2185 /* On the CPU32 it is faster to use two addqw instructions to
2186 add a small integer (8 < N <= 16) to a register.
2187 Likewise for subqw. */
2188 if (TUNE_CPU32 && REG_P (operands[0]))
2190 if (INTVAL (operands[1]) > 8
2191 && INTVAL (operands[1]) <= 16)
2193 operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
2194 return "addq%.w #8,%0\;addq%.w %1,%0";
2196 if (INTVAL (operands[1]) < -8
2197 && INTVAL (operands[1]) >= -16)
2199 operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
2200 return "subq%.w #8,%0\;subq%.w %1,%0";
2203 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2204 return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";
2206 return "add%.w %1,%0";
2210 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2211 (plus:HI (match_operand:HI 1 "general_src_operand" "dn,rmSn")
2215 if (GET_CODE (operands[1]) == CONST_INT)
2217 /* If the constant would be a negative number when interpreted as
2218 HImode, make it negative. This is usually, but not always, done
2219 elsewhere in the compiler. First check for constants out of range,
2220 which could confuse us. */
2222 if (INTVAL (operands[1]) >= 32768)
2223 operands[1] = GEN_INT (INTVAL (operands[1]) - 65536);
2225 if (INTVAL (operands[1]) > 0
2226 && INTVAL (operands[1]) <= 8)
2227 return "addq%.w %1,%0";
2228 if (INTVAL (operands[1]) < 0
2229 && INTVAL (operands[1]) >= -8)
2231 operands[1] = GEN_INT (- INTVAL (operands[1]));
2232 return "subq%.w %1,%0";
2234 /* On the CPU32 it is faster to use two addqw instructions to
2235 add a small integer (8 < N <= 16) to a register.
2236 Likewise for subqw. */
2237 if (TUNE_CPU32 && REG_P (operands[0]))
2239 if (INTVAL (operands[1]) > 8
2240 && INTVAL (operands[1]) <= 16)
2242 operands[1] = GEN_INT (INTVAL (operands[1]) - 8);
2243 return "addq%.w #8,%0\;addq%.w %1,%0";
2245 if (INTVAL (operands[1]) < -8
2246 && INTVAL (operands[1]) >= -16)
2248 operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);
2249 return "subq%.w #8,%0\;subq%.w %1,%0";
2252 if (ADDRESS_REG_P (operands[0]) && !TUNE_68040)
2253 return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";
2255 return "add%.w %1,%0";
2258 (define_insn "addqi3"
2259 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
2260 (plus:QI (match_operand:QI 1 "general_operand" "%0,0")
2261 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
2264 if (GET_CODE (operands[2]) == CONST_INT)
2266 if (INTVAL (operands[2]) >= 128)
2267 operands[2] = GEN_INT (INTVAL (operands[2]) - 256);
2269 if (INTVAL (operands[2]) > 0
2270 && INTVAL (operands[2]) <= 8)
2271 return "addq%.b %2,%0";
2272 if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8)
2274 operands[2] = GEN_INT (- INTVAL (operands[2]));
2275 return "subq%.b %2,%0";
2278 return "add%.b %2,%0";
2282 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2283 (plus:QI (match_dup 0)
2284 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
2287 if (GET_CODE (operands[1]) == CONST_INT)
2289 if (INTVAL (operands[1]) >= 128)
2290 operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
2292 if (INTVAL (operands[1]) > 0
2293 && INTVAL (operands[1]) <= 8)
2294 return "addq%.b %1,%0";
2295 if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
2297 operands[1] = GEN_INT (- INTVAL (operands[1]));
2298 return "subq%.b %1,%0";
2301 return "add%.b %1,%0";
2305 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2306 (plus:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
2310 if (GET_CODE (operands[1]) == CONST_INT)
2312 if (INTVAL (operands[1]) >= 128)
2313 operands[1] = GEN_INT (INTVAL (operands[1]) - 256);
2315 if (INTVAL (operands[1]) > 0
2316 && INTVAL (operands[1]) <= 8)
2317 return "addq%.b %1,%0";
2318 if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)
2320 operands[1] = GEN_INT (- INTVAL (operands[1]));
2321 return "subq%.b %1,%0";
2324 return "add%.b %1,%0";
2327 (define_expand "add<mode>3"
2328 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2329 (plus:FP (match_operand:FP 1 "general_operand" "")
2330 (match_operand:FP 2 "general_operand" "")))]
2334 (define_insn "add<mode>3_floatsi_68881"
2335 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2336 (plus:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
2337 (match_operand:FP 1 "general_operand" "0")))]
2339 "f<FP:round>add%.l %2,%0")
2341 (define_insn "add<mode>3_floathi_68881"
2342 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2343 (plus:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
2344 (match_operand:FP 1 "general_operand" "0")))]
2346 "f<FP:round>add%.w %2,%0")
2348 (define_insn "add<mode>3_floatqi_68881"
2349 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2350 (plus:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
2351 (match_operand:FP 1 "general_operand" "0")))]
2353 "f<FP:round>add%.b %2,%0")
2355 (define_insn "add<mode>3_68881"
2356 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2357 (plus:FP (match_operand:FP 1 "general_operand" "%0")
2358 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2361 if (FP_REG_P (operands[2]))
2362 return "f<FP:round>add%.x %2,%0";
2363 return "f<FP:round>add%.<FP:prec> %f2,%0";
2366 (define_insn "add<mode>3_cf"
2367 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2368 (plus:FP (match_operand:FP 1 "general_operand" "%0")
2369 (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
2370 "TARGET_COLDFIRE_FPU"
2372 if (FP_REG_P (operands[2]))
2373 return "f<FP:round>add%.d %2,%0";
2374 return "f<FP:round>add%.<FP:prec> %2,%0";
2377 ;; subtract instructions
2379 (define_insn "subdi_sexthishl32"
2380 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
2381 (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
2382 (ashift:DI (sign_extend:DI (match_operand:HI 2 "general_operand" "rm,rm,rm,rm"))
2384 (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]
2388 if (ADDRESS_REG_P (operands[0]))
2389 return "sub%.w %2,%0";
2390 else if (ADDRESS_REG_P (operands[3]))
2391 return "move%.w %2,%3\;sub%.l %3,%0";
2393 return "move%.w %2,%3\;ext%.l %3\;sub%.l %3,%0";
2396 (define_insn "subdi_dishl32"
2397 [(set (match_operand:DI 0 "nonimmediate_operand" "+ro")
2398 (minus:DI (match_dup 0)
2399 (ashift:DI (match_operand:DI 1 "general_operand" "ro")
2404 if (GET_CODE (operands[1]) == REG)
2405 operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
2407 operands[1] = adjust_address (operands[1], SImode, 4);
2408 return "sub%.l %1,%0";
2411 (define_insn "subdi3"
2412 [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")
2413 (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0,0")
2414 (match_operand:DI 2 "general_operand" "<,d,no>,d,a")))
2415 (clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]
2418 if (DATA_REG_P (operands[0]))
2420 if (DATA_REG_P (operands[2]))
2421 return "sub%.l %R2,%R0\;subx%.l %2,%0";
2422 else if (GET_CODE (operands[2]) == MEM
2423 && GET_CODE (XEXP (operands[2], 0)) == POST_INC)
2425 return "move%.l %2,%3\;sub%.l %2,%R0\;subx%.l %3,%0";
2432 if (GET_CODE (operands[2]) == REG)
2434 low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
2437 else if (CONSTANT_P (operands[2]))
2438 split_double (operands[2], &high, &low);
2441 low = adjust_address (operands[2], SImode, 4);
2445 operands[1] = low, operands[2] = high;
2446 xoperands[0] = operands[3];
2447 if (GET_CODE (operands[1]) == CONST_INT
2448 && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2449 xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
2451 xoperands[1] = operands[2];
2453 output_asm_insn (output_move_simode (xoperands), xoperands);
2454 if (GET_CODE (operands[1]) == CONST_INT)
2456 if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
2457 return "subq%.l %1,%R0\;subx%.l %3,%0";
2458 else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
2460 operands[1] = GEN_INT (-INTVAL (operands[1]));
2461 return "addq%.l %1,%R0\;addx%.l %3,%0";
2464 return "sub%.l %1,%R0\;subx%.l %3,%0";
2469 gcc_assert (GET_CODE (operands[0]) == MEM);
2470 if (GET_CODE (operands[2]) == MEM
2471 && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC)
2472 return "sub%.l %2,%0\;subx%.l %2,%0";
2474 if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
2477 = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[0], 0), -8));
2478 return "move%.l %0,%3\;sub%.l %R2,%0\;subx%.l %2,%3\;move%.l %3,%1";
2480 else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
2482 operands[1] = XEXP(operands[0], 0);
2483 return "sub%.l %R2,%0\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%1";
2487 operands[1] = adjust_address (operands[0], SImode, 4);
2488 return "sub%.l %R2,%1\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%0";
2493 (define_insn "subsi3"
2494 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d,a")
2495 (minus:SI (match_operand:SI 1 "general_operand" "0,0,0")
2496 (match_operand:SI 2 "general_src_operand" "dT,mSrT,mSrs")))]
2501 [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
2502 (minus:SI (match_operand:SI 1 "general_operand" "0")
2504 (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
2508 (define_insn "subhi3"
2509 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
2510 (minus:HI (match_operand:HI 1 "general_operand" "0,0")
2511 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
2516 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
2517 (minus:HI (match_dup 0)
2518 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
2522 (define_insn "subqi3"
2523 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
2524 (minus:QI (match_operand:QI 1 "general_operand" "0,0")
2525 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
2530 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
2531 (minus:QI (match_dup 0)
2532 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
2536 (define_expand "sub<mode>3"
2537 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2538 (minus:FP (match_operand:FP 1 "general_operand" "")
2539 (match_operand:FP 2 "general_operand" "")))]
2543 (define_insn "sub<mode>3_floatsi_68881"
2544 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2545 (minus:FP (match_operand:FP 1 "general_operand" "0")
2546 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
2548 "f<FP:round>sub%.l %2,%0")
2550 (define_insn "sub<mode>3_floathi_68881"
2551 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2552 (minus:FP (match_operand:FP 1 "general_operand" "0")
2553 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
2555 "f<FP:round>sub%.w %2,%0")
2557 (define_insn "sub<mode>3_floatqi_68881"
2558 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2559 (minus:FP (match_operand:FP 1 "general_operand" "0")
2560 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
2562 "f<FP:round>sub%.b %2,%0")
2564 (define_insn "sub<mode>3_68881"
2565 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2566 (minus:FP (match_operand:FP 1 "general_operand" "0")
2567 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2570 if (FP_REG_P (operands[2]))
2571 return "f<FP:round>sub%.x %2,%0";
2572 return "f<FP:round>sub%.<FP:prec> %f2,%0";
2575 (define_insn "sub<mode>3_cf"
2576 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2577 (minus:FP (match_operand:FP 1 "general_operand" "0")
2578 (match_operand:FP 2 "general_operand" "f<FP:dreg><Q>U")))]
2579 "TARGET_COLDFIRE_FPU"
2581 if (FP_REG_P (operands[2]))
2582 return "f<FP:round>sub%.d %2,%0";
2583 return "f<FP:round>sub%.<FP:prec> %2,%0";
2586 ;; multiply instructions
2588 (define_insn "mulhi3"
2589 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
2590 (mult:HI (match_operand:HI 1 "general_operand" "%0")
2591 (match_operand:HI 2 "general_src_operand" "dmSn")))]
2594 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2597 (define_insn "mulhisi3"
2598 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2599 (mult:SI (sign_extend:SI
2600 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2602 (match_operand:HI 2 "nonimmediate_src_operand" "dmS"))))]
2605 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2609 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2610 (mult:SI (sign_extend:SI
2611 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2612 (match_operand:SI 2 "const_int_operand" "n")))]
2613 "INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) <= 0x7fff"
2615 return MOTOROLA ? "muls%.w %2,%0" : "muls %2,%0";
2618 (define_expand "mulsi3"
2619 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2620 (mult:SI (match_operand:SI 1 "general_operand" "")
2621 (match_operand:SI 2 "general_operand" "")))]
2622 "TARGET_68020 || TARGET_COLDFIRE"
2626 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2627 (mult:SI (match_operand:SI 1 "general_operand" "%0")
2628 (match_operand:SI 2 "general_src_operand" "dmSTK")))]
2634 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2635 (mult:SI (match_operand:SI 1 "general_operand" "%0")
2636 (match_operand:SI 2 "general_operand" "d<Q>")))]
2640 (define_insn "umulhisi3"
2641 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2642 (mult:SI (zero_extend:SI
2643 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2645 (match_operand:HI 2 "nonimmediate_src_operand" "dmS"))))]
2648 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
2652 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
2653 (mult:SI (zero_extend:SI
2654 (match_operand:HI 1 "nonimmediate_operand" "%0"))
2655 (match_operand:SI 2 "const_int_operand" "n")))]
2656 "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 0xffff"
2658 return MOTOROLA ? "mulu%.w %2,%0" : "mulu %2,%0";
2661 ;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
2662 ;; proper matching constraint. This is because the matching is between
2663 ;; the high-numbered word of the DImode operand[0] and operand[1].
2664 (define_expand "umulsidi3"
2666 [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
2667 (mult:SI (match_operand:SI 1 "register_operand" "")
2668 (match_operand:SI 2 "register_operand" "")))
2669 (set (subreg:SI (match_dup 0) 0)
2670 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2671 (zero_extend:DI (match_dup 2)))
2672 (const_int 32))))])]
2673 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2677 [(set (match_operand:SI 0 "register_operand" "=d")
2678 (mult:SI (match_operand:SI 1 "register_operand" "%0")
2679 (match_operand:SI 2 "nonimmediate_operand" "dm")))
2680 (set (match_operand:SI 3 "register_operand" "=d")
2681 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2682 (zero_extend:DI (match_dup 2)))
2684 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2687 ; Match immediate case. For 2.4 only match things < 2^31.
2688 ; It's tricky with larger values in these patterns since we need to match
2689 ; values between the two parallel multiplies, between a CONST_DOUBLE and
2692 [(set (match_operand:SI 0 "register_operand" "=d")
2693 (mult:SI (match_operand:SI 1 "register_operand" "%0")
2694 (match_operand:SI 2 "const_int_operand" "n")))
2695 (set (match_operand:SI 3 "register_operand" "=d")
2696 (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
2699 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE
2700 && (unsigned) INTVAL (operands[2]) <= 0x7fffffff"
2703 (define_expand "mulsidi3"
2705 [(set (subreg:SI (match_operand:DI 0 "register_operand" "") 4)
2706 (mult:SI (match_operand:SI 1 "register_operand" "")
2707 (match_operand:SI 2 "register_operand" "")))
2708 (set (subreg:SI (match_dup 0) 0)
2709 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
2710 (sign_extend:DI (match_dup 2)))
2711 (const_int 32))))])]
2712 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2716 [(set (match_operand:SI 0 "register_operand" "=d")
2717 (mult:SI (match_operand:SI 1 "register_operand" "%0")
2718 (match_operand:SI 2 "nonimmediate_operand" "dm")))
2719 (set (match_operand:SI 3 "register_operand" "=d")
2720 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
2721 (sign_extend:DI (match_dup 2)))
2723 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2727 [(set (match_operand:SI 0 "register_operand" "=d")
2728 (mult:SI (match_operand:SI 1 "register_operand" "%0")
2729 (match_operand:SI 2 "const_int_operand" "n")))
2730 (set (match_operand:SI 3 "register_operand" "=d")
2731 (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
2734 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2737 (define_expand "umulsi3_highpart"
2739 [(set (match_operand:SI 0 "register_operand" "")
2742 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" ""))
2743 (zero_extend:DI (match_operand:SI 2 "general_operand" "")))
2745 (clobber (match_dup 3))])]
2746 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2748 operands[3] = gen_reg_rtx (SImode);
2750 if (GET_CODE (operands[2]) == CONST_INT)
2752 operands[2] = immed_double_const (INTVAL (operands[2]) & 0xffffffff,
2755 /* We have to adjust the operand order for the matching constraints. */
2756 emit_insn (gen_const_umulsi3_highpart (operands[0], operands[3],
2757 operands[1], operands[2]));
2763 [(set (match_operand:SI 0 "register_operand" "=d")
2766 (mult:DI (zero_extend:DI (match_operand:SI 2 "register_operand" "%1"))
2767 (zero_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
2769 (clobber (match_operand:SI 1 "register_operand" "=d"))]
2770 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2773 (define_insn "const_umulsi3_highpart"
2774 [(set (match_operand:SI 0 "register_operand" "=d")
2777 (mult:DI (zero_extend:DI (match_operand:SI 2 "register_operand" "1"))
2778 (match_operand:DI 3 "const_uint32_operand" "n"))
2780 (clobber (match_operand:SI 1 "register_operand" "=d"))]
2781 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2784 (define_expand "smulsi3_highpart"
2786 [(set (match_operand:SI 0 "register_operand" "")
2789 (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" ""))
2790 (sign_extend:DI (match_operand:SI 2 "general_operand" "")))
2792 (clobber (match_dup 3))])]
2793 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2795 operands[3] = gen_reg_rtx (SImode);
2796 if (GET_CODE (operands[2]) == CONST_INT)
2798 /* We have to adjust the operand order for the matching constraints. */
2799 emit_insn (gen_const_smulsi3_highpart (operands[0], operands[3],
2800 operands[1], operands[2]));
2806 [(set (match_operand:SI 0 "register_operand" "=d")
2809 (mult:DI (sign_extend:DI (match_operand:SI 2 "register_operand" "%1"))
2810 (sign_extend:DI (match_operand:SI 3 "nonimmediate_operand" "dm")))
2812 (clobber (match_operand:SI 1 "register_operand" "=d"))]
2813 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2816 (define_insn "const_smulsi3_highpart"
2817 [(set (match_operand:SI 0 "register_operand" "=d")
2820 (mult:DI (sign_extend:DI (match_operand:SI 2 "register_operand" "1"))
2821 (match_operand:DI 3 "const_sint32_operand" "n"))
2823 (clobber (match_operand:SI 1 "register_operand" "=d"))]
2824 "TARGET_68020 && !TUNE_68060 && !TARGET_COLDFIRE"
2827 (define_expand "mul<mode>3"
2828 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2829 (mult:FP (match_operand:FP 1 "general_operand" "")
2830 (match_operand:FP 2 "general_operand" "")))]
2834 (define_insn "mul<mode>3_floatsi_68881"
2835 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2836 (mult:FP (float:FP (match_operand:SI 2 "general_operand" "dmi"))
2837 (match_operand:FP 1 "general_operand" "0")))]
2840 return TARGET_68040_ONLY
2841 ? "f<FP:round>mul%.l %2,%0"
2842 : "f<FP:round_mul>mul%.l %2,%0";
2845 (define_insn "mul<mode>3_floathi_68881"
2846 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2847 (mult:FP (float:FP (match_operand:HI 2 "general_operand" "dmn"))
2848 (match_operand:FP 1 "general_operand" "0")))]
2851 return TARGET_68040_ONLY
2852 ? "f<FP:round>mul%.w %2,%0"
2853 : "f<FP:round_mul>mul%.w %2,%0";
2856 (define_insn "mul<mode>3_floatqi_68881"
2857 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2858 (mult:FP (float:FP (match_operand:QI 2 "general_operand" "dmn"))
2859 (match_operand:FP 1 "general_operand" "0")))]
2862 return TARGET_68040_ONLY
2863 ? "f<FP:round>mul%.b %2,%0"
2864 : "f<FP:round_mul>mul%.b %2,%0";
2867 (define_insn "muldf_68881"
2868 [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
2869 (mult:DF (match_operand:DF 1 "general_operand" "%0")
2870 (match_operand:DF 2 "general_operand" "fmG")))]
2873 if (GET_CODE (operands[2]) == CONST_DOUBLE
2874 && floating_exact_log2 (operands[2]) && !TUNE_68040_60)
2876 int i = floating_exact_log2 (operands[2]);
2877 operands[2] = GEN_INT (i);
2878 return "fscale%.l %2,%0";
2880 if (REG_P (operands[2]))
2881 return "f%&mul%.x %2,%0";
2882 return "f%&mul%.d %f2,%0";
2885 (define_insn "mulsf_68881"
2886 [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
2887 (mult:SF (match_operand:SF 1 "general_operand" "%0")
2888 (match_operand:SF 2 "general_operand" "fdmF")))]
2891 if (FP_REG_P (operands[2]))
2892 return (TARGET_68040_ONLY
2894 : "fsglmul%.x %2,%0");
2895 return (TARGET_68040_ONLY
2897 : "fsglmul%.s %f2,%0");
2900 (define_insn "mulxf3_68881"
2901 [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
2902 (mult:XF (match_operand:XF 1 "nonimmediate_operand" "%0")
2903 (match_operand:XF 2 "nonimmediate_operand" "fm")))]
2906 return "fmul%.x %f2,%0";
2909 (define_insn "fmul<mode>3_cf"
2910 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2911 (mult:FP (match_operand:FP 1 "general_operand" "%0")
2912 (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
2913 "TARGET_COLDFIRE_FPU"
2915 if (FP_REG_P (operands[2]))
2916 return "f<FP:prec>mul%.d %2,%0";
2917 return "f<FP:prec>mul%.<FP:prec> %2,%0";
2920 ;; divide instructions
2922 (define_expand "div<mode>3"
2923 [(set (match_operand:FP 0 "nonimmediate_operand" "")
2924 (div:FP (match_operand:FP 1 "general_operand" "")
2925 (match_operand:FP 2 "general_operand" "")))]
2929 (define_insn "div<mode>3_floatsi_68881"
2930 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2931 (div:FP (match_operand:FP 1 "general_operand" "0")
2932 (float:FP (match_operand:SI 2 "general_operand" "dmi"))))]
2935 return TARGET_68040_ONLY
2936 ? "f<FP:round>div%.l %2,%0"
2937 : "f<FP:round_mul>div%.l %2,%0";
2940 (define_insn "div<mode>3_floathi_68881"
2941 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2942 (div:FP (match_operand:FP 1 "general_operand" "0")
2943 (float:FP (match_operand:HI 2 "general_operand" "dmn"))))]
2946 return TARGET_68040_ONLY
2947 ? "f<FP:round>div%.w %2,%0"
2948 : "f<FP:round_mul>div%.w %2,%0";
2951 (define_insn "div<mode>3_floatqi_68881"
2952 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2953 (div:FP (match_operand:FP 1 "general_operand" "0")
2954 (float:FP (match_operand:QI 2 "general_operand" "dmn"))))]
2957 return TARGET_68040_ONLY
2958 ? "f<FP:round>div%.b %2,%0"
2959 : "f<FP:round_mul>div%.b %2,%0";
2962 (define_insn "div<mode>3_68881"
2963 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2964 (div:FP (match_operand:FP 1 "general_operand" "0")
2965 (match_operand:FP 2 "general_operand" "f<FP:dreg>m<FP:const>")))]
2968 if (FP_REG_P (operands[2]))
2969 return (TARGET_68040_ONLY
2970 ? "f<FP:round>div%.x %2,%0"
2971 : "f<FP:round_mul>div%.x %2,%0");
2972 return (TARGET_68040_ONLY
2973 ? "f<FP:round>div%.<FP:prec> %f2,%0"
2974 : "f<FP:round_mul>div%.<FP:prec> %f2,%0");
2977 (define_insn "div<mode>3_cf"
2978 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
2979 (div:FP (match_operand:FP 1 "general_operand" "0")
2980 (match_operand:FP 2 "general_operand" "f<Q>U<FP:dreg>")))]
2981 "TARGET_COLDFIRE_FPU"
2983 if (FP_REG_P (operands[2]))
2984 return "f<FP:prec>div%.d %2,%0";
2985 return "f<FP:prec>div%.<FP:prec> %2,%0";
2988 ;; Remainder instructions.
2990 (define_expand "divmodsi4"
2992 [(set (match_operand:SI 0 "nonimmediate_operand" "")
2993 (div:SI (match_operand:SI 1 "general_operand" "")
2994 (match_operand:SI 2 "general_src_operand" "")))
2995 (set (match_operand:SI 3 "nonimmediate_operand" "")
2996 (mod:SI (match_dup 1) (match_dup 2)))])]
2997 "TARGET_68020 || TARGET_CF_HWDIV"
3001 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3002 (div:SI (match_operand:SI 1 "general_operand" "0")
3003 (match_operand:SI 2 "general_src_operand" "d<Q>U")))
3004 (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
3005 (mod:SI (match_dup 1) (match_dup 2)))]
3008 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3009 return "divs%.l %2,%0";
3010 else if (find_reg_note (insn, REG_UNUSED, operands[0]))
3011 return "rems%.l %2,%3:%0";
3013 return "rems%.l %2,%3:%0\;divs%.l %2,%0";
3017 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3018 (div:SI (match_operand:SI 1 "general_operand" "0")
3019 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3020 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3021 (mod:SI (match_dup 1) (match_dup 2)))]
3024 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3025 return "divs%.l %2,%0";
3027 return "divsl%.l %2,%3:%0";
3030 (define_expand "udivmodsi4"
3032 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3033 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3034 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3035 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3036 (umod:SI (match_dup 1) (match_dup 2)))])]
3037 "TARGET_68020 || TARGET_CF_HWDIV"
3041 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3042 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3043 (match_operand:SI 2 "general_src_operand" "d<Q>U")))
3044 (set (match_operand:SI 3 "nonimmediate_operand" "=&d")
3045 (umod:SI (match_dup 1) (match_dup 2)))]
3048 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3049 return "divu%.l %2,%0";
3050 else if (find_reg_note (insn, REG_UNUSED, operands[0]))
3051 return "remu%.l %2,%3:%0";
3053 return "remu%.l %2,%3:%0\;divu%.l %2,%0";
3057 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3058 (udiv:SI (match_operand:SI 1 "general_operand" "0")
3059 (match_operand:SI 2 "general_src_operand" "dmSTK")))
3060 (set (match_operand:SI 3 "nonimmediate_operand" "=d")
3061 (umod:SI (match_dup 1) (match_dup 2)))]
3062 "TARGET_68020 && !TARGET_COLDFIRE"
3064 if (find_reg_note (insn, REG_UNUSED, operands[3]))
3065 return "divu%.l %2,%0";
3067 return "divul%.l %2,%3:%0";
3070 (define_insn "divmodhi4"
3071 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3072 (div:HI (match_operand:HI 1 "general_operand" "0")
3073 (match_operand:HI 2 "general_src_operand" "dmSKT")))
3074 (set (match_operand:HI 3 "nonimmediate_operand" "=d")
3075 (mod:HI (match_dup 1) (match_dup 2)))]
3076 "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
3078 output_asm_insn (MOTOROLA ?
3079 "ext%.l %0\;divs%.w %2,%0" :
3080 "extl %0\;divs %2,%0",
3082 if (!find_reg_note(insn, REG_UNUSED, operands[3]))
3085 return "move%.l %0,%3\;swap %3";
3091 (define_insn "udivmodhi4"
3092 [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
3093 (udiv:HI (match_operand:HI 1 "general_operand" "0")
3094 (match_operand:HI 2 "general_src_operand" "dmSKT")))
3095 (set (match_operand:HI 3 "nonimmediate_operand" "=d")
3096 (umod:HI (match_dup 1) (match_dup 2)))]
3097 "!TARGET_COLDFIRE || TARGET_CF_HWDIV"
3100 output_asm_insn (MOTOROLA ?
3101 "mvz%.w %0,%0\;divu%.w %2,%0" :
3102 "mvz%.w %0,%0\;divu %2,%0",
3105 output_asm_insn (MOTOROLA ?
3106 "and%.l #0xFFFF,%0\;divu%.w %2,%0" :
3107 "and%.l #0xFFFF,%0\;divu %2,%0",
3110 if (!find_reg_note(insn, REG_UNUSED, operands[3]))
3113 return "move%.l %0,%3\;swap %3";
3119 ;; logical-and instructions
3121 ;; "anddi3" is mainly here to help combine().
3122 (define_insn "anddi3"
3123 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3124 (and:DI (match_operand:DI 1 "general_operand" "%0,0")
3125 (match_operand:DI 2 "general_operand" "dn,don")))]
3129 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3130 if (CONSTANT_P (operands[2]))
3134 split_double (operands[2], &hi, &lo);
3136 switch (INTVAL (hi))
3139 output_asm_insn ("clr%.l %0", operands);
3147 xoperands[0] = operands[0];
3149 output_asm_insn (output_andsi3 (xoperands), xoperands);
3152 if (GET_CODE (operands[0]) == REG)
3153 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3155 operands[0] = adjust_address (operands[0], SImode, 4);
3156 switch (INTVAL (lo))
3159 output_asm_insn ("clr%.l %0", operands);
3167 xoperands[0] = operands[0];
3169 output_asm_insn (output_andsi3 (xoperands), xoperands);
3174 if (GET_CODE (operands[0]) != REG)
3176 operands[1] = adjust_address (operands[0], SImode, 4);
3177 return "and%.l %2,%0\;and%.l %R2,%1";
3179 if (GET_CODE (operands[2]) != REG)
3181 operands[1] = adjust_address (operands[2], SImode, 4);
3182 return "and%.l %2,%0\;and%.l %1,%R0";
3184 return "and%.l %2,%0\;and%.l %R2,%R0";
3187 ;; Prevent AND from being made with sp. This doesn't exist in the machine
3188 ;; and reload will cause inefficient code. Since sp is a FIXED_REG, we
3189 ;; can't allocate pseudos into it.
3191 (define_expand "andsi3"
3192 [(set (match_operand:SI 0 "not_sp_operand" "")
3193 (and:SI (match_operand:SI 1 "general_operand" "")
3194 (match_operand:SI 2 "general_src_operand" "")))]
3198 ;; produced by split operations after reload finished
3199 (define_insn "*andsi3_split"
3200 [(set (match_operand:SI 0 "register_operand" "=d")
3201 (and:SI (match_operand:SI 1 "register_operand" "0")
3202 (match_operand:SI 2 "const_int_operand" "i")))]
3203 "reload_completed && !TARGET_COLDFIRE"
3205 return output_andsi3 (operands);
3208 (define_insn "andsi3_internal"
3209 [(set (match_operand:SI 0 "not_sp_operand" "=m,d")
3210 (and:SI (match_operand:SI 1 "general_operand" "%0,0")
3211 (match_operand:SI 2 "general_src_operand" "dKT,dmSM")))]
3214 return output_andsi3 (operands);
3217 (define_insn "andsi3_5200"
3218 [(set (match_operand:SI 0 "not_sp_operand" "=m,d")
3219 (and:SI (match_operand:SI 1 "general_operand" "%0,0")
3220 (match_operand:SI 2 "general_src_operand" "d,dmsK")))]
3224 && DATA_REG_P (operands[0])
3225 && GET_CODE (operands[2]) == CONST_INT)
3227 if (INTVAL (operands[2]) == 0x000000ff)
3228 return "mvz%.b %0,%0";
3229 else if (INTVAL (operands[2]) == 0x0000ffff)
3230 return "mvz%.w %0,%0";
3232 return output_andsi3 (operands);
3235 (define_insn "andhi3"
3236 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
3237 (and:HI (match_operand:HI 1 "general_operand" "%0,0")
3238 (match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
3243 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3244 (and:HI (match_dup 0)
3245 (match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
3250 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3251 (and:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
3256 (define_insn "andqi3"
3257 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
3258 (and:QI (match_operand:QI 1 "general_operand" "%0,0")
3259 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
3264 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3265 (and:QI (match_dup 0)
3266 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
3271 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3272 (and:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
3277 ;; inclusive-or instructions
3279 (define_insn "iordi_zext"
3280 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3281 (ior:DI (zero_extend:DI (match_operand 1 "general_operand" "dn,dmn"))
3282 (match_operand:DI 2 "general_operand" "0,0")))]
3288 if (GET_CODE (operands[0]) == REG)
3289 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3291 operands[0] = adjust_address (operands[0], SImode, 4);
3292 if (GET_MODE (operands[1]) == SImode)
3293 return "or%.l %1,%0";
3294 byte_mode = (GET_MODE (operands[1]) == QImode);
3295 if (GET_CODE (operands[0]) == MEM)
3296 operands[0] = adjust_address (operands[0], byte_mode ? QImode : HImode,
3299 return "or%.b %1,%0";
3301 return "or%.w %1,%0";
3304 ;; "iordi3" is mainly here to help combine().
3305 (define_insn "iordi3"
3306 [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
3307 (ior:DI (match_operand:DI 1 "general_operand" "%0,0")
3308 (match_operand:DI 2 "general_operand" "dn,don")))]
3312 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3313 if (CONSTANT_P (operands[2]))
3317 split_double (operands[2], &hi, &lo);
3319 switch (INTVAL (hi))
3324 /* FIXME : a scratch register would be welcome here if operand[0]
3325 is not a register */
3326 output_asm_insn ("move%.l #-1,%0", operands);
3332 xoperands[0] = operands[0];
3334 output_asm_insn (output_iorsi3 (xoperands), xoperands);
3337 if (GET_CODE (operands[0]) == REG)
3338 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3340 operands[0] = adjust_address (operands[0], SImode, 4);
3341 switch (INTVAL (lo))
3346 /* FIXME : a scratch register would be welcome here if operand[0]
3347 is not a register */
3348 output_asm_insn ("move%.l #-1,%0", operands);
3354 xoperands[0] = operands[0];
3356 output_asm_insn (output_iorsi3 (xoperands), xoperands);
3361 if (GET_CODE (operands[0]) != REG)
3363 operands[1] = adjust_address (operands[0], SImode, 4);
3364 return "or%.l %2,%0\;or%.l %R2,%1";
3366 if (GET_CODE (operands[2]) != REG)
3368 operands[1] = adjust_address (operands[2], SImode, 4);
3369 return "or%.l %2,%0\;or%.l %1,%R0";
3371 return "or%.l %2,%0\;or%.l %R2,%R0";
3374 (define_expand "iorsi3"
3375 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3376 (ior:SI (match_operand:SI 1 "general_operand" "")
3377 (match_operand:SI 2 "general_src_operand" "")))]
3381 (define_insn "iorsi3_internal"
3382 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
3383 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
3384 (match_operand:SI 2 "general_src_operand" "dKT,dmSMT")))]
3387 return output_iorsi3 (operands);
3390 (define_insn "iorsi3_5200"
3391 [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
3392 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
3393 (match_operand:SI 2 "general_src_operand" "d,dmsK")))]
3396 return output_iorsi3 (operands);
3399 (define_insn "iorhi3"
3400 [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
3401 (ior:HI (match_operand:HI 1 "general_operand" "%0,0")
3402 (match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
3407 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3408 (ior:HI (match_dup 0)
3409 (match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
3414 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
3415 (ior:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
3420 (define_insn "iorqi3"
3421 [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
3422 (ior:QI (match_operand:QI 1 "general_operand" "%0,0")
3423 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
3428 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3429 (ior:QI (match_dup 0)
3430 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
3435 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
3436 (ior:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
3441 ;; On all 68k models, this makes faster code in a special case.
3442 ;; See also ashlsi_16, ashrsi_16 and lshrsi_16.
3444 (define_insn "iorsi_zexthi_ashl16"
3445 [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
3446 (ior:SI (zero_extend:SI (match_operand:HI 1 "general_operand" "rmn"))
3447 (ashift:SI (match_operand:SI 2 "general_operand" "or")
3452 if (GET_CODE (operands[2]) != REG)
3453 operands[2] = adjust_address (operands[2], HImode, 2);
3454 if (GET_CODE (operands[2]) != REG
3455 || REGNO (operands[2]) != REGNO (operands[0]))
3456 output_asm_insn ("move%.w %2,%0", operands);
3457 return "swap %0\;mov%.w %1,%0";
3460 (define_insn "iorsi_zext"
3461 [(set (match_operand:SI 0 "nonimmediate_operand" "=o,d")
3462 (ior:SI (zero_extend:SI (match_operand 1 "general_operand" "dn,dmn"))
3463 (match_operand:SI 2 "general_operand" "0,0")))]
3469 byte_mode = (GET_MODE (operands[1]) == QImode);
3470 if (GET_CODE (operands[0]) == MEM)
3471 operands[0] = adjust_address (operands[0], byte_mode ? QImode : HImode,
3474 return "or%.b %1,%0";
3476 return "or%.w %1,%0";
3481 ;; "xordi3" is mainly here to help combine().
3482 (define_insn "xordi3"
3483 [(set (match_operand:DI 0 "nonimmediate_operand" "=od")
3484 (xor:DI (match_operand:DI 1 "general_operand" "%0")
3485 (match_operand:DI 2 "general_operand" "dn")))]
3489 /* We can get CONST_DOUBLE, but also const1_rtx etc. */
3491 if (CONSTANT_P (operands[2]))
3495 split_double (operands[2], &hi, &lo);
3497 switch (INTVAL (hi))
3502 output_asm_insn ("not%.l %0", operands);
3505 /* FIXME : a scratch register would be welcome here if
3506 -128 <= INTVAL (hi) < -1 */
3510 xoperands[0] = operands[0];
3512 output_asm_insn (output_xorsi3 (xoperands), xoperands);
3515 if (GET_CODE (operands[0]) == REG)
3516 operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3518 operands[0] = adjust_address (operands[0], SImode, 4);
3519 switch (INTVAL (lo))
3524 output_asm_insn ("not%.l %0", operands);
3527 /* FIXME : a scratch register would be welcome here if
3528 -128 <= INTVAL (lo) < -1 */
3530 /* FIXME : this should be merged with xorsi3 */
3534 xoperands[0] = operands[0];
3536 output_asm_insn (output_xorsi3 (xoperands), xoperands);
3541 if (GET_CODE (operands[0]) != REG)
3543 operands[1] = adjust_address (operands[0], SImode, 4);
3544 return "eor%.l %2,%0\;eor%.l %R2,%1";
3546 if (GET_CODE (operands[2]) != REG)
3548 operands[1] = adjust_address (operands[2], SImode, 4);
3549 return "eor%.l %2,%0\;eor%.l %1,%R0";
3551 return "eor%.l %2,%0\;eor%.l %R2,%R0";
3554 (define_expand "xorsi3"
3555 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3556 (xor:SI (match_operand:SI 1 "general_operand" "")
3557 (match_operand:SI 2 "general_operand" "")))]
3561 (define_insn "xorsi3_internal"
3562 [(set (match_operand:SI 0 "nonimmediate_operand" "=do,m")
3563 (xor:SI (match_operand:SI 1 "general_operand" "%0,0")
3564 (match_operand:SI 2 "general_operand" "di,dKT")))]
3568 return output_xorsi3 (operands);
3571 (define_insn "xorsi3_5200"
3572 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm,d")
3573 (xor:SI (match_operand:SI 1 "general_operand" "%0,0")
3574 (match_operand:SI 2 "general_operand" "d,Ks")))]
3577 return output_xorsi3 (operands);
3580 (define_insn "xorhi3"
3581 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
3582 (xor:HI (match_operand:HI 1 "general_operand" "%0")
3583 (match_operand:HI 2 "general_operand" "dn")))]
3588 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3589 (xor:HI (match_dup 0)
3590 (match_operand:HI 1 "general_operand" "dn")))]
3595 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3596 (xor:HI (match_operand:HI 1 "general_operand" "dn")
3601 (define_insn "xorqi3"
3602 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
3603 (xor:QI (match_operand:QI 1 "general_operand" "%0")
3604 (match_operand:QI 2 "general_operand" "dn")))]
3609 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3610 (xor:QI (match_dup 0)
3611 (match_operand:QI 1 "general_operand" "dn")))]
3616 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3617 (xor:QI (match_operand:QI 1 "general_operand" "dn")
3622 ;; negation instructions
3624 (define_expand "negdi2"
3625 [(set (match_operand:DI 0 "nonimmediate_operand" "")
3626 (neg:DI (match_operand:DI 1 "general_operand" "")))]
3629 if (TARGET_COLDFIRE)
3630 emit_insn (gen_negdi2_5200 (operands[0], operands[1]));
3632 emit_insn (gen_negdi2_internal (operands[0], operands[1]));
3636 (define_insn "negdi2_internal"
3637 [(set (match_operand:DI 0 "nonimmediate_operand" "=<,do,!*a")
3638 (neg:DI (match_operand:DI 1 "general_operand" "0,0,0")))]
3641 if (which_alternative == 0)
3642 return "neg%.l %0\;negx%.l %0";
3643 if (GET_CODE (operands[0]) == REG)
3644 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3646 operands[1] = adjust_address (operands[0], SImode, 4);
3647 if (ADDRESS_REG_P (operands[0]))
3648 return "exg %/d0,%1\;neg%.l %/d0\;exg %/d0,%1\;exg %/d0,%0\;negx%.l %/d0\;exg %/d0,%0";
3650 return "neg%.l %1\;negx%.l %0";
3653 (define_insn "negdi2_5200"
3654 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
3655 (neg:DI (match_operand:DI 1 "general_operand" "0")))]
3658 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3659 return "neg%.l %1\;negx%.l %0";
3662 (define_expand "negsi2"
3663 [(set (match_operand:SI 0 "nonimmediate_operand" "")
3664 (neg:SI (match_operand:SI 1 "general_operand" "")))]
3667 if (TARGET_COLDFIRE)
3668 emit_insn (gen_negsi2_5200 (operands[0], operands[1]));
3670 emit_insn (gen_negsi2_internal (operands[0], operands[1]));
3674 (define_insn "negsi2_internal"
3675 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
3676 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
3680 (define_insn "negsi2_5200"
3681 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
3682 (neg:SI (match_operand:SI 1 "general_operand" "0")))]
3686 (define_insn "neghi2"
3687 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
3688 (neg:HI (match_operand:HI 1 "general_operand" "0")))]
3693 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
3694 (neg:HI (match_dup 0)))]
3698 (define_insn "negqi2"
3699 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
3700 (neg:QI (match_operand:QI 1 "general_operand" "0")))]
3705 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
3706 (neg:QI (match_dup 0)))]
3710 ;; If using software floating point, just flip the sign bit.
3712 (define_expand "negsf2"
3713 [(set (match_operand:SF 0 "nonimmediate_operand" "")
3714 (neg:SF (match_operand:SF 1 "general_operand" "")))]
3717 if (!TARGET_HARD_FLOAT)
3722 target = operand_subword_force (operands[0], 0, SFmode);
3723 result = expand_binop (SImode, xor_optab,
3724 operand_subword_force (operands[1], 0, SFmode),
3725 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
3726 gcc_assert (result);
3728 if (result != target)
3729 emit_move_insn (result, target);
3731 /* Make a place for REG_EQUAL. */
3732 emit_move_insn (operands[0], operands[0]);
3737 (define_expand "negdf2"
3738 [(set (match_operand:DF 0 "nonimmediate_operand" "")
3739 (neg:DF (match_operand:DF 1 "general_operand" "")))]
3742 if (!TARGET_HARD_FLOAT)
3749 target = operand_subword (operands[0], 0, 1, DFmode);
3750 result = expand_binop (SImode, xor_optab,
3751 operand_subword_force (operands[1], 0, DFmode),
3752 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
3753 gcc_assert (result);
3755 if (result != target)
3756 emit_move_insn (result, target);
3758 emit_move_insn (operand_subword (operands[0], 1, 1, DFmode),
3759 operand_subword_force (operands[1], 1, DFmode));
3761 insns = get_insns ();
3764 emit_no_conflict_block (insns, operands[0], operands[1], 0, 0);
3769 (define_expand "negxf2"
3770 [(set (match_operand:XF 0 "nonimmediate_operand" "")
3771 (neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
3781 target = operand_subword (operands[0], 0, 1, XFmode);
3782 result = expand_binop (SImode, xor_optab,
3783 operand_subword_force (operands[1], 0, XFmode),
3784 GEN_INT (-2147483647 - 1), target, 0, OPTAB_WIDEN);
3785 gcc_assert (result);
3787 if (result != target)
3788 emit_move_insn (result, target);
3790 emit_move_insn (operand_subword (operands[0], 1, 1, XFmode),
3791 operand_subword_force (operands[1], 1, XFmode));
3792 emit_move_insn (operand_subword (operands[0], 2, 1, XFmode),
3793 operand_subword_force (operands[1], 2, XFmode));
3795 insns = get_insns ();
3798 emit_no_conflict_block (insns, operands[0], operands[1], 0, 0);
3803 (define_insn "neg<mode>2_68881"
3804 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
3805 (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,0")))]
3808 if (DATA_REG_P (operands[0]))
3810 operands[1] = GEN_INT (31);
3811 return "bchg %1,%0";
3813 if (FP_REG_P (operands[1]))
3814 return "f<FP:round>neg%.x %1,%0";
3815 return "f<FP:round>neg%.<FP:prec> %f1,%0";
3818 (define_insn "neg<mode>2_cf"
3819 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
3820 (neg:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
3821 "TARGET_COLDFIRE_FPU"
3823 if (DATA_REG_P (operands[0]))
3825 operands[1] = GEN_INT (31);
3826 return "bchg %1,%0";
3828 if (FP_REG_P (operands[1]))
3829 return "f<FP:prec>neg%.d %1,%0";
3830 return "f<FP:prec>neg%.<FP:prec> %1,%0";
3833 ;; Sqrt instruction for the 68881
3835 (define_expand "sqrt<mode>2"
3836 [(set (match_operand:FP 0 "nonimmediate_operand" "")
3837 (sqrt:FP (match_operand:FP 1 "general_operand" "")))]
3841 (define_insn "sqrt<mode>2_68881"
3842 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3843 (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
3846 if (FP_REG_P (operands[1]))
3847 return "f<FP:round>sqrt%.x %1,%0";
3848 return "f<FP:round>sqrt%.<FP:prec> %1,%0";
3851 (define_insn "sqrt<mode>2_cf"
3852 [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
3853 (sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U")))]
3854 "TARGET_COLDFIRE_FPU"
3856 if (FP_REG_P (operands[1]))
3857 return "f<FP:prec>sqrt%.d %1,%0";
3858 return "f<FP:prec>sqrt%.<FP:prec> %1,%0";
3860 ;; Absolute value instructions
3861 ;; If using software floating point, just zero the sign bit.
3863 (define_expand "abssf2"
3864 [(set (match_operand:SF 0 "nonimmediate_operand" "")
3865 (abs:SF (match_operand:SF 1 "general_operand" "")))]
3868 if (!TARGET_HARD_FLOAT)
3873 target = operand_subword_force (operands[0], 0, SFmode);
3874 result = expand_binop (SImode, and_optab,
3875 operand_subword_force (operands[1], 0, SFmode),
3876 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
3877 gcc_assert (result);
3879 if (result != target)
3880 emit_move_insn (result, target);
3882 /* Make a place for REG_EQUAL. */
3883 emit_move_insn (operands[0], operands[0]);
3888 (define_expand "absdf2"
3889 [(set (match_operand:DF 0 "nonimmediate_operand" "")
3890 (abs:DF (match_operand:DF 1 "general_operand" "")))]
3893 if (!TARGET_HARD_FLOAT)
3900 target = operand_subword (operands[0], 0, 1, DFmode);
3901 result = expand_binop (SImode, and_optab,
3902 operand_subword_force (operands[1], 0, DFmode),
3903 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
3904 gcc_assert (result);
3906 if (result != target)
3907 emit_move_insn (result, target);
3909 emit_move_insn (operand_subword (operands[0], 1, 1, DFmode),
3910 operand_subword_force (operands[1], 1, DFmode));
3912 insns = get_insns ();
3915 emit_no_conflict_block (insns, operands[0], operands[1], 0, 0);
3920 (define_expand "absxf2"
3921 [(set (match_operand:XF 0 "nonimmediate_operand" "")
3922 (abs:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
3932 target = operand_subword (operands[0], 0, 1, XFmode);
3933 result = expand_binop (SImode, and_optab,
3934 operand_subword_force (operands[1], 0, XFmode),
3935 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);
3936 gcc_assert (result);
3938 if (result != target)
3939 emit_move_insn (result, target);
3941 emit_move_insn (operand_subword (operands[0], 1, 1, XFmode),
3942 operand_subword_force (operands[1], 1, XFmode));
3943 emit_move_insn (operand_subword (operands[0], 2, 1, XFmode),
3944 operand_subword_force (operands[1], 2, XFmode));
3946 insns = get_insns ();
3949 emit_no_conflict_block (insns, operands[0], operands[1], 0, 0);
3954 (define_insn "abs<mode>2_68881"
3955 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
3956 (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m<FP:const>,0")))]
3959 if (DATA_REG_P (operands[0]))
3961 operands[1] = GEN_INT (31);
3962 return "bclr %1,%0";
3964 if (FP_REG_P (operands[1]))
3965 return "f<FP:round>abs%.x %1,%0";
3966 return "f<FP:round>abs%.<FP:prec> %f1,%0";
3969 (define_insn "abs<mode>2_cf"
3970 [(set (match_operand:FP 0 "nonimmediate_operand" "=f,d")
3971 (abs:FP (match_operand:FP 1 "general_operand" "f<FP:dreg><Q>U,0")))]
3972 "TARGET_COLDFIRE_FPU"
3974 if (DATA_REG_P (operands[0]))
3976 operands[1] = GEN_INT (31);
3977 return "bclr %1,%0";
3979 if (FP_REG_P (operands[1]))
3980 return "f<FP:prec>abs%.d %1,%0";
3981 return "f<FP:prec>abs%.<FP:prec> %1,%0";
3984 ;; one complement instructions
3986 ;; "one_cmpldi2" is mainly here to help combine().
3987 (define_insn "one_cmpldi2"
3988 [(set (match_operand:DI 0 "nonimmediate_operand" "=dm")
3989 (not:DI (match_operand:DI 1 "general_operand" "0")))]
3993 if (GET_CODE (operands[0]) == REG)
3994 operands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
3995 else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC
3996 || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
3997 operands[1] = operands[0];
3999 operands[1] = adjust_address (operands[0], SImode, 4);
4000 return "not%.l %1\;not%.l %0";
4003 (define_expand "one_cmplsi2"
4004 [(set (match_operand:SI 0 "nonimmediate_operand" "")
4005 (not:SI (match_operand:SI 1 "general_operand" "")))]
4008 if (TARGET_COLDFIRE)
4009 emit_insn (gen_one_cmplsi2_5200 (operands[0], operands[1]));
4011 emit_insn (gen_one_cmplsi2_internal (operands[0], operands[1]));
4015 (define_insn "one_cmplsi2_internal"
4016 [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
4017 (not:SI (match_operand:SI 1 "general_operand" "0")))]
4021 (define_insn "one_cmplsi2_5200"
4022 [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
4023 (not:SI (match_operand:SI 1 "general_operand" "0")))]
4027 (define_insn "one_cmplhi2"
4028 [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
4029 (not:HI (match_operand:HI 1 "general_operand" "0")))]
4034 [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
4035 (not:HI (match_dup 0)))]
4039 (define_insn "one_cmplqi2"
4040 [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
4041 (not:QI (match_operand:QI 1 "general_operand" "0")))]
4046 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
4047 (not:QI (match_dup 0)))]
4051 ;; arithmetic shift instructions
4052 ;; We don't need the shift memory by 1 bit instruction
4054 (define_insn "ashldi_extsi"
4055 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro")
4057 (match_operator:DI 2 "extend_operator"
4058 [(match_operand:SI 1 "general_operand" "rm")])