1 ;; Machine Description for Renesas RX processors
2 ;; Copyright (C) 2008-2018 Free Software Foundation, Inc.
3 ;; Contributed by Red Hat.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
12 ;; GCC is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>.
22 ;; This code iterator is used for sign- and zero- extensions.
23 (define_mode_iterator small_int_modes [(HI "") (QI "")])
25 ;; This code iterator is used for max and min operations.
26 (define_mode_iterator int_modes [(SI "") (HI "") (QI "")])
28 ;; We do not handle DFmode here because it is either
29 ;; the same as SFmode, or if -m64bit-doubles is active
30 ;; then all operations on doubles have to be handled by
32 (define_mode_iterator register_modes
33 [(SF "") (SI "") (HI "") (QI "")])
54 (UNSPEC_BUILTIN_BRK 30)
55 (UNSPEC_BUILTIN_CLRPSW 31)
56 (UNSPEC_BUILTIN_INT 32)
57 (UNSPEC_BUILTIN_MACHI 33)
58 (UNSPEC_BUILTIN_MACLO 34)
59 (UNSPEC_BUILTIN_MULHI 35)
60 (UNSPEC_BUILTIN_MULLO 36)
61 (UNSPEC_BUILTIN_MVFACHI 37)
62 (UNSPEC_BUILTIN_MVFACMI 38)
63 (UNSPEC_BUILTIN_MVFC 39)
64 (UNSPEC_BUILTIN_MVFCP 40)
65 (UNSPEC_BUILTIN_MVTACHI 41)
66 (UNSPEC_BUILTIN_MVTACLO 42)
67 (UNSPEC_BUILTIN_MVTC 43)
68 (UNSPEC_BUILTIN_MVTIPL 44)
69 (UNSPEC_BUILTIN_RACW 45)
70 (UNSPEC_BUILTIN_REVW 46)
71 (UNSPEC_BUILTIN_RMPA 47)
72 (UNSPEC_BUILTIN_ROUND 48)
73 (UNSPEC_BUILTIN_SAT 49)
74 (UNSPEC_BUILTIN_SETPSW 50)
75 (UNSPEC_BUILTIN_WAIT 51)
91 (define_attr "length" "" (const_int 8))
93 (include "predicates.md")
94 (include "constraints.md")
96 ;; Pipeline description.
98 ;; The RX only has a single pipeline. It has five stages (fetch,
99 ;; decode, execute, memory access, writeback) each of which normally
100 ;; takes a single CPU clock cycle.
102 ;; The timings attribute consists of two numbers, the first is the
103 ;; throughput, which is the number of cycles the instruction takes
104 ;; to execute and generate a result. The second is the latency
105 ;; which is the effective number of cycles the instruction takes to
106 ;; execute if its result is used by the following instruction. The
107 ;; latency is always greater than or equal to the throughput.
108 ;; These values were taken from tables 2.13 and 2.14 in section 2.8
109 ;; of the RX610 Group Hardware Manual v0.11
111 ;; Note - it would be nice to use strings rather than integers for
112 ;; the possible values of this attribute, so that we can have the
113 ;; gcc build mechanism check for values that are not supported by
114 ;; the reservations below. But this will not work because the code
115 ;; in rx_adjust_sched_cost() needs integers not strings.
117 (define_attr "timings" "" (const_int 11))
119 (define_automaton "pipelining")
120 (define_cpu_unit "throughput" "pipelining")
122 (define_insn_reservation "throughput__1_latency__1" 1
123 (eq_attr "timings" "11") "throughput")
124 (define_insn_reservation "throughput__1_latency__2" 2
125 (eq_attr "timings" "12") "throughput,nothing")
126 (define_insn_reservation "throughput__2_latency__2" 1
127 (eq_attr "timings" "22") "throughput*2")
128 (define_insn_reservation "throughput__3_latency__3" 1
129 (eq_attr "timings" "33") "throughput*3")
130 (define_insn_reservation "throughput__3_latency__4" 2
131 (eq_attr "timings" "34") "throughput*3,nothing")
132 (define_insn_reservation "throughput__4_latency__4" 1
133 (eq_attr "timings" "44") "throughput*4")
134 (define_insn_reservation "throughput__4_latency__5" 2
135 (eq_attr "timings" "45") "throughput*4,nothing")
136 (define_insn_reservation "throughput__5_latency__5" 1
137 (eq_attr "timings" "55") "throughput*5")
138 (define_insn_reservation "throughput__5_latency__6" 2
139 (eq_attr "timings" "56") "throughput*5,nothing")
140 (define_insn_reservation "throughput__6_latency__6" 1
141 (eq_attr "timings" "66") "throughput*6")
142 (define_insn_reservation "throughput_10_latency_10" 1
143 (eq_attr "timings" "1010") "throughput*10")
144 (define_insn_reservation "throughput_11_latency_11" 1
145 (eq_attr "timings" "1111") "throughput*11")
146 (define_insn_reservation "throughput_16_latency_16" 1
147 (eq_attr "timings" "1616") "throughput*16")
148 (define_insn_reservation "throughput_18_latency_18" 1
149 (eq_attr "timings" "1818") "throughput*18")
151 ;; ----------------------------------------------------------------------------
155 ;; Note - we do not specify the two instructions necessary to perform
156 ;; a compare-and-branch in the cbranchsi4 pattern because that would
157 ;; allow the comparison to be moved away from the jump before the reload
158 ;; pass has completed. That would be problematical because reload can
159 ;; generate ADDSI3 instructions which would corrupt the PSW flags.
161 (define_expand "cbranchsi4"
164 (match_operator 0 "comparison_operator"
165 [(match_operand:SI 1 "register_operand")
166 (match_operand:SI 2 "rx_source_operand")])
167 (label_ref (match_operand 3 ""))
172 (define_insn_and_split "*cbranchsi4"
175 (match_operator 3 "comparison_operator"
176 [(match_operand:SI 0 "register_operand" "r")
177 (match_operand:SI 1 "rx_source_operand" "riQ")])
178 (match_operand 2 "label_ref_operand" "")
185 rx_split_cbranch (CCmode, GET_CODE (operands[3]),
186 operands[0], operands[1], operands[2]);
190 (define_insn "*cmpsi"
191 [(set (reg:CC CC_REG)
192 (compare:CC (match_operand:SI 0 "register_operand" "r,r,r,r,r,r,r")
193 (match_operand:SI 1 "rx_source_operand" "r,Uint04,Int08,Sint16,Sint24,i,Q")))]
196 [(set_attr "timings" "11,11,11,11,11,11,33")
197 (set_attr "length" "2,2,3,4,5,6,5")]
200 ;; Canonical method for representing TST.
201 (define_insn_and_split "*cbranchsi4_tst"
204 (match_operator 3 "rx_zs_comparison_operator"
205 [(and:SI (match_operand:SI 0 "register_operand" "r")
206 (match_operand:SI 1 "rx_source_operand" "riQ"))
208 (match_operand 2 "label_ref_operand" "")
215 rx_split_cbranch (CC_ZSmode, GET_CODE (operands[3]),
216 XEXP (operands[3], 0), XEXP (operands[3], 1),
221 ;; Various other ways that GCC codes "var & const"
222 (define_insn_and_split "*cbranchsi4_tst_ext"
225 (match_operator 4 "rx_z_comparison_operator"
227 (match_operand:SI 0 "register_operand" "r")
228 (match_operand:SI 1 "rx_constshift_operand" "")
229 (match_operand:SI 2 "rx_constshift_operand" ""))
231 (match_operand 3 "label_ref_operand" "")
242 mask <<= INTVAL (operands[1]);
244 mask <<= INTVAL (operands[2]);
245 x = gen_rtx_AND (SImode, operands[0], gen_int_mode (mask, SImode));
247 rx_split_cbranch (CC_ZSmode, GET_CODE (operands[4]),
248 x, const0_rtx, operands[3]);
252 (define_insn "*tstsi"
253 [(set (reg:CC_ZS CC_REG)
255 (and:SI (match_operand:SI 0 "register_operand" "r,r,r")
256 (match_operand:SI 1 "rx_source_operand" "r,i,Q"))
260 [(set_attr "timings" "11,11,33")
261 (set_attr "length" "3,7,6")]
264 (define_expand "cbranchsf4"
267 (match_operator 0 "rx_fp_comparison_operator"
268 [(match_operand:SF 1 "register_operand")
269 (match_operand:SF 2 "rx_source_operand")])
270 (label_ref (match_operand 3 ""))
275 (define_insn_and_split "*cbranchsf4"
278 (match_operator 3 "rx_fp_comparison_operator"
279 [(match_operand:SF 0 "register_operand" "r")
280 (match_operand:SF 1 "rx_source_operand" "rFQ")])
281 (match_operand 2 "label_ref_operand" "")
285 "&& reload_completed"
288 rx_split_cbranch (CC_Fmode, GET_CODE (operands[3]),
289 operands[0], operands[1], operands[2]);
293 (define_insn "*cmpsf"
294 [(set (reg:CC_F CC_REG)
296 (match_operand:SF 0 "register_operand" "r,r,r")
297 (match_operand:SF 1 "rx_source_operand" "r,F,Q")))]
298 "ALLOW_RX_FPU_INSNS && reload_completed"
300 [(set_attr "timings" "11,11,33")
301 (set_attr "length" "3,7,5")]
304 ;; Flow Control Instructions:
306 (define_insn "*conditional_branch"
309 (match_operator 1 "comparison_operator"
310 [(reg CC_REG) (const_int 0)])
311 (label_ref (match_operand 0 "" ""))
315 [(set_attr "length" "8") ;; This length is wrong, but it is
316 ;; too hard to compute statically.
317 (set_attr "timings" "33")] ;; The timing assumes that the branch is taken.
320 ;; ----------------------------------------------------------------------------
324 (label_ref (match_operand 0 "" "")))]
327 [(set_attr "length" "4")
328 (set_attr "timings" "33")]
331 (define_insn "indirect_jump"
333 (match_operand:SI 0 "register_operand" "r"))]
336 [(set_attr "length" "2")
337 (set_attr "timings" "33")]
340 (define_insn "tablejump"
342 (match_operand:SI 0 "register_operand" "r"))
343 (use (label_ref (match_operand 1 "" "")))]
345 { return TARGET_PID ? (TARGET_AS100_SYNTAX ? "\n?:\tbra\t%0"
349 [(set_attr "timings" "33")
350 (set_attr "length" "2")]
353 (define_expand "return"
355 "rx_can_use_simple_return ()"
356 "rx_expand_epilogue (false); DONE;"
359 (define_insn "simple_return"
363 [(set_attr "length" "1")
364 (set_attr "timings" "55")]
367 ;; Unspec used so that the constant will not be invalid
368 ;; if -mmax-constant-size has been specified.
369 (define_insn "deallocate_and_return"
370 [(set (reg:SI SP_REG)
371 (plus:SI (reg:SI SP_REG)
372 (const:SI (unspec:SI [(match_operand 0 "const_int_operand" "n")] UNSPEC_CONST))))
376 [(set_attr "length" "2")
377 (set_attr "timings" "55")]
380 (define_insn "pop_and_return"
381 [(match_parallel 1 "rx_rtsd_vector"
382 [(set (reg:SI SP_REG)
383 (plus:SI (reg:SI SP_REG)
384 (match_operand:SI 0 "const_int_operand" "n")))])
388 rx_emit_stack_popm (operands, false);
391 [(set_attr "length" "3")
392 (set_attr "timings" "56")]
395 (define_insn "fast_interrupt_return"
396 [(unspec_volatile [(return)] UNSPEC_RTFI) ]
399 [(set_attr "length" "2")
400 (set_attr "timings" "33")]
403 (define_insn "exception_return"
404 [(unspec_volatile [(return)] UNSPEC_RTE) ]
407 [(set_attr "length" "2")
408 (set_attr "timings" "66")]
411 (define_insn "naked_return"
412 [(unspec_volatile [(return)] UNSPEC_NAKED) ]
414 "; Naked function: epilogue provided by programmer."
418 ;; Note - the following set of patterns do not use the "memory_operand"
419 ;; predicate or an "m" constraint because we do not allow symbol_refs
420 ;; or label_refs as legitimate memory addresses. This matches the
421 ;; behavior of most of the RX instructions. Only the call/branch
422 ;; instructions are allowed to refer to symbols/labels directly.
423 ;; The call operands are in QImode because that is the value of
426 (define_expand "call"
427 [(call (match_operand:QI 0 "general_operand")
428 (match_operand:SI 1 "general_operand"))]
431 rtx dest = XEXP (operands[0], 0);
433 if (! rx_call_operand (dest, Pmode))
434 dest = force_reg (Pmode, dest);
435 emit_call_insn (gen_call_internal (dest));
440 (define_insn "call_internal"
441 [(call (mem:QI (match_operand:SI 0 "rx_call_operand" "r,CALL_OP_SYMBOL_REF"))
443 (clobber (reg:CC CC_REG))]
448 [(set_attr "length" "2,4")
449 (set_attr "timings" "33")]
452 (define_expand "call_value"
453 [(set (match_operand 0 "register_operand")
454 (call (match_operand:QI 1 "general_operand")
455 (match_operand:SI 2 "general_operand")))]
458 rtx dest = XEXP (operands[1], 0);
460 if (! rx_call_operand (dest, Pmode))
461 dest = force_reg (Pmode, dest);
462 emit_call_insn (gen_call_value_internal (operands[0], dest));
467 (define_insn "call_value_internal"
468 [(set (match_operand 0 "register_operand" "=r,r")
469 (call (mem:QI (match_operand:SI 1 "rx_call_operand" "r,CALL_OP_SYMBOL_REF"))
471 (clobber (reg:CC CC_REG))]
476 [(set_attr "length" "2,4")
477 (set_attr "timings" "33")]
480 ;; Note - we do not allow indirect sibcalls (with the address
481 ;; held in a register) because we cannot guarantee that the register
482 ;; chosen will be a call-used one. If it is a call-saved register,
483 ;; then the epilogue code will corrupt it by popping the saved value
485 (define_expand "sibcall"
487 [(call (mem:QI (match_operand:SI 0 "rx_symbolic_call_operand"))
488 (match_operand:SI 1 "general_operand"))
492 if (MEM_P (operands[0]))
493 operands[0] = XEXP (operands[0], 0);
494 emit_call_insn (gen_sibcall_internal (operands[0]));
499 (define_insn "sibcall_internal"
500 [(call (mem:QI (match_operand:SI 0 "rx_symbolic_call_operand" "Symbol"))
505 [(set_attr "length" "4")
506 (set_attr "timings" "33")]
509 (define_expand "sibcall_value"
511 [(set (match_operand 0 "register_operand")
512 (call (mem:QI (match_operand:SI 1 "rx_symbolic_call_operand"))
513 (match_operand:SI 2 "general_operand")))
517 if (MEM_P (operands[1]))
518 operands[1] = XEXP (operands[1], 0);
519 emit_call_insn (gen_sibcall_value_internal (operands[0], operands[1]));
524 (define_insn "sibcall_value_internal"
525 [(set (match_operand 0 "register_operand" "=r")
526 (call (mem:QI (match_operand:SI 1 "rx_symbolic_call_operand" "Symbol"))
531 [(set_attr "length" "4")
532 (set_attr "timings" "33")]
535 ;; Function Prologue/Epilogue Instructions
537 (define_expand "prologue"
540 "rx_expand_prologue (); DONE;"
543 (define_expand "epilogue"
546 "rx_expand_epilogue (false); DONE;"
549 (define_expand "sibcall_epilogue"
552 "rx_expand_epilogue (true); DONE;"
557 ;; Note - we do not allow memory to memory moves, even though the ISA
558 ;; supports them. The reason is that the conditions on such moves are
559 ;; too restrictive, specifically the source addressing mode is limited
560 ;; by the destination addressing mode and vice versa. (For example it
561 ;; is not possible to use indexed register indirect addressing for one
562 ;; of the operands if the other operand is anything other than a register,
563 ;; but it is possible to use register relative addressing when the other
564 ;; operand also uses register relative or register indirect addressing).
566 ;; GCC does not support computing legitimate addresses based on the
567 ;; nature of other operands involved in the instruction, and reload is
568 ;; not smart enough to cope with a whole variety of different memory
569 ;; addressing constraints, so it is simpler and safer to just refuse
570 ;; to support memory to memory moves.
572 (define_expand "mov<register_modes:mode>"
573 [(set (match_operand:register_modes 0 "general_operand")
574 (match_operand:register_modes 1 "general_operand"))]
577 if (MEM_P (operands[0]) && MEM_P (operands[1]))
578 operands[1] = copy_to_mode_reg (<register_modes:MODE>mode, operands[1]);
579 operands[0] = rx_maybe_pidify_operand (operands[0], 0);
580 operands[1] = rx_maybe_pidify_operand (operands[1], 0);
581 if (GET_CODE (operands[0]) != REG
582 && GET_CODE (operands[1]) == PLUS)
583 operands[1] = copy_to_mode_reg (<register_modes:MODE>mode, operands[1]);
584 if (GET_CODE (operands[1]) == PLUS && GET_MODE (operands[1]) == SImode)
586 emit_insn (gen_addsi3 (operands[0], XEXP (operands[1], 0), XEXP (operands[1], 1)));
589 if (CONST_INT_P (operand1)
590 && ! rx_is_legitimate_constant (<register_modes:MODE>mode, operand1))
595 (define_insn "*mov<register_modes:mode>_internal"
596 [(set (match_operand:register_modes
597 0 "nonimmediate_operand" "=r,r,r,r,r,r,m,Q,Q,Q,Q,r")
598 (match_operand:register_modes
599 1 "general_operand" "Int08,Sint16,Sint24,i,r,m,r,Int08,Sint16,Sint24,i,RpdaRpid"))]
601 { return rx_gen_move_template (operands, false); }
602 [(set_attr "length" "3,4,5,6,2,4,6,5,6,7,8,8")
603 (set_attr "timings" "11,11,11,11,11,12,11,11,11,11,11,11")]
606 (define_insn "extend<small_int_modes:mode>si2"
607 [(set (match_operand:SI 0 "register_operand" "=r,r")
608 (sign_extend:SI (match_operand:small_int_modes
609 1 "nonimmediate_operand" "r,m")))]
611 { return rx_gen_move_template (operands, false); }
612 [(set_attr "length" "2,6")
613 (set_attr "timings" "11,12")]
616 (define_insn "zero_extend<small_int_modes:mode>si2"
617 [(set (match_operand:SI 0 "register_operand" "=r,r")
618 (zero_extend:SI (match_operand:small_int_modes
619 1 "nonimmediate_operand" "r,m")))]
621 { return rx_gen_move_template (operands, true); }
622 [(set_attr "length" "2,4")
623 (set_attr "timings" "11,12")]
626 (define_insn "stack_push"
627 [(set (reg:SI SP_REG)
628 (minus:SI (reg:SI SP_REG)
630 (set (mem:SI (minus:SI (reg:SI SP_REG) (const_int 4)))
631 (match_operand:SI 0 "register_operand" "r"))]
634 [(set_attr "length" "2")]
637 (define_insn "stack_pushm"
638 [(match_parallel 1 "rx_store_multiple_vector"
639 [(set (reg:SI SP_REG)
640 (minus:SI (reg:SI SP_REG)
641 (match_operand:SI 0 "const_int_operand" "n")))])]
644 rx_emit_stack_pushm (operands);
647 [(set_attr "length" "2")
648 (set_attr "timings" "44")] ;; The timing is a guesstimate average timing.
651 (define_insn "stack_pop"
652 [(set (match_operand:SI 0 "register_operand" "=r")
653 (mem:SI (reg:SI SP_REG)))
655 (plus:SI (reg:SI SP_REG)
659 [(set_attr "length" "2")
660 (set_attr "timings" "12")]
663 (define_insn "stack_popm"
664 [(match_parallel 1 "rx_load_multiple_vector"
665 [(set (reg:SI SP_REG)
666 (plus:SI (reg:SI SP_REG)
667 (match_operand:SI 0 "const_int_operand" "n")))])]
670 rx_emit_stack_popm (operands, true);
673 [(set_attr "length" "2")
674 (set_attr "timings" "45")] ;; The timing is a guesstimate average timing.
677 (define_insn_and_split "cstoresi4"
678 [(set (match_operand:SI 0 "register_operand" "=r")
679 (match_operator:SI 1 "comparison_operator"
680 [(match_operand:SI 2 "register_operand" "r")
681 (match_operand:SI 3 "rx_source_operand" "riQ")]))
682 (clobber (reg:CC CC_REG))]
690 flags = gen_rtx_REG (CCmode, CC_REG);
691 x = gen_rtx_COMPARE (CCmode, operands[2], operands[3]);
692 x = gen_rtx_SET (flags, x);
695 x = gen_rtx_fmt_ee (GET_CODE (operands[1]), SImode, flags, const0_rtx);
696 x = gen_rtx_SET (operands[0], x);
702 [(set (match_operand:SI 0 "register_operand" "=r")
703 (match_operator:SI 1 "comparison_operator"
704 [(reg CC_REG) (const_int 0)]))]
707 [(set_attr "length" "3")]
710 (define_insn_and_split "cstoresf4"
711 [(set (match_operand:SI 0 "register_operand" "=r")
712 (match_operator:SI 1 "rx_fp_comparison_operator"
713 [(match_operand:SF 2 "register_operand" "r")
714 (match_operand:SF 3 "rx_source_operand" "rFQ")]))]
722 flags = gen_rtx_REG (CC_Fmode, CC_REG);
723 x = gen_rtx_COMPARE (CC_Fmode, operands[2], operands[3]);
724 x = gen_rtx_SET (flags, x);
727 x = gen_rtx_fmt_ee (GET_CODE (operands[1]), SImode, flags, const0_rtx);
728 x = gen_rtx_SET (operands[0], x);
733 (define_expand "movsicc"
735 [(set (match_operand:SI 0 "register_operand")
736 (if_then_else:SI (match_operand 1 "comparison_operator")
737 (match_operand:SI 2 "nonmemory_operand")
738 (match_operand:SI 3 "nonmemory_operand")))
739 (clobber (reg:CC CC_REG))])]
742 /* Make sure that we have an integer comparison... */
743 if (GET_MODE (XEXP (operands[1], 0)) != CCmode
744 && GET_MODE (XEXP (operands[1], 0)) != SImode)
747 /* One operand must be a constant or a register, the other must be a register. */
748 if ( ! CONSTANT_P (operands[2])
749 && ! CONSTANT_P (operands[3])
750 && ! (REG_P (operands[2]) && REG_P (operands[3])))
754 (define_insn_and_split "*movsicc"
755 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
757 (match_operator 5 "comparison_operator"
758 [(match_operand:SI 3 "register_operand" "r,r,r")
759 (match_operand:SI 4 "rx_source_operand" "riQ,riQ,riQ")])
760 (match_operand:SI 1 "nonmemory_operand" "i,ri,r")
761 (match_operand:SI 2 "nonmemory_operand" "ri,i,r")))
762 (clobber (reg:CC CC_REG))]
763 "(CONSTANT_P (operands[1]) || CONSTANT_P (operands[2]))
764 || (REG_P (operands[1]) && REG_P (operands[2]))"
766 "&& reload_completed"
769 rtx x, flags, op0, op1, op2;
770 enum rtx_code cmp_code;
772 flags = gen_rtx_REG (CCmode, CC_REG);
773 x = gen_rtx_COMPARE (CCmode, operands[3], operands[4]);
774 emit_insn (gen_rtx_SET (flags, x));
776 cmp_code = GET_CODE (operands[5]);
781 /* If OP2 is the constant, reverse the sense of the move.
782 Likewise if both operands are registers but OP1 == OP0. */
783 if ((! CONSTANT_P (operands[1]) && CONSTANT_P (operands[2]))
784 || (REG_P (operands[1]) && REG_P (operands[2])
785 && rtx_equal_p (op0, op1)))
787 x = op1, op1 = op2, op2 = x;
788 cmp_code = reverse_condition (cmp_code);
791 /* If OP2 does not match the output, copy it into place. We have allowed
792 these alternatives so that the destination can legitimately be one of
793 the comparison operands without increasing register pressure. */
794 if (! rtx_equal_p (op0, op2))
795 emit_move_insn (op0, op2);
797 x = gen_rtx_fmt_ee (cmp_code, VOIDmode, flags, const0_rtx);
798 x = gen_rtx_IF_THEN_ELSE (SImode, x, op1, op0);
799 emit_insn (gen_rtx_SET (op0, x));
804 [(set (match_operand:SI 0 "register_operand" "+r,r,r,r")
806 (match_operator 2 "rx_z_comparison_operator"
807 [(reg CC_REG) (const_int 0)])
808 (match_operand:SI 1 "immediate_operand" "Sint08,Sint16,Sint24,i")
811 && ((GET_CODE (operands[2]) == EQ) || (GET_CODE (operands[2]) == NE))"
813 if (GET_CODE (operands[2]) == EQ)
814 return "stz\t%1, %0";
816 return "stnz\t%1, %0";
818 [(set_attr "length" "4,5,6,7")]
821 (define_insn "*stcc_reg"
822 [(set (match_operand:SI 0 "register_operand" "+r,r,r,r,r,r")
824 (match_operator 2 "comparison_operator"
825 [(reg CC_REG) (const_int 0)])
826 (match_operand:SI 1 "nonmemory_operand"
827 "r,Uint04,Sint08,Sint16,Sint24,i")
831 PUT_CODE (operands[2], reverse_condition (GET_CODE (operands[2])));
832 return "b%B2 1f\n\tmov %1, %0\n1:";
834 [(set_attr "length" "3,3,4,5,6,7")]
837 ;; Arithmetic Instructions
839 (define_insn "abssi2"
840 [(set (match_operand:SI 0 "register_operand" "=r,r")
841 (abs:SI (match_operand:SI 1 "register_operand" "0,r")))
842 (clobber (reg:CC CC_REG))]
847 [(set_attr "length" "2,3")]
850 (define_insn "*abssi2_flags"
852 (compare (abs:SI (match_operand:SI 1 "register_operand" "0,r"))
854 (set (match_operand:SI 0 "register_operand" "=r,r")
855 (abs:SI (match_dup 1)))]
856 ;; Note - although the ABS instruction does set the O bit in the processor
857 ;; status word, it does not do so in a way that is comparable with the CMP
858 ;; instruction. Hence we use CC_ZSmode rather than CC_ZSOmode.
859 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
863 [(set_attr "length" "2,3")]
866 (define_expand "addsi3"
867 [(parallel [(set (match_operand:SI 0 "register_operand" "")
868 (plus:SI (match_operand:SI 1 "register_operand" "")
869 (match_operand:SI 2 "rx_source_operand" "")))
870 (clobber (reg:CC CC_REG))])]
873 operands[0] = rx_maybe_pidify_operand (operands[0], 1);
874 operands[1] = rx_maybe_pidify_operand (operands[1], 1);
875 operands[2] = rx_maybe_pidify_operand (operands[2], 1);
879 (define_insn "addsi3_internal"
880 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r,r,r,r,r,r")
881 (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,0,r,r,r,r,r,r,0")
882 (match_operand:SI 2 "rx_source_operand" "r,Uint04,NEGint4,Sint08,Sint16,Sint24,i,0,r,Sint08,Sint16,Sint24,i,Q")))
883 (clobber (reg:CC CC_REG))]
900 [(set_attr "timings" "11,11,11,11,11,11,11,11,11,11,11,11,11,33")
901 (set_attr "length" "2,2,2,3,4,5,6,2,3,3,4,5,6,5")]
904 (define_insn "*addsi3_flags"
906 (compare (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,0,r,r,r,r,r,r,0")
907 (match_operand:SI 2 "rx_source_operand" "r,Uint04,NEGint4,Sint08,Sint16,Sint24,i,0,r,Sint08,Sint16,Sint24,i,Q"))
909 (set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r,r,r,r,r,r")
910 (plus:SI (match_dup 1) (match_dup 2)))]
911 "reload_completed && rx_match_ccmode (insn, CC_ZSCmode)"
927 [(set_attr "timings" "11,11,11,11,11,11,11,11,11,11,11,11,11,33")
928 (set_attr "length" "2,2,2,3,4,5,6,2,3,3,4,5,6,5")]
931 ;; A helper to expand the above with the CC_MODE filled in.
932 (define_expand "addsi3_flags"
933 [(parallel [(set (reg:CC_ZSC CC_REG)
935 (plus:SI (match_operand:SI 1 "register_operand")
936 (match_operand:SI 2 "rx_source_operand"))
938 (set (match_operand:SI 0 "register_operand")
939 (plus:SI (match_dup 1) (match_dup 2)))])]
942 (define_insn "adc_internal"
943 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
946 (ltu:SI (reg:CC CC_REG) (const_int 0))
947 (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0"))
948 (match_operand:SI 2 "rx_source_operand" "r,Sint08,Sint16,Sint24,i,Q")))
949 (clobber (reg:CC CC_REG))]
952 [(set_attr "timings" "11,11,11,11,11,33")
953 (set_attr "length" "3,4,5,6,7,6")]
956 (define_insn "*adc_flags"
961 (ltu:SI (reg:CC CC_REG) (const_int 0))
962 (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0"))
963 (match_operand:SI 2 "rx_source_operand" "r,Sint08,Sint16,Sint24,i,Q"))
965 (set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
968 (ltu:SI (reg:CC CC_REG) (const_int 0))
971 "reload_completed && rx_match_ccmode (insn, CC_ZSCmode)"
973 [(set_attr "timings" "11,11,11,11,11,33")
974 (set_attr "length" "3,4,5,6,7,6")]
977 ;; Peepholes to match:
978 ;; (set (reg A) (reg B))
979 ;; (set (CC) (compare:CC (reg A/reg B) (const_int 0)))
980 ;; and replace them with the addsi3_flags pattern, using an add
981 ;; of zero to copy the register and set the condition code bits.
983 [(set (match_operand:SI 0 "register_operand")
984 (match_operand:SI 1 "register_operand"))
986 (compare:CC (match_dup 0)
989 [(parallel [(set (reg:CC_ZSC CC_REG)
990 (compare:CC_ZSC (plus:SI (match_dup 1) (const_int 0))
993 (plus:SI (match_dup 1) (const_int 0))) ])]
997 [(set (match_operand:SI 0 "register_operand")
998 (match_operand:SI 1 "register_operand"))
1000 (compare:CC (match_dup 1)
1003 [(parallel [(set (reg:CC_ZSC CC_REG)
1004 (compare:CC_ZSC (plus:SI (match_dup 1) (const_int 0))
1007 (plus:SI (match_dup 1) (const_int 0)))])]
1010 (define_expand "adddi3"
1011 [(set (match_operand:DI 0 "register_operand")
1012 (plus:DI (match_operand:DI 1 "register_operand")
1013 (match_operand:DI 2 "rx_source_operand")))]
1016 rtx op0l, op0h, op1l, op1h, op2l, op2h;
1018 op0l = gen_lowpart (SImode, operands[0]);
1019 op1l = gen_lowpart (SImode, operands[1]);
1020 op2l = gen_lowpart (SImode, operands[2]);
1021 op0h = gen_highpart (SImode, operands[0]);
1022 op1h = gen_highpart (SImode, operands[1]);
1023 op2h = gen_highpart_mode (SImode, DImode, operands[2]);
1025 emit_insn (gen_adddi3_internal (op0l, op0h, op1l, op2l, op1h, op2h));
1029 (define_insn_and_split "adddi3_internal"
1030 [(set (match_operand:SI 0 "register_operand" "=&r")
1031 (plus:SI (match_operand:SI 2 "register_operand" "r")
1032 (match_operand:SI 3 "rx_source_operand" "riQ")))
1033 (set (match_operand:SI 1 "register_operand" "=r")
1036 (ltu:SI (plus:SI (match_dup 2) (match_dup 3)) (match_dup 2))
1037 (match_operand:SI 4 "register_operand" "%1"))
1038 (match_operand:SI 5 "rx_source_operand" "riQ")))
1039 (clobber (match_scratch:SI 6 "=&r"))
1040 (clobber (reg:CC CC_REG))]
1046 rtx op0l = operands[0];
1047 rtx op0h = operands[1];
1048 rtx op1l = operands[2];
1049 rtx op2l = operands[3];
1050 rtx op1h = operands[4];
1051 rtx op2h = operands[5];
1052 rtx scratch = operands[6];
1055 if (reg_overlap_mentioned_p (op0l, op1h))
1057 emit_move_insn (scratch, op0l);
1059 if (reg_overlap_mentioned_p (op0l, op2h))
1062 else if (reg_overlap_mentioned_p (op0l, op2h))
1064 emit_move_insn (scratch, op0l);
1068 if (rtx_equal_p (op0l, op1l))
1070 /* It is preferable that op0l == op1l... */
1071 else if (rtx_equal_p (op0l, op2l))
1072 x = op1l, op1l = op2l, op2l = x;
1073 /* ... but it is only a requirement if op2l == MEM. */
1074 else if (MEM_P (op2l))
1076 /* Let's hope that we still have a scratch register free. */
1077 gcc_assert (op1h != scratch);
1078 emit_move_insn (scratch, op2l);
1082 emit_insn (gen_addsi3_flags (op0l, op1l, op2l));
1084 if (rtx_equal_p (op0h, op1h))
1086 else if (rtx_equal_p (op0h, op2h))
1087 x = op1h, op1h = op2h, op2h = x;
1090 emit_move_insn (op0h, op1h);
1093 emit_insn (gen_adc_internal (op0h, op1h, op2h));
1097 (define_insn "andsi3"
1098 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
1099 (and:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r,0")
1100 (match_operand:SI 2 "rx_source_operand" "r,Uint04,Sint08,Sint16,Sint24,i,0,r,Q")))
1101 (clobber (reg:CC CC_REG))]
1113 [(set_attr "timings" "11,11,11,11,11,11,11,11,33")
1114 (set_attr "length" "2,2,3,4,5,6,2,5,5")]
1117 (define_insn "*andsi3_flags"
1119 (compare (and:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r,0")
1120 (match_operand:SI 2 "rx_source_operand" "r,Uint04,Sint08,Sint16,Sint24,i,0,r,Q"))
1122 (set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
1123 (and:SI (match_dup 1) (match_dup 2)))]
1124 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1135 [(set_attr "timings" "11,11,11,11,11,11,11,11,33")
1136 (set_attr "length" "2,2,3,4,5,6,2,5,5")]
1139 ;; Byte swap (single 32-bit value).
1140 (define_insn "bswapsi2"
1141 [(set (match_operand:SI 0 "register_operand" "=r")
1142 (bswap:SI (match_operand:SI 1 "register_operand" "r")))]
1145 [(set_attr "length" "3")]
1148 ;; Byte swap (single 16-bit value). Note - we ignore the swapping of the high 16-bits.
1149 (define_insn "bswaphi2"
1150 [(set (match_operand:HI 0 "register_operand" "=r")
1151 (bswap:HI (match_operand:HI 1 "register_operand" "r")))]
1154 [(set_attr "length" "3")]
1157 (define_insn "divsi3"
1158 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1159 (div:SI (match_operand:SI 1 "register_operand" "0,0,0,0,0,0")
1160 (match_operand:SI 2 "rx_source_operand" "r,Sint08,Sint16,Sint24,i,Q")))
1161 (clobber (reg:CC CC_REG))]
1164 [(set_attr "timings" "1111") ;; Strictly speaking the timing should be
1165 ;; 2222, but that is a worst case sceanario.
1166 (set_attr "length" "3,4,5,6,7,6")]
1169 (define_insn "udivsi3"
1170 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1171 (udiv:SI (match_operand:SI 1 "register_operand" "0,0,0,0,0,0")
1172 (match_operand:SI 2 "rx_source_operand" "r,Sint08,Sint16,Sint24,i,Q")))
1173 (clobber (reg:CC CC_REG))]
1176 [(set_attr "timings" "1010") ;; Strictly speaking the timing should be
1177 ;; 2020, but that is a worst case sceanario.
1178 (set_attr "length" "3,4,5,6,7,6")]
1181 ;; Note - these patterns are suppressed in big-endian mode because they
1182 ;; generate a little endian result. ie the most significant word of the
1183 ;; result is placed in the higher numbered register of the destination
1186 (define_insn "mulsidi3"
1187 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r,r")
1188 (mult:DI (sign_extend:DI (match_operand:SI
1189 1 "register_operand" "%0,0,0,0,0,0"))
1190 (sign_extend:DI (match_operand:SI
1191 2 "rx_source_operand"
1192 "r,Sint08,Sint16,Sint24,i,Q"))))]
1193 "! TARGET_BIG_ENDIAN_DATA"
1195 [(set_attr "length" "3,4,5,6,7,6")
1196 (set_attr "timings" "22,22,22,22,22,44")]
1199 ;; See comment for mulsidi3.
1200 ;; Note - the zero_extends are to distinguish this pattern from the
1201 ;; mulsidi3 pattern. Immediate mode addressing is not supported
1202 ;; because gcc cannot handle the expression: (zero_extend (const_int)).
1203 (define_insn "umulsidi3"
1204 [(set (match_operand:DI 0 "register_operand" "=r,r")
1205 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0,0"))
1206 (zero_extend:DI (match_operand:SI 2 "rx_compare_operand" "r,Q"))))]
1207 "! TARGET_BIG_ENDIAN_DATA"
1209 [(set_attr "length" "3,6")
1210 (set_attr "timings" "22,44")]
1213 (define_insn "smaxsi3"
1214 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1215 (smax:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
1216 (match_operand:SI 2 "rx_source_operand"
1217 "r,Sint08,Sint16,Sint24,i,Q")))]
1220 [(set_attr "length" "3,4,5,6,7,6")
1221 (set_attr "timings" "11,11,11,11,11,33")]
1224 (define_insn "sminsi3"
1225 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1226 (smin:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
1227 (match_operand:SI 2 "rx_source_operand"
1228 "r,Sint08,Sint16,Sint24,i,Q")))]
1231 [(set_attr "length" "3,4,5,6,7,6")
1232 (set_attr "timings" "11,11,11,11,11,33")]
1235 (define_insn "umax<small_int_modes:mode>3_u"
1236 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1237 (smax:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
1238 (zero_extend:SI (match_operand:small_int_modes 2 "rx_minmaxex_operand"
1239 "r,Sint08,Sint16,Sint24,i,Q"))))]
1242 [(set_attr "length" "3,4,5,6,7,6")
1243 (set_attr "timings" "11,11,11,11,11,33")]
1246 (define_insn "umin<small_int_modes:mode>3_ur"
1247 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1248 (smin:SI (zero_extend:SI (match_operand:small_int_modes 2 "rx_minmaxex_operand"
1249 "r,Sint08,Sint16,Sint24,i,Q"))
1250 (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")))]
1253 [(set_attr "length" "3,4,5,6,7,6")
1254 (set_attr "timings" "11,11,11,11,11,33")]
1257 (define_insn "umax<small_int_modes:mode>3_ur"
1258 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1259 (smax:SI (zero_extend:SI (match_operand:small_int_modes 2 "rx_minmaxex_operand"
1260 "r,Sint08,Sint16,Sint24,i,Q"))
1261 (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")))]
1264 [(set_attr "length" "3,4,5,6,7,6")
1265 (set_attr "timings" "11,11,11,11,11,33")]
1268 (define_expand "umax<small_int_modes:mode>3"
1270 (zero_extend:SI (match_operand:small_int_modes 1 "register_operand" "%0,0,0,0,0,0")))
1272 (smax:SI (match_dup 4)
1273 (match_operand:small_int_modes 2 "rx_source_operand"
1274 "r,Sint08,Sint16,Sint24,i,Q")))
1275 (set (match_operand:small_int_modes 0 "register_operand" "=r,r,r,r,r,r")
1279 "operands[3] = gen_reg_rtx (SImode);
1280 operands[4] = gen_reg_rtx (SImode);
1281 operands[5] = gen_reg_rtx (SImode);
1282 operands[6] = gen_rtx_SUBREG (GET_MODE (operands[0]), operands[3],
1283 TARGET_BIG_ENDIAN_DATA ? (GET_MODE (operands[0]) == HImode ? 2 : 3) : 0);
1284 if (GET_CODE (operands[2]) != CONST_INT)
1286 emit_move_insn (operands[5], gen_rtx_ZERO_EXTEND (SImode, operands[2]));
1287 operands[2] = operands[5];
1292 (define_expand "umin<small_int_modes:mode>3"
1294 (zero_extend:SI (match_operand:small_int_modes 1 "register_operand" "%0,0,0,0,0,0")))
1296 (smin:SI (match_dup 4)
1297 (match_operand:small_int_modes 2 "rx_source_operand"
1298 "r,Sint08,Sint16,Sint24,i,Q")))
1299 (set (match_operand:small_int_modes 0 "register_operand" "=r,r,r,r,r,r")
1303 "operands[3] = gen_reg_rtx (SImode);
1304 operands[4] = gen_reg_rtx (SImode);
1305 operands[5] = gen_reg_rtx (SImode);
1306 operands[6] = gen_rtx_SUBREG (GET_MODE (operands[0]), operands[3],
1307 TARGET_BIG_ENDIAN_DATA ? (GET_MODE (operands[0]) == HImode ? 2 : 3) : 0);
1308 if (GET_CODE (operands[2]) != CONST_INT)
1310 emit_move_insn (operands[5], gen_rtx_ZERO_EXTEND (SImode, operands[2]));
1311 operands[2] = operands[5];
1316 (define_insn "mulsi3"
1317 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
1318 (mult:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,0,r,r")
1319 (match_operand:SI 2 "rx_source_operand"
1320 "r,Uint04,Sint08,Sint16,Sint24,i,Q,0,r")))]
1332 [(set_attr "length" "2,2,3,4,5,6,5,2,3")
1333 (set_attr "timings" "11,11,11,11,11,11,33,11,11")]
1336 (define_insn "negsi2"
1337 [(set (match_operand:SI 0 "register_operand" "=r,r")
1338 (neg:SI (match_operand:SI 1 "register_operand" "0,r")))
1339 (clobber (reg:CC CC_REG))]
1344 [(set_attr "length" "2,3")]
1347 ;; Note that the O and C flags are not set as per a normal compare,
1348 ;; and thus are unusable in that context.
1349 (define_insn "*negsi2_flags"
1351 (compare (neg:SI (match_operand:SI 1 "register_operand" "0,r"))
1353 (set (match_operand:SI 0 "register_operand" "=r,r")
1354 (neg:SI (match_dup 1)))]
1355 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1359 [(set_attr "length" "2,3")]
1362 (define_insn "one_cmplsi2"
1363 [(set (match_operand:SI 0 "register_operand" "=r,r")
1364 (not:SI (match_operand:SI 1 "register_operand" "0,r")))
1365 (clobber (reg:CC CC_REG))]
1370 [(set_attr "length" "2,3")]
1373 (define_insn "*one_cmplsi2_flags"
1375 (compare (not:SI (match_operand:SI 1 "register_operand" "0,r"))
1377 (set (match_operand:SI 0 "register_operand" "=r,r")
1378 (not:SI (match_dup 1)))]
1379 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1383 [(set_attr "length" "2,3")]
1386 (define_insn "iorsi3"
1387 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
1388 (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r,0")
1389 (match_operand:SI 2 "rx_source_operand" "r,Uint04,Sint08,Sint16,Sint24,i,0,r,Q")))
1390 (clobber (reg:CC CC_REG))]
1402 [(set_attr "timings" "11,11,11,11,11,11,11,11,33")
1403 (set_attr "length" "2,2,3,4,5,6,2,3,5")]
1406 (define_insn "*iorsi3_flags"
1408 (compare (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r,0")
1409 (match_operand:SI 2 "rx_source_operand" "r,Uint04,Sint08,Sint16,Sint24,i,0,r,Q"))
1411 (set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r,r")
1412 (ior:SI (match_dup 1) (match_dup 2)))]
1413 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1424 [(set_attr "timings" "11,11,11,11,11,11,11,11,33")
1425 (set_attr "length" "2,2,3,4,5,6,2,3,5")]
1428 (define_insn "rotlsi3"
1429 [(set (match_operand:SI 0 "register_operand" "=r")
1430 (rotate:SI (match_operand:SI 1 "register_operand" "0")
1431 (match_operand:SI 2 "rx_shift_operand" "rn")))
1432 (clobber (reg:CC CC_REG))]
1435 [(set_attr "length" "3")]
1438 (define_insn "*rotlsi3_flags"
1440 (compare (rotate:SI (match_operand:SI 1 "register_operand" "0")
1441 (match_operand:SI 2 "rx_shift_operand" "rn"))
1443 (set (match_operand:SI 0 "register_operand" "=r")
1444 (rotate:SI (match_dup 1) (match_dup 2)))]
1445 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1447 [(set_attr "length" "3")]
1450 (define_insn "rotrsi3"
1451 [(set (match_operand:SI 0 "register_operand" "=r")
1452 (rotatert:SI (match_operand:SI 1 "register_operand" "0")
1453 (match_operand:SI 2 "rx_shift_operand" "rn")))
1454 (clobber (reg:CC CC_REG))]
1457 [(set_attr "length" "3")]
1460 (define_insn "*rotrsi3_flags"
1462 (compare (rotatert:SI (match_operand:SI 1 "register_operand" "0")
1463 (match_operand:SI 2 "rx_shift_operand" "rn"))
1465 (set (match_operand:SI 0 "register_operand" "=r")
1466 (rotatert:SI (match_dup 1) (match_dup 2)))]
1467 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1469 [(set_attr "length" "3")]
1472 (define_insn "ashrsi3"
1473 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1474 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r")
1475 (match_operand:SI 2 "rx_shift_operand" "r,n,n")))
1476 (clobber (reg:CC CC_REG))]
1482 [(set_attr "length" "3,2,3")]
1485 (define_insn "*ashrsi3_flags"
1487 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r")
1488 (match_operand:SI 2 "rx_shift_operand" "r,n,n"))
1490 (set (match_operand:SI 0 "register_operand" "=r,r,r")
1491 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
1492 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1497 [(set_attr "length" "3,2,3")]
1500 (define_insn "lshrsi3"
1501 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1502 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r")
1503 (match_operand:SI 2 "rx_shift_operand" "r,n,n")))
1504 (clobber (reg:CC CC_REG))]
1510 [(set_attr "length" "3,2,3")]
1513 (define_insn "*lshrsi3_flags"
1515 (compare (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0,r")
1516 (match_operand:SI 2 "rx_shift_operand" "r,n,n"))
1518 (set (match_operand:SI 0 "register_operand" "=r,r,r")
1519 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
1520 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1525 [(set_attr "length" "3,2,3")]
1528 (define_insn "ashlsi3"
1529 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1530 (ashift:SI (match_operand:SI 1 "register_operand" "0,0,r")
1531 (match_operand:SI 2 "rx_shift_operand" "r,n,n")))
1532 (clobber (reg:CC CC_REG))]
1538 [(set_attr "length" "3,2,3")]
1541 (define_insn "*ashlsi3_flags"
1543 (compare (ashift:SI (match_operand:SI 1 "register_operand" "0,0,r")
1544 (match_operand:SI 2 "rx_shift_operand" "r,n,n"))
1546 (set (match_operand:SI 0 "register_operand" "=r,r,r")
1547 (ashift:SI (match_dup 1) (match_dup 2)))]
1548 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1553 [(set_attr "length" "3,2,3")]
1556 ;; Saturate to 32-bits
1557 (define_insn_and_split "ssaddsi3"
1558 [(set (match_operand:SI 0 "register_operand" "=r")
1559 (ss_plus:SI (match_operand:SI 1 "register_operand" "r")
1560 (match_operand:SI 2 "rx_source_operand" "riQ")))
1561 (clobber (reg:CC CC_REG))]
1565 [(parallel [(set (reg:CC_ZSC CC_REG)
1567 (plus:SI (match_dup 1) (match_dup 2))
1570 (plus:SI (match_dup 1) (match_dup 2)))])
1572 (unspec:SI [(match_dup 0) (reg:CC CC_REG)]
1573 UNSPEC_BUILTIN_SAT))]
1578 [(set (match_operand:SI 0 "register_operand" "=r")
1579 (unspec:SI [(match_operand:SI 1 "register_operand" "0")
1581 UNSPEC_BUILTIN_SAT))]
1584 [(set_attr "length" "2")]
1587 (define_insn "subsi3"
1588 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r")
1589 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0")
1590 (match_operand:SI 2 "rx_source_operand" "r,Uint04,n,r,Q")))
1591 (clobber (reg:CC CC_REG))]
1599 [(set_attr "timings" "11,11,11,11,33")
1600 (set_attr "length" "2,2,6,3,5")]
1603 ;; Note that the O flag is set as if (compare op1 op2) not for
1604 ;; what is described here, (compare op0 0).
1605 (define_insn "*subsi3_flags"
1607 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0")
1608 (match_operand:SI 2 "rx_source_operand" "r,Uint04,n,r,Q"))
1610 (set (match_operand:SI 0 "register_operand" "=r,r,r,r,r")
1611 (minus:SI (match_dup 1) (match_dup 2)))]
1612 "reload_completed && rx_match_ccmode (insn, CC_ZSCmode)"
1619 [(set_attr "timings" "11,11,11,11,33")
1620 (set_attr "length" "2,2,6,3,5")]
1623 ;; A helper to expand the above with the CC_MODE filled in.
1624 (define_expand "subsi3_flags"
1625 [(parallel [(set (reg:CC_ZSC CC_REG)
1627 (minus:SI (match_operand:SI 1 "register_operand")
1628 (match_operand:SI 2 "rx_source_operand"))
1630 (set (match_operand:SI 0 "register_operand")
1631 (minus:SI (match_dup 1) (match_dup 2)))])]
1634 (define_insn "sbb_internal"
1635 [(set (match_operand:SI 0 "register_operand" "=r,r")
1638 (match_operand:SI 1 "register_operand" " 0,0")
1639 (match_operand:SI 2 "rx_compare_operand" " r,Q"))
1640 (geu:SI (reg:CC CC_REG) (const_int 0))))
1641 (clobber (reg:CC CC_REG))]
1644 [(set_attr "timings" "11,33")
1645 (set_attr "length" "3,6")]
1648 (define_insn "*sbb_flags"
1653 (match_operand:SI 1 "register_operand" " 0,0")
1654 (match_operand:SI 2 "rx_compare_operand" " r,Q"))
1655 (geu:SI (reg:CC CC_REG) (const_int 0)))
1657 (set (match_operand:SI 0 "register_operand" "=r,r")
1659 (minus:SI (match_dup 1) (match_dup 2))
1660 (geu:SI (reg:CC CC_REG) (const_int 0))))]
1663 [(set_attr "timings" "11,33")
1664 (set_attr "length" "3,6")]
1667 (define_expand "subdi3"
1668 [(set (match_operand:DI 0 "register_operand")
1669 (minus:DI (match_operand:DI 1 "register_operand")
1670 (match_operand:DI 2 "register_operand")))]
1673 rtx op0l, op0h, op1l, op1h, op2l, op2h;
1675 op0l = gen_lowpart (SImode, operands[0]);
1676 op1l = gen_lowpart (SImode, operands[1]);
1677 op2l = gen_lowpart (SImode, operands[2]);
1678 op0h = gen_highpart (SImode, operands[0]);
1679 op1h = gen_highpart (SImode, operands[1]);
1680 op2h = gen_highpart_mode (SImode, DImode, operands[2]);
1682 emit_insn (gen_subdi3_internal (op0l, op0h, op1l, op2l, op1h, op2h));
1686 (define_insn_and_split "subdi3_internal"
1687 [(set (match_operand:SI 0 "register_operand" "=&r,&r")
1688 (minus:SI (match_operand:SI 2 "register_operand" " 0, r")
1689 (match_operand:SI 3 "rx_compare_operand" "rQ, r")))
1690 (set (match_operand:SI 1 "register_operand" "= r, r")
1693 (match_operand:SI 4 "register_operand" " 1, 1")
1694 (match_operand:SI 5 "rx_compare_operand" " rQ,rQ"))
1695 (geu:SI (match_dup 2) (match_dup 3))))
1696 (clobber (reg:CC CC_REG))]
1702 emit_insn (gen_subsi3_flags (operands[0], operands[2], operands[3]));
1703 emit_insn (gen_sbb_internal (operands[1], operands[4], operands[5]));
1707 (define_insn "xorsi3"
1708 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1709 (xor:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
1710 (match_operand:SI 2 "rx_source_operand"
1711 "r,Sint08,Sint16,Sint24,i,Q")))
1712 (clobber (reg:CC CC_REG))]
1715 [(set_attr "timings" "11,11,11,11,11,33")
1716 (set_attr "length" "3,4,5,6,7,6")]
1719 (define_insn "*xorsi3_flags"
1721 (compare (xor:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
1722 (match_operand:SI 2 "rx_source_operand"
1723 "r,Sint08,Sint16,Sint24,i,Q"))
1725 (set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
1726 (xor:SI (match_dup 1) (match_dup 2)))]
1727 "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
1729 [(set_attr "timings" "11,11,11,11,11,33")
1730 (set_attr "length" "3,4,5,6,7,6")]
1733 ;; A set of peepholes to catch extending loads followed by arithmetic operations.
1734 ;; We use iterators where possible to reduce the amount of typing and hence the
1735 ;; possibilities for typos.
1737 (define_code_iterator extend_types [(zero_extend "") (sign_extend "")])
1738 (define_code_attr letter [(zero_extend "R") (sign_extend "Q")])
1740 (define_code_iterator memex_commutative [(plus "") (and "") (ior "") (xor "")])
1741 (define_code_iterator memex_noncomm [(div "") (udiv "") (minus "")])
1742 (define_code_iterator memex_nocc [(smax "") (smin "") (mult "")])
1744 (define_code_attr op [(plus "add") (and "and") (div "div") (udiv "divu") (smax "max") (smin "min") (mult "mul") (ior "or") (minus "sub") (xor "xor")])
1747 [(set (match_operand:SI 0 "register_operand")
1748 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand")))
1749 (parallel [(set (match_operand:SI 2 "register_operand")
1750 (memex_commutative:SI (match_dup 0)
1752 (clobber (reg:CC CC_REG))])]
1753 "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)"
1754 [(parallel [(set (match_dup 2)
1755 (memex_commutative:SI (match_dup 2)
1756 (extend_types:SI (match_dup 1))))
1757 (clobber (reg:CC CC_REG))])]
1761 [(set (match_operand:SI 0 "register_operand")
1762 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand")))
1763 (parallel [(set (match_operand:SI 2 "register_operand")
1764 (memex_commutative:SI (match_dup 2)
1766 (clobber (reg:CC CC_REG))])]
1767 "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)"
1768 [(parallel [(set (match_dup 2)
1769 (memex_commutative:SI (match_dup 2)
1770 (extend_types:SI (match_dup 1))))
1771 (clobber (reg:CC CC_REG))])]
1775 [(set (match_operand:SI 0 "register_operand")
1776 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand")))
1777 (parallel [(set (match_operand:SI 2 "register_operand")
1778 (memex_noncomm:SI (match_dup 2)
1780 (clobber (reg:CC CC_REG))])]
1781 "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)"
1782 [(parallel [(set (match_dup 2)
1783 (memex_noncomm:SI (match_dup 2)
1784 (extend_types:SI (match_dup 1))))
1785 (clobber (reg:CC CC_REG))])]
1789 [(set (match_operand:SI 0 "register_operand")
1790 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand")))
1791 (set (match_operand:SI 2 "register_operand")
1792 (memex_nocc:SI (match_dup 0)
1794 "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)"
1796 (memex_nocc:SI (match_dup 2)
1797 (extend_types:SI (match_dup 1))))]
1801 [(set (match_operand:SI 0 "register_operand")
1802 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand")))
1803 (set (match_operand:SI 2 "register_operand")
1804 (memex_nocc:SI (match_dup 2)
1806 "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)"
1808 (memex_nocc:SI (match_dup 2)
1809 (extend_types:SI (match_dup 1))))]
1812 (define_insn "<memex_commutative:code>si3_<extend_types:code><small_int_modes:mode>"
1813 [(set (match_operand:SI 0 "register_operand" "=r")
1814 (memex_commutative:SI (match_operand:SI 1 "register_operand" "%0")
1815 (extend_types:SI (match_operand:small_int_modes 2 "rx_restricted_mem_operand" "Q"))))
1816 (clobber (reg:CC CC_REG))]
1817 "(optimize < 3 || optimize_size)"
1818 "<memex_commutative:op>\t%<extend_types:letter>2, %0"
1819 [(set_attr "timings" "33")
1820 (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length
1823 (define_insn "<memex_noncomm:code>si3_<extend_types:code><small_int_modes:mode>"
1824 [(set (match_operand:SI 0 "register_operand" "=r")
1825 (memex_noncomm:SI (match_operand:SI 1 "register_operand" "0")
1826 (extend_types:SI (match_operand:small_int_modes 2 "rx_restricted_mem_operand" "Q"))))
1827 (clobber (reg:CC CC_REG))]
1828 "(optimize < 3 || optimize_size)"
1829 "<memex_noncomm:op>\t%<extend_types:letter>2, %0"
1830 [(set_attr "timings" "33")
1831 (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length
1834 (define_insn "<memex_nocc:code>si3_<extend_types:code><small_int_modes:mode>"
1835 [(set (match_operand:SI 0 "register_operand" "=r")
1836 (memex_nocc:SI (match_operand:SI 1 "register_operand" "%0")
1837 (extend_types:SI (match_operand:small_int_modes 2 "rx_restricted_mem_operand" "Q"))))]
1838 "(optimize < 3 || optimize_size)"
1839 "<memex_nocc:op>\t%<extend_types:letter>2, %0"
1840 [(set_attr "timings" "33")
1841 (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length
1845 [(set (match_operand:SI 0 "register_operand")
1846 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand")))
1847 (set (reg:CC CC_REG)
1848 (compare:CC (match_operand:SI 2 "register_operand")
1850 "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)"
1851 [(set (reg:CC CC_REG)
1852 (compare:CC (match_dup 2)
1853 (extend_types:SI (match_dup 1))))]
1857 ;; (set (reg1) (sign_extend (mem))
1858 ;; (set (reg2) (zero_extend (reg1))
1860 ;; (set (reg2) (zero_extend (mem)))
1862 [(set (match_operand:SI 0 "register_operand")
1863 (sign_extend:SI (match_operand:small_int_modes 1 "memory_operand")))
1864 (set (match_operand:SI 2 "register_operand")
1865 (zero_extend:SI (match_operand:small_int_modes 3 "register_operand")))]
1866 "REGNO (operands[0]) == REGNO (operands[3])
1867 && (REGNO (operands[0]) == REGNO (operands[2])
1868 || peep2_regno_dead_p (2, REGNO (operands[0])))"
1870 (zero_extend:SI (match_dup 1)))]
1873 ;; Remove the redundant sign extension from:
1874 ;; (set (reg) (extend (mem)))
1875 ;; (set (reg) (extend (reg)))
1877 [(set (match_operand:SI 0 "register_operand")
1878 (extend_types:SI (match_operand:small_int_modes 1 "memory_operand")))
1880 (extend_types:SI (match_operand:small_int_modes 2 "register_operand")))]
1881 "REGNO (operands[0]) == REGNO (operands[2])"
1882 [(set (match_dup 0) (extend_types:SI (match_dup 1)))]
1885 (define_insn "comparesi3_<extend_types:code><small_int_modes:mode>"
1886 [(set (reg:CC CC_REG)
1887 (compare:CC (match_operand:SI 0 "register_operand" "r")
1888 (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand" "Q"))))]
1889 "(optimize < 3 || optimize_size)"
1890 "cmp\t%<extend_types:letter>1, %0"
1891 [(set_attr "timings" "33")
1892 (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length
1895 ;; Floating Point Instructions
1897 (define_insn "addsf3"
1898 [(set (match_operand:SF 0 "register_operand" "=r,r,r")
1899 (plus:SF (match_operand:SF 1 "register_operand" "%0,0,0")
1900 (match_operand:SF 2 "rx_source_operand" "r,F,Q")))
1901 (clobber (reg:CC CC_REG))]
1902 "ALLOW_RX_FPU_INSNS"
1904 [(set_attr "timings" "44,44,66")
1905 (set_attr "length" "3,7,5")]
1908 (define_insn "divsf3"
1909 [(set (match_operand:SF 0 "register_operand" "=r,r,r")
1910 (div:SF (match_operand:SF 1 "register_operand" "0,0,0")
1911 (match_operand:SF 2 "rx_source_operand" "r,F,Q")))
1912 (clobber (reg:CC CC_REG))]
1913 "ALLOW_RX_FPU_INSNS"
1915 [(set_attr "timings" "1616,1616,1818")
1916 (set_attr "length" "3,7,5")]
1919 (define_insn "mulsf3"
1920 [(set (match_operand:SF 0 "register_operand" "=r,r,r")
1921 (mult:SF (match_operand:SF 1 "register_operand" "%0,0,0")
1922 (match_operand:SF 2 "rx_source_operand" "r,F,Q")))
1923 (clobber (reg:CC CC_REG))]
1924 "ALLOW_RX_FPU_INSNS"
1926 [(set_attr "timings" "33,33,55")
1927 (set_attr "length" "3,7,5")]
1930 (define_insn "subsf3"
1931 [(set (match_operand:SF 0 "register_operand" "=r,r,r")
1932 (minus:SF (match_operand:SF 1 "register_operand" "0,0,0")
1933 (match_operand:SF 2 "rx_source_operand" "r,F,Q")))
1934 (clobber (reg:CC CC_REG))]
1935 "ALLOW_RX_FPU_INSNS"
1937 [(set_attr "timings" "44,44,66")
1938 (set_attr "length" "3,7,5")]
1941 (define_insn "fix_truncsfsi2"
1942 [(set (match_operand:SI 0 "register_operand" "=r,r")
1943 (fix:SI (match_operand:SF 1 "rx_compare_operand" "r,Q")))
1944 (clobber (reg:CC CC_REG))]
1945 "ALLOW_RX_FPU_INSNS"
1947 [(set_attr "timings" "22,44")
1948 (set_attr "length" "3,5")]
1951 (define_insn "floatsisf2"
1952 [(set (match_operand:SF 0 "register_operand" "=r,r")
1953 (float:SF (match_operand:SI 1 "rx_compare_operand" "r,Q")))
1954 (clobber (reg:CC CC_REG))]
1955 "ALLOW_RX_FPU_INSNS"
1957 [(set_attr "timings" "22,44")
1958 (set_attr "length" "3,6")]
1961 ;; Bit manipulation instructions.
1963 ;; ??? The *_in_memory patterns will not be matched without further help.
1964 ;; At one time we had the insv expander generate them, but I suspect that
1965 ;; in general we get better performance by exposing the register load to
1968 ;; An alternate solution would be to re-organize these patterns such
1969 ;; that allow both register and memory operands. This would allow the
1970 ;; register allocator to spill and not load the register operand. This
1971 ;; would be possible only for operations for which we have a constant
1972 ;; bit offset, so that we can adjust the address by ofs/8 and replace
1973 ;; the offset in the insn by ofs%8.
1975 (define_insn "*bitset"
1976 [(set (match_operand:SI 0 "register_operand" "=r")
1977 (ior:SI (ashift:SI (const_int 1)
1978 (match_operand:SI 1 "rx_shift_operand" "ri"))
1979 (match_operand:SI 2 "register_operand" "0")))]
1982 [(set_attr "length" "3")]
1985 (define_insn "*bitset_in_memory"
1986 [(set (match_operand:QI 0 "rx_restricted_mem_operand" "+Q")
1987 (ior:QI (ashift:QI (const_int 1)
1988 (match_operand:QI 1 "nonmemory_operand" "ri"))
1992 [(set_attr "length" "3")
1993 (set_attr "timings" "33")]
1996 (define_insn "*bitinvert"
1997 [(set (match_operand:SI 0 "register_operand" "=r")
1998 (xor:SI (ashift:SI (const_int 1)
1999 (match_operand:SI 1 "rx_shift_operand" "ri"))
2000 (match_operand:SI 2 "register_operand" "0")))]
2003 [(set_attr "length" "3")]
2006 (define_insn "*bitinvert_in_memory"
2007 [(set (match_operand:QI 0 "rx_restricted_mem_operand" "+Q")
2008 (xor:QI (ashift:QI (const_int 1)
2009 (match_operand:QI 1 "nonmemory_operand" "ri"))
2013 [(set_attr "length" "5")
2014 (set_attr "timings" "33")]
2017 (define_insn "*bitclr"
2018 [(set (match_operand:SI 0 "register_operand" "=r")
2022 (match_operand:SI 1 "rx_shift_operand" "ri")))
2023 (match_operand:SI 2 "register_operand" "0")))]
2026 [(set_attr "length" "3")]
2029 (define_insn "*bitclr_in_memory"
2030 [(set (match_operand:QI 0 "rx_restricted_mem_operand" "+Q")
2034 (match_operand:QI 1 "nonmemory_operand" "ri")))
2038 [(set_attr "length" "3")
2039 (set_attr "timings" "33")]
2042 (define_insn "*insv_imm"
2043 [(set (zero_extract:SI
2044 (match_operand:SI 0 "register_operand" "+r")
2046 (match_operand:SI 1 "rx_shift_operand" "ri"))
2047 (match_operand:SI 2 "const_int_operand" ""))]
2050 if (INTVAL (operands[2]) & 1)
2051 return "bset\t%1, %0";
2053 return "bclr\t%1, %0";
2055 [(set_attr "length" "3")]
2058 (define_insn_and_split "rx_insv_reg"
2059 [(set (zero_extract:SI
2060 (match_operand:SI 0 "register_operand" "+r")
2062 (match_operand:SI 1 "const_int_operand" ""))
2063 (match_operand:SI 2 "register_operand" "r"))
2064 (clobber (reg:CC CC_REG))]
2068 [(set (zero_extract:SI (match_dup 0) (const_int 1) (match_dup 1))
2073 /* Emit tst #1, op2. */
2074 flags = gen_rtx_REG (CC_ZSmode, CC_REG);
2075 x = gen_rtx_AND (SImode, operands[2], const1_rtx);
2076 x = gen_rtx_COMPARE (CC_ZSmode, x, const0_rtx);
2077 x = gen_rtx_SET (flags, x);
2081 operands[3] = gen_rtx_NE (SImode, flags, const0_rtx);
2084 (define_insn_and_split "*insv_cond"
2085 [(set (zero_extract:SI
2086 (match_operand:SI 0 "register_operand" "+r")
2088 (match_operand:SI 1 "const_int_operand" ""))
2089 (match_operator:SI 4 "comparison_operator"
2090 [(match_operand:SI 2 "register_operand" "r")
2091 (match_operand:SI 3 "rx_source_operand" "riQ")]))
2092 (clobber (reg:CC CC_REG))]
2096 [(set (zero_extract:SI (match_dup 0) (const_int 1) (match_dup 1))
2101 flags = gen_rtx_REG (CCmode, CC_REG);
2102 x = gen_rtx_COMPARE (CCmode, operands[2], operands[3]);
2103 x = gen_rtx_SET (flags, x);
2106 operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[4]), SImode,
2110 (define_insn "*bmcc"
2111 [(set (zero_extract:SI
2112 (match_operand:SI 0 "register_operand" "+r")
2114 (match_operand:SI 1 "const_int_operand" ""))
2115 (match_operator:SI 2 "comparison_operator"
2116 [(reg CC_REG) (const_int 0)]))]
2119 [(set_attr "length" "3")]
2122 ;; Work around the fact that X=Y<0 is preferentially expanded as a shift.
2123 (define_insn_and_split "*insv_cond_lt"
2124 [(set (zero_extract:SI
2125 (match_operand:SI 0 "register_operand" "+r")
2127 (match_operand:SI 1 "const_int_operand" ""))
2128 (match_operator:SI 3 "rshift_operator"
2129 [(match_operand:SI 2 "register_operand" "r")
2131 (clobber (reg:CC CC_REG))]
2135 [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 1) (match_dup 1))
2136 (lt:SI (match_dup 2) (const_int 0)))
2137 (clobber (reg:CC CC_REG))])]
2141 (define_expand "insv"
2142 [(set (zero_extract:SI
2143 (match_operand:SI 0 "register_operand") ;; Destination
2144 (match_operand:SI 1 "const_int_operand") ;; # of bits to set
2145 (match_operand:SI 2 "nonmemory_operand")) ;; Starting bit
2146 (match_operand:SI 3 "nonmemory_operand"))] ;; Bits to insert
2149 /* We only handle single-bit inserts. */
2150 if (!CONST_INT_P (operands[1]) || INTVAL (operands[1]) != 1)
2153 /* Either the bit to insert or the position must be constant. */
2154 if (CONST_INT_P (operands[3]))
2155 operands[3] = GEN_INT (INTVAL (operands[3]) & 1);
2156 else if (CONST_INT_P (operands[2]))
2158 emit_insn (gen_rx_insv_reg (operands[0], operands[2], operands[3]));
2165 ;; Atomic operations.
2167 (define_code_iterator FETCHOP [plus minus ior xor and])
2168 (define_code_iterator FETCHOP_NO_MINUS [plus ior xor and])
2170 (define_code_attr fetchop_name
2171 [(plus "add") (minus "sub") (ior "or") (xor "xor") (and "and")])
2173 (define_code_attr fetchop_name2
2174 [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")])
2176 (define_mode_iterator QIHI [QI HI])
2177 (define_mode_attr BW [(QI "B") (HI "W")])
2179 (define_insn "sync_lock_test_and_setsi"
2180 [(set (match_operand:SI 0 "register_operand" "=r,r")
2181 (match_operand:SI 1 "rx_compare_operand" "=r,Q"))
2183 (match_operand:SI 2 "register_operand" "0,0"))]
2186 [(set_attr "length" "3,6")
2187 (set_attr "timings" "22")]
2190 (define_expand "atomic_exchange<mode>"
2191 [(match_operand:QIHI 0 "register_operand") ;; oldval output
2192 (match_operand:QIHI 1 "rx_restricted_mem_operand") ;; memory
2193 (match_operand:QIHI 2 "register_operand") ;; newval input
2194 (match_operand:QIHI 3 "const_int_operand")] ;; memory model
2197 emit_insn (gen_xchg_mem<mode> (operands[0], operands[1], operands[2]));
2201 (define_expand "atomic_exchangesi"
2202 [(match_operand:SI 0 "register_operand") ;; oldval output
2203 (match_operand:SI 1 "rx_restricted_mem_operand") ;; memory
2204 (match_operand:SI 2 "register_operand") ;; newval input
2205 (match_operand:SI 3 "const_int_operand")] ;; memory model
2208 emit_insn (gen_sync_lock_test_and_setsi (operands[0], operands[1],
2213 (define_insn "xchg_mem<mode>"
2214 [(set (match_operand:QIHI 0 "register_operand" "=r")
2215 (match_operand:QIHI 1 "rx_compare_operand" "=Q"))
2217 (match_operand:QIHI 2 "register_operand" "0"))]
2220 [(set_attr "length" "6")
2221 (set_attr "timings" "22")]
2224 ;; read - modify - write - return old value
2225 (define_expand "atomic_fetch_<fetchop_name>si"
2226 [(set (match_operand:SI 0 "register_operand")
2227 (match_operand:SI 1 "memory_operand"))
2229 (FETCHOP:SI (match_dup 1) (match_operand:SI 2 "rx_source_operand")))
2230 (match_operand:SI 3 "const_int_operand")] ;; memory model
2234 rx_atomic_sequence seq (current_function_decl);
2236 emit_move_insn (operands[0], operands[1]);
2238 rtx tmp = gen_reg_rtx (SImode);
2239 emit_insn (gen_<fetchop_name2>si3 (tmp, operands[0], operands[2]));
2241 emit_move_insn (operands[1], tmp);
2246 (define_expand "atomic_fetch_nandsi"
2247 [(set (match_operand:SI 0 "register_operand")
2248 (match_operand:SI 1 "memory_operand"))
2250 (not:SI (and:SI (match_dup 1)
2251 (match_operand:SI 2 "rx_source_operand"))))
2252 (match_operand:SI 3 "const_int_operand")] ;; memory model
2256 rx_atomic_sequence seq (current_function_decl);
2258 emit_move_insn (operands[0], operands[1]);
2260 rtx tmp = gen_reg_rtx (SImode);
2261 emit_insn (gen_andsi3 (tmp, operands[0], operands[2]));
2262 emit_insn (gen_one_cmplsi2 (tmp, tmp));
2264 emit_move_insn (operands[1], tmp);
2269 ;; read - modify - write - return new value
2270 ;; Because subtraction is not commutative we need to specify a different
2271 ;; set of patterns for it.
2272 (define_expand "atomic_<fetchop_name>_fetchsi"
2273 [(set (match_operand:SI 0 "register_operand")
2274 (FETCHOP_NO_MINUS:SI (match_operand:SI 1 "rx_restricted_mem_operand")
2275 (match_operand:SI 2 "register_operand")))
2277 (FETCHOP_NO_MINUS:SI (match_dup 1) (match_dup 2)))
2278 (match_operand:SI 3 "const_int_operand")] ;; memory model
2282 rx_atomic_sequence seq (current_function_decl);
2284 emit_move_insn (operands[0], operands[2]);
2285 emit_insn (gen_<fetchop_name2>si3 (operands[0], operands[0], operands[1]));
2286 emit_move_insn (operands[1], operands[0]);
2291 (define_expand "atomic_sub_fetchsi"
2292 [(set (match_operand:SI 0 "register_operand")
2293 (minus:SI (match_operand:SI 1 "rx_restricted_mem_operand")
2294 (match_operand:SI 2 "rx_source_operand")))
2296 (minus:SI (match_dup 1) (match_dup 2)))
2297 (match_operand:SI 3 "const_int_operand")] ;; memory model
2301 rx_atomic_sequence seq (current_function_decl);
2303 emit_move_insn (operands[0], operands[1]);
2304 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
2305 emit_move_insn (operands[1], operands[0]);
2310 (define_expand "atomic_nand_fetchsi"
2311 [(set (match_operand:SI 0 "register_operand")
2312 (not:SI (and:SI (match_operand:SI 1 "rx_restricted_mem_operand")
2313 (match_operand:SI 2 "register_operand"))))
2315 (not:SI (and:SI (match_dup 1) (match_dup 2))))
2316 (match_operand:SI 3 "const_int_operand")] ;; memory model
2320 rx_atomic_sequence seq (current_function_decl);
2322 emit_move_insn (operands[0], operands[2]);
2323 emit_insn (gen_andsi3 (operands[0], operands[0], operands[1]));
2324 emit_insn (gen_one_cmplsi2 (operands[0], operands[0]));
2325 emit_move_insn (operands[1], operands[0]);
2331 ;; Block move functions.
2333 (define_expand "movstr"
2334 [(set (match_operand:BLK 1 "memory_operand") ;; Dest
2335 (match_operand:BLK 2 "memory_operand")) ;; Source
2336 (use (match_operand:SI 0 "register_operand")) ;; Updated Dest
2338 "rx_allow_string_insns"
2340 rtx addr1 = gen_rtx_REG (SImode, 1);
2341 rtx addr2 = gen_rtx_REG (SImode, 2);
2342 rtx len = gen_rtx_REG (SImode, 3);
2343 rtx dest_copy = gen_reg_rtx (SImode);
2345 emit_move_insn (len, GEN_INT (-1));
2346 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2347 emit_move_insn (addr2, force_operand (XEXP (operands[2], 0), NULL_RTX));
2348 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2349 operands[2] = replace_equiv_address_nv (operands[2], addr2);
2350 emit_move_insn (dest_copy, addr1);
2351 emit_insn (gen_rx_movstr ());
2352 emit_move_insn (len, GEN_INT (-1));
2353 emit_insn (gen_rx_strend (operands[0], dest_copy));
2358 (define_insn "rx_movstr"
2359 [(set (mem:BLK (reg:SI 1))
2360 (mem:BLK (reg:SI 2)))
2361 (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVSTR)
2362 (clobber (reg:SI 1))
2363 (clobber (reg:SI 2))
2364 (clobber (reg:SI 3))]
2365 "rx_allow_string_insns"
2367 [(set_attr "length" "2")
2368 (set_attr "timings" "1111")] ;; The timing is a guesstimate.
2371 (define_insn "rx_strend"
2372 [(set (match_operand:SI 0 "register_operand" "=r")
2373 (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
2374 (reg:SI 3)] UNSPEC_STRLEN))
2375 (clobber (reg:SI 1))
2376 (clobber (reg:SI 2))
2377 (clobber (reg:SI 3))
2378 (clobber (reg:CC CC_REG))
2380 "rx_allow_string_insns"
2381 "mov\t%1, r1\n\tmov\t#0, r2\n\tsuntil.b\n\tmov\tr1, %0\n\tsub\t#1, %0"
2382 [(set_attr "length" "10")
2383 (set_attr "timings" "1111")] ;; The timing is a guesstimate.
2386 (define_expand "movmemsi"
2388 [(set (match_operand:BLK 0 "memory_operand") ;; Dest
2389 (match_operand:BLK 1 "memory_operand")) ;; Source
2390 (use (match_operand:SI 2 "register_operand")) ;; Length in bytes
2391 (match_operand 3 "immediate_operand") ;; Align
2392 (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVMEM)]
2394 "rx_allow_string_insns"
2396 rtx addr1 = gen_rtx_REG (SImode, 1);
2397 rtx addr2 = gen_rtx_REG (SImode, 2);
2398 rtx len = gen_rtx_REG (SImode, 3);
2400 /* Do not use when the source or destination are volatile - the SMOVF
2401 instruction will read and write in word sized blocks, which may be
2402 outside of the valid address range. */
2403 if (MEM_P (operands[0]) && MEM_VOLATILE_P (operands[0]))
2405 if (MEM_P (operands[1]) && MEM_VOLATILE_P (operands[1]))
2408 if (REG_P (operands[0]) && (REGNO (operands[0]) == 2
2409 || REGNO (operands[0]) == 3))
2411 if (REG_P (operands[1]) && (REGNO (operands[1]) == 1
2412 || REGNO (operands[1]) == 3))
2414 if (REG_P (operands[2]) && (REGNO (operands[2]) == 1
2415 || REGNO (operands[2]) == 2))
2418 emit_move_insn (addr1, force_operand (XEXP (operands[0], 0), NULL_RTX));
2419 emit_move_insn (addr2, force_operand (XEXP (operands[1], 0), NULL_RTX));
2420 emit_move_insn (len, force_operand (operands[2], NULL_RTX));
2421 operands[0] = replace_equiv_address_nv (operands[0], addr1);
2422 operands[1] = replace_equiv_address_nv (operands[1], addr2);
2423 emit_insn (gen_rx_movmem ());
2428 (define_insn "rx_movmem"
2429 [(set (mem:BLK (reg:SI 1))
2430 (mem:BLK (reg:SI 2)))
2432 (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_MOVMEM)
2433 (clobber (reg:SI 1))
2434 (clobber (reg:SI 2))
2435 (clobber (reg:SI 3))]
2436 "rx_allow_string_insns"
2438 [(set_attr "length" "2")
2439 (set_attr "timings" "1111")] ;; The timing is a guesstimate.
2442 (define_expand "setmemsi"
2443 [(set (match_operand:BLK 0 "memory_operand") ;; Dest
2444 (match_operand:QI 2 "nonmemory_operand")) ;; Value
2445 (use (match_operand:SI 1 "nonmemory_operand")) ;; Length
2446 (match_operand 3 "immediate_operand") ;; Align
2447 (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_SETMEM)]
2450 rtx addr = gen_rtx_REG (SImode, 1);
2451 rtx val = gen_rtx_REG (QImode, 2);
2452 rtx len = gen_rtx_REG (SImode, 3);
2454 emit_move_insn (addr, force_operand (XEXP (operands[0], 0), NULL_RTX));
2455 emit_move_insn (len, force_operand (operands[1], NULL_RTX));
2456 emit_move_insn (val, operands[2]);
2457 emit_insn (gen_rx_setmem ());
2462 (define_insn "rx_setmem"
2463 [(set (mem:BLK (reg:SI 1))
2464 (unspec_volatile:BLK [(reg:SI 1) (reg:SI 2) (reg:SI 3)] UNSPEC_SETMEM))
2465 (clobber (reg:SI 1))
2466 (clobber (reg:SI 3))]
2469 [(set_attr "length" "2")
2470 (set_attr "timings" "1111")] ;; The timing is a guesstimate.
2473 (define_expand "cmpstrnsi"
2474 [(set (match_operand:SI 0 "register_operand") ;; Result
2475 (unspec_volatile:SI [(match_operand:BLK 1 "memory_operand") ;; String1
2476 (match_operand:BLK 2 "memory_operand")] ;; String2
2478 (use (match_operand:SI 3 "register_operand")) ;; Max Length
2479 (match_operand:SI 4 "immediate_operand")] ;; Known Align
2480 "rx_allow_string_insns"
2482 rtx str1 = gen_rtx_REG (SImode, 1);
2483 rtx str2 = gen_rtx_REG (SImode, 2);
2484 rtx len = gen_rtx_REG (SImode, 3);
2486 emit_move_insn (str1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2487 emit_move_insn (str2, force_operand (XEXP (operands[2], 0), NULL_RTX));
2488 emit_move_insn (len, operands[3]);
2490 emit_insn (gen_rx_cmpstrn (operands[0], operands[1], operands[2]));
2495 (define_expand "cmpstrsi"
2496 [(set (match_operand:SI 0 "register_operand") ;; Result
2497 (unspec_volatile:SI [(match_operand:BLK 1 "memory_operand") ;; String1
2498 (match_operand:BLK 2 "memory_operand")] ;; String2
2500 (match_operand:SI 3 "immediate_operand")] ;; Known Align
2501 "rx_allow_string_insns"
2503 rtx str1 = gen_rtx_REG (SImode, 1);
2504 rtx str2 = gen_rtx_REG (SImode, 2);
2505 rtx len = gen_rtx_REG (SImode, 3);
2507 emit_move_insn (str1, force_reg (SImode, XEXP (operands[1], 0)));
2508 emit_move_insn (str2, force_reg (SImode, XEXP (operands[2], 0)));
2509 emit_move_insn (len, GEN_INT (-1));
2511 emit_insn (gen_rx_cmpstrn (operands[0], operands[1], operands[2]));
2516 (define_insn "rx_cmpstrn"
2517 [(set (match_operand:SI 0 "register_operand" "=r")
2518 (unspec_volatile:SI [(reg:SI 1) (reg:SI 2) (reg:SI 3)]
2520 (use (match_operand:BLK 1 "memory_operand" "m"))
2521 (use (match_operand:BLK 2 "memory_operand" "m"))
2522 (clobber (reg:SI 1))
2523 (clobber (reg:SI 2))
2524 (clobber (reg:SI 3))
2525 (clobber (reg:CC CC_REG))]
2526 "rx_allow_string_insns"
2527 "scmpu ; Perform the string comparison
2528 mov #-1, %0 ; Set up -1 result (which cannot be created
2530 bnc ?+ ; If Carry is not set skip over
2531 scne.L %0 ; Set result based on Z flag
2534 [(set_attr "length" "9")
2535 (set_attr "timings" "1111")] ;; The timing is a guesstimate.
2538 ;; Builtin Functions
2540 ;; GCC does not have the ability to generate the following instructions
2541 ;; on its own so they are provided as builtins instead. To use them from
2542 ;; a program for example invoke them as __builtin_rx_<insn_name>. For
2545 ;; int short_byte_swap (int arg) { return __builtin_rx_revw (arg); }
2547 ;;---------- Accumulator Support ------------------------
2549 ;; Multiply & Accumulate (high)
2550 (define_insn "machi"
2551 [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
2552 (match_operand:SI 1 "register_operand" "r")]
2553 UNSPEC_BUILTIN_MACHI)]
2556 [(set_attr "length" "3")]
2559 ;; Multiply & Accumulate (low)
2560 (define_insn "maclo"
2561 [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
2562 (match_operand:SI 1 "register_operand" "r")]
2563 UNSPEC_BUILTIN_MACLO)]
2566 [(set_attr "length" "3")]
2570 (define_insn "mulhi"
2571 [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
2572 (match_operand:SI 1 "register_operand" "r")]
2573 UNSPEC_BUILTIN_MULHI)]
2576 [(set_attr "length" "3")]
2580 (define_insn "mullo"
2581 [(unspec:SI [(match_operand:SI 0 "register_operand" "r")
2582 (match_operand:SI 1 "register_operand" "r")]
2583 UNSPEC_BUILTIN_MULLO)]
2586 [(set_attr "length" "3")]
2589 ;; Move from Accumulator (high)
2590 (define_insn "mvfachi"
2591 [(set (match_operand:SI 0 "register_operand" "=r")
2592 (unspec:SI [(const_int 0)]
2593 UNSPEC_BUILTIN_MVFACHI))]
2596 [(set_attr "length" "3")]
2599 ;; Move from Accumulator (middle)
2600 (define_insn "mvfacmi"
2601 [(set (match_operand:SI 0 "register_operand" "=r")
2602 (unspec:SI [(const_int 0)]
2603 UNSPEC_BUILTIN_MVFACMI))]
2606 [(set_attr "length" "3")]
2609 ;; Move to Accumulator (high)
2610 (define_insn "mvtachi"
2611 [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "r")]
2612 UNSPEC_BUILTIN_MVTACHI)]
2615 [(set_attr "length" "3")]
2618 ;; Move to Accumulator (low)
2619 (define_insn "mvtaclo"
2620 [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "r")]
2621 UNSPEC_BUILTIN_MVTACLO)]
2624 [(set_attr "length" "3")]
2627 ;; Round Accumulator
2629 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")]
2630 UNSPEC_BUILTIN_RACW)]
2633 [(set_attr "length" "3")]
2636 ;; Repeat multiply and accumulate
2638 [(unspec:SI [(const_int 0) (reg:SI 1) (reg:SI 2) (reg:SI 3)
2639 (reg:SI 4) (reg:SI 5) (reg:SI 6)]
2640 UNSPEC_BUILTIN_RMPA)
2641 (clobber (reg:SI 1))
2642 (clobber (reg:SI 2))
2643 (clobber (reg:SI 3))]
2644 "rx_allow_string_insns"
2646 [(set_attr "length" "2")
2647 (set_attr "timings" "1010")]
2650 ;;---------- Arithmetic ------------------------
2652 ;; Byte swap (two 16-bit values).
2654 [(set (match_operand:SI 0 "register_operand" "=r")
2655 (unspec:SI [(match_operand:SI 1 "register_operand" "r")]
2656 UNSPEC_BUILTIN_REVW))]
2659 [(set_attr "length" "3")]
2662 ;; Round to integer.
2663 (define_insn "lrintsf2"
2664 [(set (match_operand:SI 0 "register_operand" "=r,r")
2665 (unspec:SI [(match_operand:SF 1 "rx_compare_operand" "r,Q")]
2666 UNSPEC_BUILTIN_ROUND))
2667 (clobber (reg:CC CC_REG))]
2670 [(set_attr "timings" "22,44")
2671 (set_attr "length" "3,5")]
2674 ;;---------- Control Registers ------------------------
2676 ;; Clear Processor Status Word
2677 (define_insn "clrpsw"
2678 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")]
2679 UNSPEC_BUILTIN_CLRPSW)
2680 (clobber (reg:CC CC_REG))]
2683 [(set_attr "length" "2")]
2686 ;; Set Processor Status Word
2687 (define_insn "setpsw"
2688 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")]
2689 UNSPEC_BUILTIN_SETPSW)
2690 (clobber (reg:CC CC_REG))]
2693 [(set_attr "length" "2")]
2696 ;; Move from control register
2698 [(set (match_operand:SI 0 "register_operand" "=r")
2699 (unspec_volatile:SI [(match_operand:SI 1 "immediate_operand" "i")]
2700 UNSPEC_BUILTIN_MVFC))]
2703 [(set_attr "length" "3")]
2706 ;; Move to control register
2707 ;; This insn can be used in atomic sequences to restore the previous PSW
2708 ;; and re-enable interrupts. Because of that it always clobbers the CC_REG.
2710 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i,i")
2711 (match_operand:SI 1 "nonmemory_operand" "r,i")]
2712 UNSPEC_BUILTIN_MVTC)
2713 (clobber (reg:CC CC_REG))]
2716 [(set_attr "length" "3,7")]
2719 ;; Move to interrupt priority level
2720 (define_insn "mvtipl"
2721 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "Uint04")]
2722 UNSPEC_BUILTIN_MVTIPL)]
2725 [(set_attr "length" "3")]
2728 ;;---------- Interrupts ------------------------
2732 [(unspec_volatile [(const_int 0)]
2733 UNSPEC_BUILTIN_BRK)]
2736 [(set_attr "length" "1")
2737 (set_attr "timings" "66")]
2742 [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")]
2743 UNSPEC_BUILTIN_INT)]
2746 [(set_attr "length" "3")]
2751 [(unspec_volatile [(const_int 0)]
2752 UNSPEC_BUILTIN_WAIT)]
2755 [(set_attr "length" "2")]
2758 ;;---------- CoProcessor Support ------------------------
2760 ;; FIXME: The instructions are currently commented out because
2761 ;; the bit patterns have not been finalized, so the assembler
2762 ;; does not support them. Once they are decided and the assembler
2763 ;; supports them, enable the instructions here.
2765 ;; Move from co-processor register
2766 (define_insn "mvfcp"
2767 [(set (match_operand:SI 0 "register_operand" "=r")
2768 (unspec:SI [(match_operand:SI 1 "immediate_operand" "i")
2769 (match_operand:SI 2 "immediate_operand" "i")]
2770 UNSPEC_BUILTIN_MVFCP))]
2772 "; mvfcp\t%1, %0, %2"
2773 [(set_attr "length" "5")]
2776 ;;---------- Misc ------------------------
2778 ;; Required by cfglayout.c...
2783 [(set_attr "length" "1")]
2786 (define_expand "pid_addr"
2787 [(plus:SI (match_operand:SI 0)
2788 (const:SI (unspec:SI [(match_operand:SI 1)] UNSPEC_PID_ADDR)))]
2793 (define_insn "movdi"
2794 [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
2795 (match_operand:DI 1 "general_operand" "rmi"))]
2797 { return rx_gen_move_template (operands, false); }
2798 [(set_attr "length" "16")
2799 (set_attr "timings" "22")]
2802 (define_insn "movdf"
2803 [(set (match_operand:DF 0 "nonimmediate_operand" "=rm")
2804 (match_operand:DF 1 "general_operand" "rmi"))]
2806 { return rx_gen_move_template (operands, false); }
2807 [(set_attr "length" "16")
2808 (set_attr "timings" "22")]